export http_proxy=http://10.10.10.100:3142
-: ${LINUX:=linux-image-6.1.0-25-arm64}
: ${DISTNAME:=daedalus}
: ${DISTVERS:=5.1.0}
: ${TARGET_ARCH:=arm64}
[ -f $INTO ] || die "Cannot get $BASE"
done
+######################################################################
+# Determine the linux kernel version from $LINUX or via
+# linux-image-$TARGET_ARCH
+if [ -z "$LINUX" ] ; then
+ M='/Package: \(linux\|kernel\)-image-'"$TARGET_ARCH"'$/'
+ M+=',/^$/!d;/^Depends:/!d;s|^[^ ]* ||;s| .*||'
+ LINUX="$(sed "$M" $SOURCES/main-Packages)"
+fi
+echo "LINUX=$LINUX" >&2
+export KERNELVERSION="${LINUX#linux-image-}"
+KERNELVERSION="${KERNELVERSION#kernel-mage-}" # jic
+
######################################################################
# Populate DEBURL and DEBDIR from the $SOURCES/*-Packages files as
# mappings from package name to download filename and pool section
# already installed, and /sbin/losetup is retained (due to being hard
# link).
target_dpkg -E --unpack $(debs busybox-static)
+rm -f $INITRD/bin/sh
executable $INITRD/bin/sh <<EOF
#!$(realpath $INITRD)/bin/busybox sh
echo "### /bin/sh OVERRIDE " >&2
# Note that udebs are installed with "--force-overwrite" because some
# of them compete about adding some configuration files.
UDEBS=(
- $( KERNELVERSION="${LINUX#linux-image-}" envsubst '${KERNELVERSION}' \
- < $UDEBSLIST | sed '/#/d;/^$/d' )
+ $( envsubst '${KERNELVERSION}' < $UDEBSLIST | sed '/#/d;/^$/d' )
)
for P in ${UDEBS[@]} ; do
echo "UDEB install = $P" >&2
echo ${DISTNAME} > $INITRD/etc/default-release
mkdir $INITRD/etc/console-setup
mkdir -p $INITRD/cdrom
+sed '/TAR_OPTIONS/d' -i $INITRD/usr/share/debootstrap/scripts/ceres
+
+# Add a udev rule to recognize /dev/loop0 as possible media device
+heredoc $INITRD/lib/udev/rules.d/70-loop0-is-media.rules <<EOF
+KERNEL=="loop0", ENV{ID_CDROM}="1"
+EOF
######################################################################
# Install "initrd-init" as the initrd /init to run at boot time. This
$(date +"Devuan GNU/Linux $DISTVERS $DISTNAME $ARCH - bespoke %Y%m%d")
EOF
heredoc $MEDIA/md5sum.txt <<EOF
-$(cd $MEDIA ; md5sum $( find . -type f -printf "%P\n" ))
+$(cd $MEDIA ; md5sum $( find . -type f -not -name 'md5sum*' -printf "%P\n" ))
EOF
#-- Prepare a squashfs of $MEDIA into $INITRD.
rm $INITRD/bin/logger
# cannot open /bin/archdetect -- file exists
mv $INITRD/{bin,sbin}/archdetect
+# uses squashfs rather than iso9660
+sed 's/iso9960\b/squashfs/' -i $INITRD/var/lib/dpkg/info/cdrom-detect.postinst
######################################################################
# Pack up $INITRD into a top-level initrd.gz, and copy out vmlinuz
find $INITRD -not -name udebs -printf '%P\n' | \
fakeroot cpio -o -H newc -D $INITRD | gzip > $TARGET_ARCH/initrd.gz
-VMLINUZ=( $INITRD/boot/vmlinu* )
+VMLINUZ=$INITRD/boot/vmlinuz-$KERNELVERSION
#-- Note that this renames it to vmlinuz regarless of its real name
#-- Eg the riscv64 kernel is actually not compressed
cp $VMLINUZ $TARGET_ARCH/vmlinuz
kmod-udeb
libfribidi0-udeb
libkmod2
-libpcre3-udeb
+#libpcre3-udeb #not in ceres
libelogind0
libtinfo6-udeb
load-cdrom
fat-modules-${KERNELVERSION}-di
fb-modules-${KERNELVERSION}-di
#firewire-core-modules-${KERNELVERSION}-di
-fuse-modules-${KERNELVERSION}-di
+#fuse-modules-${KERNELVERSION}-di # not in ceres
i2c-modules-${KERNELVERSION}-di
input-modules-${KERNELVERSION}-di
isofs-modules-${KERNELVERSION}-di
#mmc-core-modules-${KERNELVERSION}-di
mmc-modules-${KERNELVERSION}-di
#mouse-modules-${KERNELVERSION}-di
-mtd-core-modules-${KERNELVERSION}-di
+#mtd-core-modules-${KERNELVERSION}-di # not in ceres
multipath-modules-${KERNELVERSION}-di
nbd-modules-${KERNELVERSION}-di
nic-modules-${KERNELVERSION}-di