Autoyast for EFI [SLES12 SP5]

FredericFrederic New or Quiet Member

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:

  <bootloader>
    <loader_type>grub2-efi</loader_type>
    <global>
      <activate config:type="boolean">true</activate>
      <append>splash=verbose consoleblank=0</append>
      <boot_boot>true</boot_boot>
      <default>SUSE Linux Enterprise Server 12 SP5</default>
      <generic_mbr>true</generic_mbr>
      <timeout config:type="integer">8</timeout>
    </global>
  </bootloader>

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 ?

Comments

  • malcolmlewismalcolmlewis Knowledge Partner

    @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?

  • FredericFrederic New or Quiet Member

    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

  • FredericFrederic New or Quiet Member

    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.

  • malcolmlewismalcolmlewis Knowledge Partner

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

  • FredericFrederic New or Quiet Member

    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)

  • malcolmlewismalcolmlewis Knowledge Partner
    edited June 17

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

  • FredericFrederic New or Quiet Member

    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.

  • FredericFrederic New or Quiet Member

    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.

  • malcolmlewismalcolmlewis Knowledge Partner

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

    zypper se --provides --match-exact boost-license
    zypper se --requires boost-license
    
  • FredericFrederic New or Quiet Member

    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 ?

  • malcolmlewismalcolmlewis Knowledge Partner

    @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?

  • FredericFrederic New or Quiet Member

    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.

  • malcolmlewismalcolmlewis Knowledge Partner
    edited June 22

    @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?

  • FredericFrederic New or Quiet Member
    edited June 23

    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 :

        <partition>
              <create config:type="boolean">true</create>
              <crypt_fs config:type="boolean">false</crypt_fs>
              <filesystem config:type="symbol">fat</filesystem>
              <format config:type="boolean">true</format>
              <fstopt>defaults</fstopt>
              <loop_fs config:type="boolean">false</loop_fs>
              <mount>/boot/efi</mount>
              <mountby config:type="symbol">device</mountby>
              <partition_id config:type="integer">259</partition_id>
              <partition_nr config:type="integer">3</partition_nr>
              <resize config:type="boolean">false</resize>
              <size>100M</size>
            </partition>
    

    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.

  • FredericFrederic New or Quiet Member

    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 ?

  • malcolmlewismalcolmlewis Knowledge Partner

    @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.

  • FredericFrederic New or Quiet Member

    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.

  • malcolmlewismalcolmlewis Knowledge Partner

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

  • FredericFrederic New or Quiet Member

    Hi Malcolm
    What do you mean by "size at 16" ? I used this in autoyast :

        <partition>
              <create config:type="boolean">true</create>
              <crypt_fs config:type="boolean">false</crypt_fs>
              <filesystem config:type="symbol">vfat</filesystem>
              <format config:type="boolean">true</format>
              <fstopt>defaults</fstopt>
              <loop_fs config:type="boolean">false</loop_fs>
              <mount>/boot/efi</mount>
              <mountby config:type="symbol">device</mountby>
              <partition_id config:type="integer">259</partition_id>
              <partition_nr config:type="integer">3</partition_nr>
              <resize config:type="boolean">false</resize>
              <size>100M</size>
            </partition>
    

    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 :

      <bootloader>
    <global>
      <append>consoleblank=0 mitigations=auto showopts splash=verbose</append>
      <cpu_mitigations>auto</cpu_mitigations>
      <gfxmode>auto</gfxmode>
      <os_prober>false</os_prober>
      <terminal>gfxterm</terminal>
      <timeout config:type="integer">8</timeout>
      <xen_kernel_append>vga=gfx-1024x768x16</xen_kernel_append>
    </global>
    <loader_type>grub2-efi</loader_type>
    

    the partitions part:

      <partitioning config:type="list">
    <drive>
      <initialize config:type="boolean">true</initialize>
      <partitions config:type="list">
        <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">ext3</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>acl,user_xattr</fstopt>
          <loop_fs config:type="boolean">false</loop_fs>
          <mount>/boot</mount>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">131</partition_id>
          <partition_nr config:type="integer">1</partition_nr>
          <resize config:type="boolean">false</resize>
          <size>500M</size>
        </partition>
                <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">swap</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>defaults</fstopt>
          <loop_fs config:type="boolean">false</loop_fs>
          <mount>swap</mount>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">130</partition_id>
          <partition_nr config:type="integer">2</partition_nr>
          <resize config:type="boolean">false</resize>
          <size>512M</size>
        </partition>
        <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">vfat</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>defaults</fstopt>
          <loop_fs config:type="boolean">false</loop_fs>
          <mount>/boot/efi</mount>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">259</partition_id>
          <partition_nr config:type="integer">3</partition_nr>
          <resize config:type="boolean">false</resize>
          <size>100M</size>
        </partition>
        <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">ext4</filesystem>
          <format config:type="boolean">false</format>
          <loop_fs config:type="boolean">false</loop_fs>
          <lvm_group>vg_root</lvm_group>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">142</partition_id>
          <partition_nr config:type="integer">4</partition_nr>
          <resize config:type="boolean">false</resize>
          <size>max</size>
        </partition>
      </partitions>
      <pesize></pesize>
      <type config:type="symbol">CT_DISK</type>
      <use>all</use>
    </drive>
    <drive>
      <device>/dev/vg_root</device>
      <initialize config:type="boolean">true</initialize>
      <partitions config:type="list">
        <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">ext4</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>acl,user_xattr</fstopt>
          <loop_fs config:type="boolean">false</loop_fs>
          <lv_name>lv_root</lv_name>
          <mount>/</mount>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">131</partition_id>
          <resize config:type="boolean">false</resize>
          <size>max</size>
        </partition>
                <partition>
          <create config:type="boolean">true</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">ext4</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>acl,user_xattr</fstopt>
          <loop_fs config:type="boolean">false</loop_fs>
          <lv_name>lv_backup</lv_name>
          <mount>/var/backup</mount>
          <mountby config:type="symbol">device</mountby>
          <partition_id config:type="integer">131</partition_id>
          <resize config:type="boolean">false</resize>
          <size>2G</size>
        </partition>
      </partitions>
      <pesize>4M</pesize>
      <type config:type="symbol">CT_LVM</type>
      <use>all</use>
    </drive>
    

    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.

  • malcolmlewismalcolmlewis Knowledge Partner

    @Frederic Hi, add the mkfs option;

    <mkfs_options>-F 16</mkfs_options>
    

    The disk should be gpt and MBR should be protective for UEFI now you can use legacy with gpt but require pmbr_boot (8MB)

    parted -l /dev/sda
    ...
    Partition Table: gpt
    Disk Flags: pmbr_boot
    
    Number  Start   End     Size    File system     Name  Flags
     1      1049kB  9437kB  8389kB                        bios_grub
     2      9437kB  53.7GB  53.7GB  btrfs                 legacy_boot
    

    UEFI disk...

    parted -l /dev/sda
    ...
    Partition Table: gpt
    Disk Flags: 
    
    Number  Start   End     Size    File system     Name                  Flags
     1      1049kB  274MB   273MB   fat16           EFI system partition  msftdata
     2      274MB   54.0GB  53.7GB  btrfs           Linux filesystem
    
  • FredericFrederic New or Quiet Member

    My bad Malcolm ! I used the partition, not the device : gdisk -l /dev/sda3 instead of /dev/sda !
    So, no error raised ! Task is completed !
    I'm not done with it because I still have to adapt all my installation type but I have a strong base now.
    Thanks again for the help

Sign In or Register to comment.