summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/override_grub-efi.inc89
-rw-r--r--classes/override_grub-efi_secureboot.inc31
-rw-r--r--classes/override_image_types_ostree.inc155
-rw-r--r--classes/override_image_types_ota.inc99
-rw-r--r--classes/override_live-vm-common.inc29
-rw-r--r--classes/sota_atom-c3000.bbclass4
-rw-r--r--classes/sota_xeon-d.bbclass4
-rw-r--r--conf/distro/eneanfvaccess.conf7
-rw-r--r--conf/layer.conf1
-rw-r--r--conf/template.atom-c3000-debug/local.conf.sample14
-rw-r--r--conf/template.atom-c3000/bblayers.conf.sample1
-rw-r--r--conf/template.atom-c3000/local.conf.sample14
-rw-r--r--conf/template.qemux86-64/bblayers.conf.sample2
-rw-r--r--conf/template.xeon-d-debug/local.conf.sample14
-rw-r--r--conf/template.xeon-d/bblayers.conf.sample1
-rw-r--r--conf/template.xeon-d/local.conf.sample14
-rw-r--r--files/group1
-rw-r--r--files/passwd1
-rw-r--r--images/core-image-minimal-initramfs.bbappend12
-rw-r--r--images/enea-edge-common.inc22
-rw-r--r--images/enea-edge-host-common.inc59
-rw-r--r--images/enea-edge-vnf.bb1
22 files changed, 123 insertions, 452 deletions
diff --git a/classes/override_grub-efi.inc b/classes/override_grub-efi.inc
deleted file mode 100644
index 15a7063..0000000
--- a/classes/override_grub-efi.inc
+++ /dev/null
@@ -1,89 +0,0 @@
1GRUB_GRAPHICS ?= "console=tty0"
2
3python build_efi_cfg() {
4 import sys
5
6 workdir = d.getVar('WORKDIR')
7 if not workdir:
8 bb.error("WORKDIR not defined, unable to package")
9 return
10
11 gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
12
13 labels = d.getVar('LABELS')
14 if not labels:
15 bb.debug(1, "LABELS not defined, nothing to do")
16 return
17
18 if labels == []:
19 bb.debug(1, "No labels, nothing to do")
20 return
21
22 cfile = d.getVar('GRUB_CFG')
23 if not cfile:
24 bb.fatal('Unable to read GRUB_CFG')
25
26 try:
27 cfgfile = open(cfile, 'w')
28 except OSError:
29 bb.fatal('Unable to open %s' % cfile)
30
31 cfgfile.write('# Automatically created by OE\n')
32
33 opts = d.getVar('GRUB_OPTS')
34 if opts:
35 for opt in opts.split(';'):
36 cfgfile.write('%s\n' % opt)
37
38 cfgfile.write('default=%s\n' % (labels.split()[0]))
39
40 timeout = d.getVar('GRUB_TIMEOUT')
41 if timeout:
42 cfgfile.write('timeout=%s\n' % timeout)
43 else:
44 cfgfile.write('timeout=50\n')
45
46 root = d.getVar('GRUB_ROOT')
47 if not root:
48 bb.fatal('GRUB_ROOT not defined')
49
50 if gfxserial == "1":
51 btypes = [ [ " serial console", d.getVar('GRUB_SERIAL') or "" ],
52 [ " graphics console", d.getVar('GRUB_GRAPHICS') or "" ] ]
53 else:
54 btypes = [ [ "", "" ] ]
55
56 for label in labels.split():
57 localdata = d.createCopy()
58
59 overrides = localdata.getVar('OVERRIDES')
60 if not overrides:
61 bb.fatal('OVERRIDES not defined')
62
63 for btype in btypes:
64 localdata.setVar('OVERRIDES', label + ':' + overrides)
65
66 cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
67 lb = label
68 if label == "install":
69 lb = "install-efi"
70 cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
71
72 cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
73
74 append = localdata.getVar('APPEND')
75 initrd = localdata.getVar('INITRD')
76
77 if append:
78 append = replace_rootfs_uuid(d, append)
79 cfgfile.write(' %s' % (append))
80
81 cfgfile.write(' %s' % btype[1])
82 cfgfile.write('\n')
83
84 if initrd:
85 cfgfile.write('initrd /initrd')
86 cfgfile.write('\n}\n')
87
88 cfgfile.close()
89}
diff --git a/classes/override_grub-efi_secureboot.inc b/classes/override_grub-efi_secureboot.inc
deleted file mode 100644
index b944ec8..0000000
--- a/classes/override_grub-efi_secureboot.inc
+++ /dev/null
@@ -1,31 +0,0 @@
1efi_populate() {
2 # DEST must be the root of the image so that EFIDIR is not
3 # nested under a top level directory.
4 DEST=$1
5
6 install -d ${DEST}${EFIDIR}
7
8 GRUB_IMAGE="grub-efi-bootia32.efi"
9 DEST_IMAGE="bootia32.efi"
10 if [ "${TARGET_ARCH}" = "x86_64" ]; then
11 GRUB_IMAGE="grub-efi-bootx64.efi"
12 DEST_IMAGE="bootx64.efi"
13 fi
14
15 #Install EFI binaries
16 install -m 0644 ${IMAGE_ROOTFS}/boot/efi${EFIDIR}/*.* ${DEST}${EFIDIR}
17
18 #Install kernel and initramfs sig
19 install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}.p7b ${DEST}/vmlinuz.p7b
20 install -m 0644 ${INITRD_LIVE}.p7b ${DEST}/initrd.p7b
21
22 EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
23 printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh
24
25 install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg
26
27 #Install UEFI keys
28 install -d ${DEST}/uefi_sb_keys
29 install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.crt ${DEST}/uefi_sb_keys/
30 install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.esl ${DEST}/uefi_sb_keys/
31}
diff --git a/classes/override_image_types_ostree.inc b/classes/override_image_types_ostree.inc
deleted file mode 100644
index 011e27e..0000000
--- a/classes/override_image_types_ostree.inc
+++ /dev/null
@@ -1,155 +0,0 @@
1# overrides meta-updater/classes/image_types_ostree.bbclass
2# - add do_image_ostree flags:
3# - dirs, cleandirs: to avoid mktemp, rm, cd, and to also remove at clean
4# - subimages, imgsuffix: to use automatic link creation
5# - override of IMAGE_CMD_ostree
6# - use the added flags
7# - IMGDEPLOYDIR, instead of DEPLOY_DIR_IMAGE
8
9OSTREE_ROOTFS="${WORKDIR}/ostree-root"
10do_image_ostree[dirs] = "${OSTREE_ROOTFS}"
11do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}"
12do_image_ostree[subimages] = "rootfs.ostree.tar.bz2"
13do_image_ostree[imgsuffix] = "."
14export OSTREE_ROOTFS
15
16IMAGE_CMD_ostree () {
17 if [ -z "$OSTREE_REPO" ]; then
18 bbfatal "OSTREE_REPO should be set in your local.conf"
19 fi
20
21 if [ -z "$OSTREE_BRANCHNAME" ]; then
22 bbfatal "OSTREE_BRANCHNAME should be set in your local.conf"
23 fi
24
25 cp -a ${IMAGE_ROOTFS}/* ${OSTREE_ROOTFS}
26 chmod a+rx ${OSTREE_ROOTFS}
27 sync
28
29 for d in var/*; do
30 if [ "${d}" != "var/local" ]; then
31 rm -rf ${d}
32 fi
33 done
34
35 # Create sysroot directory to which physical sysroot will be mounted
36 mkdir sysroot
37 ln -sf sysroot/ostree ostree
38
39 rm -rf tmp/*
40 ln -sf sysroot/tmp tmp
41
42 mkdir -p usr/rootdirs
43
44 mv etc usr/
45 # Implement UsrMove
46 dirs="bin sbin lib"
47
48 for dir in ${dirs} ; do
49 if [ -d ${dir} ] && [ ! -L ${dir} ] ; then
50 mv ${dir} usr/rootdirs/
51 rm -rf ${dir}
52 ln -sf usr/rootdirs/${dir} ${dir}
53 fi
54 done
55
56 if [ -n "$SYSTEMD_USED" ]; then
57 mkdir -p usr/etc/tmpfiles.d
58 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
59 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
60 echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf}
61 else
62 mkdir -p usr/etc/init.d
63 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh
64 echo '#!/bin/sh' > ${tmpfiles_conf}
65 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf}
66 echo "ln -sf /sysroot/home /var/rootdirs/home" >> ${tmpfiles_conf}
67
68 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh
69 fi
70
71 # Preserve OSTREE_BRANCHNAME for future information
72 mkdir -p usr/share/sota/
73 echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname
74
75 # Preserve data in /home to be later copied to /sysroot/home by sysroot
76 # generating procedure
77 mkdir -p usr/homedirs
78 if [ -d "home" ] && [ ! -L "home" ]; then
79 mv home usr/homedirs/home
80 ln -sf var/rootdirs/home home
81 fi
82
83 # Move persistent directories to /var
84 dirs="opt mnt media srv"
85
86 for dir in ${dirs}; do
87 if [ -d ${dir} ] && [ ! -L ${dir} ]; then
88 if [ "$(ls -A $dir)" ]; then
89 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr"
90 fi
91
92 if [ -n "$SYSTEMD_USED" ]; then
93 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
94 else
95 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
96 fi
97 rm -rf ${dir}
98 ln -sf var/rootdirs/${dir} ${dir}
99 fi
100 done
101
102 if [ -d root ] && [ ! -L root ]; then
103 if [ "$(ls -A root)" ]; then
104 bberror "Data in /root directory is not preserved by OSTree."
105 exit 1
106 fi
107
108 if [ -n "$SYSTEMD_USED" ]; then
109 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf}
110 else
111 echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf}
112 fi
113
114 rm -rf root
115 ln -sf var/roothome root
116 fi
117
118 if [ -n "${SOTA_SECONDARY_ECUS}" ]; then
119 mkdir -p var/sota/ecus
120 cp ${SOTA_SECONDARY_ECUS} var/sota/ecus
121 fi
122
123 # Creating boot directories is required for "ostree admin deploy"
124
125 mkdir -p boot/loader.0
126 mkdir -p boot/loader.1
127 ln -sf loader.0 boot/loader
128
129 checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "`
130
131 # Copy kernel and initramfs and their signature files
132 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum}
133 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL}.p7b boot/vmlinuz-${checksum}.p7b
134 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_INITRAMFS_IMAGE}-${MACHINE}${RAMDISK_EXT} boot/initramfs-${checksum}
135 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_INITRAMFS_IMAGE}-${MACHINE}${RAMDISK_EXT}.p7b boot/initramfs-${checksum}.p7b
136
137 # Copy image manifest
138 cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest
139
140 # Create a tarball that can be then commited to OSTree repo
141 OSTREE_TAR=${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ostree.tar.bz2
142 tar -C ${OSTREE_ROOTFS} --xattrs --xattrs-include='*' -cjf ${OSTREE_TAR} .
143 sync
144
145 if ! ostree --repo=${OSTREE_REPO} refs 2>&1 > /dev/null; then
146 ostree --repo=${OSTREE_REPO} init --mode=archive-z2
147 fi
148
149 # Commit the result
150 ostree --repo=${OSTREE_REPO} commit \
151 --tree=dir=${OSTREE_ROOTFS} \
152 --skip-if-unchanged \
153 --branch=${OSTREE_BRANCHNAME} \
154 --subject="Commit-id: ${IMAGE_NAME}"
155}
diff --git a/classes/override_image_types_ota.inc b/classes/override_image_types_ota.inc
deleted file mode 100644
index da920c1..0000000
--- a/classes/override_image_types_ota.inc
+++ /dev/null
@@ -1,99 +0,0 @@
1# overrides meta-updater/classes/image_types_ota.bbclass
2# - add do_image_otaimg flags:
3# - dirs, cleandirs: to avoid mktemp, rm, cd, and to also remove at clean
4# - override of IMAGE_CMD_otaimg
5# - use the added flags
6# - avoid untar-ing the ostree image, and use OSTREE_ROOTFS
7# - IMGDEPLOYDIR, instead of DEPLOY_DIR_IMAGE
8
9OSTREE_REPO = "${WORKDIR}/ostree-repo"
10PHYS_SYSROOT = "${WORKDIR}/ota-sysroot"
11
12do_image_otaimg[dirs] = "${PHYS_SYSROOT}"
13do_image_otaimg[cleandirs] = "${PHYS_SYSROOT}"
14
15IMAGE_CMD_otaimg () {
16 if ${@bb.utils.contains('IMAGE_FSTYPES', 'otaimg', 'true', 'false', d)}; then
17 if [ -z "$OSTREE_REPO" ]; then
18 bbfatal "OSTREE_REPO should be set in your local.conf"
19 fi
20
21 if [ -z "$OSTREE_OSNAME" ]; then
22 bbfatal "OSTREE_OSNAME should be set in your local.conf"
23 fi
24
25 if [ -z "$OSTREE_BRANCHNAME" ]; then
26 bbfatal "OSTREE_BRANCHNAME should be set in your local.conf"
27 fi
28
29 ostree admin --sysroot=${PHYS_SYSROOT} init-fs ${PHYS_SYSROOT}
30 ostree admin --sysroot=${PHYS_SYSROOT} os-init ${OSTREE_OSNAME}
31
32 mkdir -p ${PHYS_SYSROOT}/boot/loader.0
33 ln -s loader.0 ${PHYS_SYSROOT}/boot/loader
34
35 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then
36 ln -s loader ${PHYS_SYSROOT}/boot/grub
37 ln -s loader ${PHYS_SYSROOT}/boot/grub2
38 touch ${PHYS_SYSROOT}/boot/grub/grub.cfg
39 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then
40 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt
41 else
42 bberror "Invalid bootloader: ${OSTREE_BOOTLOADER}"
43 fi;
44
45 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
46
47 ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
48 export OSTREE_BOOT_PARTITION="/boot"
49 kargs_list=""
50 for arg in ${OSTREE_KERNEL_ARGS}; do
51 kargs_list="${kargs_list} --karg-append=$arg"
52 done
53
54 ostree admin --sysroot=${PHYS_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${ostree_target_hash}
55
56 cp -a ${IMAGE_ROOTFS}/var/sota ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
57 # Create /var/sota if it doesn't exist yet
58 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota
59 # Ensure the permissions are correctly set
60 chmod 700 ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota
61
62 cp -a ${OSTREE_ROOTFS}/var/local ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
63 cp -a ${OSTREE_ROOTFS}/usr/homedirs/home ${PHYS_SYSROOT}/ || true
64 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
65 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
66 # Set package version for the first deployment
67 target_version=${ostree_target_hash}
68 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
69 target_version=${GARAGE_TARGET_VERSION}
70 elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then
71 target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version")
72 fi
73 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import
74 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import/installed_versions
75
76 # Calculate image type
77 OTA_ROOTFS_SIZE=$(calculate_size `du -ks ${PHYS_SYSROOT} | cut -f 1` "${IMAGE_OVERHEAD_FACTOR}" "${IMAGE_ROOTFS_SIZE}" "${IMAGE_ROOTFS_MAXSIZE}" `expr ${IMAGE_ROOTFS_EXTRA_SPACE}` "${IMAGE_ROOTFS_ALIGNMENT}")
78
79 if [ $OTA_ROOTFS_SIZE -lt 0 ]; then
80 exit -1
81 fi
82 eval local COUNT=\"0\"
83 eval local MIN_COUNT=\"60\"
84 if [ $OTA_ROOTFS_SIZE -lt $MIN_COUNT ]; then
85 eval COUNT=\"$MIN_COUNT\"
86 fi
87
88 # create image
89 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg seek=${OTA_ROOTFS_SIZE} count=${COUNT} bs=1024
90 mkfs.ext4 -O ^64bit ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg -L otaroot -d ${PHYS_SYSROOT}
91 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg
92 ln -s ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg
93 # for forward compatibility
94 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ota-ext4
95 ln -s ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ota-ext4
96 fi
97}
98
99IMAGE_TYPEDEP_otaimg = "ostree"
diff --git a/classes/override_live-vm-common.inc b/classes/override_live-vm-common.inc
new file mode 100644
index 0000000..3ac92b9
--- /dev/null
+++ b/classes/override_live-vm-common.inc
@@ -0,0 +1,29 @@
1# efi_populate_common DEST BOOTLOADER
2efi_populate_common() {
3 # DEST must be the root of the image so that EFIDIR is not
4 # nested under a top level directory.
5 DEST=$1
6
7 install -d ${DEST}${EFIDIR}
8
9 ## ENEA_start ##
10 # install -m 0644 ${DEPLOY_DIR_IMAGE}/$2-${EFI_BOOT_IMAGE} ${DEST}${EFIDIR}/${EFI_BOOT_IMAGE}
11 ## ENEA_end ##
12
13 EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
14 printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${DEST}/startup.nsh
15
16 ## ENEA_start ##
17 # Install EFI binaries
18 install -m 0644 ${DEPLOY_DIR_IMAGE}/${SBFOLDER}/*.efi ${DEST}${EFIDIR}
19
20 # Install kernel and initramfs sig
21 install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${SB_FILE_EXT} ${DEST}/${KERNEL_IMAGETYPE}${SB_FILE_EXT}
22 install -m 0644 ${INITRD_LIVE}${SB_FILE_EXT} ${DEST}/initrd${SB_FILE_EXT}
23
24 # Install UEFI keys
25 install -d ${DEST}/uefi_sb_keys
26 install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.crt ${DEST}/uefi_sb_keys/
27 install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.esl ${DEST}/uefi_sb_keys/
28 ## ENEA_end ##
29}
diff --git a/classes/sota_atom-c3000.bbclass b/classes/sota_atom-c3000.bbclass
index dff4294..a6bc65f 100644
--- a/classes/sota_atom-c3000.bbclass
+++ b/classes/sota_atom-c3000.bbclass
@@ -4,10 +4,10 @@ PREFERRED_PROVIDER_virtual/bootloader_sota = "grub-efi"
4 4
5WKS_FILE_sota = "efiimage-sota.wks" 5WKS_FILE_sota = "efiimage-sota.wks"
6 6
7OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" 7OSTREE_INITRAMFS_FSTYPES ?= "cpio.gz"
8 8
9# Set .otaimg to be used as source for generating hddimg 9# Set .otaimg to be used as source for generating hddimg
10ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.otaimg" 10ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ota-ext4"
11 11
12# OSTree initrd needs 'ramdisk_size' and 'rw' parameters in order to boot 12# OSTree initrd needs 'ramdisk_size' and 'rw' parameters in order to boot
13OSTREE_KERNEL_ARGS ?= "rw" 13OSTREE_KERNEL_ARGS ?= "rw"
diff --git a/classes/sota_xeon-d.bbclass b/classes/sota_xeon-d.bbclass
index dff4294..a6bc65f 100644
--- a/classes/sota_xeon-d.bbclass
+++ b/classes/sota_xeon-d.bbclass
@@ -4,10 +4,10 @@ PREFERRED_PROVIDER_virtual/bootloader_sota = "grub-efi"
4 4
5WKS_FILE_sota = "efiimage-sota.wks" 5WKS_FILE_sota = "efiimage-sota.wks"
6 6
7OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" 7OSTREE_INITRAMFS_FSTYPES ?= "cpio.gz"
8 8
9# Set .otaimg to be used as source for generating hddimg 9# Set .otaimg to be used as source for generating hddimg
10ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.otaimg" 10ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ota-ext4"
11 11
12# OSTree initrd needs 'ramdisk_size' and 'rw' parameters in order to boot 12# OSTree initrd needs 'ramdisk_size' and 'rw' parameters in order to boot
13OSTREE_KERNEL_ARGS ?= "rw" 13OSTREE_KERNEL_ARGS ?= "rw"
diff --git a/conf/distro/eneanfvaccess.conf b/conf/distro/eneanfvaccess.conf
index ed7383e..070bbb8 100644
--- a/conf/distro/eneanfvaccess.conf
+++ b/conf/distro/eneanfvaccess.conf
@@ -7,14 +7,19 @@ DISTRO_VERSION = "${DISTRO_VERSION_MAJOR}${DISTRO_VERSION_MINOR}"
7 7
8SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" 8SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
9 9
10# OSTree integration
11require ${@bb.utils.contains('SOTA_MACHINE', '${MACHINE}', 'conf/distro/sota.conf.inc', '', d)}
12
10INHERIT += "distrooverrides" 13INHERIT += "distrooverrides"
11DISTRO_FEATURES_append = " odm efi-secure-boot" 14DISTRO_FEATURES_append = " odm efi-secure-boot usrmerge"
12DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot" 15DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot"
13 16
14PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native" 17PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
15PREFERRED_PROVIDER_virtual/java-native = "jamvm-native" 18PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
16PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native" 19PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
17 20
21# Override ESP mount path set by meta/conf/image-uefi.conf to align with meta-secure-core paths
22EFI_PREFIX_df-efi-secure-boot = "/boot/efi"
18SBFOLDER = "bootloader" 23SBFOLDER = "bootloader"
19 24
20HOSTTOOLS_append = " scp" 25HOSTTOOLS_append = " scp"
diff --git a/conf/layer.conf b/conf/layer.conf
index 7fec7c8..db496a4 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -11,3 +11,4 @@ BBFILE_COLLECTIONS += "el-nfv-access"
11BBFILE_PATTERN_el-nfv-access = "^${LAYERDIR}/" 11BBFILE_PATTERN_el-nfv-access = "^${LAYERDIR}/"
12BBFILE_PRIORITY_el-nfv-access = "7" 12BBFILE_PRIORITY_el-nfv-access = "7"
13LAYERDEPENDS_el-nfv-access = "nfv-access-common enea-virtualization" 13LAYERDEPENDS_el-nfv-access = "nfv-access-common enea-virtualization"
14LAYERSERIES_COMPAT_el-nfv-access = "hardknott"
diff --git a/conf/template.atom-c3000-debug/local.conf.sample b/conf/template.atom-c3000-debug/local.conf.sample
index 60e8955..b5e3f8c 100644
--- a/conf/template.atom-c3000-debug/local.conf.sample
+++ b/conf/template.atom-c3000-debug/local.conf.sample
@@ -155,6 +155,7 @@ EXTRA_IMAGE_FEATURES = " \
155# - 'image-swab' to perform host system intrusion detection 155# - 'image-swab' to perform host system intrusion detection
156# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink 156# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
157# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended 157# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
158# NOTE: image-prelink is removed by sota.conf.inc
158USER_CLASSES ?= "buildstats image-mklibs image-prelink" 159USER_CLASSES ?= "buildstats image-mklibs image-prelink"
159 160
160# 161#
@@ -241,16 +242,6 @@ CONF_VERSION = "1"
241 242
242SKIP_META_VIRT_SANITY_CHECK = "1" 243SKIP_META_VIRT_SANITY_CHECK = "1"
243 244
244#
245# OSTree integration
246#
247
248SOTA_MACHINE ?= "${MACHINE}"
249
250DISTRO_FEATURES_append = " sota"
251DISTRO_FEATURES_NATIVE_append = " sota"
252INHERIT += " sota"
253
254# Various packages dynamically add users and groups to the system at package 245# Various packages dynamically add users and groups to the system at package
255# install time. For programs that do not care what the uid/gid is of the 246# install time. For programs that do not care what the uid/gid is of the
256# resulting users/groups, the order of the install will determine the final 247# resulting users/groups, the order of the install will determine the final
@@ -276,3 +267,6 @@ USERADD_GID_TABLES = "files/group"
276# Unfortunately, setting the variable below breaks the build, so do not set it 267# Unfortunately, setting the variable below breaks the build, so do not set it
277# for now 268# for now
278# USERADD_ERROR_DYNAMIC = "1" 269# USERADD_ERROR_DYNAMIC = "1"
270
271# to be removed together with python2 layer
272I_SWEAR_TO_MIGRATE_TO_PYTHON3 = "yes"
diff --git a/conf/template.atom-c3000/bblayers.conf.sample b/conf/template.atom-c3000/bblayers.conf.sample
index 71c77cc..f5d25ce 100644
--- a/conf/template.atom-c3000/bblayers.conf.sample
+++ b/conf/template.atom-c3000/bblayers.conf.sample
@@ -28,4 +28,5 @@ BBLAYERS ?= " \
28 ##OEROOT##/meta-secure-core/meta-signing-key \ 28 ##OEROOT##/meta-secure-core/meta-signing-key \
29 ##OEROOT##/meta-secure-core/meta-efi-secure-boot \ 29 ##OEROOT##/meta-secure-core/meta-efi-secure-boot \
30 ##OEROOT##/meta-enea-user-keys \ 30 ##OEROOT##/meta-enea-user-keys \
31 ##OEROOT##/meta-python2 \
31 " 32 "
diff --git a/conf/template.atom-c3000/local.conf.sample b/conf/template.atom-c3000/local.conf.sample
index b015f43..558e110 100644
--- a/conf/template.atom-c3000/local.conf.sample
+++ b/conf/template.atom-c3000/local.conf.sample
@@ -152,6 +152,7 @@ EXTRA_IMAGE_FEATURES = "debug-tweaks"
152# - 'image-swab' to perform host system intrusion detection 152# - 'image-swab' to perform host system intrusion detection
153# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink 153# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
154# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended 154# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
155# NOTE: image-prelink is removed by sota.conf.inc
155USER_CLASSES ?= "buildstats image-mklibs image-prelink" 156USER_CLASSES ?= "buildstats image-mklibs image-prelink"
156 157
157# 158#
@@ -238,16 +239,6 @@ CONF_VERSION = "1"
238 239
239SKIP_META_VIRT_SANITY_CHECK = "1" 240SKIP_META_VIRT_SANITY_CHECK = "1"
240 241
241#
242# OSTree integration
243#
244
245SOTA_MACHINE ?= "${MACHINE}"
246
247DISTRO_FEATURES_append = " sota"
248DISTRO_FEATURES_NATIVE_append = " sota"
249INHERIT += " sota"
250
251# Various packages dynamically add users and groups to the system at package 242# Various packages dynamically add users and groups to the system at package
252# install time. For programs that do not care what the uid/gid is of the 243# install time. For programs that do not care what the uid/gid is of the
253# resulting users/groups, the order of the install will determine the final 244# resulting users/groups, the order of the install will determine the final
@@ -273,3 +264,6 @@ USERADD_GID_TABLES = "files/group"
273# Unfortunately, setting the variable below breaks the build, so do not set it 264# Unfortunately, setting the variable below breaks the build, so do not set it
274# for now 265# for now
275# USERADD_ERROR_DYNAMIC = "1" 266# USERADD_ERROR_DYNAMIC = "1"
267
268# to be removed together with python2 layer
269I_SWEAR_TO_MIGRATE_TO_PYTHON3 = "yes"
diff --git a/conf/template.qemux86-64/bblayers.conf.sample b/conf/template.qemux86-64/bblayers.conf.sample
index ea5510a..214386c 100644
--- a/conf/template.qemux86-64/bblayers.conf.sample
+++ b/conf/template.qemux86-64/bblayers.conf.sample
@@ -21,6 +21,4 @@ BBLAYERS ?= " \
21 ##OEROOT##/meta-openembedded/meta-filesystems \ 21 ##OEROOT##/meta-openembedded/meta-filesystems \
22 ##OEROOT##/meta-openembedded/meta-python \ 22 ##OEROOT##/meta-openembedded/meta-python \
23 ##OEROOT##/meta-openembedded/meta-webserver \ 23 ##OEROOT##/meta-openembedded/meta-webserver \
24 ##OEROOT##/meta-cloud-services \
25 ##OEROOT##/meta-cloud-services/meta-openstack \
26 " 24 "
diff --git a/conf/template.xeon-d-debug/local.conf.sample b/conf/template.xeon-d-debug/local.conf.sample
index 6474a37..e80ee61 100644
--- a/conf/template.xeon-d-debug/local.conf.sample
+++ b/conf/template.xeon-d-debug/local.conf.sample
@@ -156,6 +156,7 @@ EXTRA_IMAGE_FEATURES = " \
156# - 'image-swab' to perform host system intrusion detection 156# - 'image-swab' to perform host system intrusion detection
157# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink 157# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
158# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended 158# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
159# NOTE: image-prelink is removed by sota.conf.inc
159USER_CLASSES ?= "buildstats image-mklibs image-prelink" 160USER_CLASSES ?= "buildstats image-mklibs image-prelink"
160 161
161# 162#
@@ -242,16 +243,6 @@ CONF_VERSION = "1"
242 243
243SKIP_META_VIRT_SANITY_CHECK = "1" 244SKIP_META_VIRT_SANITY_CHECK = "1"
244 245
245#
246# OSTree integration
247#
248
249SOTA_MACHINE ?= "${MACHINE}"
250
251DISTRO_FEATURES_append = " sota"
252DISTRO_FEATURES_NATIVE_append = " sota"
253INHERIT += " sota"
254
255# Various packages dynamically add users and groups to the system at package 246# Various packages dynamically add users and groups to the system at package
256# install time. For programs that do not care what the uid/gid is of the 247# install time. For programs that do not care what the uid/gid is of the
257# resulting users/groups, the order of the install will determine the final 248# resulting users/groups, the order of the install will determine the final
@@ -277,3 +268,6 @@ USERADD_GID_TABLES = "files/group"
277# Unfortunately, setting the variable below breaks the build, so do not set it 268# Unfortunately, setting the variable below breaks the build, so do not set it
278# for now 269# for now
279# USERADD_ERROR_DYNAMIC = "1" 270# USERADD_ERROR_DYNAMIC = "1"
271
272# to be removed together with python2 layer
273I_SWEAR_TO_MIGRATE_TO_PYTHON3 = "yes"
diff --git a/conf/template.xeon-d/bblayers.conf.sample b/conf/template.xeon-d/bblayers.conf.sample
index 71c77cc..f5d25ce 100644
--- a/conf/template.xeon-d/bblayers.conf.sample
+++ b/conf/template.xeon-d/bblayers.conf.sample
@@ -28,4 +28,5 @@ BBLAYERS ?= " \
28 ##OEROOT##/meta-secure-core/meta-signing-key \ 28 ##OEROOT##/meta-secure-core/meta-signing-key \
29 ##OEROOT##/meta-secure-core/meta-efi-secure-boot \ 29 ##OEROOT##/meta-secure-core/meta-efi-secure-boot \
30 ##OEROOT##/meta-enea-user-keys \ 30 ##OEROOT##/meta-enea-user-keys \
31 ##OEROOT##/meta-python2 \
31 " 32 "
diff --git a/conf/template.xeon-d/local.conf.sample b/conf/template.xeon-d/local.conf.sample
index 5cfebf5..2b10f27 100644
--- a/conf/template.xeon-d/local.conf.sample
+++ b/conf/template.xeon-d/local.conf.sample
@@ -153,6 +153,7 @@ EXTRA_IMAGE_FEATURES = "debug-tweaks"
153# - 'image-swab' to perform host system intrusion detection 153# - 'image-swab' to perform host system intrusion detection
154# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink 154# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
155# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended 155# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
156# NOTE: image-prelink is removed by sota.conf.inc
156USER_CLASSES ?= "buildstats image-mklibs image-prelink" 157USER_CLASSES ?= "buildstats image-mklibs image-prelink"
157 158
158# 159#
@@ -239,16 +240,6 @@ CONF_VERSION = "1"
239 240
240SKIP_META_VIRT_SANITY_CHECK = "1" 241SKIP_META_VIRT_SANITY_CHECK = "1"
241 242
242#
243# OSTree integration
244#
245
246SOTA_MACHINE ?= "${MACHINE}"
247
248DISTRO_FEATURES_append = " sota"
249DISTRO_FEATURES_NATIVE_append = " sota"
250INHERIT += " sota"
251
252# Various packages dynamically add users and groups to the system at package 243# Various packages dynamically add users and groups to the system at package
253# install time. For programs that do not care what the uid/gid is of the 244# install time. For programs that do not care what the uid/gid is of the
254# resulting users/groups, the order of the install will determine the final 245# resulting users/groups, the order of the install will determine the final
@@ -274,3 +265,6 @@ USERADD_GID_TABLES = "files/group"
274# Unfortunately, setting the variable below breaks the build, so do not set it 265# Unfortunately, setting the variable below breaks the build, so do not set it
275# for now 266# for now
276# USERADD_ERROR_DYNAMIC = "1" 267# USERADD_ERROR_DYNAMIC = "1"
268
269# to be removed together with python2 layer
270I_SWEAR_TO_MIGRATE_TO_PYTHON3 = "yes"
diff --git a/files/group b/files/group
index 99cb628..cc37138 100644
--- a/files/group
+++ b/files/group
@@ -38,6 +38,7 @@ staff:x:50:
38games:x:60: 38games:x:60:
39shutdown:x:70: 39shutdown:x:70:
40users:x:100: 40users:x:100:
41dhcpcd:x:984:
41systemd-bus-proxy:x:985: 42systemd-bus-proxy:x:985:
42systemd-resolve:x:986: 43systemd-resolve:x:986:
43systemd-network:x:987: 44systemd-network:x:987:
diff --git a/files/passwd b/files/passwd
index 2c21e09..5a26de4 100644
--- a/files/passwd
+++ b/files/passwd
@@ -15,6 +15,7 @@ backup:x:34:34:backup:/var/backups:/bin/sh
15list:x:38:38:Mailing List Manager:/var/list:/bin/sh 15list:x:38:38:Mailing List Manager:/var/list:/bin/sh
16irc:x:39:39:ircd:/var/run/ircd:/bin/sh 16irc:x:39:39:ircd:/var/run/ircd:/bin/sh
17gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh 17gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
18dhcpcd:x:988:984::/var/lib/dhcpcd:/bin/false
18systemd-bus-proxy:x:989:985::/:/bin/nologin 19systemd-bus-proxy:x:989:985::/:/bin/nologin
19systemd-resolve:x:990:986::/:/bin/nologin 20systemd-resolve:x:990:986::/:/bin/nologin
20systemd-network:x:991:987::/:/bin/nologin 21systemd-network:x:991:987::/:/bin/nologin
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 @@
1PACKAGE_INSTALL += " nfv-installer kernel-modules ixgbe" 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"
6 8
7# run-postinsts does not belong in the minimal initramfs 9# run-postinsts does not belong in the minimal initramfs
8PACKAGE_INSTALL_remove = "run-postinsts" 10PACKAGE_INSTALL_remove = "run-postinsts"
9 11
12PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras"
13
10create_enea_symlink() { 14create_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
11PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}" 11PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}"
12 12
13PACKAGE_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
14rootfs_postinstall_dpkg_cleanup () { 16rootfs_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}
19ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;" 21ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;"
20 22
21IMAGE_FSTYPES = "ext4 ext4.gz tar.gz" 23IMAGE_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.
24IMAGE_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
25SOTA_CLIENT = "" 27# NetworkManager-wait-online.service, delaying boot up.
26SOTA_CLIENT_PROV = "" 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
index 6d446a0..3df6cb9 100644
--- a/images/enea-edge-host-common.inc
+++ b/images/enea-edge-host-common.inc
@@ -1,11 +1,11 @@
1IMAGE_FSTYPES += "hddimg"
2IMAGE_FSTYPES_remove = "wic"
3
1REQUIRE_FILES = " \ 4REQUIRE_FILES = " \
2 images/enea-edge-common.inc \ 5 images/enea-edge-common.inc \
3 classes/override_grub-efi.inc \
4 " 6 "
5REQUIRE_FILES_append_df-efi-secure-boot = " \ 7REQUIRE_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
20LABELS_LIVE = "installer live-boot" 20LABELS_LIVE = "installer live-boot"
21 21
22GRUB_GFXSERIAL_x86-64 = "1"
23# Append default parameters for x86-64 targets 22# Append default parameters for x86-64 targets
24APPEND_x86-64 = "quiet" 23APPEND_x86-64 = "quiet console=tty0 console=ttyS0,115200"
25SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" 24SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200"
26 25
27# Skip menu and boot installer immediately 26# Skip menu and boot installer immediately
28GRUB_TIMEOUT_x86-64 = "0" 27GRUB_TIMEOUT_x86-64 = "0"
29AUTO_SYSLINUXMENU_x86-64 = "0" 28AUTO_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
33DEPENDS_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
37python __anonymous() { 32python __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
43python do_bootimg_prepend () { 40python 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
56python __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
63IMAGE_CMD_ostree_prepend () { 55IMAGE_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
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 ##
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"
6WKS_FILE = "enea-edge-vnf-qemux86-64.wks" 6WKS_FILE = "enea-edge-vnf-qemux86-64.wks"
7 7
8CLOUDINITPKGS = "cloud-init util-linux-blkid" 8CLOUDINITPKGS = "cloud-init util-linux-blkid"
9CLOUDINITPKGS += " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'cloud-init-systemd', '', d)}"
10 9
11IMAGE_INSTALL += " \ 10IMAGE_INSTALL += " \
12 packagegroup-enea-virtualization-guest \ 11 packagegroup-enea-virtualization-guest \