summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
Diffstat (limited to 'images')
-rw-r--r--images/core-image-minimal-initramfs.bbappend22
-rw-r--r--images/enea-edge-common.inc40
-rw-r--r--images/enea-edge-host-common.inc84
-rw-r--r--images/enea-edge-runtime-debug.bb9
-rw-r--r--images/enea-edge-runtime-esdk.bb (renamed from images/enea-nfv-access-esdk.bb)0
-rw-r--r--images/enea-edge-runtime-sdk.bb (renamed from images/enea-nfv-access-sdk.bb)4
-rw-r--r--images/enea-edge-runtime.bb7
-rw-r--r--images/enea-edge-vnf.bb15
-rw-r--r--images/enea-nfv-access-common.inc15
-rw-r--r--images/enea-nfv-access-debug.bb9
-rw-r--r--images/enea-nfv-access-host-common.inc69
-rw-r--r--images/enea-nfv-access-vnf.bb16
-rw-r--r--images/enea-nfv-access.bb7
13 files changed, 176 insertions, 121 deletions
diff --git a/images/core-image-minimal-initramfs.bbappend b/images/core-image-minimal-initramfs.bbappend
index 2ca1d47..88dd198 100644
--- a/images/core-image-minimal-initramfs.bbappend
+++ b/images/core-image-minimal-initramfs.bbappend
@@ -1,5 +1,21 @@
1PACKAGE_INSTALL += " nfv-installer kernel-modules" 1PACKAGE_INSTALL += " nfv-installer kernel-modules"
2 2
3# ostree-switchroot is used by the init script to switch root to the 3INITRAMFS_SCRIPTS = " \
4# ostree version specified in the kernel command line 4 initramfs-framework-base \
5PACKAGE_INSTALL_append_sota = " ostree-switchroot" 5 initramfs-module-udev \
6 initramfs-module-setup-live \
7"
8
9# run-postinsts does not belong in the minimal initramfs
10PACKAGE_INSTALL_remove = "run-postinsts"
11
12PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras"
13
14create_enea_symlink() {
15 # enea image used in bare metal installation
16 cd ${DEPLOY_DIR_IMAGE}
17 ln -sf ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio.gz enea-image-minimal-initramfs-${MACHINE}.cpio.gz
18 cd -
19}
20
21IMAGE_POSTPROCESS_COMMAND_append += " create_enea_symlink;"
diff --git a/images/enea-edge-common.inc b/images/enea-edge-common.inc
new file mode 100644
index 0000000..b174064
--- /dev/null
+++ b/images/enea-edge-common.inc
@@ -0,0 +1,40 @@
1require images/enea-image-common.inc
2
3IMAGE_FEATURES += "ssh-server-openssh"
4
5IMAGE_INSTALL += " \
6 packagegroup-enea-virtualization \
7 kernel-modules \
8 "
9
10# run-postinsts duplicates dpkg-configure if package_deb is used
11PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}"
12
13PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras"
14
15# After installing packages inside the rootfs, remove backup DPKG status file
16rootfs_postinstall_dpkg_cleanup () {
17 if ${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'true', 'false', d)}; then
18 rm -f ${IMAGE_ROOTFS}/var/lib/dpkg/status-old
19 fi
20}
21ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;"
22
23IMAGE_FSTYPES += "ext4 ext4.gz tar.gz"
24
25# Remove aktualizr packages from the image, we don't use it and creates odd dependencies, e.g.
26# it creates a systemd unit that depends on network-online.target, which leads to enabling
27# NetworkManager-wait-online.service, delaying boot up.
28SOTA_CLIENT_PROV = ""
29IMAGE_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.
36IMAGE_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
new file mode 100644
index 0000000..3df6cb9
--- /dev/null
+++ b/images/enea-edge-host-common.inc
@@ -0,0 +1,84 @@
1IMAGE_FSTYPES += "hddimg"
2IMAGE_FSTYPES_remove = "wic"
3
4REQUIRE_FILES = " \
5 images/enea-edge-common.inc \
6 "
7REQUIRE_FILES_append_df-efi-secure-boot = " \
8 classes/override_live-vm-common.inc \
9 images/secure-boot.inc \
10 "
11
12require ${REQUIRE_FILES}
13
14IMAGE_INSTALL += " \
15 packagegroup-enea-virtualization-host \
16 packagegroup-enea-virtualization-4gusb-modems \
17 "
18
19# Set labels for GRUB and SYSLINUX
20LABELS_LIVE = "installer live-boot"
21
22# Append default parameters for x86-64 targets
23APPEND_x86-64 = "quiet console=tty0 console=ttyS0,115200"
24SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200"
25
26# Skip menu and boot installer immediately
27GRUB_TIMEOUT_x86-64 = "0"
28AUTO_SYSLINUXMENU_x86-64 = "0"
29
30# If building with sota enabled, build the otaimg before the hddimg, because
31# the hddimg needs it as a base image
32python __anonymous() {
33 ## ENEA_start ##
34 if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d):
35 d.appendVarFlag("do_bootimg", "depends", " %s:do_image_ota_ext4" % d.getVar("IMAGE_BASENAME", True))
36 ## ENEA_end ##
37}
38
39# Append OSTree specific parameters to the kernel command line before creating the live image
40python do_bootimg_prepend () {
41 ## ENEA_start ##
42 if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d):
43 ostree_osname = d.getVar('OSTREE_OSNAME')
44 checksum = bb.utils.sha256_file(d.getVar('DEPLOY_DIR_IMAGE') + "/" + d.getVar('OSTREE_KERNEL'))
45
46 # The boot tree is identified through a sha256 checksum over the kernel binary
47 ostree_params = " ostree=/ostree/boot.1/" + ostree_osname + "/" + checksum + "/0"
48
49 d.setVar("APPEND", d.getVar("APPEND") + ostree_params)
50 ## ENEA_end ##
51}
52
53# Before building the OSTree image, move DPKG data to /usr/dpkg, because
54# OSTree does not preserve the contents of /var
55IMAGE_CMD_ostree_prepend () {
56 ## ENEA_start ##
57 # Note: We do configure DPKG admindir at build time, but we can't do the same for APT since
58 # yocto hardcodes /var/lib/dpkg paths in various places in OE-core, which we can't override,
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/
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
74IMAGE_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 ##
84}
diff --git a/images/enea-edge-runtime-debug.bb b/images/enea-edge-runtime-debug.bb
new file mode 100644
index 0000000..4736f24
--- /dev/null
+++ b/images/enea-edge-runtime-debug.bb
@@ -0,0 +1,9 @@
1DESCRIPTION = "Image for the host side of the Enea Edge Runtime with ODM and NETCONF Edgelink customizations"
2
3require images/enea-edge-host-common.inc
4
5IMAGE_INSTALL += " \
6 element-vcpe \
7 gdbserver \
8 oprofile \
9 "
diff --git a/images/enea-nfv-access-esdk.bb b/images/enea-edge-runtime-esdk.bb
index d424ef6..d424ef6 100644
--- a/images/enea-nfv-access-esdk.bb
+++ b/images/enea-edge-runtime-esdk.bb
diff --git a/images/enea-nfv-access-sdk.bb b/images/enea-edge-runtime-sdk.bb
index a957add..c6a15b4 100644
--- a/images/enea-nfv-access-sdk.bb
+++ b/images/enea-edge-runtime-sdk.bb
@@ -1,6 +1,6 @@
1DESCRIPTION = "Image for building the SDK for the host side of the Enea NFV Access Platform with ODM customizations" 1DESCRIPTION = "Image for building the SDK for the host side of the Enea Edge Runtime with ODM customizations"
2 2
3require images/enea-nfv-access-host-common.inc 3require images/enea-edge-host-common.inc
4 4
5IMAGE_INSTALL += " \ 5IMAGE_INSTALL += " \
6 element-odm-sdk \ 6 element-odm-sdk \
diff --git a/images/enea-edge-runtime.bb b/images/enea-edge-runtime.bb
new file mode 100644
index 0000000..5071619
--- /dev/null
+++ b/images/enea-edge-runtime.bb
@@ -0,0 +1,7 @@
1DESCRIPTION = "Image for the host side of the Enea Edge Runtime with ODM and NETCONF Edgelink customizations"
2
3require images/enea-edge-host-common.inc
4
5IMAGE_INSTALL += " \
6 element-vcpe \
7 "
diff --git a/images/enea-edge-vnf.bb b/images/enea-edge-vnf.bb
new file mode 100644
index 0000000..5d2365b
--- /dev/null
+++ b/images/enea-edge-vnf.bb
@@ -0,0 +1,15 @@
1DESCRIPTION = "VNF image of the Enea Edge Runtime, includes kernel, rootfs and boot parameters"
2
3require images/enea-edge-common.inc
4
5IMAGE_FSTYPES += "wic.qcow2"
6WKS_FILE = "enea-edge-vnf-qemux86-64.wks"
7
8CLOUDINITPKGS = "cloud-init util-linux-blkid"
9
10IMAGE_INSTALL += " \
11 packagegroup-enea-virtualization-guest \
12 nfv-init \
13 iperf3 \
14 ${CLOUDINITPKGS} \
15 "
diff --git a/images/enea-nfv-access-common.inc b/images/enea-nfv-access-common.inc
deleted file mode 100644
index 3f9fc84..0000000
--- a/images/enea-nfv-access-common.inc
+++ /dev/null
@@ -1,15 +0,0 @@
1require images/enea-image-common.inc
2
3IMAGE_FEATURES += "ssh-server-openssh"
4
5IMAGE_INSTALL += " \
6 packagegroup-enea-virtualization \
7 kernel-modules \
8 "
9
10IMAGE_FSTYPES = "ext4 ext4.gz tar.gz"
11
12# Add ostree specific image types if sota support is set
13IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'otaimg wic', ' ', d)}"
14SOTA_CLIENT = ""
15SOTA_CLIENT_PROV = ""
diff --git a/images/enea-nfv-access-debug.bb b/images/enea-nfv-access-debug.bb
deleted file mode 100644
index 63a2322..0000000
--- a/images/enea-nfv-access-debug.bb
+++ /dev/null
@@ -1,9 +0,0 @@
1DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM and NETCONF Edgelink customizations"
2
3require images/enea-nfv-access-host-common.inc
4
5IMAGE_INSTALL += " \
6 element-vcpe \
7 gdbserver \
8 oprofile \
9 "
diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc
deleted file mode 100644
index 1cde827..0000000
--- a/images/enea-nfv-access-host-common.inc
+++ /dev/null
@@ -1,69 +0,0 @@
1REQUIRE_FILES = " \
2 images/enea-nfv-access-common.inc \
3 classes/override_grub-efi.inc \
4 "
5REQUIRE_FILES_append_df-efi-secure-boot = " \
6 classes/override_image_types_ostree.inc \
7 classes/override_image_types_ota.inc \
8 classes/override_grub-efi_secureboot.inc \
9 images/secure-boot.inc \
10 "
11
12require ${REQUIRE_FILES}
13
14IMAGE_INSTALL += " \
15 packagegroup-enea-virtualization-host \
16 packagegroup-enea-virtualization-4gusb-modems \
17 "
18
19# Set labels for GRUB and SYSLINUX
20LABELS_LIVE = "installer live-boot"
21
22GRUB_GFXSERIAL_x86-64 = "1"
23# Append default parameters for x86-64 targets
24APPEND_x86-64 = "quiet"
25SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200"
26
27# Skip menu and boot installer immediately
28GRUB_TIMEOUT_x86-64 = "0"
29AUTO_SYSLINUXMENU_x86-64 = "0"
30
31# grub-efi-native is needed in recipe-sysroot-native to generate the initial
32# configuration file for grub
33DEPENDS_append += " grub-efi-native"
34
35# If building with sota enabled, build the otaimg before the hddimg, because
36# the hddimg needs it as a base image
37python __anonymous() {
38 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))
40}
41
42# Append OSTree specific parameters to the kernel command line before creating the live image
43python do_bootimg_prepend () {
44 if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d):
45 ostree_osname = d.getVar('OSTREE_OSNAME')
46 checksum = bb.utils.sha256_file(d.getVar('DEPLOY_DIR_IMAGE') + "/" + d.getVar('OSTREE_KERNEL'))
47
48 # The boot tree is identified through a sha256 checksum over the kernel binary
49 ostree_params = " ostree=/ostree/boot.1/" + ostree_osname + "/" + checksum + "/0"
50
51 d.setVar("APPEND", d.getVar("APPEND") + ostree_params)
52}
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
56python __anonymous () {
57 d.delVarFlag("do_image_otaimg", "depends")
58 d.setVarFlag("do_image_otaimg", "depends", "e2fsprogs-native:do_populate_sysroot")
59}
60
61# Before building the OSTree image, move DPKG data to /usr/dpkg, because
62# OSTree does not preserve the contents of /var
63IMAGE_CMD_ostree_prepend () {
64
65 install -d ${IMAGE_ROOTFS}/usr/dpkg/lib/dpkg
66 if [ "$(ls -A ${IMAGE_ROOTFS}/var/lib/dpkg)" ]; then
67 mv ${IMAGE_ROOTFS}/var/lib/dpkg/* ${IMAGE_ROOTFS}/usr/dpkg/lib/dpkg/
68 fi
69}
diff --git a/images/enea-nfv-access-vnf.bb b/images/enea-nfv-access-vnf.bb
deleted file mode 100644
index a3902c2..0000000
--- a/images/enea-nfv-access-vnf.bb
+++ /dev/null
@@ -1,16 +0,0 @@
1DESCRIPTION = "VNF image of the Enea NFV Access Platform, includes kernel, rootfs and boot parameters"
2
3require images/enea-nfv-access-common.inc
4
5IMAGE_FSTYPES += "wic.qcow2"
6WKS_FILE = "enea-nfv-access-vnf-qemux86-64.wks"
7
8CLOUDINITPKGS = "cloud-init util-linux-blkid"
9CLOUDINITPKGS += " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'cloud-init-systemd', '', d)}"
10
11IMAGE_INSTALL += " \
12 packagegroup-enea-virtualization-guest \
13 nfv-init \
14 iperf3 \
15 ${CLOUDINITPKGS} \
16 "
diff --git a/images/enea-nfv-access.bb b/images/enea-nfv-access.bb
deleted file mode 100644
index 9311992..0000000
--- a/images/enea-nfv-access.bb
+++ /dev/null
@@ -1,7 +0,0 @@
1DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM and NETCONF Edgelink customizations"
2
3require images/enea-nfv-access-host-common.inc
4
5IMAGE_INSTALL += " \
6 element-vcpe \
7 "