On 26/04/2023 22:57, Valentin Caracalla wrote:
the issue with the BIOS boot interface (see my original posting) is still 
unsolved

I had impression that there was no issue with booting in BIOS (legacy, compatibility, CSM) mode, of course when it is chosen in firmware/BIOS setup (requires disabling of secure boot). Perhaps I confused it with qemu instead of bare metal.

I tried using the EFI removable media path (which should bypass any issues with 
EFI variables) without success.

This statement might be too strong. Internal drive is not a removable media. My impression is that you can boot from removable media (live CD), but not from internal drive.
- Is booting from that internal drive enabled in firmware setup?
- Is shim-signed package installed? Just shim is not enough when secure boot is enabled in firmware.

I want to install Debian on my Asus UX31A

UEFI implementation may have some peculiarities, likely you will find more pages:
https://wiki.osdev.org/Broken_UEFI_implementations
https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Troubleshooting

I want to install it to the internal drive /dev/sda, and I want to do so
by executing commands on an installer system, which is a system already
installed on the external drive /dev/sdb.

Does it mean that you have another linux installed and there is no issue with its booting? Is it debian?

For now, I only want to get a GRUB command line, because that appears to be the 
difficult part.

Then you do not need debian installer at all. To debug such issues it is enough to copy files to EFI/debian and to run a couple of efibootmgr commands. By the way, you have not posted "efibootmgr -v" or at least "efibootmgr" output. Running it from an existing install or a live media is OK.

For the BIOS boot interface:

sudo parted /dev/sda mklabel gpt
sudo parted /dev/sda mkpart root 512MiB 100%
sudo parted /dev/sda set 1 bios_grub on

Perhaps you may create both BIOS Boot and EFI System partitions on the same disk to support both modes.

For the EFI boot interface:

sudo parted /dev/sda mklabel gpt
sudo parted /dev/sda mkpart init 0% 512MiB
sudo parted /dev/sda set 1 boot on
sudo mkfs.vfat /dev/sda1

I do not remember if the "boot" flag sets proper GUID for ESP. I have heard that there may be issues if fat16 is used instead of fat32
https://www.rodsbooks.com/gdisk/booting.html

file --special /dev/sda1
parted /dev/sda print
sgdisk -p /dev/sda

(Some people may be more familiar with output of sgdisk than parted)

sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /run /mnt/run

I still do not see /sys/firmware/efi/efivars here. Check /mnt/sys/firmware/efi/efivars

Frankly speaking, I am confused by your description. I suspect it is a mix of - What you are going to do in future (having working install, prepare a disk for another machine or install a fresh system for the same computer)
- What you are really doing
- Recipe which way others may try reproduce (boot from a live media and install to an internal drive)

Let's concentrate on UEFI. Unless you faced an Asus-specific issue, it should be possible to use qemu+OVMF.

Reply via email to