From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH 02/17] installer: Allow to install IPFire on BTRFS Date: Mon, 18 Mar 2024 16:03:40 +0000 Message-ID: <302B424F-5F2A-465A-AB25-95A569C9A4AD@ipfire.org> In-Reply-To: <20240315191442.3951-3-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9186608909703919498==" List-Id: --===============9186608909703919498== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, > On 15 Mar 2024, at 19:14, Stefan Schantl wrot= e: >=20 > Signed-off-by: Stefan Schantl > --- > 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(-) >=20 > diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dr= acut-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 >=20 > # 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 >=20 > # Extraction > inst_multiple tar gzip zstd > diff --git a/src/installer/hw.c b/src/installer/hw.c > index 894b887d9..a196bf8be 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 =3D=3D HW_FS_XFS) { > snprintf(cmd, sizeof(cmd), "/sbin/mkfs.xfs -f %s", path); >=20 > + // BTRFS > + } else if (fs =3D=3D HW_FS_BTRFS) { > + snprintf(cmd, sizeof(cmd), "/usr/bin/mkfs.btrfs -L rootfs -f %s", path); > + Is this label required here? The other filesystems don=E2=80=99t use a label. > // FAT32 > } else if (fs =3D=3D 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 =3D "xfs"; > break; >=20 > + case HW_FS_BTRFS: > + filesystem =3D "btrfs"; > + break; > + > case HW_FS_FAT32: > filesystem =3D "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 >=20 > #define HW_FS_DEFAULT HW_FS_EXT4 >=20 > diff --git a/src/installer/main.c b/src/installer/main.c > index cddb0d91a..b3c9d27ee 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") }, Can we please add an =E2=80=9C(EXPERIMENTAL)=E2=80=9D here to signal to users= that this is currently an experimental feature? > { 0, NULL }, > }; > unsigned int num_filesystems =3D sizeof(filesystems) / sizeof(*filesystems); > --=20 > 2.39.2 >=20 --===============9186608909703919498==--