diff options
Diffstat (limited to 'images')
-rw-r--r-- | images/core-image-minimal-initramfs.bbappend | 12 | ||||
-rw-r--r-- | images/enea-edge-common.inc | 22 | ||||
-rw-r--r-- | images/enea-edge-host-common.inc | 59 | ||||
-rw-r--r-- | images/enea-edge-vnf.bb | 1 |
4 files changed, 63 insertions, 31 deletions
diff --git a/images/core-image-minimal-initramfs.bbappend b/images/core-image-minimal-initramfs.bbappend index 67ab251..88dd198 100644 --- a/images/core-image-minimal-initramfs.bbappend +++ b/images/core-image-minimal-initramfs.bbappend | |||
@@ -1,12 +1,16 @@ | |||
1 | PACKAGE_INSTALL += " nfv-installer kernel-modules ixgbe" | 1 | PACKAGE_INSTALL += " nfv-installer kernel-modules" |
2 | 2 | ||
3 | # ostree-switchroot is used by the init script to switch root to the | 3 | INITRAMFS_SCRIPTS = " \ |
4 | # ostree version specified in the kernel command line | 4 | initramfs-framework-base \ |
5 | PACKAGE_INSTALL_append_sota = " ostree-switchroot" | 5 | initramfs-module-udev \ |
6 | initramfs-module-setup-live \ | ||
7 | " | ||
6 | 8 | ||
7 | # run-postinsts does not belong in the minimal initramfs | 9 | # run-postinsts does not belong in the minimal initramfs |
8 | PACKAGE_INSTALL_remove = "run-postinsts" | 10 | PACKAGE_INSTALL_remove = "run-postinsts" |
9 | 11 | ||
12 | PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras" | ||
13 | |||
10 | create_enea_symlink() { | 14 | create_enea_symlink() { |
11 | # enea image used in bare metal installation | 15 | # enea image used in bare metal installation |
12 | cd ${DEPLOY_DIR_IMAGE} | 16 | cd ${DEPLOY_DIR_IMAGE} |
diff --git a/images/enea-edge-common.inc b/images/enea-edge-common.inc index 5472056..b174064 100644 --- a/images/enea-edge-common.inc +++ b/images/enea-edge-common.inc | |||
@@ -10,6 +10,8 @@ IMAGE_INSTALL += " \ | |||
10 | # run-postinsts duplicates dpkg-configure if package_deb is used | 10 | # run-postinsts duplicates dpkg-configure if package_deb is used |
11 | PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}" | 11 | PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}" |
12 | 12 | ||
13 | PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras" | ||
14 | |||
13 | # After installing packages inside the rootfs, remove backup DPKG status file | 15 | # After installing packages inside the rootfs, remove backup DPKG status file |
14 | rootfs_postinstall_dpkg_cleanup () { | 16 | rootfs_postinstall_dpkg_cleanup () { |
15 | if ${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'true', 'false', d)}; then | 17 | if ${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'true', 'false', d)}; then |
@@ -18,9 +20,21 @@ rootfs_postinstall_dpkg_cleanup () { | |||
18 | } | 20 | } |
19 | ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;" | 21 | ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;" |
20 | 22 | ||
21 | IMAGE_FSTYPES = "ext4 ext4.gz tar.gz" | 23 | IMAGE_FSTYPES += "ext4 ext4.gz tar.gz" |
22 | 24 | ||
23 | # Add ostree specific image types if sota support is set | 25 | # Remove aktualizr packages from the image, we don't use it and creates odd dependencies, e.g. |
24 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'otaimg wic', ' ', d)}" | 26 | # it creates a systemd unit that depends on network-online.target, which leads to enabling |
25 | SOTA_CLIENT = "" | 27 | # NetworkManager-wait-online.service, delaying boot up. |
26 | SOTA_CLIENT_PROV = "" | 28 | SOTA_CLIENT_PROV = "" |
29 | IMAGE_INSTALL_remove_sota = " \ | ||
30 | aktualizr \ | ||
31 | aktualizr-info \ | ||
32 | " | ||
33 | |||
34 | # We currently don't use automatic push/sign/check to a backend server, so skip running useless | ||
35 | # OSTree tasks during image build. | ||
36 | IMAGE_FSTYPES_remove_sota = " \ | ||
37 | ostreepush \ | ||
38 | garagesign \ | ||
39 | garagecheck \ | ||
40 | " | ||
diff --git a/images/enea-edge-host-common.inc b/images/enea-edge-host-common.inc index 6d446a0..3df6cb9 100644 --- a/images/enea-edge-host-common.inc +++ b/images/enea-edge-host-common.inc | |||
@@ -1,11 +1,11 @@ | |||
1 | IMAGE_FSTYPES += "hddimg" | ||
2 | IMAGE_FSTYPES_remove = "wic" | ||
3 | |||
1 | REQUIRE_FILES = " \ | 4 | REQUIRE_FILES = " \ |
2 | images/enea-edge-common.inc \ | 5 | images/enea-edge-common.inc \ |
3 | classes/override_grub-efi.inc \ | ||
4 | " | 6 | " |
5 | REQUIRE_FILES_append_df-efi-secure-boot = " \ | 7 | REQUIRE_FILES_append_df-efi-secure-boot = " \ |
6 | classes/override_image_types_ostree.inc \ | 8 | classes/override_live-vm-common.inc \ |
7 | classes/override_image_types_ota.inc \ | ||
8 | classes/override_grub-efi_secureboot.inc \ | ||
9 | images/secure-boot.inc \ | 9 | images/secure-boot.inc \ |
10 | " | 10 | " |
11 | 11 | ||
@@ -19,28 +19,26 @@ IMAGE_INSTALL += " \ | |||
19 | # Set labels for GRUB and SYSLINUX | 19 | # Set labels for GRUB and SYSLINUX |
20 | LABELS_LIVE = "installer live-boot" | 20 | LABELS_LIVE = "installer live-boot" |
21 | 21 | ||
22 | GRUB_GFXSERIAL_x86-64 = "1" | ||
23 | # Append default parameters for x86-64 targets | 22 | # Append default parameters for x86-64 targets |
24 | APPEND_x86-64 = "quiet" | 23 | APPEND_x86-64 = "quiet console=tty0 console=ttyS0,115200" |
25 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" | 24 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" |
26 | 25 | ||
27 | # Skip menu and boot installer immediately | 26 | # Skip menu and boot installer immediately |
28 | GRUB_TIMEOUT_x86-64 = "0" | 27 | GRUB_TIMEOUT_x86-64 = "0" |
29 | AUTO_SYSLINUXMENU_x86-64 = "0" | 28 | AUTO_SYSLINUXMENU_x86-64 = "0" |
30 | 29 | ||
31 | # grub-efi-native is needed in recipe-sysroot-native to generate the initial | ||
32 | # configuration file for grub | ||
33 | DEPENDS_append += " grub-efi-native" | ||
34 | |||
35 | # If building with sota enabled, build the otaimg before the hddimg, because | 30 | # If building with sota enabled, build the otaimg before the hddimg, because |
36 | # the hddimg needs it as a base image | 31 | # the hddimg needs it as a base image |
37 | python __anonymous() { | 32 | python __anonymous() { |
33 | ## ENEA_start ## | ||
38 | if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): | 34 | if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): |
39 | d.appendVarFlag("do_bootimg", "depends", " %s:do_image_otaimg" % d.getVar("IMAGE_BASENAME", True)) | 35 | d.appendVarFlag("do_bootimg", "depends", " %s:do_image_ota_ext4" % d.getVar("IMAGE_BASENAME", True)) |
36 | ## ENEA_end ## | ||
40 | } | 37 | } |
41 | 38 | ||
42 | # Append OSTree specific parameters to the kernel command line before creating the live image | 39 | # Append OSTree specific parameters to the kernel command line before creating the live image |
43 | python do_bootimg_prepend () { | 40 | python do_bootimg_prepend () { |
41 | ## ENEA_start ## | ||
44 | if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): | 42 | if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): |
45 | ostree_osname = d.getVar('OSTREE_OSNAME') | 43 | ostree_osname = d.getVar('OSTREE_OSNAME') |
46 | checksum = bb.utils.sha256_file(d.getVar('DEPLOY_DIR_IMAGE') + "/" + d.getVar('OSTREE_KERNEL')) | 44 | checksum = bb.utils.sha256_file(d.getVar('DEPLOY_DIR_IMAGE') + "/" + d.getVar('OSTREE_KERNEL')) |
@@ -49,21 +47,38 @@ python do_bootimg_prepend () { | |||
49 | ostree_params = " ostree=/ostree/boot.1/" + ostree_osname + "/" + checksum + "/0" | 47 | ostree_params = " ostree=/ostree/boot.1/" + ostree_osname + "/" + checksum + "/0" |
50 | 48 | ||
51 | d.setVar("APPEND", d.getVar("APPEND") + ostree_params) | 49 | d.setVar("APPEND", d.getVar("APPEND") + ostree_params) |
52 | } | 50 | ## ENEA_end ## |
53 | |||
54 | # Get rid of GRUB dependencies added by ostree. See: | ||
55 | # https://git.enea.com/cgit/linux/meta-updater.git/tree/classes/image_types_ota.bbclass#n45 | ||
56 | python __anonymous () { | ||
57 | d.delVarFlag("do_image_otaimg", "depends") | ||
58 | d.setVarFlag("do_image_otaimg", "depends", "e2fsprogs-native:do_populate_sysroot") | ||
59 | } | 51 | } |
60 | 52 | ||
61 | # Before building the OSTree image, move DPKG data to /usr/dpkg, because | 53 | # Before building the OSTree image, move DPKG data to /usr/dpkg, because |
62 | # OSTree does not preserve the contents of /var | 54 | # OSTree does not preserve the contents of /var |
63 | IMAGE_CMD_ostree_prepend () { | 55 | IMAGE_CMD_ostree_prepend () { |
64 | 56 | ## ENEA_start ## | |
65 | install -d ${IMAGE_ROOTFS}/usr/dpkg/lib/dpkg | 57 | # Note: We do configure DPKG admindir at build time, but we can't do the same for APT since |
66 | if [ "$(ls -A ${IMAGE_ROOTFS}/var/lib/dpkg)" ]; then | 58 | # yocto hardcodes /var/lib/dpkg paths in various places in OE-core, which we can't override, |
67 | mv ${IMAGE_ROOTFS}/var/lib/dpkg/* ${IMAGE_ROOTFS}/usr/dpkg/lib/dpkg/ | 59 | # so instead we move the contents to their expected location here and configure apt at runtime |
60 | # via a configuration fragment to use the new location. | ||
61 | mkdir -p usr/dpkg/lib/dpkg | ||
62 | if [ "$(ls -A var/lib/dpkg)" ]; then | ||
63 | mv var/lib/dpkg/* usr/dpkg/lib/dpkg/ | ||
68 | fi | 64 | fi |
65 | # In Enea Edge, the EFI binaries (shim, seloader etc.) are copied from the yocto deploy dir to | ||
66 | # the installation image (hddimg) - see "classes/override_live-vm-common.inc" in this repo; | ||
67 | # and during Enea Edge installation (via utils.sh) from hddimg to the destination disk. | ||
68 | # Files installed by the package manager end up under OSTree /boot hardlink tree, but are | ||
69 | # never actually used. To avoid confusion and save some resources, clean them up. | ||
70 | rm -rf boot/* | ||
71 | ## ENEA_end ## | ||
72 | } | ||
73 | |||
74 | IMAGE_CMD_ota_prepend () { | ||
75 | ## ENEA_start ## | ||
76 | if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then | ||
77 | # Upstream bbclass creates /boot/grub2, complement it with /boot/grub | ||
78 | # Note: /boot/grub2 is a dir with /boot/grub2/grub.cfg -> ../loader/grub.cfg symlink | ||
79 | # while /boot/grub -> loader is a symlink to also account for /boot/grub/grubenv | ||
80 | mkdir -p ${OTA_SYSROOT}/boot | ||
81 | ln -s loader ${OTA_SYSROOT}/boot/grub | ||
82 | fi | ||
83 | ## ENEA_end ## | ||
69 | } | 84 | } |
diff --git a/images/enea-edge-vnf.bb b/images/enea-edge-vnf.bb index 9351160..5d2365b 100644 --- a/images/enea-edge-vnf.bb +++ b/images/enea-edge-vnf.bb | |||
@@ -6,7 +6,6 @@ IMAGE_FSTYPES += "wic.qcow2" | |||
6 | WKS_FILE = "enea-edge-vnf-qemux86-64.wks" | 6 | WKS_FILE = "enea-edge-vnf-qemux86-64.wks" |
7 | 7 | ||
8 | CLOUDINITPKGS = "cloud-init util-linux-blkid" | 8 | CLOUDINITPKGS = "cloud-init util-linux-blkid" |
9 | CLOUDINITPKGS += " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'cloud-init-systemd', '', d)}" | ||
10 | 9 | ||
11 | IMAGE_INSTALL += " \ | 10 | IMAGE_INSTALL += " \ |
12 | packagegroup-enea-virtualization-guest \ | 11 | packagegroup-enea-virtualization-guest \ |