feat(beaglebone): use a GPT formatted disk image
BREAKING CHANGE: Support for MBR formatted disk is remove, as it was only used for Beaglebone
This commit is contained in:
parent
4eaf9a6f92
commit
d77f448f5c
|
|
@ -63,6 +63,11 @@ machine.
|
||||||
Firmware requirements
|
Firmware requirements
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
CoreOS support at the moment only hardware that contains a block storage
|
||||||
|
device (SD Card, eMMC, ...) formatted with GPT. MBR disk or MTD device are
|
||||||
|
not supported.
|
||||||
|
|
||||||
ARM32 / AArch32 based machine
|
ARM32 / AArch32 based machine
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
@ -70,10 +75,7 @@ ARM32 / AArch32 based machine
|
||||||
The firmware for ARM32 should implement a subset of the UEFI specification, as
|
The firmware for ARM32 should implement a subset of the UEFI specification, as
|
||||||
defined by the EBBR Specification. As this architecure is used on old hardware,
|
defined by the EBBR Specification. As this architecure is used on old hardware,
|
||||||
it's ok to use the part of the specification that are marked as deprecated or
|
it's ok to use the part of the specification that are marked as deprecated or
|
||||||
legacy like:
|
legacy.
|
||||||
|
|
||||||
- MBR partitionning instead of GPT
|
|
||||||
- Fixed offsets to firmware data
|
|
||||||
|
|
||||||
We require the firmware to provide a DeviceTree based system description and not
|
We require the firmware to provide a DeviceTree based system description and not
|
||||||
an ACPI based table (as allowed by the specification).
|
an ACPI based table (as allowed by the specification).
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,5 @@ QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port
|
||||||
# No watchdog available yet
|
# No watchdog available yet
|
||||||
EFIBOOTGUARD_TIMEOUT ?= "0"
|
EFIBOOTGUARD_TIMEOUT ?= "0"
|
||||||
|
|
||||||
# MBR disk can't select the root device by partition label as MBR doesn't have
|
|
||||||
# a partition label. Using filesystem label only work with an initramfs and we
|
|
||||||
# don't support it yet.
|
|
||||||
COREOS_PLATFORM0_ROOT ?= "/dev/mmcblk0p3"
|
|
||||||
COREOS_PLATFORM1_ROOT ?= "/dev/mmcblk0p4"
|
|
||||||
|
|
||||||
require conf/machine/include/coreos-generic-features/efi.inc
|
require conf/machine/include/coreos-generic-features/efi.inc
|
||||||
require conf/machine/include/coreos-generic-features/legacy-mbr-disk.inc
|
|
||||||
require conf/machine/include/coreos-generic-features/emmc.inc
|
require conf/machine/include/coreos-generic-features/emmc.inc
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
# short-description: Create SD card image for Beaglebone
|
# short-description: Create SD card image for Beaglebone
|
||||||
# long-description: Creates a partitioned SD card image for Beaglebone.
|
# long-description: Creates a partitioned SD card image for Beaglebone.
|
||||||
# Boot files are located in the first vfat partition.
|
|
||||||
|
|
||||||
part --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 32M --extra-space 0 --overhead-factor 1
|
# offset 1S => 1 sector (1x512 byte)
|
||||||
${WKS_PART_EFI} --ondisk mmcblk0 --align 1024 --size 32M --extra-space 0 --overhead-factor 1
|
# The bootloader can be at 4 different position in raw mode: 0S, 256S, 512S, 768S
|
||||||
${WKS_PART_ROOT_A} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
|
# MBR disk use only the sector 0, so 1S is free
|
||||||
${WKS_PART_ROOT_B} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
|
# GPT disk use sector 0-33S, so first free slot is 256S
|
||||||
|
# Offset are from the BBB default settings
|
||||||
|
part --offset 256S --source rawcopy --sourceparams="file=MLO" --ondisk mmcblk0
|
||||||
|
part --offset 768S --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk0
|
||||||
|
|
||||||
|
|
||||||
|
# Let's define a 4MiB maximum size for the bootloader
|
||||||
|
# 4MiB => 4*1024*1024/512=8192S | 768S + 8192S => 8960S
|
||||||
|
${WKS_PART_EFI} --ondisk mmcblk0 --offset 8960S --align 1024 --size 32M --extra-space 0 --overhead-factor 1
|
||||||
|
${WKS_PART_ROOT_A} --ondisk mmcblk0 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
|
||||||
|
${WKS_PART_ROOT_B} --ondisk mmcblk0 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
|
||||||
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
||||||
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
||||||
bootloader --ptable msdos
|
bootloader --ptable gpt
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ echo "Root partition is on device ${DISK_DEVICE_NAME} - type ${DISK_PARTITION_TY
|
||||||
if [ "${DISK_PARTITION_TYPE}" == "gpt" ]; then
|
if [ "${DISK_PARTITION_TYPE}" == "gpt" ]; then
|
||||||
ROOT_PARTLABEL=$(lsblk -dno PARTLABEL "${ROOT_PART}")
|
ROOT_PARTLABEL=$(lsblk -dno PARTLABEL "${ROOT_PART}")
|
||||||
else
|
else
|
||||||
echo "Using MBR disk is less reliable than GPT disk!"
|
echo "Using MBR is not supported"
|
||||||
ROOT_PARTLABEL=$(lsblk -dno LABEL "${ROOT_PART}")
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Root partition label is ${ROOT_PARTLABEL}"
|
echo "Root partition label is ${ROOT_PARTLABEL}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue