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
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 ;;
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