]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
installer: Define common mount options for BTRFS volumes
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 23 Mar 2024 10:56:27 +0000 (11:56 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 26 Mar 2024 07:34:49 +0000 (07:34 +0000)
As default we are using zstd for compression with level 1

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/installer/hw.c
src/installer/hw.h

index 8ee6c57269a829e0320135a82895a54e25f59065..5665cb9552d1c9e39fd5afacd9de74f1b3683f4e 100644 (file)
@@ -1053,7 +1053,7 @@ int hw_mount_btrfs_subvolumes(const char* source) {
                }
 
                // Assign subvolume name.
-               r = snprintf(options, sizeof(options), "subvol=%s,", subvolume->name);
+               r = snprintf(options, sizeof(options), "subvol=%s,%s", subvolume->name, BTRFS_MOUNT_OPTIONS);
                if (r < 0) {
                        return r;
                }
index 73a5233e20ccba402e9c0bd33bfb09e78043cd38..7fbea86de04ce92b4271016a45d3df828610f5e2 100644 (file)
@@ -54,6 +54,8 @@
 
 #define SERIAL_BAUDRATE               115200
 
+#define BTRFS_MOUNT_OPTIONS           "compress=zstd:1"
+
 #define BYTES2MB(x) ((x) / 1024 / 1024)
 #define MB2BYTES(x) ((unsigned long long)(x) * 1024 * 1024)