installer: add grub packages for d-i and Calamares
d-i and Calamares select the needed grub packages based on how the computer is started (BIOS vs UEFI). Because the packages for each variant conflict, they must be provided as .deb files.
This commit is contained in:
parent
947f6aafe8
commit
61ae406dd7
|
@ -365,7 +365,9 @@ then
|
||||||
|
|
||||||
case "${LB_ARCHITECTURE}" in
|
case "${LB_ARCHITECTURE}" in
|
||||||
amd64)
|
amd64)
|
||||||
DI_REQ_PACKAGES="grub-pc"
|
DI_REQ_PACKAGES="grub-pc" # BIOS
|
||||||
|
DI_REQ_PACKAGES="${DI_REQ_PACKAGES} grub-efi-amd64 efibootmgr grub-efi-amd64-signed shim-signed" # UEFI (required for d-i, includes suggested packages)
|
||||||
|
DI_REQ_PACKAGES="${DI_REQ_PACKAGES} efibootmgr grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common mokutil shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned cryptsetup keyutils" # UEFI (required by Calamares)
|
||||||
DI_PACKAGES="linux-image-amd64"
|
DI_PACKAGES="linux-image-amd64"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -442,6 +444,14 @@ then
|
||||||
# Set apt command prefix
|
# Set apt command prefix
|
||||||
_LB_APT_COMMAND="apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb -o Dir::State::status=/dev/null -o APT::Install-Recommends=false -o Debug::NoLocking=true --download-only"
|
_LB_APT_COMMAND="apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb -o Dir::State::status=/dev/null -o APT::Install-Recommends=false -o Debug::NoLocking=true --download-only"
|
||||||
|
|
||||||
|
# Download .debs of the required packages
|
||||||
|
Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES}
|
||||||
|
# The required packages or firmware packages might conflict, so download each individually
|
||||||
|
for _PACKAGE in ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES}
|
||||||
|
do
|
||||||
|
Chroot chroot ${_LB_APT_COMMAND} install ${_PACKAGE}
|
||||||
|
done
|
||||||
|
|
||||||
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
|
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
|
||||||
then
|
then
|
||||||
# We don't want to duplicate .debs of packages in binary/pool that are already
|
# We don't want to duplicate .debs of packages in binary/pool that are already
|
||||||
|
@ -451,9 +461,6 @@ then
|
||||||
# d-i does not support (for example) re-installing grub from target/ - the grub
|
# d-i does not support (for example) re-installing grub from target/ - the grub
|
||||||
# .debs must actually exist.
|
# .debs must actually exist.
|
||||||
|
|
||||||
# Download .debs of the required packages
|
|
||||||
Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES} ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES}
|
|
||||||
|
|
||||||
# Drop the packages already installed that d-i doesn't explicitly need
|
# Drop the packages already installed that d-i doesn't explicitly need
|
||||||
_REMAINING_PACKAGES="$(echo ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES} | sed -e 's# #|#g')"
|
_REMAINING_PACKAGES="$(echo ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES} | sed -e 's# #|#g')"
|
||||||
_REMAINING_PACKAGES="$(Chroot_package_list chroot | grep -E -v "^(${_REMAINING_PACKAGES})\$")"
|
_REMAINING_PACKAGES="$(Chroot_package_list chroot | grep -E -v "^(${_REMAINING_PACKAGES})\$")"
|
||||||
|
@ -463,9 +470,6 @@ then
|
||||||
do
|
do
|
||||||
rm -f chroot/binary.deb/archives/${_PACKAGE}_*.deb
|
rm -f chroot/binary.deb/archives/${_PACKAGE}_*.deb
|
||||||
done
|
done
|
||||||
else
|
|
||||||
# Download .debs of the required packages
|
|
||||||
Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES} ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv chroot/binary.deb ./
|
mv chroot/binary.deb ./
|
||||||
|
|
Loading…
Reference in New Issue