From patchwork Fri Mar 15 19:14:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 24 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 4TxDTY0wNcz3wnw for ; Fri, 15 Mar 2024 19:14:57 +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 4TxDTW2xDyznj; Fri, 15 Mar 2024 19:14:55 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4TxDTW0kW8z32p6; Fri, 15 Mar 2024 19:14:55 +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) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4TxDTT1y9tz2xk2 for ; Fri, 15 Mar 2024 19:14:53 +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 4TxDTS1qgSznf; Fri, 15 Mar 2024 19:14:52 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1710530092; 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; bh=huklqnmso7GthaUkjbZtwhfyqWvWyQTZrJRbSfA6Ai0=; b=teOU13ETSGw6JAcJIbPpOuwgTGV1JH6IdiJ+eRKLYyvbvM6kmCoj8LfPotQ7IyOLJm/wzA u0Q5KrhB2EgxzqDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1710530092; 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; bh=huklqnmso7GthaUkjbZtwhfyqWvWyQTZrJRbSfA6Ai0=; b=NcThd9Nc5rtYayXpkePThYnjFTtZtH4saBi0ZNsAV+s4mvg9mNU4gfBwiVnbBV+sNdolHN lkasv+o7oia4SnZ0dycx7eMSIdXoiEjv2LmAYr+PcNO+XD4zTA5PrO2Hz0a0fJbAMD0qjp K4y8EEgtAeUEMsAh8SqqEDtuAnDcEeSjh4SuD+NegJjtmfjm97wfirNlB5gvNgoqZjfN0x 12pgrLHaLmiIkVrPoeUuQ+OBhJsIvr6rBz/BiBbsjhc1SuMcvgCQUrL87eKG66RXn2KeAj hVWMmwkK2IlHccQtLnjwx7VKWSyWcE5VsAQLgFZgxR0sNQD7dNw/K3E55eVAVQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 00/17] BTRFS support on IPFire 2.x (experimental) Date: Fri, 15 Mar 2024 20:14:25 +0100 Message-Id: <20240315191442.3951-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: QZ7SOOEHNKTKYBWBLP27WBOF4BVLHI27 X-Message-ID-Hash: QZ7SOOEHNKTKYBWBLP27WBOF4BVLHI27 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: Hello mailinglist followers, this first patchset will introduce basic BTRFS support in IPFire 2.x. It allows to choose BTRFS during installation as filesystem, will install IPFire and bring it up as usual. The main difference to the other file system will be displayed when showing the current mounted filesystems. When using BTRFS a lot of so called subvolumes will be created. They act as some kind of logical partition and are needed in two cases. This kind of fragmentation allows to create snapshots of such a subvolume and only the stored data on it. The more important reason of using subvolumes is, that while creating a snapshot any files which are located on a different subvolume will not be part of it. So, when creating a snaphot of the filesystem root and restoring it back later, no files which are part of a subvolume (logfile, database files etc) are rolled-back. This helps us debugging because the old logs are still there and mostly important prevents from data lost of altered databases or newly created files! Currently there is still some work to do see: Wiki-Roadmap: https://www.ipfire.org/docs/roadmap/btrfs Bugzilla: https://bugzilla.ipfire.org/show_bug.cgi?id=13606 Stefan Schantl (17): btrfs-progs: New package installer: Allow to install IPFire on BTRFS installer: Ensure to always create the /boot directory. installer: Disable seperate boot partition installer: Add code to create a BTRFS subvolume layout. installer: Correctly umount main BTRFS partition. installer: Add recurisve mkdir function installer: Mount BTRFS layout before installing the system installer: Add /var/tmp to the BTRFS layout installer: Fix using BTRFS mount options when mounting the layout installer: Add code to proper unmount the BTRFS layout installer: Add code to correctly write the fstab when installing on BTRFS installer: Define common mount options for BTRFS volumes inotify-tools: New package grub-btrfs: New package installer: Mark BTRFS support as experimental installer: Adjust BTRFS layout config/rootfiles/common/btrfs-progs | 33 +++ config/rootfiles/common/grub-btrfs | 14 ++ config/rootfiles/common/inotify-tools | 19 ++ config/rootfiles/common/x86_64/initscripts | 4 + lfs/btrfs-progs | 85 ++++++++ lfs/grub-btrfs | 79 +++++++ lfs/initscripts | 3 + lfs/inotify-tools | 83 ++++++++ make.sh | 3 + src/initscripts/system/grub-btrfsd | 61 ++++++ src/installer/dracut-module/module-setup.sh | 4 +- src/installer/hw.c | 221 +++++++++++++++++++- src/installer/hw.h | 8 + src/installer/main.c | 1 + 14 files changed, 606 insertions(+), 12 deletions(-) create mode 100644 config/rootfiles/common/btrfs-progs create mode 100644 config/rootfiles/common/grub-btrfs create mode 100644 config/rootfiles/common/inotify-tools create mode 100644 lfs/btrfs-progs create mode 100644 lfs/grub-btrfs create mode 100644 lfs/inotify-tools create mode 100644 src/initscripts/system/grub-btrfsd