diff --git a/usr/lib/archboot/cpio/cpio.sh b/usr/lib/archboot/cpio/cpio.sh index 4a384f5b8..675e995e4 100644 --- a/usr/lib/archboot/cpio/cpio.sh +++ b/usr/lib/archboot/cpio/cpio.sh @@ -246,14 +246,24 @@ _install_libs() { } _create_cpio() { - echo "Creating zstd compressed image..." pushd "${_ROOTFS}" >"${_NO_LOG}" || return + echo "Creating initramfs:" # Reproducibility: set all timestamps to 0 fd . -u --min-depth 1 -X touch -hcd "@0" + echo "Appending directories..." + fd . -t d -0 | sort -z | + LC_ALL=C.UTF-8 bsdtar --null -cnf - -T - | + LC_ALL=C.UTF-8 bsdtar --null -cf - --format=newc @- > "${_GENERATE_IMAGE}" || _abort "Image creation failed!" + echo "Appending compressed files..." + fd . -u -e 'bz2' -e 'gz' -e 'xz' -e 'zst' --min-depth 1 -0 | sort -z | + LC_ALL=C.UTF-8 bsdtar --null -cnf - -T - | + LC_ALL=C.UTF-8 bsdtar --null -cf - --format=newc @- >> "${_GENERATE_IMAGE}" || _abort "Image creation failed!" + fd . -u -e 'bz2' -e 'gz' -e 'xz' -e 'zst' --min-depth 1 -X rm + echo "Appending zstd compressed image..." # use zstd only it has best compression and decompression fd . -u --min-depth 1 -0 | sort -z | LC_ALL=C.UTF-8 bsdtar --null -cnf - -T - | LC_ALL=C.UTF-8 bsdtar --null -cf - --format=newc @- | - zstd -T0 -19 > "${_GENERATE_IMAGE}" || _abort "Image creation failed!" + zstd -T0 -19 >> "${_GENERATE_IMAGE}" || _abort "Image creation failed!" popd >"${_NO_LOG}" || return } diff --git a/usr/lib/archboot/cpio/hooks/base_common b/usr/lib/archboot/cpio/hooks/base_common index 89415b50d..b1a7d51de 100644 --- a/usr/lib/archboot/cpio/hooks/base_common +++ b/usr/lib/archboot/cpio/hooks/base_common @@ -5,11 +5,11 @@ _run () { # add basic apps - _map _binary bash blkid bsdcpio cat cp cut dialog echo env find grep \ + _map _binary 3cpio bash blkid cat cp cut dialog echo env find grep \ gzip halt head init journalctl kmod ln loadkeys logger ls{,blk,mod} \ mkdir mkfs.btrfs modprobe less mount mountpoint mv poweroff \ realpath reboot rg rm setfont sh shutdown sleep sulogin systemctl \ - systemd-tmpfiles udevadm umount uname + systemd-tmpfiles udevadm umount uname zstd # rdinit= kernel parameter defaults to /init # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/main.c _symlink /init bin/init diff --git a/usr/lib/archboot/cpio/hooks/base_common_cleanup b/usr/lib/archboot/cpio/hooks/base_common_cleanup index f02ad9c24..5c73646f7 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_cleanup +++ b/usr/lib/archboot/cpio/hooks/base_common_cleanup @@ -6,7 +6,7 @@ _run () { ! grep -qw 'archboot' /etc/hostname && return _install_files - rm /usr/bin/{bsdcpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\ + rm /usr/bin/{3cpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\ mountpoint,setfont,sulogin,systemctl} } diff --git a/usr/lib/archboot/cpio/hooks/base_common_system b/usr/lib/archboot/cpio/hooks/base_common_system index 08b304986..ce62d93e3 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_system +++ b/usr/lib/archboot/cpio/hooks/base_common_system @@ -35,7 +35,7 @@ usr/share/{locale/{be,bg,cs,da,de,en_US,el,es,fi,fr,hu,it,lt,lv,mk,nl,nn,pl,pt,r var/lib/pacman/local \ | tar -C "${_ROOTFS}" -xpf - fi - _map _binary agetty archlinux-keyring-wkd-sync awk bat basename brotli bsdtar \ + _map _binary agetty archlinux-keyring-wkd-sync awk bat basename brotli bsd{cpio,tar} \ {bus,boot,coredump,hostname,journal,locale,login,machine,network,\ system,timedate,userdb,home,oom,portable}ctl btm certutil chmod clear cmsutil crlutil curl date \ dbus-{broker{,-launch},cleanup-sockets,daemon,launch,monitor,run-session,send,test-tool,\ @@ -49,7 +49,7 @@ update-activation-environment,uuidgen} dd df dir du dust exa eza false fd fzf fz cgls,cgtop,confextdelta,detect-virt,escape,firstboot,hwdb,inhibit,machine-id-setup,mount,notify,nspawn,path,\ resolve,repartrun,socket-activate,stdio-bridge,sysusers,tty-ask-password-agent,umount,creds,cryptenroll,dissect,\ id128,sysext} tar tee testpkg top touch trust tty unix_{chkpwd,update} /usr/lib/dbus-1.0/dbus-daemon-launch-helper \ - umount.nfs{,4} update-ca-trust vercmp wc yes zoxide zstd + umount.nfs{,4} update-ca-trust vercmp wc yes zoxide # add C.UTF-8 locale _dir /usr/lib/locale [[ -d /usr/lib/locale/C.utf8 ]] && _full_dir /usr/lib/locale/C.utf8 diff --git a/usr/lib/archboot/cpio/hooks/base_common_system_cleanup b/usr/lib/archboot/cpio/hooks/base_common_system_cleanup index 9601718ef..1a6704333 100644 --- a/usr/lib/archboot/cpio/hooks/base_common_system_cleanup +++ b/usr/lib/archboot/cpio/hooks/base_common_system_cleanup @@ -16,7 +16,7 @@ daemon,launch,monitor,run-session,send,test-tool,update-activation-environment,u kernel-install,systemd-{analyze,ask-password,cat,cgls,cgtop,delta,detect-virt,escape,firstboot,\ hwdb,inhibit,machine-id-setup,mount,notify,nspawn,path,resolve,run,umount,socket-activate,\ stdio-bridge,sysusers,tty-ask-password-agent,repart,creds,cryptenroll,dissect,id128,sysext},\ -{bus,boot,coredump,locale,login,machine,network,hostname,timedate,userdb,home,oom,portable}ctl} +{bus,boot,coredump,locale,login,machine,network,hostname,timedate,userdb,home,oom,portable}ctl,zoxide} } # vim: set ft=sh ts=4 sw=4 et: diff --git a/usr/lib/archboot/cpio/init.sh b/usr/lib/archboot/cpio/init.sh index a766ae76a..d185e056a 100755 --- a/usr/lib/archboot/cpio/init.sh +++ b/usr/lib/archboot/cpio/init.sh @@ -83,7 +83,7 @@ _task() { #shellcheck disable=SC2164 cd /sysroot # fastest uncompression of zstd cpio format - bsdcpio -i -d -u <"/mnt/efi/boot/initrd-${_ARCH}.img" &>/dev/null + 3cpio -x "/mnt/efi/boot/initrd-${_ARCH}.img" &>/dev/null rm -r sysroot rm init fi diff --git a/usr/share/archboot/doc/archboot.html b/usr/share/archboot/doc/archboot.html index 33f563751..6e2ec1ffb 100644 --- a/usr/share/archboot/doc/archboot.html +++ b/usr/share/archboot/doc/archboot.html @@ -17,7 +17,7 @@

Archboot Home | Gallery | Donate

2024 Fundraise: 0% 0% 100%

© 2006 - 2024 | Tobias Powalowski | Arch Linux Developer tpowa
-Last update: 10.07.2024 12:06

+Last update: 14.07.2024 22:26