diff --git a/iso/builder/config/hooks/normal/9011-toram-rsync.hook.chroot b/iso/builder/config/hooks/normal/9011-toram-rsync.hook.chroot new file mode 100755 index 0000000..2771757 --- /dev/null +++ b/iso/builder/config/hooks/normal/9011-toram-rsync.hook.chroot @@ -0,0 +1,46 @@ +#!/bin/sh +# 9011-toram-rsync.hook.chroot +# +# Adds rsync to the initramfs so that live-boot's toram code takes the +# rsync --progress path instead of the silent "cp -a" fallback. +# +# live-boot's 9990-toram-todisk.sh already contains: +# if [ -x /bin/rsync ]; then +# rsync -a --progress ... 1>/dev/console +# else +# cp -a ... # no output +# fi +# +# We install an initramfs-tools hook that calls copy_exec /usr/bin/rsync, +# which copies the binary + all shared-library dependencies into the initrd. + +set -e + +HOOK_DIR="/etc/initramfs-tools/hooks" +HOOK="${HOOK_DIR}/bee-rsync" + +mkdir -p "${HOOK_DIR}" + +cat > "${HOOK}" << 'EOF' +#!/bin/sh +# initramfs hook: include rsync for live-boot toram progress output +PREREQ="" +prereqs() { echo "$PREREQ"; } +case "$1" in prereqs) prereqs; exit 0 ;; esac + +. /usr/share/initramfs-tools/hook-functions + +if [ -x /usr/bin/rsync ]; then + copy_exec /usr/bin/rsync /bin +fi +EOF + +chmod +x "${HOOK}" + +echo "9011-toram-rsync: installed initramfs hook at ${HOOK}" + +# Rebuild initramfs so the hook takes effect in the ISO's initrd.img +KVER=$(ls /lib/modules | sort -V | tail -1) +echo "9011-toram-rsync: rebuilding initramfs for kernel ${KVER}" +update-initramfs -u -k "${KVER}" +echo "9011-toram-rsync: done" diff --git a/iso/builder/config/package-lists/bee.list.chroot b/iso/builder/config/package-lists/bee.list.chroot index f30b79a..2de340a 100644 --- a/iso/builder/config/package-lists/bee.list.chroot +++ b/iso/builder/config/package-lists/bee.list.chroot @@ -3,6 +3,7 @@ dmidecode smartmontools nvme-cli pciutils +rsync ipmitool util-linux e2fsprogs