David Craven <da...@craven.ch> skribis: > * gnu/build/file-systems.scm (%btrfs-endianness, btrfs-superblock?, > read-btrfs-superblock, btrfs-superblock-uuid, > btrfs-superblock-volume-name, check-btrfs-file-system): New variables. > (%paritition-label-readers, %partition-uuid-readers): Add btrfs > readers. > * gnu/system/linux-initrd.scm (linux-modules): Add btrfs modules when a > btrfs file-system is used. > * gnu/tests/install.scm (%btrfs-root-os %btrfs-root-os-source, > %btrfs-root-installation-script, %test-btrfs-root-os): New system > test.
Woohoo, excellent work! You can add “Fixes <http://bugs.gnu.org/19280>.” > +;;; BTRFS file systems. “Btrfs” I think. > +;;; BTRFS root file system. Ditto. > +(define %btrfs-root-installation-script > + ;; Shell script of a simple installation. > + "\ > +. /etc/profile > +set -e -x > +guix --version > + > +export GUIX_BUILD_OPTIONS=--no-grafts > +ls -l /run/current-system/gc-roots > +parted --script /dev/vdb mklabel gpt \\ > + mkpart primary ext2 1M 3M \\ > + mkpart primary ext2 3M 1G \\ > + set 1 boot on \\ > + set 1 bios_grub on > +mkfs.btrfs -L my-root /dev/vdb2 > +mount /dev/vdb2 /mnt > +btrfs subvolume create /mnt/home > +herd start cow-store /mnt > +mkdir /mnt/etc > +cp /etc/target-config.scm /mnt/etc/config.scm > +guix system build /mnt/etc/config.scm > +guix system init /mnt/etc/config.scm /mnt --no-substitutes > +sync > +reboot\n") > + > +(define %test-btrfs-root-os > + (system-test > + (name "btrfs-root-os") > + (description > + "Test basic functionality of an OS installed like one would do by hand. > +This test is expensive in terms of CPU and storage usage since we need to > +build (current-guix) and then store a couple of full system images.") > + (value > + (mlet* %store-monad ((image (run-install %btrfs-root-os > + %btrfs-root-os-source > + #:script > + > %btrfs-root-installation-script)) > + (command (qemu-command/writable-image image))) > + (run-basic-test %btrfs-root-os command "btrfs-root-os"))))) Great stuff. Could you remote apply this as well:
diff --git a/doc/guix.texi b/doc/guix.texi index adc7fefca..e57bf6128 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6901,9 +6901,9 @@ cfdisk Once you are done partitioning the target hard disk drive, you have to create a file system on the relevant partition(s)@footnote{Currently -GuixSD pretty much assumes an ext4 file system. In particular, code -that reads partition UUIDs and labels only works with ext4. This will -be fixed in the future.}. +GuixSD only supports ext4 and btrfs file systems. In particular, code +that reads partition UUIDs and labels only works for these file system +types.}. Preferably, assign partitions a label so that you can easily and reliably refer to them in @code{file-system} declarations (@pxref{File
OK with these changes! In the future it would be nice to have btrfs installation instructions in the manual. Thank you! Ludo’.