base-installer: integrate udeb from debian upstream

This commit is contained in:
Luis Guzmán 2022-10-19 18:30:23 +00:00
parent eeb06d94e8
commit 73d99a9a9a
4 changed files with 90 additions and 4 deletions

View file

@ -0,0 +1,37 @@
arch_get_kernel_flavour () {
echo amd64
}
arch_check_usable_kernel () {
if echo "$1" | grep -q -e "signed" -e "edge" -e "hwe-16.04"; then return 1; fi
if echo "$1" | grep -Eq -- "-(server|generic|virtual|xen|preempt|rt)(-.*)?$"; then return 0; fi
return 1
}
arch_get_kernel () {
echo "linux-generic"
echo "linux-image-generic"
echo "linux-generic-hwe-20.04"
echo "linux-image-generic-hwe-20.04"
echo "linux-lowlatency"
echo "linux-image-lowlatency"
echo "linux-lowlatency-hwe-20.04"
echo "linux-image-lowlatency-hwe-20.04"
echo "linux-oem-20.04"
echo "linux-image-oem-20.04"
echo "linux-virtual"
echo "linux-image-virtual"
echo "linux-image-extra-virtual"
echo "linux-virtual-hwe-20.04"
echo "linux-image-virtual-hwe-20.04"
echo "linux-image-extra-virtual-hwe-20.04"
}

View file

@ -0,0 +1,62 @@
arch_get_kernel_flavour () {
# Should we offer an amd64 kernel?
if grep -q '^flags.*\blm\b' "$CPUINFO"; then
echo 686-pae amd64 686 586
# Should we offer a PAE kernel?
elif grep -q '^flags.*\bpae\b' "$CPUINFO"; then
echo 686-pae 686 586
# Should we offer a 686 kernel?
elif grep -q '^flags.*\bfpu\b.*\btsc\b.*\bcx8\b.*\bcmov\b' "$CPUINFO"; then
echo 686 586
else
echo 586
fi
}
arch_check_usable_kernel () {
if echo "$1" | grep -q -e "signed" -e "edge" -e "hwe-16.04"; then return 1; fi
local NAME="$1"
set -- $2
while [ $# -ge 1 ]; do
case "$1:$NAME" in
*-dbg)
return 1
;;
*-"$1"-pae)
# Don't allow -pae suffix, as this requires an
# extra CPU feature
;;
*:*-"$1" | *:*-"$1"-*)
# Allow any other hyphenated suffix
return 0
;;
686-*:*-generic | 686-*:*-generic-*)
return 0
;;
686-*:*-virtual | 686-*:*-virtual-*)
return 0
;;
esac
shift
done
return 1
}
arch_get_kernel () {
imgbase="linux-image"
set -- $1
while [ $# -ge 1 ]; do
case $1 in
686-*)
echo "linux-generic"
echo "linux-image-generic"
echo "linux-virtual"
echo "linux-image-virtual"
break
;;
esac
shift
done
}