diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2018-08-17 09:26:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 09:26:45 +0200 |
commit | 897be2e8d01cf53e545874f36a83ce6b7244d2f7 (patch) | |
tree | 7ec52a536c6095e6a7613841bcee5543864aaa81 /classes | |
parent | c4902394cc6673b07ad5ee87570e02afbdf7b022 (diff) | |
parent | 7d657d0cbec360cafb94952fcd652fd084579204 (diff) | |
download | meta-updater-897be2e8d01cf53e545874f36a83ce6b7244d2f7.tar.gz |
Merge pull request #368 from advancedtelematic/fit-initramfs-support
Fit initramfs support
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 14 | ||||
-rw-r--r-- | classes/sota.bbclass | 4 | ||||
-rw-r--r-- | classes/sota_qemux86-64.bbclass | 2 | ||||
-rw-r--r-- | classes/sota_raspberrypi.bbclass | 2 |
4 files changed, 15 insertions, 7 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ca8aee3..b525738 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -5,14 +5,13 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ | |||
5 | coreutils-native:do_populate_sysroot \ | 5 | coreutils-native:do_populate_sysroot \ |
6 | unzip-native:do_populate_sysroot \ | 6 | unzip-native:do_populate_sysroot \ |
7 | virtual/kernel:do_deploy \ | 7 | virtual/kernel:do_deploy \ |
8 | ${OSTREE_INITRAMFS_IMAGE}:do_image_complete" | 8 | ${INITRAMFS_IMAGE}:do_image_complete \ |
9 | " | ||
9 | 10 | ||
10 | export OSTREE_REPO | 11 | export OSTREE_REPO |
11 | export OSTREE_BRANCHNAME | 12 | export OSTREE_BRANCHNAME |
12 | export GARAGE_TARGET_NAME | 13 | export GARAGE_TARGET_NAME |
13 | 14 | ||
14 | RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" | ||
15 | |||
16 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | 15 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" |
17 | 16 | ||
18 | export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" | 17 | export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" |
@@ -124,7 +123,14 @@ IMAGE_CMD_ostree () { | |||
124 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` | 123 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` |
125 | 124 | ||
126 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} | 125 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} |
127 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_INITRAMFS_IMAGE}-${MACHINE}${RAMDISK_EXT} boot/initramfs-${checksum} | 126 | |
127 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then | ||
128 | # this is a hack for ostree not to override init= in kernel cmdline - | ||
129 | # make it think that the initramfs is present (while it is in FIT image) | ||
130 | touch boot/initramfs-${checksum} | ||
131 | else | ||
132 | cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} | ||
133 | fi | ||
128 | 134 | ||
129 | # Copy image manifest | 135 | # Copy image manifest |
130 | cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest | 136 | cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 3aca92c..f5c6247 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -23,13 +23,13 @@ WKS_FILE_sota ?= "sdimage-sota.wks" | |||
23 | 23 | ||
24 | EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" | 24 | EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" |
25 | 25 | ||
26 | OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" | 26 | INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" |
27 | 27 | ||
28 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo | 28 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo |
29 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 29 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
30 | OSTREE_BRANCHNAME ?= "${MACHINE}" | 30 | OSTREE_BRANCHNAME ?= "${MACHINE}" |
31 | OSTREE_OSNAME ?= "poky" | 31 | OSTREE_OSNAME ?= "poky" |
32 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 32 | INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
33 | OSTREE_BOOTLOADER ??= 'u-boot' | 33 | OSTREE_BOOTLOADER ??= 'u-boot' |
34 | 34 | ||
35 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 35 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 82efe52..0850af6 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass | |||
@@ -4,7 +4,7 @@ IMAGE_FSTYPES_remove = "wic" | |||
4 | PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot" | 4 | PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot" |
5 | UBOOT_MACHINE_sota = "qemu-x86_defconfig" | 5 | UBOOT_MACHINE_sota = "qemu-x86_defconfig" |
6 | OSTREE_BOOTLOADER ?= "u-boot" | 6 | OSTREE_BOOTLOADER ?= "u-boot" |
7 | OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" | 7 | INITRAMFS_FSTYPES ?= "cpio.gz" |
8 | 8 | ||
9 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" | 9 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" |
10 | 10 | ||
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index a5558b4..e5f002d 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass | |||
@@ -2,6 +2,8 @@ RPI_USE_U_BOOT_sota = "1" | |||
2 | 2 | ||
3 | KERNEL_CLASSES_append_sota = " kernel-fitimage" | 3 | KERNEL_CLASSES_append_sota = " kernel-fitimage" |
4 | KERNEL_IMAGETYPE_sota = "fitImage" | 4 | KERNEL_IMAGETYPE_sota = "fitImage" |
5 | OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}.bin" | ||
6 | INITRAMFS_FSTYPES = "cpio.gz" | ||
5 | 7 | ||
6 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" | 8 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" |
7 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" | 9 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" |