From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCHv2 02/12] installer: Allow to install IPFire on BTRFS
Date: Sat, 23 Mar 2024 11:56:19 +0100 [thread overview]
Message-ID: <20240323105629.371511-2-stefan.schantl@ipfire.org> (raw)
In-Reply-To: <20240323105629.371511-1-stefan.schantl@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 2746 bytes --]
Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
src/installer/dracut-module/module-setup.sh | 4 ++--
src/installer/hw.c | 8 ++++++++
src/installer/hw.h | 1 +
src/installer/main.c | 1 +
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dracut-module/module-setup.sh
index 26a257cf8..09564f885 100755
--- a/src/installer/dracut-module/module-setup.sh
+++ b/src/installer/dracut-module/module-setup.sh
@@ -30,8 +30,8 @@ install() {
instmods virtio_net hv_netvsc vmxnet3
# Filesystem support
- inst_multiple parted mkswap mke2fs mkfs.xfs mkfs.vfat
- instmods ext4 iso9660 vfat xfs ntfs3
+ inst_multiple parted mkswap mke2fs mkfs.xfs mkfs.vfat mkfs.btrfs
+ instmods ext4 iso9660 vfat xfs ntfs3 btrfs
# Extraction
inst_multiple tar gzip zstd
diff --git a/src/installer/hw.c b/src/installer/hw.c
index 894b887d9..4d214c152 100644
--- a/src/installer/hw.c
+++ b/src/installer/hw.c
@@ -822,6 +822,10 @@ static int hw_format_filesystem(const char* path, int fs, const char* output) {
} else if (fs == HW_FS_XFS) {
snprintf(cmd, sizeof(cmd), "/sbin/mkfs.xfs -f %s", path);
+ // BTRFS
+ } else if (fs == HW_FS_BTRFS) {
+ snprintf(cmd, sizeof(cmd), "/usr/bin/mkfs.btrfs -f %s", path);
+
// FAT32
} else if (fs == HW_FS_FAT32) {
snprintf(cmd, sizeof(cmd), "/sbin/mkfs.vfat %s", path);
@@ -882,6 +886,10 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) {
filesystem = "xfs";
break;
+ case HW_FS_BTRFS:
+ filesystem = "btrfs";
+ break;
+
case HW_FS_FAT32:
filesystem = "vfat";
break;
diff --git a/src/installer/hw.h b/src/installer/hw.h
index 6a7f23aa7..e5ee65a6d 100644
--- a/src/installer/hw.h
+++ b/src/installer/hw.h
@@ -46,6 +46,7 @@
#define HW_FS_EXT4_WO_JOURNAL 2
#define HW_FS_XFS 3
#define HW_FS_FAT32 4
+#define HW_FS_BTRFS 5
#define HW_FS_DEFAULT HW_FS_EXT4
diff --git a/src/installer/main.c b/src/installer/main.c
index cddb0d91a..47daccdaa 100644
--- a/src/installer/main.c
+++ b/src/installer/main.c
@@ -720,6 +720,7 @@ int main(int argc, char *argv[]) {
{ HW_FS_EXT4, _("ext4 Filesystem") },
{ HW_FS_EXT4_WO_JOURNAL, _("ext4 Filesystem without journal") },
{ HW_FS_XFS, _("XFS Filesystem") },
+ { HW_FS_BTRFS, _("BTRFS Filesystem (EXPERIMENTAL)") },
{ 0, NULL },
};
unsigned int num_filesystems = sizeof(filesystems) / sizeof(*filesystems);
--
2.39.2
next prev parent reply other threads:[~2024-03-23 10:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 10:56 [PATCHv2 01/12] btrfs-progs: New package Stefan Schantl
2024-03-23 10:56 ` Stefan Schantl [this message]
2024-03-23 10:56 ` [PATCHv2 03/12] dracut: Ship BTRFS related modules Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 04/12] installer: Ensure to always create the /boot directory Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 05/12] installer: Disable own boot partition when using BTRFS Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 06/12] installer: Add code to create a BTRFS subvolume layout Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 07/12] installer: Add recurisve mkdir function Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 08/12] installer: Allow writing to the debug console from anywhere Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 09/12] installer: Mount BTRFS layout before installing the system Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 10/12] installer: Define common mount options for BTRFS volumes Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 11/12] installer: Add code to proper unmount the BTRFS layout Stefan Schantl
2024-03-23 10:56 ` [PATCHv2 12/12] installer: Add code to correctly write the fstab when installing on BTRFS Stefan Schantl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240323105629.371511-2-stefan.schantl@ipfire.org \
--to=stefan.schantl@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox