## 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
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 <<EOF > $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
. ./minbase-strap-mkimg.sh
for E in $ENDING ; do $E ; done
+
+#. ./minbase-strap-mkiso.sh $IMG