From 6c552a2c6fe216757450c6ae07fa2e0a1b1102df Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Fri, 11 Oct 2024 20:39:55 +1100 Subject: [PATCH] added debootstrapp install option --- trial-arm64-upgrade.sh | 72 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/trial-arm64-upgrade.sh b/trial-arm64-upgrade.sh index 77c79a3..2ff247f 100755 --- a/trial-arm64-upgrade.sh +++ b/trial-arm64-upgrade.sh @@ -2,7 +2,7 @@ # This is the boot system build script. : ${REPO_URL:=http://deb.devuan.org/merged} : ${ARCH:=arm64} -: ${CODENAME:=daedalus} +: ${CODENAME:=ceres} : ${BUILD:=$ARCH/build} : ${SOURCES:=$ARCH/sources} : ${INITRD:=$ARCH/build/initrd} @@ -55,10 +55,13 @@ do_depends() { # package depend-tag directory while read D ; do [ -z "$D" ] || unpack $D $3 || exit 1 ; done } +typeset -A SKIP + unpack() { # package directory local F="$(debattr $1 Filename)" local URL="${REPO_URL%/*}/$F" local DST="$MEDIA/$F" + [ -z "${SKIP[$1]}" ] || return 0 [ -z "$F" ] && die "Unknown package $1" [ -f "$DST" ] && return 0 local URL="${REPO_URL}/$F" @@ -66,14 +69,27 @@ unpack() { # package directory note "${INDENT}Get $1" if ! wget -q -O $DST $URL ; then rm "$DST" ; exit 1 ; fi mkdir -p "$2" - ar p $DST data.tar.xz | tar -xJf - -C $2 + if ar t $DST | grep -q data.tar.xz ; then + ar p $DST data.tar.xz | tar -xJf - --keep-directory-symlink -C $2 + elif ar t $DST | grep -q data.tar.gz ; then + ar p $DST data.tar.gz | tar -xzf - --keep-directory-symlink -C $2 + else + die unknow format $DST + fi INDENT="$INDENT " do_depends "$1" Pre-Depends "$2" || exit 1 INDENT="$INDENT " do_depends "$1" Depends "$2" || exit 1 } +sillylinks() { + for D in bin sbin lib lib64 ; do + mkdir -p $INITRD/usr/$D + ln -s usr/$D $INITRD/$d + done +} #================================================================= SECTIONS="main main/debian-installer" for S in $SECTIONS ; do get_source $S || die $S ; done +sillylinks LINUX="$(debattr linux-image-$ARCH Depends | sed 's| .*||' )" VERSION="${LINUX#linux-image-}" KERNEL="kernel-image-$VERSION-di" @@ -86,18 +102,16 @@ EOF for P in $($INITRD/bin/busybox --list) ; do [ -e "$INITRD/bin/$P" ] || ln -sTf busybox "$INITRD/bin/$P" done - note "Prepare modules.dep for ${LINUX#linux-image-}" +find $INITRD/lib/modules/$VERSION -name '*.xz' -exec unxz '{}' ';' ( cd $INITRD; bin/depmod -b . ${LINUX#linux-image-} ) -# root:toor +# root:toor login heredoc $INITRD/etc/passwd < $INITRD/etc/hostname herescript $INITRD/sbin/boot-modules-probe <&2 + echo "unknown format: \$*" >&2 + exit 1 +fi +EOF + +herescript $INITRD/install < $ARCH/initrd.gz -- 2.39.2