Posts: 45
hobbyist7890
Joined: 24 Apr 2016
#1
The initial installation needs to be performed to a GPT disk to allow convertion to UEFI. The GPT disk needs to have an ESP partition formatted to fat32 and labelled as a EF00 type. I installed my antix to dual-boot with windows and the ESP partition was already existing and used by Windows so I reused the ESP for antix.

Code: Select all

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1026047   500.0 MiB   EF00  EFI system partition
I installed the antix-16-core-libre dist to a partition created from unallocated space after shrinking the Windows OS partition. The last step of the installer was to select"Install Grub to the root partition" of my antix partition. Do not choose to install to the MBR because this is a GPT disk. The easiest way would be to fix the antix partition before rebooting so everything will start in UEFI mode. The messy details of rebooting without a bootloader are left to the ingenuity of the reader. The first step after the installer is finished with the Grub is to edit the fstab to mount the ESP partition to the /boot/efi directory.
EDIT: First change from the live installer to the installation partition as shown in the next post.
Then edit the fstab and change the UUID to match your ESP.

Code: Select all

UUID=1234-WXYZ  /boot/efi  vfat  umask=0077  0 0
The next step was to create the /boot/efi directory in my antix partition as a mount point. The subsequent step was to create the antix directory in the EFI directory after mounting the ESP partition to the /boot/efi directory.

Code: Select all

mkdir /boot/efi
mount /boot/efi
mkdir /boot/efi/EFI/antix
There were some packages missing from the core-libre installation needed to convert to the UEFI:

Code: Select all

Start-Date: 2016-10-29  21:28:17
Commandline: apt-get install efibootmgr
Install: libefivar0:amd64 (0.15-3, automatic), efibootmgr:amd64 (0.11.0-3)
End-Date: 2016-10-29  21:28:24

Start-Date: 2016-10-29  21:29:46
Commandline: apt-get install grub-efi
Install: grub-efi-amd64-bin:amd64 (2.02~beta2-22+deb8u1, automatic), grub-efi-amd64:amd64 (2.02~beta2-22+deb8u1, automatic), grub-efi:amd64 (2.02~beta2-22+deb8u1)
Remove: grub-pc:amd64 (2.02~beta2-22+deb8u1)
End-Date: 2016-10-29  21:29:51
Next is to create the bootloader in the ESP directory with this command:

Code: Select all

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=antix
This is the resulting UEFI bootloader: /boot/efi/EFI/antix/grubx64.efi

An easy way to keep the installation working is to put the above grub-install command into a script like /usr/local/sbin/update-efi for example. Then running the 'update-efi' with every new kernel will tell the UEFI what to do.

When finished, I rebooted into the UEFI and changed the mode from Legacy to boot in UEFI. There is a possibility to do everything in UEFI mode if starting with a UEFI USB stick made with live-usb-maker if fixing the partition before rebooting. I am curious if anybody can fix everything before the first reboot. The steps shown here would be the same either way.
Last edited by hobbyist7890 on 30 Oct 2016, 18:45, edited 3 times in total.
Posts: 45
hobbyist7890
Joined: 24 Apr 2016
#2
A big problem is the installer unmounts the antix install root partition when finished with the Grub and is ready to reboot. The root partition has to be remounted and then chroot to finish the installation. The way to do the chroot is at least these commands depending on the networking:

Code: Select all

mkdir /mnt/mynewroot
mount /dev/sdXY /mnt/mynewroot
mount -o bind /dev /mnt/mynewroot/dev
mount -o bind /sys /mnt/mynewroot/sys
mount -o bind /proc /mnt/mynewroot/proc
mount -o bind /tmp /mnt/mynewroot/tmp
mount -o bind \etc/resolv.conf /mnt/mynewroot\etc/resolv.conf
chroot /mnt/mynewroot /bin/bash
There are probably some more steps here except my install went the hard way so this is now speculation. This is much easier with an ethernet connection.
Be sure to change the back-slashes above to the forward slashes needed.
Posts: 45
hobbyist7890
Joined: 24 Apr 2016
#3
I just tried the SuperGrub2 disk and that gives an easy way to boot a kernel without a bootloader installed. This worked fine on both UEFI and Legacy booting. I would recommend the SuperGrub2 instead of the chroot shown above and allows for easier converting to UEFI booting.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.supergrubdisk.org/super-grub2-disk/"
linktext was:"http://www.supergrubdisk.org/super-grub2-disk/"
====================================