This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, next has been updated via e22ff3c71ba606e11046d17f486fc3ed7fc0ef56 (commit) via a6d5b71f2c9e0c4819d6b8c66155d4fb4ad34fc2 (commit) via 32d81fdc2e57bf25bef5c36d348e3fc689218234 (commit) via ad73749dabdd0630475048c7c71c7b3deb157972 (commit) via 15be1e1b9fff41a33364bf89918cbcb1f4ccd37f (commit) via 2a98139628459d1d7f59951f30b8dc858a327691 (commit) via a9963bf035c6c0b2f2ac87cbe2be4895443a89d5 (commit) via e7740eaf94d7adffc81c31b5ea278ea8d6e31286 (commit) via 8e3b022a831e06f9f1ab0340534778cdf0dc95d1 (commit) via e0a7cdd86f5ae425b76d73d9b39f51308d48d611 (commit) via 0465449e42a7c64b0c1e3d3831c199955a522070 (commit) via 58a46f0bc2063dbc8f55fd46d44d7348199aefbc (commit) via fbeac0960ae9fab5bbe4ddf1518c6514be5873de (commit) via 4305e02d792a57e4065b158e85df1a1836bfceb3 (commit) via 130815d3f1fb181fd8cbe5a02d6a96f784f34022 (commit) via 09bb459edb08916ff5801dd9fd972bd3d17fda8c (commit) via 4f6f5e68447ed5c5571002d323cbdb0e032af573 (commit) via 2e94953dd40134d05d3dd93c9c3e125f5ec427f9 (commit) via cb0488997b9c2237058a0ff8c546c269b6a6f1ed (commit) from 46a9e7a0a462095add7fa508322d837b78912596 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit e22ff3c71ba606e11046d17f486fc3ed7fc0ef56 Author: Arne Fitzenreiter arne_f@ipfire.org Date: Tue Mar 26 07:40:56 2024 +0000
core186: add brtfs related changes to updater
Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit a6d5b71f2c9e0c4819d6b8c66155d4fb4ad34fc2 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sun Mar 24 13:39:53 2024 +0100
grub-btrfs: New package
This kind of grub addon will extend the grub boot menu by a additional submenu where a BTRFS snapshot can be selected to directly use as root volume and boot into it.
The grub-btrfsd daemon is using inotify(tools) to watch the snapshot directory for new or deleted snapshots and calls grub-mkconfig to adjust the snapshot grub submenu
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 32d81fdc2e57bf25bef5c36d348e3fc689218234 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sun Mar 24 13:39:52 2024 +0100
inotify-tools: New package
This package is required for the grub-btrfs daemon
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit ad73749dabdd0630475048c7c71c7b3deb157972 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sun Mar 24 13:37:35 2024 +0100
installer: Pass choosen filesystem to hw_make_destination
This is required to proper choose if a seperate boot partition should be created or must not created (BTRFS)
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Reviewed-by: Michael Tremer michael.tremer@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 15be1e1b9fff41a33364bf89918cbcb1f4ccd37f Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:29 2024 +0100
installer: Add code to correctly write the fstab when installing on BTRFS
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 2a98139628459d1d7f59951f30b8dc858a327691 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:28 2024 +0100
installer: Add code to proper unmount the BTRFS layout
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit a9963bf035c6c0b2f2ac87cbe2be4895443a89d5 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:27 2024 +0100
installer: Define common mount options for BTRFS volumes
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
commit e7740eaf94d7adffc81c31b5ea278ea8d6e31286 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:26 2024 +0100
installer: Mount BTRFS layout before installing the system
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 8e3b022a831e06f9f1ab0340534778cdf0dc95d1 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:25 2024 +0100
installer: Allow writing to the debug console from anywhere
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit e0a7cdd86f5ae425b76d73d9b39f51308d48d611 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:24 2024 +0100
installer: Add recurisve mkdir function
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 0465449e42a7c64b0c1e3d3831c199955a522070 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:23 2024 +0100
installer: Add code to create a BTRFS subvolume layout
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 58a46f0bc2063dbc8f55fd46d44d7348199aefbc Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:22 2024 +0100
installer: Disable own boot partition when using BTRFS
Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit fbeac0960ae9fab5bbe4ddf1518c6514be5873de Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:21 2024 +0100
installer: Ensure to always create the /boot directory.
Ensure to always create the /boot directory during the mounting of the various created file systems. If the /boot directory does not exist some following mount operations could not be performed correctly and the installation/mounting will fail.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 4305e02d792a57e4065b158e85df1a1836bfceb3 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:20 2024 +0100
dracut: Ship BTRFS related modules
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 130815d3f1fb181fd8cbe5a02d6a96f784f34022 Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:19 2024 +0100
installer: Allow to install IPFire on BTRFS
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 09bb459edb08916ff5801dd9fd972bd3d17fda8c Author: Stefan Schantl stefan.schantl@ipfire.org Date: Sat Mar 23 11:56:18 2024 +0100
btrfs-progs: New package
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org Signed-off-by: Arne Fitzenreiter arne_f@ipfire.org
commit 4f6f5e68447ed5c5571002d323cbdb0e032af573 Merge: 46a9e7a0a4 2e94953dd4 Author: Arne Fitzenreiter arne_f@ipfire.org Date: Tue Mar 26 07:28:20 2024 +0000
Merge remote-tracking branch 'origin/master' into next
-----------------------------------------------------------------------
Summary of changes: config/rootfiles/common/btrfs-progs | 33 +++ config/rootfiles/common/dracut | 12 +- config/rootfiles/common/grub-btrfs | 14 + config/rootfiles/common/inotify-tools | 19 ++ config/rootfiles/common/x86_64/initscripts | 4 + config/rootfiles/core/186/filelists/btrfs-progs | 1 + .../{oldcore/167 => core/186}/filelists/dracut | 0 config/rootfiles/core/186/filelists/grub-btrfs | 1 + config/rootfiles/core/186/filelists/inotify-tools | 1 + config/shadow/login.defs | 5 - lfs/{p11-kit => btrfs-progs} | 17 +- lfs/{iw => grub-btrfs} | 13 +- lfs/initscripts | 3 + lfs/{jq => inotify-tools} | 11 +- lfs/samba | 4 +- make.sh | 3 + .../{packages/mympd => system/grub-btrfsd} | 44 +-- src/installer/dracut-module/module-setup.sh | 4 +- src/installer/hw.c | 307 ++++++++++++++++++++- src/installer/hw.h | 25 +- src/installer/main.c | 62 +++-- 21 files changed, 489 insertions(+), 94 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 120000 config/rootfiles/core/186/filelists/btrfs-progs copy config/rootfiles/{oldcore/167 => core/186}/filelists/dracut (100%) create mode 120000 config/rootfiles/core/186/filelists/grub-btrfs create mode 120000 config/rootfiles/core/186/filelists/inotify-tools copy lfs/{p11-kit => btrfs-progs} (90%) copy lfs/{iw => grub-btrfs} (91%) copy lfs/{jq => inotify-tools} (91%) copy src/initscripts/{packages/mympd => system/grub-btrfsd} (73%)
Difference in files: diff --git a/config/rootfiles/common/btrfs-progs b/config/rootfiles/common/btrfs-progs new file mode 100644 index 0000000000..04af32d3fe --- /dev/null +++ b/config/rootfiles/common/btrfs-progs @@ -0,0 +1,33 @@ +lib/udev/rules.d/64-btrfs-dm.rules +lib/udev/rules.d/64-btrfs-zoned.rules +usr/bin/btrfs +usr/bin/btrfs-convert +usr/bin/btrfs-find-root +usr/bin/btrfs-image +usr/bin/btrfs-map-logical +usr/bin/btrfs-select-super +usr/bin/btrfsck +usr/bin/btrfstune +usr/bin/fsck.btrfs +usr/bin/mkfs.btrfs +#usr/include/btrfs +#usr/include/btrfs/ctree.h +#usr/include/btrfs/ioctl.h +#usr/include/btrfs/kerncompat.h +#usr/include/btrfs/list.h +#usr/include/btrfs/rbtree.h +#usr/include/btrfs/rbtree_types.h +#usr/include/btrfs/send-stream.h +#usr/include/btrfs/send-utils.h +#usr/include/btrfs/send.h +#usr/include/btrfs/version.h +#usr/include/btrfsutil.h +#usr/lib/libbtrfs.a +#usr/lib/libbtrfs.so +usr/lib/libbtrfs.so.0 +usr/lib/libbtrfs.so.0.1 +#usr/lib/libbtrfsutil.a +#usr/lib/libbtrfsutil.so +usr/lib/libbtrfsutil.so.1 +usr/lib/libbtrfsutil.so.1.2.0 +#usr/lib/pkgconfig/libbtrfsutil.pc diff --git a/config/rootfiles/common/dracut b/config/rootfiles/common/dracut index d172898ee2..b08b39a300 100644 --- a/config/rootfiles/common/dracut +++ b/config/rootfiles/common/dracut @@ -189,12 +189,12 @@ usr/lib/dracut/modules.d/50drm/module-setup.sh #usr/lib/dracut/modules.d/81cio_ignore #usr/lib/dracut/modules.d/81cio_ignore/module-setup.sh #usr/lib/dracut/modules.d/81cio_ignore/parse-cio_accept.sh -#usr/lib/dracut/modules.d/90btrfs -#usr/lib/dracut/modules.d/90btrfs/80-btrfs.rules -#usr/lib/dracut/modules.d/90btrfs/btrfs_device_ready.sh -#usr/lib/dracut/modules.d/90btrfs/btrfs_finished.sh -#usr/lib/dracut/modules.d/90btrfs/btrfs_timeout.sh -#usr/lib/dracut/modules.d/90btrfs/module-setup.sh +usr/lib/dracut/modules.d/90btrfs +usr/lib/dracut/modules.d/90btrfs/80-btrfs.rules +usr/lib/dracut/modules.d/90btrfs/btrfs_device_ready.sh +usr/lib/dracut/modules.d/90btrfs/btrfs_finished.sh +usr/lib/dracut/modules.d/90btrfs/btrfs_timeout.sh +usr/lib/dracut/modules.d/90btrfs/module-setup.sh #usr/lib/dracut/modules.d/90crypt #usr/lib/dracut/modules.d/90crypt/crypt-cleanup.sh #usr/lib/dracut/modules.d/90crypt/crypt-lib.sh diff --git a/config/rootfiles/common/grub-btrfs b/config/rootfiles/common/grub-btrfs new file mode 100644 index 0000000000..a612af0653 --- /dev/null +++ b/config/rootfiles/common/grub-btrfs @@ -0,0 +1,14 @@ +boot/grub/grubenv +etc/default/grub-btrfs +etc/default/grub-btrfs/config +etc/grub.d/41_snapshots-btrfs +usr/bin/grub-btrfsd +#usr/lib/systemd/system/grub-btrfsd.service +#usr/share/doc/grub-btrfs +#usr/share/doc/grub-btrfs/README.md +#usr/share/doc/grub-btrfs/initramfs-overlayfs.md +#usr/share/licenses +#usr/share/licenses/grub-btrfs +#usr/share/licenses/grub-btrfs/LICENSE +#usr/share/man/man8/grub-btrfs.8.bz2 +#usr/share/man/man8/grub-btrfsd.8.bz2 diff --git a/config/rootfiles/common/inotify-tools b/config/rootfiles/common/inotify-tools new file mode 100644 index 0000000000..f99d64c019 --- /dev/null +++ b/config/rootfiles/common/inotify-tools @@ -0,0 +1,19 @@ +usr/bin/fsnotifywait +usr/bin/fsnotifywatch +usr/bin/inotifywait +usr/bin/inotifywatch +#usr/include/inotifytools +#usr/include/inotifytools/fanotify-dfid-name.h +#usr/include/inotifytools/fanotify.h +#usr/include/inotifytools/inotify-nosys.h +#usr/include/inotifytools/inotify.h +#usr/include/inotifytools/inotifytools.h +#usr/lib/libinotifytools.a +#usr/lib/libinotifytools.la +#usr/lib/libinotifytools.so +usr/lib/libinotifytools.so.0 +usr/lib/libinotifytools.so.0.4.1 +#usr/share/man/man1/fsnotifywait.1 +#usr/share/man/man1/fsnotifywatch.1 +#usr/share/man/man1/inotifywait.1 +#usr/share/man/man1/inotifywatch.1 diff --git a/config/rootfiles/common/x86_64/initscripts b/config/rootfiles/common/x86_64/initscripts index a5e1596fb0..2d6fa85dce 100644 --- a/config/rootfiles/common/x86_64/initscripts +++ b/config/rootfiles/common/x86_64/initscripts @@ -26,6 +26,7 @@ etc/rc.d/init.d/firewall etc/rc.d/init.d/firstsetup etc/rc.d/init.d/fsresize etc/rc.d/init.d/functions +etc/rc.d/init.d/grub-btrfsd etc/rc.d/init.d/halt etc/rc.d/init.d/ipsec etc/rc.d/init.d/leds @@ -92,6 +93,7 @@ etc/rc.d/init.d/vnstat etc/rc.d/init.d/waitdrives etc/rc.d/init.d/wlanclient #etc/rc.d/rc0.d +etc/rc.d/rc0.d/K01grub-btrfsd #etc/rc.d/rc0.d/K01imspetor #etc/rc.d/rc0.d/K01motion #etc/rc.d/rc0.d/K01vdradmin @@ -135,10 +137,12 @@ etc/rc.d/rc3.d/S32apache etc/rc.d/rc3.d/S40fcron etc/rc.d/rc3.d/S98rc.local #etc/rc.d/rc3.d/S98sslh +etc/rc.d/rc3.d/S99grub-btrfsd #etc/rc.d/rc3.d/S99imspetor #etc/rc.d/rc3.d/S99motion #etc/rc.d/rc3.d/S99vdradmin #etc/rc.d/rc6.d +etc/rc.d/rc6.d/K01grub-btrfsd #etc/rc.d/rc6.d/K01imspetor #etc/rc.d/rc6.d/K01motion #etc/rc.d/rc6.d/K01vdradmin diff --git a/config/rootfiles/core/186/filelists/btrfs-progs b/config/rootfiles/core/186/filelists/btrfs-progs new file mode 120000 index 0000000000..d7a2f6f524 --- /dev/null +++ b/config/rootfiles/core/186/filelists/btrfs-progs @@ -0,0 +1 @@ +../../../common/btrfs-progs \ No newline at end of file diff --git a/config/rootfiles/core/186/filelists/dracut b/config/rootfiles/core/186/filelists/dracut new file mode 120000 index 0000000000..160869946d --- /dev/null +++ b/config/rootfiles/core/186/filelists/dracut @@ -0,0 +1 @@ +../../../common/dracut \ No newline at end of file diff --git a/config/rootfiles/core/186/filelists/grub-btrfs b/config/rootfiles/core/186/filelists/grub-btrfs new file mode 120000 index 0000000000..508721bb47 --- /dev/null +++ b/config/rootfiles/core/186/filelists/grub-btrfs @@ -0,0 +1 @@ +../../../common/grub-btrfs \ No newline at end of file diff --git a/config/rootfiles/core/186/filelists/inotify-tools b/config/rootfiles/core/186/filelists/inotify-tools new file mode 120000 index 0000000000..b316c2e73d --- /dev/null +++ b/config/rootfiles/core/186/filelists/inotify-tools @@ -0,0 +1 @@ +../../../common/inotify-tools \ No newline at end of file diff --git a/config/shadow/login.defs b/config/shadow/login.defs index a9559d6c42..2662a62cc9 100644 --- a/config/shadow/login.defs +++ b/config/shadow/login.defs @@ -175,11 +175,6 @@ PASS_WARN_AGE 7 # SU_WHEEL_ONLY no
-# -# If compiled with cracklib support, sets the path to the dictionaries -# -CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict - # # Min/max values for automatic uid selection in useradd(8) # diff --git a/lfs/btrfs-progs b/lfs/btrfs-progs new file mode 100644 index 0000000000..caf8f0b960 --- /dev/null +++ b/lfs/btrfs-progs @@ -0,0 +1,85 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2023 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 6.7.1 + +THISAPP = btrfs-progs-v$(VER) +DL_FILE = $(THISAPP).tar.xz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = 4e05e9dd80e5531425490970318389aef280f61cc636a80aa2bbc630399afd4f1f3ce649d194822ff93ff4b1774d65a504e3bed6f1426ff60830e4c0d0ac87b0 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + $(UPDATE_AUTOMAKE) + cd $(DIR_APP) && ./autogen.sh + cd $(DIR_APP) && ./configure \ + --prefix=/usr \ + --disable-documentation \ + --disable-python + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/grub-btrfs b/lfs/grub-btrfs new file mode 100644 index 0000000000..8dc0c4f3ed --- /dev/null +++ b/lfs/grub-btrfs @@ -0,0 +1,79 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2023 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 4.13 + +THISAPP = grub-btrfs-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = e2f11a0a8282e3ec8ff8223e3bad70b5d5c5e81b4d740a1bf3554db412dbe48a8a0f216f4e6c65ae1d11c01a27b8b92bae9b470c60d2389505ce089511536e1a + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + $(UPDATE_AUTOMAKE) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/initscripts b/lfs/initscripts index e078632ab3..4d67ee0c48 100644 --- a/lfs/initscripts +++ b/lfs/initscripts @@ -91,6 +91,7 @@ $(TARGET) : install -v -m 755 $$i /etc/rc.d/helper/; \ done
+ ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc0.d/K01grub-btrfsd ln -sf ../init.d/imspetor /etc/rc.d/rc0.d/K01imspetor ln -sf ../init.d/motion /etc/rc.d/rc0.d/K01motion ln -sf ../init.d/vdradmin /etc/rc.d/rc0.d/K01vdradmin @@ -132,10 +133,12 @@ $(TARGET) : ln -sf ../init.d/fcron /etc/rc.d/rc3.d/S40fcron ln -sf ../../sysconfig/rc.local /etc/rc.d/rc3.d/S98rc.local ln -sf ../init.d/sslh /etc/rc.d/rc3.d/S98sslh + ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc3.d/S99grub-btrfsd ln -sf ../init.d/imspetor /etc/rc.d/rc3.d/S99imspetor ln -sf ../init.d/motion /etc/rc.d/rc3.d/S99motion ln -sf ../init.d/vdradmin /etc/rc.d/rc3.d/S99vdradmin
+ ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc6.d/K01grub-btrfsd ln -sf ../init.d/imspetor /etc/rc.d/rc6.d/K01imspetor ln -sf ../init.d/motion /etc/rc.d/rc6.d/K01motion ln -sf ../init.d/vdradmin /etc/rc.d/rc6.d/K01vdradmin diff --git a/lfs/inotify-tools b/lfs/inotify-tools new file mode 100644 index 0000000000..bb70fbfc63 --- /dev/null +++ b/lfs/inotify-tools @@ -0,0 +1,83 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2023 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 4.23.9.0 + +THISAPP = inotify-tools-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = eddb0e44721cd8674f2309046998de16a030ed9ad84c49bc5950b9362055db9242dc0de1c615c3bd6c1f2835c83fc55446c9f8e6da52a98870c53f4e6cfa31f9 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + $(UPDATE_AUTOMAKE) + cd $(DIR_APP) && ./autogen.sh + cd $(DIR_APP) && ./configure \ + --prefix=/usr + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/samba b/lfs/samba index 76088abfad..df78113139 100644 --- a/lfs/samba +++ b/lfs/samba @@ -33,9 +33,9 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = samba -PAK_VER = 99 +PAK_VER = 100
-DEPS = avahi cups perl-Parse-Yapp perl-JSON +DEPS = avahi cups perl-Parse-Yapp perl-JSON wsdd
SERVICES = samba
diff --git a/make.sh b/make.sh index 1006383bf1..e025f260f6 100755 --- a/make.sh +++ b/make.sh @@ -1712,6 +1712,9 @@ buildipfire() { lfsmake2 rsnapshot lfsmake2 mympd lfsmake2 wsdd + lfsmake2 btrfs-progs + lfsmake2 inotify-tools + lfsmake2 grub-btrfs
# Kernelbuild ... current we have no platform that need # multi kernel builds so KCFG is empty diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd new file mode 100644 index 0000000000..dc5e32ad47 --- /dev/null +++ b/src/initscripts/system/grub-btrfsd @@ -0,0 +1,61 @@ +#!/bin/sh +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2024 IPFire Team info@ipfire.org # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +. /etc/sysconfig/rc +. ${rc_functions} + +SNAPSHOTDIR="/.snapshots" +PIDFILE="/run/grub-btrfsd.pid" + +root_is_btrfs() { + [ "$(stat -f --format="%T" /)" == "btrfs" ] || return 1 + + return 0 +} + +case "$1" in + start) + root_is_btrfs || exit 0 + + boot_mesg "Starting Grub/Btrfs snapshot manager..." + loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR" + + # Store the gained PID to the defined pidfile + echo "$!" > "$PIDFILE" + ;; + + stop) + boot_mesg "Stopping grub-btrfsd..." + killproc -p "$PIDFILE" /usr/bin/grub-btrfsd + sleep 1; + ;; + + restart) + $0 stop + sleep 2 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dracut-module/module-setup.sh index 26a257cf89..09564f885c 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 894b887d90..46330ce431 100644 --- a/src/installer/hw.c +++ b/src/installer/hw.c @@ -44,6 +44,8 @@
#include "hw.h"
+extern FILE* flog; + static int system_chroot(const char* output, const char* path, const char* cmd) { char chroot_cmd[STRING_SIZE];
@@ -563,7 +565,12 @@ static int hw_calculate_partition_table(struct hw* hw, struct hw_destination* de dest->size_bootldr = 0; }
- dest->size_boot = hw_boot_size(dest); + // Disable seperate boot partition for BTRFS installations. + if(dest->filesystem == HW_FS_BTRFS) { + dest->size_boot = 0; + } else { + dest->size_boot = hw_boot_size(dest); + }
// Create an EFI partition when running in EFI mode if (hw->efi) @@ -624,9 +631,13 @@ static int hw_calculate_partition_table(struct hw* hw, struct hw_destination* de return 0; }
-struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks, int disable_swap) { +struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks, + int disable_swap, int filesystem) { struct hw_destination* dest = malloc(sizeof(*dest));
+ // Assign filesystem + dest->filesystem = filesystem; + if (part_type == HW_PART_TYPE_NORMAL) { dest->disk1 = *disks; dest->disk2 = NULL; @@ -648,9 +659,6 @@ struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct if (r) return NULL;
- // Set default filesystem - dest->filesystem = HW_FS_DEFAULT; - return dest; }
@@ -805,6 +813,7 @@ int hw_create_partitions(struct hw_destination* dest, const char* output) {
static int hw_format_filesystem(const char* path, int fs, const char* output) { char cmd[STRING_SIZE] = "\0"; + int r;
// Swap if (fs == HW_FS_SWAP) { @@ -822,6 +831,12 @@ 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) { + r = hw_create_btrfs_layout(path, output); + + return r; + // FAT32 } else if (fs == HW_FS_FAT32) { snprintf(cmd, sizeof(cmd), "/sbin/mkfs.vfat %s", path); @@ -829,7 +844,7 @@ static int hw_format_filesystem(const char* path, int fs, const char* output) {
assert(*cmd);
- int r = mysystem(output, cmd); + r = mysystem(output, cmd);
return r; } @@ -866,8 +881,62 @@ int hw_create_filesystems(struct hw_destination* dest, const char* output) { return 0; }
+int hw_create_btrfs_layout(const char* path, const char* output) { + const struct btrfs_subvolumes* subvolume = NULL; + char cmd[STRING_SIZE]; + char volume[STRING_SIZE]; + int r; + + r = snprintf(cmd, sizeof(cmd), "/usr/bin/mkfs.btrfs -f %s", path); + if (r < 0) { + return r; + } + + // Create the main BTRFS file system. + r = mysystem(output, cmd); + + if (r) { + return r; + } + + + // We need to mount the FS in order to create any subvolumes. + r = hw_mount(path, DESTINATION_MOUNT_PATH, "btrfs", 0); + + if (r) { + return r; + } + + // Loop through the list of subvolumes to create. + for ( subvolume = btrfs_subvolumes; subvolume->name; subvolume++ ) { + r = snprintf(volume, sizeof(volume), "%s", subvolume->name); + + // Abort if snprintf fails. + if (r < 0) { + return r; + } + + // Call function to create the subvolume + r = hw_create_btrfs_subvolume(output, volume); + + if (r) { + return r; + } + } + + // Umount the main BTRFS after subvolume creation. + r = hw_umount(DESTINATION_MOUNT_PATH, 0); + + if (r) { + return r; + } + + return 0; +} + int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) { char target[STRING_SIZE]; + int r;
assert(*prefix == '/');
@@ -882,6 +951,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; @@ -891,15 +964,29 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) { }
// root - int r = hw_mount(dest->part_root, prefix, filesystem, 0); - if (r) - return r; + if (dest->filesystem == HW_FS_BTRFS) { + r = hw_mount_btrfs_subvolumes(dest->part_root); + + if (r) + return r; + } else { + r = hw_mount(dest->part_root, prefix, filesystem, 0); + + if (r) + return r; + }
// boot - if (*dest->part_boot) { - snprintf(target, sizeof(target), "%s%s", prefix, HW_PATH_BOOT); - mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO); + snprintf(target, sizeof(target), "%s%s", prefix, HW_PATH_BOOT); + r = mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO); + + if (r) { + hw_umount_filesystems(dest, prefix);
+ return r; + } + + if (*dest->part_boot) { r = hw_mount(dest->part_boot, target, filesystem, 0); if (r) { hw_umount_filesystems(dest, prefix); @@ -951,6 +1038,48 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) { return 0; }
+int hw_mount_btrfs_subvolumes(const char* source) { + const struct btrfs_subvolumes* subvolume = NULL; + char path[STRING_SIZE]; + char options[STRING_SIZE]; + int r; + + // Loop through the list of known subvolumes. + for ( subvolume = btrfs_subvolumes; subvolume->name; subvolume++ ) { + // Assign subvolume path. + r = snprintf(path, sizeof(path), "%s%s", DESTINATION_MOUNT_PATH, subvolume->mount_path); + + if (r < 0) { + return r; + } + + // Assign subvolume name. + r = snprintf(options, sizeof(options), "subvol=%s,%s", subvolume->name, BTRFS_MOUNT_OPTIONS); + if (r < 0) { + return r; + } + + // Create the directory. + r = hw_mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO); + + // Abort if the directory could not be created. + if(r != 0 && errno != EEXIST) + return r; + + // Print log message + fprintf(flog, "Mounting subvolume %s to %s\n", subvolume->name, subvolume->mount_path); + + // Try to mount the subvolume. + r = mount(source, path, "btrfs", NULL, options); + + if (r) { + return r; + } + } + + return 0; +} + int hw_umount_filesystems(struct hw_destination* dest, const char* prefix) { int r; char target[STRING_SIZE]; @@ -995,13 +1124,83 @@ int hw_umount_filesystems(struct hw_destination* dest, const char* prefix) { return -1;
// root - r = hw_umount(prefix, NULL); + if(dest->filesystem == HW_FS_BTRFS) { + r = hw_umount_btrfs_layout(); + } else { + r = hw_umount(prefix, NULL); + } + if (r) return -1;
return 0; }
+int hw_umount_btrfs_layout() { + const struct btrfs_subvolumes* subvolume = NULL; + char path[STRING_SIZE]; + int counter = 0; + int retry = 1; + int r; + + do { + // Reset the retry marker + retry = 0; + + // Loop through the list of subvolumes + for (subvolume = btrfs_subvolumes; subvolume->name; subvolume++) { + // Abort if the subvolume path could not be assigned. + r = snprintf(path, sizeof(path), "%s%s", DESTINATION_MOUNT_PATH, subvolume->mount_path); + + if (r < 0) { + return r; + } + + // Try to umount the subvolume. + r = umount2(path, 0); + + // Handle return codes. + if (r) { + switch(errno) { + case EBUSY: + // Set marker to retry the umount. + retry = 1; + + // Ignore if the subvolume could not be unmounted yet, + // because it is still used. + continue; + + case EINVAL: + // Ignore if the subvolume already has been unmounted + continue; + case ENOENT: + // Ignore if the directory does not longer exist. + continue; + default: + fprintf(flog, "Could not umount %s from %s - Error: %d\n", subvolume->name, path, r); + return r; + } + } + + // Print log message + fprintf(flog, "Umounted %s from %s\n", subvolume->name, path); + } + + // Abort loop if all mountpoins got umounted + if (retry == 0) { + return 0; + } + + // Abort after five failed umount attempts + if (counter == 5) { + return -1; + } + + // Increment counter. + counter++; + } while (1); +} + int hw_destroy_raid_superblocks(const struct hw_destination* dest, const char* output) { char cmd[STRING_SIZE];
@@ -1121,11 +1320,13 @@ static char* hw_get_uuid(const char* dev) { #define FSTAB_FMT "UUID=%s %-8s %-4s %-10s %d %d\n"
int hw_write_fstab(struct hw_destination* dest) { + const struct btrfs_subvolumes* subvolume = NULL; FILE* f = fopen(DESTINATION_MOUNT_PATH "/etc/fstab", "w"); if (!f) return -1;
char* uuid = NULL; + char mount_options[STRING_SIZE];
// boot if (*dest->part_boot) { @@ -1161,7 +1362,22 @@ int hw_write_fstab(struct hw_destination* dest) { // root uuid = hw_get_uuid(dest->part_root); if (uuid) { - fprintf(f, FSTAB_FMT, uuid, "/", "auto", "defaults", 1, 1); + if(dest->filesystem == HW_FS_BTRFS) { + // Loop through the list of subvolumes + for (subvolume = btrfs_subvolumes; subvolume->name; subvolume++) { + // Abort if the mount options could not be assigned + int r = snprintf(mount_options, sizeof(mount_options), "defaults,%s,subvol=%s", BTRFS_MOUNT_OPTIONS, subvolume->name); + if (r < 0) { + return r; + } + + // Write the entry to the file + fprintf(f, FSTAB_FMT, uuid, subvolume->mount_path, "btrfs", mount_options, 1, 1); + } + } else { + fprintf(f, FSTAB_FMT, uuid, "/", "auto", "defaults", 1, 1); + } + free(uuid); }
@@ -1205,3 +1421,66 @@ int hw_restore_backup(const char* output, const char* backup_path, const char* d
return 0; } + +int hw_mkdir(const char *dir) { + char tmp[STRING_SIZE]; + char *p = NULL; + size_t len; + int r; + + snprintf(tmp, sizeof(tmp),"%s",dir); + len = strlen(tmp); + + if (tmp[len - 1] == '/') { + tmp[len - 1] = 0; + } + + for (p = tmp + 1; *p; p++) { + if (*p == '/') { + *p = 0; + + // Create target if it does not exist + if (access(tmp, X_OK) != 0) { + r = mkdir(tmp, S_IRWXU|S_IRWXG|S_IRWXO); + + if (r) { + return r; + } + } + + *p = '/'; + } + } + + // Create target if it does not exist + if (access(tmp, X_OK) != 0) { + r = mkdir(tmp, S_IRWXU|S_IRWXG|S_IRWXO); + + if (r) { + return r; + } + } + + return 0; +} + + +int hw_create_btrfs_subvolume(const char* output, const char* subvolume) { + char command [STRING_SIZE]; + int r; + + // Abort if the command could not be assigned. + r = snprintf(command, sizeof(command), "/usr/bin/btrfs subvolume create %s/%s", DESTINATION_MOUNT_PATH, subvolume); + if (r < 0) { + return r; + } + + // Create the subvolume + r = mysystem(output, command); + + if (r) { + return r; + } + + return 0; +} diff --git a/src/installer/hw.h b/src/installer/hw.h index 6a7f23aa7c..bba06da95d 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
@@ -53,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)
@@ -103,6 +106,26 @@ struct hw_destination { unsigned long long size_root; };
+// Struct to define the BTRFS subvolumes layout +static const struct btrfs_subvolumes { + const char* name; + const char* mount_path; +} btrfs_subvolumes[] = { + { "@", "/" }, + { "@snapshots", "/.snapshots" }, + { "@home", "/home" }, + { "@root", "/root" }, + { "@cache", "/var/cache" }, + { "@backups", "/var/ipfire/backup" }, + { "@lib", "/var/lib" }, + { "@logs", "/var/log" }, + { "@mails", "/var/mail" }, + { "@tmp", "/var/tmp" }, + + // Sentinel + { NULL }, +}; + struct hw* hw_init(); void hw_free(struct hw* hw);
@@ -118,7 +141,7 @@ struct hw_disk** hw_select_disks(struct hw_disk** disks, int* selection); struct hw_disk** hw_select_first_disk(const struct hw_disk** disks);
struct hw_destination* hw_make_destination(struct hw* hw, int part_type, struct hw_disk** disks, - int disable_swap); + int disable_swap, int filesystem);
unsigned long long hw_memory();
diff --git a/src/installer/main.c b/src/installer/main.c index cddb0d91a6..c31c032c29 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -29,6 +29,8 @@
extern char url[STRING_SIZE];
+FILE* flog = NULL; + static int newtChecklist(const char* title, const char* message, unsigned int width, unsigned int height, unsigned int num_entries, const char** entries, int* states) { @@ -377,7 +379,6 @@ int main(int argc, char *argv[]) { sethostname(DISTRO_SNAME, 10);
/* Log file/terminal stuff. */ - FILE* flog = NULL; if (argc >= 2) { logfile = argv[1];
@@ -684,34 +685,9 @@ int main(int argc, char *argv[]) {
hw_free_disks(disks);
- struct hw_destination* destination = hw_make_destination(hw, part_type, - selected_disks, config.disable_swap); - - if (!destination) { - errorbox(_("Your harddisk is too small.")); - goto EXIT; - } - - fprintf(flog, "Destination drive: %s\n", destination->path); - fprintf(flog, " bootldr: %s (%lluMB)\n", destination->part_bootldr, BYTES2MB(destination->size_bootldr)); - fprintf(flog, " boot : %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot)); - fprintf(flog, " ESP : %s (%lluMB)\n", destination->part_boot_efi, BYTES2MB(destination->size_boot_efi)); - fprintf(flog, " swap : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap)); - fprintf(flog, " root : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root)); - fprintf(flog, "Memory : %lluMB\n", BYTES2MB(hw_memory())); - - // Warn the user if there is not enough space to create a swap partition - if (!config.unattended) { - if (!config.disable_swap && !*destination->part_swap) { - rc = newtWinChoice(title, _("OK"), _("Cancel"), - _("Your harddisk is very small, but you can continue without a swap partition.")); - - if (rc != 1) - goto EXIT; - } - } - // Filesystem selection + int filesystem = HW_FS_DEFAULT; + if (!config.unattended) { struct filesystems { int fstype; @@ -720,6 +696,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); @@ -739,7 +716,34 @@ int main(int argc, char *argv[]) { if (rc == 2) goto EXIT;
- destination->filesystem = filesystems[fs_choice].fstype; + filesystem = filesystems[fs_choice].fstype; + } + + struct hw_destination* destination = hw_make_destination(hw, part_type, + selected_disks, config.disable_swap, filesystem); + + if (!destination) { + errorbox(_("Your harddisk is too small.")); + goto EXIT; + } + + fprintf(flog, "Destination drive: %s\n", destination->path); + fprintf(flog, " bootldr: %s (%lluMB)\n", destination->part_bootldr, BYTES2MB(destination->size_bootldr)); + fprintf(flog, " boot : %s (%lluMB)\n", destination->part_boot, BYTES2MB(destination->size_boot)); + fprintf(flog, " ESP : %s (%lluMB)\n", destination->part_boot_efi, BYTES2MB(destination->size_boot_efi)); + fprintf(flog, " swap : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap)); + fprintf(flog, " root : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root)); + fprintf(flog, "Memory : %lluMB\n", BYTES2MB(hw_memory())); + + // Warn the user if there is not enough space to create a swap partition + if (!config.unattended) { + if (!config.disable_swap && !*destination->part_swap) { + rc = newtWinChoice(title, _("OK"), _("Cancel"), + _("Your harddisk is very small, but you can continue without a swap partition.")); + + if (rc != 1) + goto EXIT; + } }
// Setting up RAID if needed.
hooks/post-receive -- IPFire 2.x development tree