setup-storage and GPT partition tables with EFI boot partition

Andreas Heinlein aheinlein at gmx.com
Mon Jan 26 08:34:44 CET 2015


Am 23.01.2015 um 18:18 schrieb John Paul Adrian Glaubitz:
> On 01/22/2015 06:31 PM, John Paul Adrian Glaubitz wrote:
>> primary -                 512   vfat    rw
>> primary /               30000   ext4    rw
>> logical swap             8000   swap    sw
>> logical /var             6000   ext4    rw
>> primary /local_scratch  1-      ext4    rw
>>
>> which results into an error:
>>
>> Starting setup-storage 1.7
>> Syntax error: invalid partition type at
>> /usr/share/fai/setup-storage/Parser.pm line 188, <$config_file> line 1.
> Ok, it turns out this error message is just very confusing and all you
> have to do is actually use primary partition types only since GPT
> doesn't distinguish between primary and logical.
>
> However, I'm still a bit stuck since setup-storage uses the incorrect
> partition type for the EFI system partition. It sets it to 0x0b (FAT32)
> but it needs to be 0xef00 (EFI SYSTEM PARTITION). Any idea how to
> achieve that?
>
> Adrian
>
Hello,

I came across the same problem and made a workaround by declaring a
variable EFI_PART_NUMBER and assigning it the partition number of the
EFI partition (in your case EFI_PART_NUMBER="1"). Then I have a script
like this:

if [ $action = "install" ] || [ $FAI_ACTION = "install" ]; then
        [ -r /tmp/fai/disk_var.sh ] && . /tmp/fai/disk_var.sh
       
        umount ${target}/boot/efi
        sgdisk --typecode=${EFI_PART_NUMBER}:ef00 $BOOT_DEVICE
        mount ${BOOT_DEVICE}${EFI_PART_NUMBER} ${target}/boot/efi
fi

This assumes that the EFI partition is mounted unter ${target}/boot/efi,
which it normally should be. From looking at your disk_config, I guess
that currently you do not mount it at all. This won't work either, grub
and its scripts (namely update-grub) rely on the EFI partition being
mounted there.

Bye,
Andreas



More information about the linux-fai-devel mailing list