From patchwork Fri Mar 15 19:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7626 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4TxDTc6jWBz3wnw for ; Fri, 15 Mar 2024 19:15:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4TxDTY5SnwzFLC; Fri, 15 Mar 2024 19:14:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4TxDTY4vYTz32pB; Fri, 15 Mar 2024 19:14:57 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4TxDTV1V6Hz32P8 for ; Fri, 15 Mar 2024 19:14:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4TxDTT6JWVzvx; Fri, 15 Mar 2024 19:14:53 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1710530094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=twnIWUSAAXHUVdw/Q30FXcS7hpFijSNrPcBrEvLXofw=; b=I9+MXV3J0gwXems9D+RG7SZp3KJIHxs/5zBkk7ijA5D9xMTNhPyCYTv+npDRsd496Uvh2Y 65XTrHI2y5BDbuAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1710530094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=twnIWUSAAXHUVdw/Q30FXcS7hpFijSNrPcBrEvLXofw=; b=JRa7G9icXBhQwMULhcp95z1JaTDv8g6hubqBLBUQizQcBUI1d1BWo4SEkIqU1vwgSk3IN1 2cMHf+TlLI+fcVA4bE18FXpNgA77wxahX/9ClcWWuZk6ThpFOP2TZ3qkEE81s4mwT2hUbB HoRcN4D4bvhRnT+I0XP9znc8KeGksR0F/rnbcV7skUd1DDaAkKqG+rROhM4P68MKzCfA4Q tJHKuNhw1aG0DOWOLqqz7T7t8tB1VXKiaXLt5DTdlIMCyX1J0pN6VKBBd8u41xTYl2w/1A 5zaSTZsYF/SlxteL0IODb0AJDLLUUBzFD6ujcLI9wzP3d1wMfoHJWLrtxWhn0w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 02/17] installer: Allow to install IPFire on BTRFS Date: Fri, 15 Mar 2024 20:14:27 +0100 Message-Id: <20240315191442.3951-3-stefan.schantl@ipfire.org> In-Reply-To: <20240315191442.3951-1-stefan.schantl@ipfire.org> References: <20240315191442.3951-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: CCQRTEIPZR7YCWUMQYOOTHDVYGXWWPCB X-Message-ID-Hash: CCQRTEIPZR7YCWUMQYOOTHDVYGXWWPCB X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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(-) 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..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 == 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 -L rootfs -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..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") }, { 0, NULL }, }; unsigned int num_filesystems = sizeof(filesystems) / sizeof(*filesystems);