Add some additional supplemental packages (fw)

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:55 -04:00
parent b708058b06
commit 2dae04ab2a
2 changed files with 19 additions and 3 deletions

View File

@ -99,7 +99,7 @@ prepare_iso() {
echo -n "Extracting Debian Live ISO files... " echo -n "Extracting Debian Live ISO files... "
iso_tempdir=$( mktemp -d ) iso_tempdir=$( mktemp -d )
sudo mount artifacts/${srcliveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting Live ISO file." sudo mount artifacts/${srcliveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting Live ISO file."
sudo rsync -au --exclude live/filesystem.squashfs ${iso_tempdir}/ ${tempdir}/installer/ &>/dev/null || fail "Error extracting Live ISO files." sudo rsync -a --exclude live/filesystem.squashfs --exclude isolinux/menu.cfg --exclude isolinux/stdmenu.cfg ${iso_tempdir}/ ${tempdir}/installer/ &>/dev/null || fail "Error extracting Live ISO files."
sudo umount ${iso_tempdir} &>/dev/null || fail "Error unmounting Live ISO file." sudo umount ${iso_tempdir} &>/dev/null || fail "Error unmounting Live ISO file."
rmdir ${iso_tempdir} &>/dev/null rmdir ${iso_tempdir} &>/dev/null
echo "done." echo "done."
@ -117,6 +117,11 @@ prepare_rootfs() {
buster \ buster \
artifacts/debootstrap/ \ artifacts/debootstrap/ \
http://ftp.ca.debian.org/debian &>debootstrap.log || fail "Error performing debootstrap." http://ftp.ca.debian.org/debian &>debootstrap.log || fail "Error performing debootstrap."
# Grab some additional files in non-free
sudo wget http://ftp.ca.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_20190114-2_all.deb -O artifacts/debootstrap/var/cache/apt/archives/firmware-bnx2_20190114-2_all.deb
sudo chroot artifacts/debootstrap/ dpkg -i /var/cache/apt/archives/firmware-bnx2_20190114-2_all.deb || fail "Error installing supplemental package firmware-bnx2"
sudo wget http://ftp.ca.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2x_20190114-2_all.deb -O artifacts/debootstrap/var/cache/apt/archives/firmware-bnx2x_20190114-2_all.deb
sudo chroot artifacts/debootstrap/ dpkg -i /var/cache/apt/archives/firmware-bnx2x_20190114-2_all.deb || fail "Error installing supplemental package firmware-bnx2x"
if [[ -n ${clean_me} ]]; then if [[ -n ${clean_me} ]]; then
sudo chroot artifacts/debootstrap/ apt clean &>/dev/null || fail "Error cleaning apt cache in debootstrap." sudo chroot artifacts/debootstrap/ apt clean &>/dev/null || fail "Error cleaning apt cache in debootstrap."
else else
@ -147,7 +152,7 @@ prepare_rootfs() {
fi fi
sudo nice mksquashfs ${tempdir}/rootfs/ artifacts/filesystem.squashfs -e boot &>/dev/null || fail "Error generating squashfs." sudo nice mksquashfs ${tempdir}/rootfs/ artifacts/filesystem.squashfs -e boot &>/dev/null || fail "Error generating squashfs."
fi fi
sudo cp artifacts/filesystem.squashfs ${tempdir}/installer/live/filesystem.squashfs &>/dev/null || fail "Error copying squashfs to tempdir." sudo rsync -a artifacts/filesystem.squashfs ${tempdir}/installer/live/filesystem.squashfs &>/dev/null || fail "Error copying squashfs to tempdir."
echo "done." echo "done."
} }
@ -166,7 +171,7 @@ build_iso() {
-iso-level 3 \ -iso-level 3 \
-o ../${isofilename} \ -o ../${isofilename} \
-full-iso9660-filenames \ -full-iso9660-filenames \
-volid "DEBIAN_CUSTOM" \ -volid "PVC_NODE_INSTALLER" \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-eltorito-boot \ -eltorito-boot \
isolinux/isolinux.bin \ isolinux/isolinux.bin \

View File

@ -9,6 +9,7 @@ logfile="/tmp/pvc-install.log"
debrelease="buster" debrelease="buster"
debmirror="http://debian.mirror.rafal.ca/debian" debmirror="http://debian.mirror.rafal.ca/debian"
debpkglist="lvm2,parted,gdisk,grub-pc,grub-efi-amd64,linux-image-amd64,sudo,vim,gpg,gpg-agent,aptitude,openssh-server,vlan,ifenslave,python,python2,python3,ca-certificates,ntp" debpkglist="lvm2,parted,gdisk,grub-pc,grub-efi-amd64,linux-image-amd64,sudo,vim,gpg,gpg-agent,aptitude,openssh-server,vlan,ifenslave,python,python2,python3,ca-certificates,ntp"
suppkglist="firmware-linux,firmware-linux-nonfree"
clear clear
@ -309,6 +310,16 @@ echo -n "Running debootstrap install... "
debootstrap --include=${debpkglist} ${debrelease} ${target}/ ${debmirror} >&2 debootstrap --include=${debpkglist} ${debrelease} ${target}/ ${debmirror} >&2
echo "done." echo "done."
echo -n "Adding non-free repository (firmware, etc.)... "
mkdir -p ${target}/etc/apt/sources.list.d/ >&2
echo "deb ${debmirror} ${debrelease} contrib non-free" | tee -a ${target}/etc/apt/sources.list.d/non-free.list >&2
chroot ${target} apt update >&2
echo "done."
echo -n "Installing supplemental packages... "
chroot ${target} apt install -y --no-install-recommends $( sed 's/,/ /g' <<<"${suppkglist}" ) >&2
echo "done."
# Determine the bypath name of the specified system disk # Determine the bypath name of the specified system disk
for disk in /dev/disk/by-path/*; do for disk in /dev/disk/by-path/*; do
bypathlink="$( readlink ${disk} | awk -F'/' '{ print $NF }' )" bypathlink="$( readlink ${disk} | awk -F'/' '{ print $NF }' )"