debian-installer: enable further archs.

This commit is contained in:
Luis Guzmán 2023-07-06 02:48:27 +00:00
parent f24e315a6d
commit 03761554a7
8 changed files with 1089 additions and 32 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright (C) 2009-2020 Ruben Rodriguez <ruben@trisquel.info>
# Copyright (C) 2022 Luis Guzman <ark@switnet.org>
# Copyright (C) 2023 Luis Guzman <ark@switnet.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -18,17 +18,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=12
VERSION=13
EXTERNAL='deb-src http://ftp.debian.org/debian bullseye main'
REPOKEY=0E98404D386FA1D9
NETINST=true
. ./config
#Manually disable 'any' other arch than amd64
sed -i '/Architecture:/s|any|amd64|' debian/control
# Set complete name as BUILD_DATE
sed -i "/DATE=/s/ | cut -d '.' -f 1//" debian/rules
cat << EOF > ${LOCAL_APT}/etc/apt_${CODENAME}.conf
Dir::State "${LOCAL_APT}/var/lib/apt";
Dir::State::status "${LOCAL_APT}/var/lib/dpkg/status";
@ -51,23 +46,22 @@ EOF
find build/pkg-lists -type f | xargs sed -i /media-retriever/d
apt-get update -c ${LOCAL_APT}/etc/apt_${CODENAME}.conf
# Get available kernel at release/main packages.
LASTKERNEL="$(apt-cache madison -c ${LOCAL_APT}/etc/apt_${CODENAME}.conf linux-libc-dev|grep ${CODENAME}/main|awk '{print$3}'|head -n1|cut -d. -f1,2,3)"
#sed -i "/# The version of the kernel to use./a BASEVERSION = $LASTKERNEL" ./build/config/amd64.cfg
#sed -i "s/^KERNELVERSION = .*/KERNELVERSION = \$(BASEVERSION)-generic/g" ./build/config/amd64.cfg
#sed -i "s/^MEDIUM_SUPPORTED.*/MEDIUM_SUPPORTED = cdrom netboot/g" ./build/config/amd64.cfg
##Optional
#sed -i '/KERNELNAME = vmlinuz/a #KERNELIMAGEVERSION = $(KERNELVERSION)' ./build/config/amd64.cfg
LASTKERNEL="$(apt-cache madison -c ${LOCAL_APT}/etc/apt_${CODENAME}.conf linux-libc-dev|\
grep ${CODENAME}/main|\
awk '{print$3}'|head -n1|\
cut -d. -f1,2,3)"
sed -i "s|LINUX_KERNEL_ABI ?= .*|LINUX_KERNEL_ABI ?= $LASTKERNEL|" build/config/common
sed -i '/LINUX_KERNEL_ABI/d' build/config/ppc64el.cfg
# Patch MEDIUM_SUPPORTED
patch --no-backup-if-mismatch -p1 < $DATA/medium_supported.patch
for i in amd64 arm64 armhf ppc64el
do
find build/config/ -name $i.cfg | xargs sed -i "/# The version of the kernel to use./a BASEVERSION = $LASTKERNEL"
find build/config/ -name $i.cfg | xargs sed -i "s/^KERNELVERSION = .*/KERNELVERSION = \$(BASEVERSION)-generic/g"
find build/config/ -name $i.cfg | xargs sed -i "s/^MEDIUM_SUPPORTED.*/MEDIUM_SUPPORTED = cdrom netboot/g"
find build/config/ -name $i.cfg | xargs sed -i '/KERNELNAME = vmlinuz/a #KERNELIMAGEVERSION = $(KERNELVERSION)'
done
#Limit arm to u-boot
for i in arm64 armhf
do
find build/config/ -name $i.cfg | xargs sed -i "s/^MEDIUM_SUPPORTED.*/MEDIUM_SUPPORTED = u-boot/g"
sed -i "/^KERNELVERSION =/i BASEVERSION = $LASTKERNEL" build/config/$i.cfg
sed -i 's/^KERNELVERSION = .*/KERNELVERSION = $(BASEVERSION)-generic/g' build/config/$i.cfg
sed -i '/^KERNELVERSION =/a KERNEL_FLAVOUR = di' build/config/$i.cfg
sed -i '/^KERNEL_FLAVOUR = di/a KERNELIMAGEVERSION = $(KERNELVERSION)' build/config/$i.cfg
done
##TODO: fix the EFI bootloader image
@ -121,6 +115,7 @@ rpl Debian Trisquel . -R
rpl DEBIAN TRISQUEL . -R
rpl http://ftp.debian.org/debian http://archive.trisquel.org/trisquel . -R
rpl http://www.debian.org/ https://trisquel.info build/boot/ -R
# Replace the debian release for the trisquel one.
rpl bullseye $CODENAME . -R
rpl debian-archive-keyring trisquel-keyring debian/control
@ -134,7 +129,7 @@ rpl debian-ports-archive-keyring-udeb trisquel-keyring-udeb . -R
grep -rl TRISQUEL_VERSION |xargs sed -i "s|TRISQUEL_VERSION =.*|TRISQUEL_VERSION = $REVISION ($CODENAME)|"
# Disable proposed-updates patch
patch -p1 < $DATA/remove-proposed-updates.patch
patch --no-backup-if-mismatch -p1 < $DATA/remove-proposed-updates.patch
echo "# Remove gtk related packages, not looking for graphical installer"
rm $(find build/pkg-lists -type f -path "*/gtk/*")
@ -143,11 +138,8 @@ grep -rl acpi-modules- build/pkg-lists/ |xargs sed -i '/acpi-modules-/d'
grep -rl cdrom-core-modules- build/pkg-lists/ |xargs sed -i '/cdrom-core-modules-/d'
grep -rl cdebconf-gtk-entropy build/config/ | xargs sed -i 's/cdebconf-gtk-entropy//'
#sed -i 's/.*SIGNED_IMAGE="$(KERNELNAME_ALT_SUFFIX)".*/'$'\t''efi-image $(TEMP_GRUB_EFI) x86_64-efi x64/' build/config/x86.cfg build/config/arm64.cfg
/bin/sed -i '/KERNELNAME_ALT_SUFFIX = -$(KERNELVERSION)/d' build/config/*.cfg build/config/*/*.cfg
# Ensure that ld-linux is executable
sed '/ifdef KERNELVERSION/a\\tchmod 755 $(TREE)\/lib\/$(DEB_HOST_MULTIARCH)\/ld-linux*' -i build/Makefile
patch --no-backup-if-mismatch -p1 < $DATA/chmod_755_ld-linux.patch
# HACK: include liblzma.so and liblz4.so from host into iso image, as runtime dependencies of zstd
sed '/not packaged as a udeb/a\\tcp /lib/$(DEB_HOST_MULTIARCH)/liblzma.so.5* $(TREE)/lib/$(DEB_HOST_MULTIARCH)' -i build/Makefile
@ -158,13 +150,18 @@ sed -i '/Build-Depends:/a\\tliblzma5, liblz4-1,' debian/control
sed 's|/debian|/trisquel|' -i ./build/util/efi-image
sed 's|EFI/debian|EFI/trisquel|' -i ./build/config/arm.cfg ./build/config/x86.cfg
## Set modules as optional
### no arm support for netboot (yet?).
#sed -i "/i2c-modules-/s|$| \?|" build/pkg-lists/netboot/armhf.cfg
#sed -i "/mtd-modules-/s|$| \?|" build/pkg-lists/netboot/armhf.cfg
#Fix u-boot naming debian>ubuntu
sed -i 's|.imx|-dtb.imx|g' build/boot/arm/u-boot-image-config
# Re apply upstream behavior and configuration features from last release (focal).
# https://git.launchpad.net/ubuntu/+source/debian-installer/log/?h=ubuntu/focal
## - Makebuild set of patches
## https://bazaar.launchpad.net/~xnox/debian-installer/di-focal/changes?filter_path=build/Makefile
for patch in $(ls -v ${DATA}/di_focal/*.diff)
do
echo "Applying $patch"
patch --no-backup-if-mismatch -Np0 < $patch
done
changelog "Rebranded and adapted for Trisquel"
compile