From: Ralph Ronnquist Date: Sun, 27 Apr 2025 22:23:21 +0000 (+1000) Subject: Updated to build excalibur X-Git-Url: https://git.rrq.selfhost.au/?a=commitdiff_plain;h=e02dd039984e7da52da3c0f09e507f2d27155b72;p=rrq%2Ftiniest.git Updated to build excalibur --- diff --git a/mkit.sh b/mkit.sh index 2fb62d0..c52cba2 100755 --- a/mkit.sh +++ b/mkit.sh @@ -16,11 +16,14 @@ MAPFILE=save/mapfile.txt DEPFILE=save/mapdepends.txt REPOS=( - deb.devuan.org/merged_daedalus_main + deb.devuan.org/merged_excalibur_main deb.devuan.org/merged_ceres_main ) ARCH="amd64" MBR=dos # gpt +# silly-links setup +LIB=/usr/lib +BIN=/usr/bin : > $MAPFILE : > $DEPFILE @@ -167,11 +170,20 @@ fi echo "# Extract static busybox, and fluff it up for more utilities" mkdir -p initrd debextract initrd $(debfile busybox-static head) -for L in $(initrd/bin/busybox --listfull) ; do - mkdir -p $(dirname initrd/$L) +if [ "$BIN" = "/usr/bin" ] ; then + for D in bin sbin lib ; do + mkdir -p initrd/usr/$D + ln -s usr/$D initrd/$D + done +else + for D in bin sbin lib ; do + mkdir -p initrd/$D initrd/usr/$D + done +fi +for L in $(initrd$BIN/busybox --listfull) ; do [ -e "initrd/$L" ] && continue case "$L" in - bin/busybox) : ;; + bin/busybox) [ -e initrd/$L ] || ln -s usr/$L initrd/$L ;; usr/*) ln -s ../../bin/busybox initrd/$L ;; sbin/*) ln -s ../bin/busybox initrd/$L ;; bin/*) ln -s busybox initrd/$L ;; @@ -213,22 +225,27 @@ MODULES=( MOODLES="" B=$(pwd) for m in ${MODULES[@]} ; do - km=$(find kernel/lib/modules -name $m.ko) + km=$(find kernel$LIB/modules -name "$m.ko*") if [ -z "$km" ] ; then echo "Missing module $m" continue fi im=initrd/${km#kernel/} + im=${im%.xz} MOODLES+=" $B/$im" mkdir -p $(dirname $im) - cp -n $km $im + if [ -z "${km##*xz}" ] ; then + xzcat $km > $im + else + cp -n $km $im + fi done V=${KERNEL#linux-image-} -mkdir -p initrd/boot initrd/lib/modules/$V +mkdir -p initrd/boot initrd$LIB/modules/$V cp kernel/boot/System.map-$V initrd/ -cp kernel/lib/modules/$V/modules.order initrd/lib/modules/$V/ -cp kernel/lib/modules/$V/modules.builtin initrd/lib/modules/$V/ -depmod -F initrd/System.map-$V -b initrd $V $MOODLES +cp kernel$LIB/modules/$V/modules.order initrd$LIB/modules/$V/ +cp kernel$LIB/modules/$V/modules.builtin initrd$LIB/modules/$V/ +depmod -F initrd/System.map-$V -b initrd -o initrd $V echo "# setup a scripted init. The kernel runs this via the #! interpreter" rm -f initrd/sbin/init # just in case