Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFI: Installation of GRUB fails, if config variable GRUB is undefined #167

Open
paulmenzel opened this issue Feb 19, 2021 · 3 comments
Open

Comments

@paulmenzel
Copy link
Contributor

Using Grml from today with grml-debootstrap 0.95, installing Debian Sid/unstable on a system, the EFI System Partition (ESP) was empty despite passing the switch --efi. (I remember this happening in the past.)

% sudo grml-debootstrap -c config --packages packages --efi /dev/nvme0n1p1 --chroot-scripts chroot-scripts
 * Reading specified config file config.
 * EFI support detected.
 * grml-debootstrap [0.95] - Please recheck configuration before execution:

   Target:          /dev/mapper/nvme0n1p3_crypt
   Install grub:    no
   Install efi:     /dev/nvme0n1p1
   Using release:   sid
   Using hostname:  test
   Using mirror:    http://deb.debian.org/debian
   Using arch:      amd64
   Config files:    /etc/debootstrap

   Important! Continuing will delete all data from /dev/mapper/nvme0n1p3_crypt!

 * Is this ok for you? [y/N] y
 * EFI partition /dev/nvme0n1p1 seems to have a FAT filesystem, not modifying.
 * Running mkfs.ext4  on /dev/mapper/nvme0n1p3_crypt
mke2fs 1.46.1 (9-Feb-2021)
Creating filesystem with 249784657 4k blocks and 62447616 inodes
Filesystem UUID: bfaeb600-ff13-45c7-a18d-0af9652e04ed
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848

Allocating group tables: done
[…]
Adjusting /etc/localtime
Setting /etc/timezone to Europe/Berlin
   Executing stage fstab
Setting up /etc/fstab
   Executing stage hostname
Setting hostname to davitoria.
   Executing stage initrd
Generating initrd.
update-initramfs: Generating /boot/initrd.img-5.10.0-3-amd64
   Executing stage grub_install
Notice: $GRUB not defined, will not install grub inside chroot at this stage.
   Executing stage passwords
Activating shadow passwords.
Shadow passwords are now on.
   Executing stage custom_scripts
Executing script /etc/debootstrap/chroot-scripts/add-user.sh
[…]

(The notice is unfortunately hard to spot in the output.)

The method grub_install() returns if the configuration variable GRUB is unset.

# grub configuration/installation {{{
grub_install() {
if [ -z "$GRUB" ] ; then
echo "Notice: \$GRUB not defined, will not install grub inside chroot at this stage."
return 0
fi
efi_setup || return 1
if [ -n "$EFI" ] ; then
GRUB_PACKAGE=grub-efi-amd64
else
GRUB_PACKAGE=grub-pc
fi

It looks like there is also a – at least for me – new configuration option GRUB_INSTALL (commit 0b1b798 (support skipping installation of grub using GRUB_INSTALL='no')).

So, should grml-debootstrap abort if installation of GRUB to the EFI System Partition (ESP) is requested, or should it be implied?

@jkirk
Copy link
Contributor

jkirk commented Feb 22, 2021

Thx for the report!

I never tried it, but does installing EFI make sense without a boot loader (grub)? If yes, efi_setup should run, if not we should at least display a warning or so.

@paulmenzel
Copy link
Contributor Author

(“installing EFI” sounds strange.)

(Also, Linux built as EFI stub (EFI_STUB=y, which Debian does), the UEFI firmware can execute this Linux kernel. (Then you have “Linux as boot loader”.)

Anyway, and this is the point for my report, in grml-debootstrap’s case, it’s indeed a contradiction. Note, currently, the switch --grub takes a device, and is not a boolean if to install GRUB or not.

But until that is improved, the installation should abort in my opinion, if --efi is passed, but GRUB won’t be installed.

@paulmenzel
Copy link
Contributor Author

Or, that --efi just implies to install GRUB as an EFI application on the ESP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants