summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlbonn <lbonn@users.noreply.github.com>2018-05-16 16:23:48 +0200
committerGitHub <noreply@github.com>2018-05-16 16:23:48 +0200
commita694dc7ff1dc08cef9ddade0327befa155a3a853 (patch)
tree3ec6119050fe4362d9604d168daa8ed527029af7
parent41c2df71f443047ea6d6adb988f17eb493f10f89 (diff)
parent7e6ffbce3f8717d91142d1e80d7cda279f24145a (diff)
downloadmeta-updater-a694dc7ff1dc08cef9ddade0327befa155a3a853.tar.gz
Merge pull request #311 from advancedtelematic/fix/PRO-5376/backport-master-fixes
Backport from master to rocko
-rw-r--r--classes/image_types_ostree.bbclass5
-rw-r--r--classes/image_types_ota.bbclass10
-rw-r--r--classes/sota.bbclass4
-rw-r--r--classes/sota_qemux86-64.bbclass1
-rw-r--r--recipes-core/images/initramfs-ostree-image.bb3
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb9
-rw-r--r--recipes-sota/ostree/ostree_git.bb7
-rw-r--r--scripts/lib/wic/canned-wks/sdimage-sota.wks2
8 files changed, 19 insertions, 22 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 9e3bc6f..bc44e33 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -11,12 +11,11 @@ export OSTREE_REPO
11export OSTREE_BRANCHNAME 11export OSTREE_BRANCHNAME
12export GARAGE_TARGET_NAME 12export GARAGE_TARGET_NAME
13 13
14RAMDISK_EXT ?= ".ext4.gz" 14RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}"
15RAMDISK_EXT_arm ?= ".ext4.gz.u-boot"
16 15
17OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" 16OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
18 17
19export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" 18export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}"
20 19
21IMAGE_CMD_ostree () { 20IMAGE_CMD_ostree () {
22 if [ -z "$OSTREE_REPO" ]; then 21 if [ -z "$OSTREE_REPO" ]; then
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 17fe4e8..9581971 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -7,8 +7,6 @@
7# boot scripts, kernel and initramfs images 7# boot scripts, kernel and initramfs images
8# 8#
9 9
10OSTREE_BOOTLOADER ??= 'u-boot'
11
12do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ 10do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \
13 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \ 11 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \
14 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}" 12 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}"
@@ -78,7 +76,7 @@ IMAGE_CMD_otaimg () {
78 76
79 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then 77 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then
80 mkdir -p ${PHYS_SYSROOT}/boot/grub2 78 mkdir -p ${PHYS_SYSROOT}/boot/grub2
81 touch ${PHYS_SYSROOT}/boot/grub2/grub.cfg 79 ln -s ../loader/grub.cfg ${PHYS_SYSROOT}/boot/grub2/grub.cfg
82 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then 80 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then
83 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt 81 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt
84 else 82 else
@@ -109,7 +107,11 @@ IMAGE_CMD_otaimg () {
109 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) 107 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
110 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local 108 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
111 # Set package version for the first deployment 109 # Set package version for the first deployment
112 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${ostree_target_hash}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions 110 target_version=${ostree_target_hash}
111 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
112 target_version=${GARAGE_TARGET_VERSION}
113 fi
114 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions
113 115
114 rm -rf ${HOME_TMP} 116 rm -rf ${HOME_TMP}
115 117
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 1e765f0..38d4ce5 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -20,13 +20,15 @@ WKS_FILE_sota ?= "sdimage-sota.wks"
20 20
21EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" 21EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native"
22 22
23OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}"
24
23# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 25# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
24OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 26OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
25# For UPTANE operation, OSTREE_BRANCHNAME must start with "${MACHINE}-" 27# For UPTANE operation, OSTREE_BRANCHNAME must start with "${MACHINE}-"
26OSTREE_BRANCHNAME ?= "${MACHINE}" 28OSTREE_BRANCHNAME ?= "${MACHINE}"
27OSTREE_OSNAME ?= "poky" 29OSTREE_OSNAME ?= "poky"
28OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" 30OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image"
29 31OSTREE_BOOTLOADER ??= 'u-boot'
30 32
31GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" 33GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo"
32GARAGE_SIGN_KEYNAME ?= "garage-key" 34GARAGE_SIGN_KEYNAME ?= "garage-key"
diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass
index a5fd6a4..15b2043 100644
--- a/classes/sota_qemux86-64.bbclass
+++ b/classes/sota_qemux86-64.bbclass
@@ -4,6 +4,7 @@ IMAGE_FSTYPES_remove = "wic"
4PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot" 4PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot"
5UBOOT_MACHINE_sota = "qemu-x86_defconfig" 5UBOOT_MACHINE_sota = "qemu-x86_defconfig"
6OSTREE_BOOTLOADER ?= "u-boot" 6OSTREE_BOOTLOADER ?= "u-boot"
7OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz"
7 8
8OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" 9OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda"
9 10
diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb
index 4ab9da8..b2d9e27 100644
--- a/recipes-core/images/initramfs-ostree-image.bb
+++ b/recipes-core/images/initramfs-ostree-image.bb
@@ -13,8 +13,7 @@ IMAGE_LINGUAS = ""
13 13
14LICENSE = "MIT" 14LICENSE = "MIT"
15 15
16IMAGE_FSTYPES = "ext4.gz" 16IMAGE_FSTYPES = "${OSTREE_INITRAMFS_FSTYPES}"
17IMAGE_FSTYPES_append_arm = " ext4.gz.u-boot"
18 17
19inherit core-image 18inherit core-image
20 19
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 95c36fa..452a128 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -55,7 +55,7 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \
55do_install_append () { 55do_install_append () {
56 rm -fr ${D}${libdir}/systemd 56 rm -fr ${D}${libdir}/systemd
57 rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package 57 rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package
58 install -m 0700 -d ${D}${libdir}/sota/conf.d 58 install -d ${D}${libdir}/sota
59 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 59 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
60 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml 60 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml
61 install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml 61 install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml
@@ -65,6 +65,7 @@ do_install_append () {
65 install -d ${D}${systemd_unitdir}/system 65 install -d ${D}${systemd_unitdir}/system
66 install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket 66 install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket
67 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service 67 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service
68 install -m 0700 -d ${D}${libdir}/sota/conf.d
68 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d 69 install -m 0700 -d ${D}${sysconfdir}/sota/conf.d
69} 70}
70 71
@@ -75,12 +76,6 @@ do_install_append_class-target () {
75} 76}
76 77
77do_install_append_class-native () { 78do_install_append_class-native () {
78 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
79 install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml
80 install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml
81 install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml
82 install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml
83
84 install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir} 79 install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir}
85 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} 80 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir}
86} 81}
diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb
index ad85775..cdcb485 100644
--- a/recipes-sota/ostree/ostree_git.bb
+++ b/recipes-sota/ostree/ostree_git.bb
@@ -21,8 +21,7 @@ DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse e2fsprogs g
21DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" 21DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
22DEPENDS_remove_class-native = "systemd-native" 22DEPENDS_remove_class-native = "systemd-native"
23 23
24RDEPENDS_${PN} = "python util-linux-libuuid util-linux-libblkid util-linux-libmount libcap bash" 24RDEPENDS_${PN} = "util-linux-libuuid util-linux-libblkid util-linux-libmount libcap bash"
25RDEPENDS_${PN}_remove_class-native = "python-native"
26 25
27EXTRA_OECONF = "CFLAGS='-Wno-error=missing-prototypes' --with-libarchive --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --disable-man --with-smack --with-builtin-grub2-mkconfig --with-curl --without-soup" 26EXTRA_OECONF = "CFLAGS='-Wno-error=missing-prototypes' --with-libarchive --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --disable-man --with-smack --with-builtin-grub2-mkconfig --with-curl --without-soup"
28EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" 27EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat"
@@ -63,8 +62,8 @@ export SYSTEMD_REQUIRED
63 62
64do_install_append() { 63do_install_append() {
65 if [ -n ${SYSTEMD_REQUIRED} ]; then 64 if [ -n ${SYSTEMD_REQUIRED} ]; then
66 install -p -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service 65 install -m 0644 -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service
67 install -p -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service 66 install -m 0644 -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service
68 fi 67 fi
69} 68}
70 69
diff --git a/scripts/lib/wic/canned-wks/sdimage-sota.wks b/scripts/lib/wic/canned-wks/sdimage-sota.wks
index c31c3a5..f396526 100644
--- a/scripts/lib/wic/canned-wks/sdimage-sota.wks
+++ b/scripts/lib/wic/canned-wks/sdimage-sota.wks
@@ -4,4 +4,4 @@
4# first vfat partition. 4# first vfat partition.
5 5
6part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 20 6part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 20
7part / --source otaimage --ondisk mmcblk --fstype=ext4 --label root --align 4096 7part / --source otaimage --ondisk mmcblk --fstype=ext4 --align 4096