Bump buildroot to 2019.02
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
image efi-part.vfat {
|
||||
vfat {
|
||||
file startup.nsh {
|
||||
image = "efi-part/startup.nsh"
|
||||
}
|
||||
file EFI {
|
||||
image = "efi-part/EFI"
|
||||
}
|
||||
file bzImage {
|
||||
image = "bzImage"
|
||||
}
|
||||
}
|
||||
size = 16M
|
||||
}
|
||||
|
||||
image disk.img {
|
||||
|
||||
hdimage {
|
||||
}
|
||||
|
||||
partition boot {
|
||||
partition-type = 0xEF
|
||||
image = "efi-part.vfat"
|
||||
}
|
||||
|
||||
partition root {
|
||||
partition-type = 0x83
|
||||
image = "rootfs.ext2"
|
||||
}
|
||||
|
||||
}
|
||||
0
bsp/buildroot/board/pc/grub-efi.cfg
Executable file → Normal file
0
bsp/buildroot/board/pc/grub-efi.cfg
Executable file → Normal file
@@ -82,3 +82,4 @@ CONFIG_EXT4_FS=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_SQUASHFS=y
|
||||
CONFIG_UNWINDER_FRAME_POINTER=y
|
||||
|
||||
10
bsp/buildroot/board/pc/post-build.sh
Executable file
10
bsp/buildroot/board/pc/post-build.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
BOARD_DIR=$(dirname "$0")
|
||||
|
||||
cp -f "$BOARD_DIR/grub-bios.cfg" "$TARGET_DIR/boot/grub/grub.cfg"
|
||||
|
||||
# Copy grub 1st stage to binaries, required for genimage
|
||||
cp -f "$HOST_DIR/lib/grub/i386-pc/boot.img" "$BINARIES_DIR"
|
||||
62
bsp/buildroot/board/pc/post-image-efi-gpt.sh
Executable file
62
bsp/buildroot/board/pc/post-image-efi-gpt.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd ${BINARIES_DIR}
|
||||
|
||||
# GPT partition type UUIDs
|
||||
esp_type=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
|
||||
linux_type=44479540-f297-41b2-9af7-d131d5f0458a
|
||||
|
||||
# Partition UUIDs
|
||||
efi_part_uuid=$(uuidgen)
|
||||
root_part_uuid=$(uuidgen)
|
||||
|
||||
# Boot partition offset and size, in 512-byte sectors
|
||||
efi_part_start=64
|
||||
efi_part_size=32768
|
||||
|
||||
# Rootfs partition offset and size, in 512-byte sectors
|
||||
root_part_start=$(( efi_part_start + efi_part_size ))
|
||||
root_part_size=$(( $(stat -c %s rootfs.ext2) / 512 ))
|
||||
|
||||
first_lba=34
|
||||
last_lba=$(( root_part_start + root_part_size ))
|
||||
|
||||
# Disk image size in 512-byte sectors
|
||||
image_size=$(( last_lba + first_lba ))
|
||||
|
||||
cat > efi-part/EFI/BOOT/grub.cfg <<EOF
|
||||
set default="0"
|
||||
set timeout="5"
|
||||
|
||||
menuentry "Buildroot" {
|
||||
linux /bzImage root=PARTUUID=$root_part_uuid rootwait console=tty1
|
||||
}
|
||||
EOF
|
||||
|
||||
# Create EFI system partition
|
||||
rm -f efi-part.vfat
|
||||
dd if=/dev/zero of=efi-part.vfat bs=512 count=0 seek=$efi_part_size
|
||||
mkdosfs efi-part.vfat
|
||||
mcopy -bsp -i efi-part.vfat efi-part/startup.nsh ::startup.nsh
|
||||
mcopy -bsp -i efi-part.vfat efi-part/EFI ::EFI
|
||||
mcopy -bsp -i efi-part.vfat bzImage ::bzImage
|
||||
|
||||
rm -f disk.img
|
||||
dd if=/dev/zero of=disk.img bs=512 count=0 seek=$image_size
|
||||
|
||||
sfdisk disk.img <<EOF
|
||||
label: gpt
|
||||
label-id: $(uuidgen)
|
||||
device: /dev/foobar0
|
||||
unit: sectors
|
||||
first-lba: $first_lba
|
||||
last-lba: $last_lba
|
||||
|
||||
/dev/foobar0p1 : start=$efi_part_start, size=$efi_part_size, type=$esp_type, uuid=$efi_part_uuid, name="efi-part.vfat"
|
||||
/dev/foobar0p2 : start=$root_part_start, size=$root_part_size, type=$linux_type, uuid=$root_part_uuid, name="rootfs.ext2"
|
||||
EOF
|
||||
|
||||
dd if=efi-part.vfat of=disk.img bs=512 count=$efi_part_size seek=$efi_part_start conv=notrunc
|
||||
dd if=rootfs.ext2 of=disk.img bs=512 count=$root_part_size seek=$root_part_start conv=notrunc
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BOARD_DIR="$(dirname $0)"
|
||||
|
||||
# Detect boot strategy, EFI or BIOS
|
||||
if [ -f ${BINARIES_DIR}/efi-part/startup.nsh ]; then
|
||||
cp -f ${BOARD_DIR}/grub-efi.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
|
||||
else
|
||||
cp -f ${BOARD_DIR}/grub-bios.cfg ${TARGET_DIR}/boot/grub/grub.cfg
|
||||
# Copy grub 1st stage to binaries, required for genimage
|
||||
cp -f ${HOST_DIR}/lib/grub/i386-pc/boot.img ${BINARIES_DIR}
|
||||
fi
|
||||
|
||||
exit $?
|
||||
@@ -9,7 +9,7 @@ Bare PC sample config
|
||||
|
||||
$ make pc_x86_64_bios_defconfig
|
||||
|
||||
Or for EFI:
|
||||
For EFI-based boot strategy on a GPT-partitioned disk:
|
||||
|
||||
$ make pc_x86_64_efi_defconfig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user