From 58e7b90e392c911fa3df2d17fda34441ea509675 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 10 Apr 2017 17:04:13 +0200 Subject: Add configuration for grub-efi on Minnowboard --- classes/image_types_ota.bbclass | 2 +- conf/include/local/sota_minnowboard.inc | 10 +++++----- conf/include/local/sota_minnowboard_uboot.inc | 10 ++++++++++ recipes-bsp/grub/grub-efi_%.bbappend | 2 ++ scripts/lib/wic/canned-wks/efiimage-sota.wks | 8 ++++++++ scripts/lib/wic/canned-wks/grub-ota.cfg | 2 ++ 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 conf/include/local/sota_minnowboard_uboot.inc create mode 100644 recipes-bsp/grub/grub-efi_%.bbappend create mode 100644 scripts/lib/wic/canned-wks/efiimage-sota.wks create mode 100644 scripts/lib/wic/canned-wks/grub-ota.cfg diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 74533dd..b275930 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -115,7 +115,7 @@ IMAGE_CMD_otaimg () { rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg sync dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg seek=$OTA_ROOTFS_SIZE count=$COUNT bs=1024 - mkfs.ext4 -O ^64bit ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg -d ${PHYS_SYSROOT} + mkfs.ext4 -O ^64bit ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg -L otaroot -d ${PHYS_SYSROOT} rm -rf ${PHYS_SYSROOT} rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg diff --git a/conf/include/local/sota_minnowboard.inc b/conf/include/local/sota_minnowboard.inc index 5a5b3f4..d39f4d3 100644 --- a/conf/include/local/sota_minnowboard.inc +++ b/conf/include/local/sota_minnowboard.inc @@ -1,9 +1,9 @@ MACHINE = "intel-corei7-64" -PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota" -UBOOT_MACHINE_sota = "minnowmax_defconfig" +OSTREE_BOOTLOADER ?= "grub" +EFI_PROVIDER = "grub-efi" -EXTRA_IMAGEDEPENDS_append_sota = " minnowboard-bootfiles" -IMAGE_BOOT_FILES_sota += "minnowboard-bootfiles/*" +WKS_FILE = "efiimage-sota.wks" +IMAGE_BOOT_FILES = "" -OSTREE_BOOTLOADER ?= "u-boot" +OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk2p2 console=ttyS0,115200 console=tty0" diff --git a/conf/include/local/sota_minnowboard_uboot.inc b/conf/include/local/sota_minnowboard_uboot.inc new file mode 100644 index 0000000..e64f7eb --- /dev/null +++ b/conf/include/local/sota_minnowboard_uboot.inc @@ -0,0 +1,10 @@ +MACHINE = "intel-corei7-64" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" +UBOOT_MACHINE = "minnowmax_defconfig" + +EXTRA_IMAGEDEPENDS_append = " minnowboard-bootfiles" +IMAGE_BOOT_FILES = "minnowboard-bootfiles/*" + +OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda console=ttyS0,115200 console=tty0" + diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend new file mode 100644 index 0000000..545e806 --- /dev/null +++ b/recipes-bsp/grub/grub-efi_%.bbappend @@ -0,0 +1,2 @@ + +GRUB_BUILDIN += "configfile" diff --git a/scripts/lib/wic/canned-wks/efiimage-sota.wks b/scripts/lib/wic/canned-wks/efiimage-sota.wks new file mode 100644 index 0000000..1e37d96 --- /dev/null +++ b/scripts/lib/wic/canned-wks/efiimage-sota.wks @@ -0,0 +1,8 @@ +# short-description: Create an OTA-enabled EFI disk image +# long-description: Creates an OTA-enabled EFI disk image that the user +# can directly dd to boot media. + +part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk hda --label msdos --active --align 1024 +part / --source otaimage --ondisk hda --fstype=ext4 --align 1024 --use-uuid + +bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0" --configfile="grub-ota.cfg" diff --git a/scripts/lib/wic/canned-wks/grub-ota.cfg b/scripts/lib/wic/canned-wks/grub-ota.cfg new file mode 100644 index 0000000..fcd8d70 --- /dev/null +++ b/scripts/lib/wic/canned-wks/grub-ota.cfg @@ -0,0 +1,2 @@ +search.fs_label otaroot root +configfile /boot/loader/grub.cfg -- cgit v1.2.3-54-g00ecf