aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-15 09:41:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-04 06:10:57 +0200
commitd916317c8c5c0093978a13495c17cf8b319d3ad9 (patch)
tree62ccb02d124f594b8de93a182c9e3ccae9aac4d8
parent81b23d75d873cbabc086729022a4b9b4f3d22a66 (diff)
Switch to xz instead of gzip for initrd compression
-rw-r--r--.gitignore2
-rwxr-xr-xbootstrap13
2 files changed, 9 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 46a102d..3ea7963 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-*.cpio.gz
+*.cpio.xz
buildos-buildid-*
buildos-initrd-*
buildos-image-*
diff --git a/bootstrap b/bootstrap
index b32a931..773b379 100755
--- a/bootstrap
+++ b/bootstrap
@@ -652,15 +652,18 @@ if [ "$stage" -le "5" ]; then
# Quite a few files/directories are only accessible by root (e.g., /root) so
# we run under sudo.
#
+ # Note also that without --check=crc32 the kernel will not be able to
+ # decompress things.
+ #
root_dirs="build dev etc mnt root usr var"
root_links="bin sbin lib lib32 lib64"
- info "generating buildos-rootfs.cpio.gz..."
+ info "generating buildos-rootfs.cpio.xz..."
cd "$root"
sudo find $root_dirs $root_links -print0 | \
sudo cpio --null -o -H newc | \
- gzip -9 > "$owd/buildos-rootfs.cpio.gz"
+ xz -9 --check=crc32 >"$owd/buildos-rootfs.cpio.xz"
cd "$owd"
subvol_snapshot -r "$root" "$root-5"
@@ -687,11 +690,11 @@ if [ "$stage" -le "6" ]; then
sudo ln -sf "$root/usr/lib/systemd/system/buildos.service" \
"$root/etc/systemd/system/multi-user.target.wants/buildos.service"
- info "generating buildos-init.cpio.gz..."
+ info "generating buildos-init.cpio.xz..."
cd "$root"
sudo cpio -o -H newc <<EOF | \
- gzip -9 > "$owd/buildos-init.cpio.gz"
+ xz -9 --check=crc32 >"$owd/buildos-init.cpio.xz"
usr/lib/os-release
init
usr/sbin/buildos
@@ -700,7 +703,7 @@ etc/systemd/system/multi-user.target.wants/buildos.service
EOF
cd "$owd"
- cat buildos-rootfs.cpio.gz buildos-init.cpio.gz >"buildos-initrd-$arch"
+ cat buildos-rootfs.cpio.xz buildos-init.cpio.xz >"buildos-initrd-$arch"
# Copy the kernel image next to the initramfs for convenience.
#