Autoyast for EFI [SLES12 SP5]

Hello
For many years I have been using autoyast files to handle my various SLES12 SP5 installation cases (and previous versions too).
I was not using EFI mode on servers or virtual machines and would now like to do so.
After reading the SUSE documentation, I tried to modify the bootloader section to take this mode into account.
I use this kind of bootloader which seems to me simple:

!
! <loader_type>grub2-efi</loader_type>
!
! true
! splash=verbose consoleblank=0
! <boot_boot>true</boot_boot>
! SUSE Linux Enterprise Server 12 SP5
! <generic_mbr>true</generic_mbr>
! 8
!
!
The problem is that I can’t boot on it either on a physical machine via a PXE boot or on a virtual machine (vmware).
I just see as an error message on the machine, the status “unsuccessfull” for booting from DVD (or PXE for the physical machine)

I was expecting to have problems with the “legacy bios” and “EFI” modes on the same autoyast file, but I didn’t expect to be stuck so soon by focusing only on the EFI mode at first.

Any advice to do that ? What’s wrong ?

@Frederic Hi, so are the disks set to gpt not dos? Not sure for vmware, but for kvm/qemu set the chipset to pc-q35-4.0 or equivalent. Needs to be uefi not generic_mbr?

Hi Malcom,
To be honest, I didn’t even look at disks as the boot did not succeed to start… Not sure that we can specify the disk type in vmware (we can specify SATA/IDE/SCSI, etc…).
I made some tests around the bootloader, even by removing the generic_mbr, I’ll continue them

In fact, I think I don’t look at the good place : I make a custom iso where I have a menu with the different entries for my installation types, each with its own autoyast file.
I cannot boot on the iso and see this menu, so the problem is not (for the moment) on how to adapt my autoyast files.
I made a test and used the SLES12SP5 iso : it works fine. So I have to find what’s missing on my custom iso to correctly boot.

@Frederic Hi, thanks for reporting back :slight_smile: Are you using kiwi to create the image?

No, I’m using an old product : ProductCreator. No more supported I know but it still works… until now ! :wink:
I just noticed that, at the end of the creation process, the directory “EFI” is not present on the generated directory tree (while it’s obviously present on basic sles12sp5 iso).
(I make some change to customize : add personal menu with differents autoyast files, and use mkisofs to generate the final iso)

@Frederic Hi perhaps no UEFI boot support (although elilo was around) in ProductCreator? Are you creating the efi partition (~260MB type ef00 fat16)?

I think there is a problem with EFI in ProductCreator.
In my autoyast files, I use a script during the pre-scripts phasis to make partitions, don’t know if it can prevent ProductCreator from creating the EFI folder.
I’ll try to force this EFI folder before making the iso.

So, I have some “good” news : from my directory tree, generated by ProductCreator, I added the basic EFI folder from the sles12sp5 iso. I used mksusecd to generate a new iso (for a first try, I used mkisofs but the result does not boot).
This new iso is bootable with the classic boot menu, it’s normal I didn’t change it for the moment, but I have some error with missing packages.
I’d like to know how to find a pattern containing some specific package ? For example, the boost-license1_54_0 package is missing, I tried zypper info, zypper se --details, … but did not find any reference to a pattern which can contain it.

@Frederic Hi not sure there is a pattern requirement for it…

zypper se --provides --match-exact boost-license
zypper se --requires boost-license

I just added all packages manually, there were some missing… :wink:
Before I continue this autoyast subject (I think I’m near a bootable iso and begin of autoyast deployment tests), I’ve a last problem to solve : change the grub.cgf for this iso. Maybe I could open a new subject for this ?
I wish to change the default grub.cfg from the installation ISO by changing/adding some customized entries. For example, for my legacy bios deployment, I had this kind of entries :
>! # Product Others

! label others
! menu label Others products
! append ->subothers
! # install RP package
! label others rp
! menu label ->subothers Reverse Proxy
! kernel linux
! append initrd=initrd biosdevname=0 splash=verbose consoleblank=0 showopts autoyast=device://sr0/autoinstrp.xml

It was pretty easy to change, all these entries are in a single file.
Now, for grub.cfg, it seems that it should be built only from the tool and all I see on web is how to build an installed grub.cfg. I only need to change the entries from the default grub.cfg. How can I do that ?

@Frederic Hi, you can add custom entries in /etc/grub.d/40_custom? Any other changes would be overwritten on an update. The other option would be creating you own branding package?

Hello Malcolm, sorry I was testing a modified grub.cfg (manually, just modify the entries, it looks good except one thing, it seems that I can have only one submenu).
I cannot use the mkconfig to build a grub.cfg because I want, as you said, create my own branding package : a personal grub.cfg on my custom bootable iso, capable to install Suse depending on my parameters in autoinst file.

@Frederic Hi, well the real issue is ongoing maintenance, if you can use provided defaults and then just tweak around it, else you may miss a critical update or inadvertently negate it and support? I wonder if the grub theme package may be a better option to look at?

Hi Malcolm, I’ll ask support team if there’s a better way to have a grub.cfg for what I want (without breaking support of course).
For the moment, I can continue my tests and begin to adapt my old autoyast files to EFI.
I met a first problem : I add a new partition in autoyast file for the /boot/efi but it seems that “fat” is not recognized.
Here is the partition part :
>!

! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! fat
! true
! defaults
! <loop_fs config:type=“boolean”>false</loop_fs>
! /boot/efi
! device
! <partition_id config:type=“integer”>259</partition_id>
! <partition_nr config:type=“integer”>3</partition_nr>
! false
! 100M
!
The filesystem entry should be “fat” as it’s written in autoyast doc but I’ve this kind of error :
!

