2016-01-18 02:21:39 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## live-build(7) - System Build Scripts
|
2020-03-11 09:07:21 -01:00
|
|
|
## Copyright (C) 2016-2020 The Debian Live team
|
2016-01-18 02:21:39 -01:00
|
|
|
## Copyright (C) 2016 Adrian Gibanel Lopez <adrian15sgd@gmail.com>
|
|
|
|
##
|
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
|
|
|
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
|
|
|
|
|
|
|
|
# Setting static variables
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Prepares and installs Grub based EFI support into binary"
|
2016-01-18 02:21:39 -01:00
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Processing arguments and configuration files
|
|
|
|
Init_config_data "${@}"
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
Check_Any_Bootloader_Role "grub-efi"
|
|
|
|
|
|
|
|
Echo_message "Begin preparing Grub based EFI support..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
2020-03-15 12:05:44 -01:00
|
|
|
Require_stagefiles config bootstrap
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
# Checking stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Check_stagefile
|
2016-01-18 02:21:39 -01:00
|
|
|
|
2020-03-13 15:19:59 -01:00
|
|
|
# Acquire lock file
|
2015-02-05 02:30:47 -01:00
|
|
|
Acquire_lockfile
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
# Check architecture
|
2020-03-15 10:35:19 -01:00
|
|
|
Check_architectures amd64 i386 arm64 armhf
|
2016-01-18 02:21:39 -01:00
|
|
|
Check_crossarchitectures
|
|
|
|
|
2020-03-11 22:04:49 -01:00
|
|
|
# Setting destination directory
|
|
|
|
case "${LIVE_IMAGE_TYPE}" in
|
2020-03-28 04:13:11 -01:00
|
|
|
hdd|netboot)
|
2020-03-11 22:04:49 -01:00
|
|
|
Echo_warning "Bootloader in this image type not yet supported by live-build."
|
|
|
|
Echo_error "This would produce a not bootable image, aborting (FIXME)."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-01-18 02:21:39 -01:00
|
|
|
# Checking depends
|
2018-02-28 13:39:32 -01:00
|
|
|
case "${LB_ARCHITECTURES}" in
|
|
|
|
amd64|i386)
|
|
|
|
Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod grub-efi-amd64-bin
|
|
|
|
Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2018-02-28 13:39:32 -01:00
|
|
|
arm64)
|
|
|
|
Check_package chroot /usr/lib/grub/arm64-efi/configfile.mod grub-efi-arm64-bin
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2020-03-15 10:35:19 -01:00
|
|
|
armhf)
|
|
|
|
Check_package chroot /usr/lib/grub/arm-efi/configfile.mod grub-efi-arm-bin
|
|
|
|
;;
|
2018-02-28 13:39:32 -01:00
|
|
|
esac
|
2017-08-28 09:29:54 +00:00
|
|
|
Check_package chroot /usr/bin/grub-mkimage grub-common
|
|
|
|
Check_package chroot /usr/bin/mcopy mtools
|
|
|
|
Check_package chroot /sbin/mkfs.msdos dosfstools
|
2016-01-18 02:21:39 -01:00
|
|
|
|
2018-02-27 18:28:33 -01:00
|
|
|
# Check UEFI Secure Boot setting and depends
|
|
|
|
# By default (auto) do a best-effort build: if the signed binaries are available use
|
|
|
|
# them, but don't fail if they are not, just print a warning.
|
|
|
|
case "${LB_ARCHITECTURES}" in
|
|
|
|
amd64|i386)
|
|
|
|
_SB_EFI_PLATFORM="x86_64"
|
|
|
|
_SB_EFI_NAME="x64"
|
|
|
|
_SB_EFI_DEB="amd64"
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2018-02-27 18:28:33 -01:00
|
|
|
arm64)
|
|
|
|
_SB_EFI_PLATFORM="arm64"
|
|
|
|
_SB_EFI_NAME="aa64"
|
|
|
|
_SB_EFI_DEB="arm64"
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2020-03-15 10:35:19 -01:00
|
|
|
armhf)
|
|
|
|
_SB_EFI_PLATFORM="arm"
|
|
|
|
_SB_EFI_NAME="arm"
|
|
|
|
_SB_EFI_DEB="arm"
|
|
|
|
;;
|
2018-02-27 18:28:33 -01:00
|
|
|
esac
|
|
|
|
|
|
|
|
_PRE_SB_PACKAGES="${_LB_PACKAGES}"
|
|
|
|
_LB_PACKAGES="shim-signed grub-efi-${_SB_EFI_DEB}-signed"
|
|
|
|
case "${LB_UEFI_SECURE_BOOT}" in
|
|
|
|
auto)
|
|
|
|
# Use Check_installed, as Check_package will error out immediately
|
|
|
|
set +e
|
|
|
|
Install_package
|
|
|
|
set -e
|
2018-08-22 03:43:40 +00:00
|
|
|
Check_installed chroot /usr/lib/grub/${_SB_EFI_PLATFORM}-efi-signed/gcd${_SB_EFI_NAME}.efi.signed \
|
2018-02-27 18:28:33 -01:00
|
|
|
grub-efi-${_SB_EFI_DEB}-signed
|
|
|
|
_GRUB_INSTALL_STATUS="${INSTALL_STATUS}"
|
|
|
|
Check_installed chroot /usr/lib/shim/shim${_SB_EFI_NAME}.efi.signed \
|
|
|
|
shim-signed
|
|
|
|
|
|
|
|
if [ "${INSTALL_STATUS}" -ne 0 -o "${_GRUB_INSTALL_STATUS}" -ne 0 ]
|
|
|
|
then
|
|
|
|
Echo_warning "UEFI Secure Boot disabled due to missing signed Grub/Shim."
|
|
|
|
else
|
|
|
|
Echo_message "UEFI Secure Boot support enabled."
|
|
|
|
fi
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2018-02-27 18:28:33 -01:00
|
|
|
enable)
|
2018-08-22 03:43:40 +00:00
|
|
|
Check_package chroot /usr/lib/grub/${_SB_EFI_PLATFORM}-efi-signed/gcd${_SB_EFI_NAME}.efi.signed \
|
2018-02-27 18:28:33 -01:00
|
|
|
grub-efi-${_SB_EFI_DEB}-signed
|
|
|
|
Check_package chroot /usr/lib/shim/shim${_SB_EFI_NAME}.efi.signed \
|
|
|
|
shim-signed
|
|
|
|
Install_package
|
|
|
|
Echo_message "UEFI Secure Boot support enabled."
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2018-02-27 18:28:33 -01:00
|
|
|
disable)
|
|
|
|
Echo_message "UEFI Secure Boot support disabled."
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2018-02-27 18:28:33 -01:00
|
|
|
esac
|
|
|
|
_LB_PACKAGES="${_PRE_SB_PACKAGES}"
|
|
|
|
|
2016-01-18 02:21:39 -01:00
|
|
|
# Restoring cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Restore_package_cache binary
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
# Installing depends
|
|
|
|
Install_package
|
|
|
|
|
|
|
|
# Cleanup files that we generate
|
2020-03-15 10:35:19 -01:00
|
|
|
rm -rf binary/boot/efi.img binary/boot/grub/i386-efi/ binary/boot/grub/x86_64-efi binary/boot/grub/arm64-efi binary/boot/grub/arm-efi
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
# This is workaround till both efi-image and grub-cpmodules are put into a binary package
|
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
2020-02-10 14:48:49 -01:00
|
|
|
true)
|
2016-01-18 02:21:39 -01:00
|
|
|
if [ ! -e "${LIVE_BUILD}" ] ; then
|
|
|
|
LIVE_BUILD_PATH="/usr/lib/live/build"
|
|
|
|
else
|
|
|
|
LIVE_BUILD_PATH="${LIVE_BUILD}/scripts/build"
|
|
|
|
fi
|
|
|
|
mkdir -p chroot/${LIVE_BUILD_PATH}
|
|
|
|
cp "${LIVE_BUILD_PATH}/efi-image" "chroot/${LIVE_BUILD_PATH}"
|
|
|
|
cp "${LIVE_BUILD_PATH}/grub-cpmodules" "chroot/${LIVE_BUILD_PATH}"
|
2017-08-28 09:29:54 +00:00
|
|
|
|
|
|
|
_CHROOT_DIR=""
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
false)
|
|
|
|
_CHROOT_DIR="chroot"
|
2020-02-10 14:48:49 -01:00
|
|
|
;;
|
2016-01-18 02:21:39 -01:00
|
|
|
esac
|
|
|
|
#####
|
|
|
|
cat >binary.sh <<END
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-02-28 13:39:32 -01:00
|
|
|
gen_efi_boot_img(){
|
|
|
|
local platform="\$1"
|
|
|
|
local efi_name="\$2"
|
|
|
|
local netboot_prefix="\$3"
|
|
|
|
local outdir="grub-efi-temp-\${platform}"
|
|
|
|
"\${LIVE_BUILD_PATH}/efi-image" "${_CHROOT_DIR}/\$outdir" "\$platform" "\$efi_name" "\$netboot_prefix"
|
2018-02-27 18:30:19 -01:00
|
|
|
mkdir -p ${_CHROOT_DIR}/grub-efi-temp/EFI/boot
|
|
|
|
mcopy -n -i ${_CHROOT_DIR}/\$outdir/efi.img '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/EFI/boot
|
2018-02-28 13:39:32 -01:00
|
|
|
cp -r "${_CHROOT_DIR}"/\$outdir/* "${_CHROOT_DIR}/grub-efi-temp/"
|
2018-02-27 18:28:33 -01:00
|
|
|
|
|
|
|
# Secure Boot support:
|
2018-02-27 18:30:19 -01:00
|
|
|
# - create the EFI directory in the ESP with uppercase letters to make
|
|
|
|
# certain firmwares (eg: TianoCore) happy
|
2018-02-27 18:28:33 -01:00
|
|
|
# - use shim as the boot<arch>.efi that gets loaded first by the firmware
|
|
|
|
# - drop a grub.cfg (same reason as below) in the cfg directory as configured
|
2018-06-06 12:41:35 +00:00
|
|
|
# by the signed grub efi binary creation. This is set dynamically when grub2 is
|
|
|
|
# built with the ouput of dpkg-vendor, and can be overridden by the builder, so
|
|
|
|
# we do the same here in live-build.
|
2018-02-27 18:28:33 -01:00
|
|
|
# - the source paths are taken from shim-signed:
|
|
|
|
# https://packages.debian.org/sid/amd64/shim-signed/filelist
|
|
|
|
# and grub-efi-amd64-signed, currently in Ubuntu:
|
|
|
|
# https://packages.ubuntu.com/xenial/amd64/grub-efi-amd64-signed/filelist
|
|
|
|
# https://packages.ubuntu.com/bionic/arm64/grub-efi-arm64-signed/filelist
|
2020-02-10 14:48:49 -01:00
|
|
|
# E.g., gcdx64.efi.signed is the boot loader for removable device, like CD or
|
|
|
|
# USB flash drive, while grubx64.efi.signed is for hard drive.
|
|
|
|
# Therefore here gcdx64.efi.signed is used for amd64 and gcdaa64.efi.signed is
|
|
|
|
# for arm64.
|
2018-08-22 03:43:40 +00:00
|
|
|
if [ -r ${_CHROOT_DIR}/usr/lib/grub/\$platform-signed/gcd\$efi_name.efi.signed -a \
|
2018-02-27 18:28:33 -01:00
|
|
|
-r ${_CHROOT_DIR}/usr/lib/shim/shim\$efi_name.efi.signed -a \
|
|
|
|
"${LB_UEFI_SECURE_BOOT}" != "disable" ]; then
|
2018-08-22 03:43:40 +00:00
|
|
|
cp ${_CHROOT_DIR}/usr/lib/grub/\$platform-signed/gcd\$efi_name.efi.signed \
|
2018-02-27 18:30:19 -01:00
|
|
|
${_CHROOT_DIR}/grub-efi-temp/EFI/boot/grub\$efi_name.efi
|
2018-02-27 18:28:33 -01:00
|
|
|
cp ${_CHROOT_DIR}/usr/lib/shim/shim\$efi_name.efi.signed \
|
2018-02-27 18:30:19 -01:00
|
|
|
${_CHROOT_DIR}/grub-efi-temp/EFI/boot/boot\$efi_name.efi
|
2018-02-27 18:28:33 -01:00
|
|
|
fi
|
2018-02-28 13:39:32 -01:00
|
|
|
}
|
|
|
|
|
2016-01-18 02:21:39 -01:00
|
|
|
PRE_EFI_IMAGE_PATH="${PATH}"
|
|
|
|
if [ ! -e "${LIVE_BUILD}" ] ; then
|
|
|
|
LIVE_BUILD_PATH="/usr/lib/live/build"
|
|
|
|
else
|
|
|
|
LIVE_BUILD_PATH="${LIVE_BUILD}/scripts/build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
PATH="${PATH}:\${LIVE_BUILD_PATH}" # Make sure grub-cpmodules is used as if it was installed in the system
|
|
|
|
|
2018-02-28 13:39:32 -01:00
|
|
|
case "${LB_ARCHITECTURES}" in
|
|
|
|
amd64|i386)
|
|
|
|
gen_efi_boot_img "x86_64-efi" "x64" "debian-live/amd64"
|
|
|
|
gen_efi_boot_img "i386-efi" "ia32" "debian-live/i386"
|
|
|
|
PATH="\${PRE_EFI_IMAGE_PATH}"
|
2020-03-15 10:35:19 -01:00
|
|
|
;;
|
2018-02-28 13:39:32 -01:00
|
|
|
arm64)
|
|
|
|
gen_efi_boot_img "arm64-efi" "aa64" "debian-live/arm64"
|
|
|
|
PATH="\${PRE_EFI_IMAGE_PATH}"
|
2020-03-15 10:35:19 -01:00
|
|
|
;;
|
|
|
|
armhf)
|
|
|
|
gen_efi_boot_img "arm-efi" "arm" "debian-live/arm"
|
|
|
|
PATH="\${PRE_EFI_IMAGE_PATH}"
|
|
|
|
;;
|
2018-02-28 13:39:32 -01:00
|
|
|
esac
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
|
2018-02-27 18:23:41 -01:00
|
|
|
# On some platforms the EFI grub image will be loaded, so grub's root
|
|
|
|
# variable will be set to the EFI partition. This means that grub will
|
|
|
|
# look in that partition for a grub.cfg file, and even if it finds it
|
|
|
|
# it will not be able to find the vmlinuz and initrd.
|
|
|
|
# Drop a minimal grub.cfg in the EFI partition that sets the root and prefix
|
grub-efi: fix partial broken boot capability
when used alongside syslinux and when a single kernel flavour is used,
things work correctly. otherwise booting from EFI is broken.
the problem comes from the fact that syslinux, for a single kernel flavour
creates the file /live/vmlinuz, which is used by the minimal EFI grub.cfg
to locate the device and partition containing the live image. when multiple
kernel flavours are used, it instead creates /live/vmlinuz1, /live/vmlinuz2,
etc. which thus is a problem. similarly when syslinux is not used, you are
left only with long filenames for the kernel files, for example
/live/vmlinuz-4.19.0-8-amd64. in these situations grub cannot find the
device containing the image and thus fails to display the boot menu.
the solution here, instead of dynamically changing the filename searched
for depending upon bootloader configuration, switches to doing a search for
the file /.disk/info instead. this file is generated by binary_disk, and
is present for iso, iso-hybrid and hdd images types, though grub-efi cannot
be used for the hdd type. it is not created for the netboot type, but again,
grub-efi is not compatible with that anyway. it is not created for the tar
type, which the grub-efi script does not block as incompatible, but is this
not a mistake?
furthermore, switching to searching for /.disk/info helps avoid issues for
systems that happen to actually include a real /live/vmlinuz path other
than on a removable live disk or CD/DVD, as is the case with a HP system
discussed in #924053.
this patch was written by adrian15sgd@gmail.com, as per the authorship,
who attached it to the #924053 bug discussion. this commit message however
has been re-written by jnqnfe@gmail.com, prior to submission via an MR,
as part of the fix towards the issues reported in #956131.
Gbp-Dch: Short
Closes: #924053
2019-03-09 12:49:01 -01:00
|
|
|
# to whatever partition holds the /.disk/info file, and load the grub
|
2018-02-27 18:23:41 -01:00
|
|
|
# config from that same partition.
|
|
|
|
mkdir -p ${_CHROOT_DIR}/grub-efi-temp-cfg
|
|
|
|
cat >${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg <<EOF
|
grub-efi: fix partial broken boot capability
when used alongside syslinux and when a single kernel flavour is used,
things work correctly. otherwise booting from EFI is broken.
the problem comes from the fact that syslinux, for a single kernel flavour
creates the file /live/vmlinuz, which is used by the minimal EFI grub.cfg
to locate the device and partition containing the live image. when multiple
kernel flavours are used, it instead creates /live/vmlinuz1, /live/vmlinuz2,
etc. which thus is a problem. similarly when syslinux is not used, you are
left only with long filenames for the kernel files, for example
/live/vmlinuz-4.19.0-8-amd64. in these situations grub cannot find the
device containing the image and thus fails to display the boot menu.
the solution here, instead of dynamically changing the filename searched
for depending upon bootloader configuration, switches to doing a search for
the file /.disk/info instead. this file is generated by binary_disk, and
is present for iso, iso-hybrid and hdd images types, though grub-efi cannot
be used for the hdd type. it is not created for the netboot type, but again,
grub-efi is not compatible with that anyway. it is not created for the tar
type, which the grub-efi script does not block as incompatible, but is this
not a mistake?
furthermore, switching to searching for /.disk/info helps avoid issues for
systems that happen to actually include a real /live/vmlinuz path other
than on a removable live disk or CD/DVD, as is the case with a HP system
discussed in #924053.
this patch was written by adrian15sgd@gmail.com, as per the authorship,
who attached it to the #924053 bug discussion. this commit message however
has been re-written by jnqnfe@gmail.com, prior to submission via an MR,
as part of the fix towards the issues reported in #956131.
Gbp-Dch: Short
Closes: #924053
2019-03-09 12:49:01 -01:00
|
|
|
search --set=root --file /.disk/info
|
2018-02-27 18:23:41 -01:00
|
|
|
set prefix=(\\\$root)/boot/grub
|
|
|
|
configfile (\\\$root)/boot/grub/grub.cfg
|
|
|
|
EOF
|
|
|
|
|
2016-01-18 02:21:39 -01:00
|
|
|
# The code below is adapted from tools/boot/jessie/boot-x86
|
|
|
|
# in debian-cd
|
|
|
|
|
|
|
|
# Stuff the EFI boot files into a FAT filesystem, making it as
|
|
|
|
# small as possible. 24KiB headroom seems to be enough;
|
|
|
|
# (x+31)/32*32 rounds up to multiple of 32.
|
|
|
|
# This is the same as in efi-image, but we need to redo it here in
|
|
|
|
# the case of a multi-arch amd64/i386 image
|
|
|
|
|
|
|
|
size=0
|
2018-02-27 18:30:19 -01:00
|
|
|
for file in ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/*.efi \
|
2018-02-27 18:23:41 -01:00
|
|
|
${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg; do
|
2016-01-18 02:21:39 -01:00
|
|
|
size=\$((\$size + \$(stat -c %s "\$file")))
|
|
|
|
done
|
|
|
|
|
2018-02-27 18:30:19 -01:00
|
|
|
# directories: EFI EFI/boot boot boot/grub
|
2018-02-27 18:23:41 -01:00
|
|
|
size=\$((\$size + 4096 * 4))
|
|
|
|
|
2016-01-18 02:21:39 -01:00
|
|
|
blocks=\$(((\$size / 1024 + 55) / 32 * 32 ))
|
|
|
|
|
|
|
|
rm -f ${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img
|
|
|
|
mkfs.msdos -C "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" \$blocks >/dev/null
|
2018-02-27 18:30:19 -01:00
|
|
|
mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::EFI
|
|
|
|
mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::EFI/boot
|
|
|
|
mcopy -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/*.efi \
|
|
|
|
"::EFI/boot"
|
2018-02-27 18:23:41 -01:00
|
|
|
|
|
|
|
mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::boot
|
|
|
|
mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::boot/grub
|
|
|
|
mcopy -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg \
|
|
|
|
"::boot/grub"
|
2016-01-18 02:21:39 -01:00
|
|
|
END
|
|
|
|
|
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
2020-02-10 14:48:49 -01:00
|
|
|
true)
|
2016-12-02 12:57:45 -01:00
|
|
|
mv binary.sh chroot/
|
|
|
|
Chroot chroot "sh binary.sh"
|
|
|
|
rm -f chroot/binary.sh
|
2016-01-18 02:21:39 -01:00
|
|
|
|
2016-12-02 12:57:45 -01:00
|
|
|
# Saving cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Save_package_cache binary
|
2016-01-18 02:21:39 -01:00
|
|
|
|
2016-12-02 12:57:45 -01:00
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
|
|
|
;;
|
2016-01-18 02:21:39 -01:00
|
|
|
|
2016-12-02 12:57:45 -01:00
|
|
|
false)
|
|
|
|
sh binary.sh
|
|
|
|
rm -f binary.sh
|
|
|
|
;;
|
2016-01-18 02:21:39 -01:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Remove unnecessary files
|
|
|
|
rm -f chroot/grub-efi-temp/bootnetia32.efi
|
|
|
|
rm -f chroot/grub-efi-temp/bootnetx64.efi
|
2018-02-28 13:39:32 -01:00
|
|
|
rm -f chroot/grub-efi-temp/bootnetaa64.efi
|
2020-03-15 10:35:19 -01:00
|
|
|
rm -f chroot/grub-efi-temp/bootnetarm.efi
|
2016-01-18 02:21:39 -01:00
|
|
|
|
|
|
|
mkdir -p binary
|
|
|
|
cp -r chroot/grub-efi-temp/* binary/
|
|
|
|
rm -rf chroot/grub-efi-temp-x86_64-efi
|
|
|
|
rm -rf chroot/grub-efi-temp-i386-efi
|
2018-02-28 13:39:32 -01:00
|
|
|
rm -rf chroot/grub-efi-temp-arm64-efi
|
2020-03-15 10:35:19 -01:00
|
|
|
rm -rf chroot/grub-efi-temp-arm-efi
|
2018-02-27 18:23:41 -01:00
|
|
|
rm -rf chroot/grub-efi-temp-cfg
|
2016-01-18 02:21:39 -01:00
|
|
|
rm -rf chroot/grub-efi-temp
|
|
|
|
|
|
|
|
# We rely on: binary_loopback_cfg to generate grub.cfg and other configuration files
|
|
|
|
|
|
|
|
# Creating stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Create_stagefile
|