From 69d6b7adc9aef8d39ca66ef8688ac968876ae040 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Fri, 19 Aug 2016 18:13:24 +0200 Subject: Replaced functionality in qemux86-ota machine with algsetup.sh feature. otaimg is now a live image. Bug-AGL: SPEC-236 Change-Id: I5a56ffbdb098c1b4eb33fceeae32e28611b83fb7 Signed-off-by: Anton Gerasimov --- meta-sota/classes/image_types_ota.bbclass | 23 +++++++++----- meta-sota/conf/machine/qemux86-ota.conf | 37 ---------------------- ...Set-up-environment-for-OSTree-integration.patch | 36 --------------------- .../recipes-bsp/u-boot/u-boot-buildrom_2016.07.bb | 19 ----------- ...Set-up-environment-for-OSTree-integration.patch | 36 +++++++++++++++++++++ meta-sota/recipes-bsp/u-boot/u-boot-ota_2016.07.bb | 22 +++++++++++++ templates/feature/agl-sota/50_local.conf.inc | 12 +++++++ 7 files changed, 85 insertions(+), 100 deletions(-) delete mode 100644 meta-sota/conf/machine/qemux86-ota.conf delete mode 100644 meta-sota/recipes-bsp/u-boot/u-boot-buildrom/0001-Set-up-environment-for-OSTree-integration.patch delete mode 100644 meta-sota/recipes-bsp/u-boot/u-boot-buildrom_2016.07.bb create mode 100644 meta-sota/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch create mode 100644 meta-sota/recipes-bsp/u-boot/u-boot-ota_2016.07.bb create mode 100644 templates/feature/agl-sota/50_local.conf.inc diff --git a/meta-sota/classes/image_types_ota.bbclass b/meta-sota/classes/image_types_ota.bbclass index a67cc80..9820724 100644 --- a/meta-sota/classes/image_types_ota.bbclass +++ b/meta-sota/classes/image_types_ota.bbclass @@ -1,6 +1,6 @@ # Image to use with u-boot as BIOS and OSTree deployment system -inherit image_types +#inherit image_types # Boot filesystem size in MiB # OSTree updates may require some space on boot file system for @@ -9,12 +9,15 @@ inherit image_types BOOTFS_EXTRA_SIZE ?= "512" export BOOTFS_EXTRA_SIZE -IMAGE_TYPES += " otaimg" -IMAGE_DEPENDS_ota = "e2fsprogs-native \ - virtual/bootloader \ - virtual/kernel \ - parted-native \ - ${INITRD_IMAGE}" +do_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ + parted-native:do_populate_sysroot \ + virtual/kernel:do_deploy \ + ${INITRD_IMAGE}:do_rootfs \ + ${PN}:do_rootfs" + +ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext4" +INITRD_IMAGE ?= "core-image-minimal-initramfs" +INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.gz" build_bootfs () { KERNEL_FILE=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} @@ -36,7 +39,7 @@ build_bootfs () { rm -rf $BOOTTMP } -IMAGE_CMD_otaimg () { +do_otaimg () { BOOTIMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaboot.ext4 rm -f $BOOTIMG build_bootfs $BOOTIMG @@ -70,4 +73,8 @@ IMAGE_CMD_otaimg () { ln -s ${IMAGE_NAME}.otaimg ${IMAGE_LINK_NAME}.otaimg } +addtask otaimg before do_build + +IMAGE_TYPES += " otaimg" +IMAGE_TYPES_MASKED += "otaimg" IMAGE_TYPEDEP_otaimg = "ext4" diff --git a/meta-sota/conf/machine/qemux86-ota.conf b/meta-sota/conf/machine/qemux86-ota.conf deleted file mode 100644 index 3c58870..0000000 --- a/meta-sota/conf/machine/qemux86-ota.conf +++ /dev/null @@ -1,37 +0,0 @@ -#@TYPE: Machine -#@NAME: common_pc -#@DESCRIPTION: Machine configuration for running a common x86 - -PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" -PREFERRED_PROVIDER_virtual/libgl ?= "mesa" -PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" -PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" - -require conf/machine/include/qemu.inc -require conf/machine/include/tune-i586.inc - -KERNEL_IMAGETYPE = "bzImage" - -PREFERRED_PROVIDER_virtual/bootloader = "u-boot-buildrom" -UBOOT_MACHINE = "qemu-x86_defconfig" - -IMAGE_CLASSES += "image_types_ota" -IMAGE_FSTYPES += "otaimg" - -SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1" - -XSERVER = "xserver-xorg \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \ - xf86-input-vmmouse \ - xf86-input-keyboard \ - xf86-input-evdev \ - xf86-video-cirrus \ - xf86-video-fbdev \ - xf86-video-vmware" - -MACHINE_FEATURES += "x86" - -MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d" - -MACHINEOVERRIDES .= ":qemux86" -KMACHINE = "qemux86" diff --git a/meta-sota/recipes-bsp/u-boot/u-boot-buildrom/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota/recipes-bsp/u-boot/u-boot-buildrom/0001-Set-up-environment-for-OSTree-integration.patch deleted file mode 100644 index c33d40c..0000000 --- a/meta-sota/recipes-bsp/u-boot/u-boot-buildrom/0001-Set-up-environment-for-OSTree-integration.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2b4d519bef51d9bfb646588aa5198f71022a867b Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Mon, 15 Aug 2016 15:54:20 +0200 -Subject: [PATCH] Set up environment for OSTree integration - ---- - include/configs/qemu-x86.h | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h -index 476d37d..f49e2a5 100644 ---- a/include/configs/qemu-x86.h -+++ b/include/configs/qemu-x86.h -@@ -56,4 +56,19 @@ - #undef CONFIG_ENV_IS_IN_SPI_FLASH - #define CONFIG_ENV_IS_NOWHERE - -+#undef CONFIG_BOOTARGS -+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" -+ -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run loadenv;" \ -+ "ext2load ide 0:1 $loadaddr $kernel_image;" \ -+ "ext2load ide 0:1 $ramdiskaddr $ramdisk_image;" \ -+ "zboot $loadaddr - $ramdiskaddr $filesize" -+ -+#undef CONFIG_EXTRA_ENV_SETTINGS -+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ -+ "ramdisk_image=/initrd\0" \ -+ "ramdiskaddr=0x4000000\0" \ -+ "loadenv=if ext2ls ide 0:1 /loader.0/uEnv.txt; then ext2load ide 0:1 $loadaddr uEnv.txt; env import -t $loadaddr $filesize; fi;" -+ - #endif /* __CONFIG_H */ --- -2.8.3 - diff --git a/meta-sota/recipes-bsp/u-boot/u-boot-buildrom_2016.07.bb b/meta-sota/recipes-bsp/u-boot/u-boot-buildrom_2016.07.bb deleted file mode 100644 index 7e3c67f..0000000 --- a/meta-sota/recipes-bsp/u-boot/u-boot-buildrom_2016.07.bb +++ /dev/null @@ -1,19 +0,0 @@ -include recipes-bsp/u-boot/u-boot.inc -DEPENDS += "dtc-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" - -# This revision corresponds to the tag "v2016.07" -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "25922d42f8e9e7ae503ae55a972ba1404e5b6a8c" - -SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch" - -PV = "v2016.07+git${SRCPV}" - -EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" - -UBOOT_SUFFIX = "rom" - diff --git a/meta-sota/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch new file mode 100644 index 0000000..c33d40c --- /dev/null +++ b/meta-sota/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch @@ -0,0 +1,36 @@ +From 2b4d519bef51d9bfb646588aa5198f71022a867b Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Mon, 15 Aug 2016 15:54:20 +0200 +Subject: [PATCH] Set up environment for OSTree integration + +--- + include/configs/qemu-x86.h | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h +index 476d37d..f49e2a5 100644 +--- a/include/configs/qemu-x86.h ++++ b/include/configs/qemu-x86.h +@@ -56,4 +56,19 @@ + #undef CONFIG_ENV_IS_IN_SPI_FLASH + #define CONFIG_ENV_IS_NOWHERE + ++#undef CONFIG_BOOTARGS ++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run loadenv;" \ ++ "ext2load ide 0:1 $loadaddr $kernel_image;" \ ++ "ext2load ide 0:1 $ramdiskaddr $ramdisk_image;" \ ++ "zboot $loadaddr - $ramdiskaddr $filesize" ++ ++#undef CONFIG_EXTRA_ENV_SETTINGS ++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ ++ "ramdisk_image=/initrd\0" \ ++ "ramdiskaddr=0x4000000\0" \ ++ "loadenv=if ext2ls ide 0:1 /loader.0/uEnv.txt; then ext2load ide 0:1 $loadaddr uEnv.txt; env import -t $loadaddr $filesize; fi;" ++ + #endif /* __CONFIG_H */ +-- +2.8.3 + diff --git a/meta-sota/recipes-bsp/u-boot/u-boot-ota_2016.07.bb b/meta-sota/recipes-bsp/u-boot/u-boot-ota_2016.07.bb new file mode 100644 index 0000000..8f0b20a --- /dev/null +++ b/meta-sota/recipes-bsp/u-boot/u-boot-ota_2016.07.bb @@ -0,0 +1,22 @@ +include recipes-bsp/u-boot/u-boot.inc +DEPENDS += "dtc-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" + +# This revision corresponds to the tag "v2016.07" +# We use the revision in order to avoid having to fetch it from the +# repo during parse +SRCREV = "25922d42f8e9e7ae503ae55a972ba1404e5b6a8c" + +SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch" + +PV = "v2016.07+git${SRCPV}" + +EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline" +EXTRA_OEMAKE_append_qemux86 = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" +EXTRA_OEMAKE_append_qemux86-64 = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" + +UBOOT_SUFFIX = "bin" +UBOOT_SUFFIX_qemux86 = "rom" +UBOOT_SUFFIX_qemux86-64 = "rom" diff --git a/templates/feature/agl-sota/50_local.conf.inc b/templates/feature/agl-sota/50_local.conf.inc new file mode 100644 index 0000000..a27d7af --- /dev/null +++ b/templates/feature/agl-sota/50_local.conf.inc @@ -0,0 +1,12 @@ +DISTRO_FEATURES_append = " agl-ota" + +# live image for OSTree-enabled systems +IMAGE_CLASSES += "image_types_ota" +IMAGE_FSTYPES += "otaimg" + +UBOOT_MACHINE_qemux86 = "qemu-x86_defconfig" +UBOOT_MACHINE_qemux86_64 = "qemu-x86_defconfig" + +PREFERRED_PROVIDER_virtual/bootloader_qemux86 ?= "u-boot-ota" +PREFERRED_PROVIDER_virtual/bootloader_qemux86-64 ?= "u-boot-ota" + -- cgit 1.2.3-korg