From: Ralph Ronnquist Date: Fri, 8 Mar 2024 13:03:15 +0000 (+1100) Subject: cannot make ISO yet X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=317e77dbae92eb58153f5288684d3425d27895da;p=rrq%2Frescue-boot.git cannot make ISO yet --- diff --git a/minbase-strap.sh b/minbase-strap.sh index 82cc91a..6f41ac0 100755 --- a/minbase-strap.sh +++ b/minbase-strap.sh @@ -47,7 +47,8 @@ if $DEBSTRAP ; then ## bootstrap a filesystem, with exclusions echo "http_proxy=$http_proxy debootstrap ..." debootstrap --exclude=logrotate,cron,cron-daemon-common \ - --arch=$ARCH $DIST "$FS" http://deb.devuan.org/merged + --arch=$ARCH $DIST "$FS" http://deb.devuan.org/merged || \ + chroot "$FS" apt-get -f install -y chroot "$FS" apt-get install -y logrotate cron ## Select and add a kernel @@ -78,89 +79,25 @@ else exit 1 fi -#============================================================ -# Prepare a temporary directory tree with a boot kernel and $FS packed -# up into an initrd.gz -TMP=$(mktemp -d XXXX) -trap "rm -r $TMP" 0 2 15 - -mkdir -p $TMP/prep/{proc,dev,tmp,sys,mnt,usr} -stupid_links $TMP/prep - -# copy FS tree(s) in full into the TMP/prep tree -copyFStree() { - local D - for D in $* ; do - tar cf - -C "$FS" $D \ - | tar -xf - --skip-old-files --keep-directory-symlink -C $TMP/prep - done -} - -# Copy FS binary(s) with all its libraries into the TMP/prep tree -copyFSbin() { - local B BIN - for B in $* ; do - BIN="$(chroot "$FS" which "$B")" - tar cf - --dereference -C "$FS" ${BIN#/} \ - $(chroot "$FS" ldd "$BIN" | grep -oE '/[^ ]*'|sed 's|/||')\ - | tar -xf - --keep-directory-symlink -C $TMP/prep - done -} - -INITRD="$FS"/boot/initrd.img${LINUX#*/vmlinuz} -if [ -r "$INITRD" ] ; then - #select X in my FS ; do [ -n "$X" ] && break ; done - X=FS -else - X=my -fi -case "$X" in - FS) - copyFStree lib/modules - zstdcat $INITRD | ( cd $TMP/prep && cpio -i ) - VERSION=( $TMP/prep/lib/modules/* ) - for V in ${VERSION[@]} ; do - depmod -a -b $TMP/prep ${V#$TMP/prep/lib/modules/} - done - ;; - my) - copyFStree lib/modules lib/udev - copyFSbin busybox sh cttyhack setsid mount mkdir - copyFSbin udevd udevadm modprobe modinfo kmod blkid - ;; -esac - -## (re)install /init -mv $TMP/prep/init{,.FS} -echo "** Please select /init template" -select INIT in none $(echo init*.template) ; do [ -n "$INIT" ] && break ; done -if [ "$INIT" != none ] ; then - cp $INIT $TMP/prep/init - chmod a+x $TMP/prep/init -fi - -# Populate $TMP with /initrd.gz. /vmlinuz and /menu.cfg -( cd "$TMP/prep" && find -printf '%P\n' | cpio -o -H newc ) | \ - gzip > $TMP/initrd.gz -cp $LINUX $TMP/vmlinuz -rm -r $TMP/prep +. ./minbase-strap-initrd.sh +#============================================================ # Common syslinux menu CON="console=ttyS0,115200" cat < $TMP/menu.cfg default menu.c32 label rescue (serial) kernel /vmlinuz - append initrd=/initrd.gz init=/init $CON rescue + append initrd=/initrd.img init=/init $CON rescue label rescue2 (vt1) kernel /vmlinuz - append initrd=/initrd.gz init=/init rescue + append initrd=/initrd.img init=/init rescue label linux2 (sda2) kernel /vmlinuz - append initrd=/initrd.gz root=/dev/sda2 rootfstype=squashfs $CON + append initrd=/initrd.img root=/dev/sda2 rootfstype=squashfs $CON label linux (sdb1) kernel /vmlinuz - append initrd=/initrd.gz root=/dev/sdb1 $CON + append initrd=/initrd.img root=/dev/sdb1 $CON EOF . ./minbase-strap-bios.sh @@ -168,3 +105,5 @@ EOF . ./minbase-strap-mkimg.sh for E in $ENDING ; do $E ; done + +#. ./minbase-strap-mkiso.sh $IMG