fdisk -l shows :

!

I did not specify the disk label as it should be automatically done by autoyast and it looks like it’s the case.

Finally, after some tests/changes, I succeed to install SLES with my custom iso : for the efi part, I put “vfat” as filesystem (after testing FAT, FAT32, fat32…). I removed also some old options from the bootloader global part.
Thanks for the help, we don’t always find a perfect solution on forum but it’s always helpfully to discuss about our problem.

I still have minor points to correct : how to purpose a way to change language and/or keyboard during the boot.
For legacy bios, by default, we have this kind of options :

!

For EFI boot, there is no options

!

I’ll continue my search for that, maybe an option to activate in bootloader part ? or maybe no way to display it ?

@Frederic Hi, I use 260MB and vfat (fat16);

lsblk /dev/sda1
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda1   8:1    0  260M  0 part /boot/efi
mount | grep sda1
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
gdisk -l /dev/sda | grep EF00
   1            2048          534527   260.0 MiB   EF00  EFI System
parted -l | grep EFI
 1      1049kB  274MB   273MB   fat16           EFI System            boot, esp

For UEFI GRUB, you need to press the ‘e’ key to edit the highlighted entry.

ok for vfat (in autoyast doc for SLES12SP5 the value should be ‘fat’, there is no ‘vfat’ choice).

I know we can use the ‘e’ for editing the entry but it’s not user-friendly : it was very simple in legacy bios boot, even a basic user can choose the correct language/keyboard. Too bad if we cannot have same level of usability.

@Frederic Hi, can you set the fat size at 16?

Hi Malcolm
What do you mean by “size at 16” ? I used this in autoyast :
>!

! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! vfat
! true
! defaults
! <loop_fs config:type=“boolean”>false</loop_fs>
! /boot/efi
! device
! <partition_id config:type=“integer”>259</partition_id>
! <partition_nr config:type=“integer”>3</partition_nr>
! false
! 100M
!

Even if I can boot and install my custom SLES, I still detect an problem on EFI partition, when I look at gdisk, I’ve this :

! [root@bstpiil2070 ~]# gdisk -l /dev/sda3
! GPT fdisk (gdisk) version 0.8.8
!
! Partition table scan:
! MBR: MBR only
! BSD: not present
! APM: not present
! GPT: not present
!
!
! ***************************************************************
! Found invalid GPT and valid MBR; converting MBR to GPT format
! in memory.
! ***************************************************************
!
! Disk /dev/sda3: 208896 sectors, 102.0 MiB
! Logical sector size: 512 bytes
! Disk identifier (GUID): E79D4370-B876-4DEA-A904-8584605CB220
! Partition table holds up to 128 entries
! First usable sector is 34, last usable sector is 208862
! Partitions will be aligned on 2048-sector boundaries
! Total free space is 208829 sectors (102.0 MiB)

I use same VM for my tests, changing configuration through VMWare, going from Legacy bios to EFI and back, maybe it’s due to this kind of change…
Here is my autoyast bootloader part :

!
!
! consoleblank=0 mitigations=auto showopts splash=verbose
! <cpu_mitigations>auto</cpu_mitigations>
! auto
! <os_prober>false</os_prober>
! gfxterm
! 8
! <xen_kernel_append>vga=gfx-1024x768x16</xen_kernel_append>
!
! <loader_type>grub2-efi</loader_type>
!

the partitions part:

!
!
! true
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! ext3
! true
! acl,user_xattr
! <loop_fs config:type=“boolean”>false</loop_fs>
! /boot
! device
! <partition_id config:type=“integer”>131</partition_id>
! <partition_nr config:type=“integer”>1</partition_nr>
! false
! 500M
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! swap
! true
! defaults
! <loop_fs config:type=“boolean”>false</loop_fs>
! swap
! device
! <partition_id config:type=“integer”>130</partition_id>
! <partition_nr config:type=“integer”>2</partition_nr>
! false
! 512M
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! vfat
! true
! defaults
! <loop_fs config:type=“boolean”>false</loop_fs>
! /boot/efi
! device
! <partition_id config:type=“integer”>259</partition_id>
! <partition_nr config:type=“integer”>3</partition_nr>
! false
! 100M
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! ext4
! false
! <loop_fs config:type=“boolean”>false</loop_fs>
! <lvm_group>vg_root</lvm_group>
! device
! <partition_id config:type=“integer”>142</partition_id>
! <partition_nr config:type=“integer”>4</partition_nr>
! false
! max
!
!
!
! CT_DISK
! all
!
!
! /dev/vg_root
! true
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! ext4
! true
! acl,user_xattr
! <loop_fs config:type=“boolean”>false</loop_fs>
! <lv_name>lv_root</lv_name>
! /
! device
! <partition_id config:type=“integer”>131</partition_id>
! false
! max
!
!
! true
! <crypt_fs config:type=“boolean”>false</crypt_fs>
! ext4
! true
! acl,user_xattr
! <loop_fs config:type=“boolean”>false</loop_fs>
! <lv_name>lv_backup</lv_name>
! /var/backup
! device
! <partition_id config:type=“integer”>131</partition_id>
! false
! 2G
!
!
! 4M
! CT_LVM
! all
!
!
!

Disk should be formatted, I don’t see any MBR call… I don’t understand why there is a problem with my EFI partition detected by gdisk.