]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
installer: Allow to install IPFire on BTRFS
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 20 Feb 2024 18:02:23 +0000 (19:02 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 23 Mar 2024 09:38:34 +0000 (10:38 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/installer/dracut-module/module-setup.sh
src/installer/hw.c
src/installer/hw.h
src/installer/main.c

index 26a257cf89e38ce9f932f1cbffbf2df4065fc3d5..09564f885cc12dbb5eade59d48f92e5929d2b19a 100755 (executable)
@@ -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
index 894b887d905886476a1b6cf8532d80d9d13dbcf9..4d214c152c50f72fa1ca785d83de9ca44ebc5e24 100644 (file)
@@ -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;
index 6a7f23aa7c03caf3f0049b4d1401c7dcb80d790c..e5ee65a6d2a7f706aa3d982c2dea6f26daec673b 100644 (file)
@@ -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
 
index cddb0d91a6fc2e2ab69a69ebd6050197ec05de40..47daccdaa80ec9dd80bd9455192e4585a781fa82 100644 (file)
@@ -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);