echo $1
}
+# Helper function to for using dpkg in $INITRD
+mydpkg() {
+ fakechroot fakeroot dpkg --force-architecture \
+ --admindir=$INITRD/var/lib/dpkg --log=$INITRD/var/log/dpkg.log \
+ --root=$INITRD $@
+}
+
# Prepare for unpacking
mkdir -p $INITRD/var/log $INITRD/var/lib/dpkg
done
echo "######## Installing installer ######### ${#PKGS[@]}" >&2
-# Use busybox-static rather than busybox-udeb
+# Install busybox-static to have a good collection of static binaries.
+# busybox-udeb may be installed and replace some of them
download busybox-static $UDEBSDIR
-rm $UDEBSDIR/busybox-udeb_*
-
-mydpkg() {
- fakechroot fakeroot dpkg --force-architecture \
- --admindir=$INITRD/var/lib/dpkg --log=$INITRD/var/log/dpkg.log \
- --root=$INITRD $@
-}
mydpkg --unpack $UDEBSDIR/busybox-static_*.deb
$INITRD/bin/busybox --list | while read B ; do
watchdog|arping|brctl|crond|fsfreeze|i2cdetect|i2cdump| \
i2cget|i2cset|i2ctransfer|loadfont|mim|partprobe| \
rdate|telnetd|ubirename|udhcpd)
- ln -s ../bin/busybox $INITRD/sbin/$B
+ ln $INITRD/bin/busybox $INITRD/sbin/$B
+ ;;
+ tar|dpkg|dpkg-deb)
+ : # ignore these
;;
*)
- ln -s busybox $INITRD/bin/$B
+ ln $INITRD/bin/busybox $INITRD/bin/$B
;;
esac
done
Version: $VERSION
Description: devuan installation image
-Package: busybox-udeb
-Status: install ok installed
-Maintainer: $TARGET_ARCH installer
-Architecture: $TARGET_ARCH
-Version: $VERSION
-Description: not actually, but busybox-static is installed
-
EOF
fi
done
done
+# libc6 cannot be unpacked in fakechroot .. do it by hand
+ar p $UDEBSDIR/libc6_*.deb data.tar.xz | \
+ tar xJf - --keep-directory-symlink -C $INITRD
+cat <<EOF >> $STATUS
+Package: libc6
+Status: install ok installed
+Maintainer: $TARGET_ARCH installer
+Architecture: $TARGET_ARCH
+Version: $(cd $UDEBSDIR ; echo libc6_*.deb | sed 's/^[^_]*_\([^_]*\).*$/\1/')
+Description: libc6 manual
+
+EOF
+
+# Helper function to generate .list and .md5sums from a tar listing
+dpkg_info_files() {
+ local P
+ cd $INITRD
+ sed '/^.\/$/{s|..|/.|;n};s|^\.||;s|/$||' | \
+ tee "var/lib/dpkg/info/$1.list" | while read P ; do
+ [ -f "${P#/}" ] && md5sum ${P#/}
+ done > "var/lib/dpkg/info/$1.md5sums"
+}
+ar p $UDEBSDIR/libc6_*.deb data.tar.xz | tar tJf - | \
+ dpkg_info_files "libc6:$TARGET_ARCH"
+
+mydpkg -E --install $UDEBSDIR/gcc-12-base_*.deb
+mydpkg -E --install $UDEBSDIR/libgcc-s1_*.deb
+
+# dpkg via tar has wide dependecy graph
+mydpkg -E --install $UDEBSDIR/libbz2-1.0_*.deb
+mydpkg -E --install $UDEBSDIR/liblzma5_*.deb
+mydpkg -E --install $UDEBSDIR/libmd0_*.deb
+mydpkg -E --install --force-overwrite $UDEBSDIR/libpcre2-8-0_*.deb
+mydpkg -E --install $UDEBSDIR/libselinux1_*.deb
+mydpkg -E --install $UDEBSDIR/libzstd1_*.deb
+mydpkg -E --install $UDEBSDIR/zlib1g_*.deb
+mydpkg -E --install $UDEBSDIR/tar_*.deb
+mydpkg -E --install $UDEBSDIR/dpkg_*.deb
+
# 3f This is set up for choose-mirror and console-setup
echo ${DISTNAME} > $INITRD/etc/default-release
mkdir $INITRD/etc/console-setup
-o APT::FTPArchive::Release::Codename="$DISTNAME" \
-o APT::FTPArchive::Release::Architectures="$TARGET_ARCH" \
-o APT::FTPArchive::Release::Components="$SECTIONS" \
- release $MEDIA > $MEDIA/dists/$DISTNAME/Release
+ release $MEDIA/dists/$DISTNAME > $MEDIA/dists/$DISTNAME/Release
ln -s $DISTNAME $MEDIA/dists/stable
+# Final media touch-up for bootstrap-base
+mkdir $MEDIA/.disk/
+touch $MEDIA/.disk/base_installable
+echo full_cd > $MEDIA/.disk/cd_type
+date +"Devuan GNU/Linux $DISTVERS $DISTNAME $ARCH - bespoke %Y%m%d" \
+ > $MEDIA/.disk/info
+
# Finally prepare a squashfs of $MEDIA into $INITRD
fakeroot mksquashfs $MEDIA $INITRD/pool.squashfs
cp $INITRD/boot/vmlinuz .
exit 0
-