1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
# vim: filetype=sh
get_debian_variant()
{
if [ ! -f "/etc/os-release" ]
then
echo 'unknown'
return
fi
variant="$(grep -o "^ID=.*" /etc/os-release | sed -e 's/ID=//')"
if [ "$variant" = "" ]
then
echo 'unknown'
return
fi
echo "$variant"
}
custom_packages()
{
echo -n "grub-pc shim-signed initramfs-tools "
# grub-install uses lsb-release to identify the debian variant
# and place the boot files in appropriate [EFI-PART]/EFI/<sub-dir>.
# on Ubuntu, if lsb-release is missing, <sub-dir> value will default
# to 'debian' instead of 'ubuntu' and prevent the UEFI bootup to work.
# lsb-release has a significant impact on resulting image size because
# it depends on python3.
# in the case of debian, the default value selected for <subdir> is
# fine, so we can avoid it. for Ubuntu, we have to include it.
if [ "$(get_debian_variant)" != "debian" ]
then
echo "lsb-release "
fi
case "$(get_target_cpu /)" in
"amd64")
echo "grub-efi-amd64-signed"
;;
"i386")
echo "grub-efi-ia32-signed"
;;
esac
}
kernel_default_package()
{
# * ubuntu: linux-image-generic
# * debian on i386: linux-image-686-pae
# * debian on amd64: linux-image-amd64
case "$(get_target_cpu /)" in
"amd64")
echo "linux-image-((generic)|(amd64))"
;;
"i386")
echo "linux-image-((generic)|(686-pae))"
;;
esac
}
|