summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitreview5
-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.inc98
-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.conf19
-rw-r--r--conf/layer.conf1
-rw-r--r--conf/template.atom-c3000-debug/conf-notes.txt2
-rw-r--r--conf/template.atom-c3000-debug/local.conf.sample36
-rw-r--r--conf/template.atom-c3000/conf-notes.txt2
-rw-r--r--conf/template.atom-c3000/local.conf.sample36
-rw-r--r--conf/template.qemux86-64-esdk/conf-notes.txt2
-rw-r--r--conf/template.qemux86-64/bblayers.conf.sample2
-rw-r--r--conf/template.qemux86-64/conf-notes.txt2
-rw-r--r--conf/template.xeon-d-debug/conf-notes.txt2
-rw-r--r--conf/template.xeon-d-debug/local.conf.sample36
-rw-r--r--conf/template.xeon-d/conf-notes.txt2
-rw-r--r--conf/template.xeon-d/local.conf.sample36
-rw-r--r--files/group52
-rw-r--r--files/passwd25
-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
-rw-r--r--recipes-core/systemd/files/basic.conf.in50
-rw-r--r--recipes-core/systemd/systemd_247.6.bbappend25
-rw-r--r--scripts/lib/wic/canned-wks/enea-edge-vnf-qemux86-64.wks (renamed from scripts/lib/wic/canned-wks/enea-nfv-access-vnf-qemux86-64.wks)0
39 files changed, 496 insertions, 546 deletions
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..39fc438
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
1[gerrit]
2host=gerrit.enea.se
3port=29418
4project=linux/meta-el-nfv-access.git
5track=1
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 ded70dd..0000000
--- a/classes/override_image_types_ota.inc
+++ /dev/null
@@ -1,98 +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 touch ${PHYS_SYSROOT}/boot/grub/grub.cfg
38 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then
39 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt
40 else
41 bberror "Invalid bootloader: ${OSTREE_BOOTLOADER}"
42 fi;
43
44 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
45
46 ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
47 export OSTREE_BOOT_PARTITION="/boot"
48 kargs_list=""
49 for arg in ${OSTREE_KERNEL_ARGS}; do
50 kargs_list="${kargs_list} --karg-append=$arg"
51 done
52
53 ostree admin --sysroot=${PHYS_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${ostree_target_hash}
54
55 cp -a ${IMAGE_ROOTFS}/var/sota ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
56 # Create /var/sota if it doesn't exist yet
57 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota
58 # Ensure the permissions are correctly set
59 chmod 700 ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota
60
61 cp -a ${OSTREE_ROOTFS}/var/local ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
62 cp -a ${OSTREE_ROOTFS}/usr/homedirs/home ${PHYS_SYSROOT}/ || true
63 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
64 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
65 # Set package version for the first deployment
66 target_version=${ostree_target_hash}
67 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
68 target_version=${GARAGE_TARGET_VERSION}
69 elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then
70 target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version")
71 fi
72 mkdir -p ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import
73 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/import/installed_versions
74
75 # Calculate image type
76 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}")
77
78 if [ $OTA_ROOTFS_SIZE -lt 0 ]; then
79 exit -1
80 fi
81 eval local COUNT=\"0\"
82 eval local MIN_COUNT=\"60\"
83 if [ $OTA_ROOTFS_SIZE -lt $MIN_COUNT ]; then
84 eval COUNT=\"$MIN_COUNT\"
85 fi
86
87 # create image
88 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg seek=${OTA_ROOTFS_SIZE} count=${COUNT} bs=1024
89 mkfs.ext4 -O ^64bit ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg -L otaroot -d ${PHYS_SYSROOT}
90 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg
91 ln -s ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg
92 # for forward compatibility
93 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ota-ext4
94 ln -s ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ota-ext4
95 fi
96}
97
98IMAGE_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 617b5dd..a8f426a 100644
--- a/conf/distro/eneanfvaccess.conf
+++ b/conf/distro/eneanfvaccess.conf
@@ -1,20 +1,31 @@
1require conf/distro/enea.conf 1require conf/distro/enea.conf
2 2
3DISTRO_NAME = "Enea NFV Access" 3DISTRO_NAME = "Enea Edge Runtime"
4DISTRO_VERSION_MAJOR ??= "2.2" 4DISTRO_VERSION_MAJOR ??= "2.7"
5DISTRO_VERSION_MINOR ??= ".3" 5DISTRO_VERSION_MINOR ??= ".0"
6DISTRO_VERSION = "${DISTRO_VERSION_MAJOR}${DISTRO_VERSION_MINOR}" 6DISTRO_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"
15DISTRO_FEATURES_remove = "x11 opengl wayland vulkan pulseaudio alsa"
12DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot" 16DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot"
13 17
14PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native" 18PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
15PREFERRED_PROVIDER_virtual/java-native = "jamvm-native" 19PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
16PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native" 20PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
17 21
22# Override ESP mount path set by meta/conf/image-uefi.conf to align with meta-secure-core paths
23EFI_PREFIX_df-efi-secure-boot = "/boot/efi"
18SBFOLDER = "bootloader" 24SBFOLDER = "bootloader"
19 25
20HOSTTOOLS_append = " scp" 26HOSTTOOLS_append = " scp"
27
28BB_HASHBASE_WHITELIST_append += "\
29 SAMPLE_UEFI_SB_KEYS_DIR \
30 SAMPLE_BOOT_KEYS_DIR \
31"
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/conf-notes.txt b/conf/template.atom-c3000-debug/conf-notes.txt
index 1c1c026..d4da82b 100644
--- a/conf/template.atom-c3000-debug/conf-notes.txt
+++ b/conf/template.atom-c3000-debug/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access-debug 2 enea-edge-runtime-debug
diff --git a/conf/template.atom-c3000-debug/local.conf.sample b/conf/template.atom-c3000-debug/local.conf.sample
index c749b24..1c5fbb2 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,12 +242,29 @@ CONF_VERSION = "1"
241 242
242SKIP_META_VIRT_SANITY_CHECK = "1" 243SKIP_META_VIRT_SANITY_CHECK = "1"
243 244
244# 245# Various packages dynamically add users and groups to the system at package
245# OSTree integration 246# install time. For programs that do not care what the uid/gid is of the
246# 247# resulting users/groups, the order of the install will determine the final
247 248# uid/gid. This can lead to non-deterministic uid/gid values from one build
248SOTA_MACHINE ?= "${MACHINE}" 249# to another. Use the following settings to specify that all user/group adds
249 250# should be created based on a static passwd/group file.
250DISTRO_FEATURES_append = " sota" 251#
251DISTRO_FEATURES_NATIVE_append = " sota" 252# Note, if you enable or disable the useradd-staticids in a configured system,
252INHERIT += " sota" 253# the TMPDIR may contain incorrect uid/gid values. Clearing the TMPDIR
254# will correct this condition.
255#
256# By default the system looks in the BBPATH for files/passwd and files/group
257# the default can be overriden by spefying USERADD_UID/GID_TABLES.
258#
259USERADDEXTENSION = "useradd-staticids"
260USERADD_UID_TABLES = "files/passwd"
261USERADD_GID_TABLES = "files/group"
262ROOTFS_POSTPROCESS_COMMAND_remove = "systemd_create_users;"
263#
264# In order to prevent generating a system where a dynamicly assigned uid/gid
265# can exist, you should enable the following setting. This will force the
266# system to error out if the user/group name is not defined in the
267# files/passwd or files/group (or specified replacements.)
268# Unfortunately, setting the variable below breaks the build, so do not set it
269# for now
270# USERADD_ERROR_DYNAMIC = "1"
diff --git a/conf/template.atom-c3000/conf-notes.txt b/conf/template.atom-c3000/conf-notes.txt
index ebd6162..580c5c9 100644
--- a/conf/template.atom-c3000/conf-notes.txt
+++ b/conf/template.atom-c3000/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access 2 enea-edge-runtime
diff --git a/conf/template.atom-c3000/local.conf.sample b/conf/template.atom-c3000/local.conf.sample
index 8c24e77..54d065c 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,12 +239,29 @@ CONF_VERSION = "1"
238 239
239SKIP_META_VIRT_SANITY_CHECK = "1" 240SKIP_META_VIRT_SANITY_CHECK = "1"
240 241
241# 242# Various packages dynamically add users and groups to the system at package
242# OSTree integration 243# install time. For programs that do not care what the uid/gid is of the
243# 244# resulting users/groups, the order of the install will determine the final
244 245# uid/gid. This can lead to non-deterministic uid/gid values from one build
245SOTA_MACHINE ?= "${MACHINE}" 246# to another. Use the following settings to specify that all user/group adds
246 247# should be created based on a static passwd/group file.
247DISTRO_FEATURES_append = " sota" 248#
248DISTRO_FEATURES_NATIVE_append = " sota" 249# Note, if you enable or disable the useradd-staticids in a configured system,
249INHERIT += " sota" 250# the TMPDIR may contain incorrect uid/gid values. Clearing the TMPDIR
251# will correct this condition.
252#
253# By default the system looks in the BBPATH for files/passwd and files/group
254# the default can be overriden by spefying USERADD_UID/GID_TABLES.
255#
256USERADDEXTENSION = "useradd-staticids"
257USERADD_UID_TABLES = "files/passwd"
258USERADD_GID_TABLES = "files/group"
259ROOTFS_POSTPROCESS_COMMAND_remove = "systemd_create_users;"
260#
261# In order to prevent generating a system where a dynamicly assigned uid/gid
262# can exist, you should enable the following setting. This will force the
263# system to error out if the user/group name is not defined in the
264# files/passwd or files/group (or specified replacements.)
265# Unfortunately, setting the variable below breaks the build, so do not set it
266# for now
267# USERADD_ERROR_DYNAMIC = "1"
diff --git a/conf/template.qemux86-64-esdk/conf-notes.txt b/conf/template.qemux86-64-esdk/conf-notes.txt
index e939ec6..14d7575 100644
--- a/conf/template.qemux86-64-esdk/conf-notes.txt
+++ b/conf/template.qemux86-64-esdk/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access-esdk 2 enea-edge-runtime-esdk
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.qemux86-64/conf-notes.txt b/conf/template.qemux86-64/conf-notes.txt
index e55e538..2b65747 100644
--- a/conf/template.qemux86-64/conf-notes.txt
+++ b/conf/template.qemux86-64/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access-vnf 2 enea-edge-vnf
diff --git a/conf/template.xeon-d-debug/conf-notes.txt b/conf/template.xeon-d-debug/conf-notes.txt
index 1c1c026..d4da82b 100644
--- a/conf/template.xeon-d-debug/conf-notes.txt
+++ b/conf/template.xeon-d-debug/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access-debug 2 enea-edge-runtime-debug
diff --git a/conf/template.xeon-d-debug/local.conf.sample b/conf/template.xeon-d-debug/local.conf.sample
index e898db6..3f8ef4a 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,12 +243,29 @@ CONF_VERSION = "1"
242 243
243SKIP_META_VIRT_SANITY_CHECK = "1" 244SKIP_META_VIRT_SANITY_CHECK = "1"
244 245
245# 246# Various packages dynamically add users and groups to the system at package
246# OSTree integration 247# install time. For programs that do not care what the uid/gid is of the
247# 248# resulting users/groups, the order of the install will determine the final
248 249# uid/gid. This can lead to non-deterministic uid/gid values from one build
249SOTA_MACHINE ?= "${MACHINE}" 250# to another. Use the following settings to specify that all user/group adds
250 251# should be created based on a static passwd/group file.
251DISTRO_FEATURES_append = " sota" 252#
252DISTRO_FEATURES_NATIVE_append = " sota" 253# Note, if you enable or disable the useradd-staticids in a configured system,
253INHERIT += " sota" 254# the TMPDIR may contain incorrect uid/gid values. Clearing the TMPDIR
255# will correct this condition.
256#
257# By default the system looks in the BBPATH for files/passwd and files/group
258# the default can be overriden by spefying USERADD_UID/GID_TABLES.
259#
260USERADDEXTENSION = "useradd-staticids"
261USERADD_UID_TABLES = "files/passwd"
262USERADD_GID_TABLES = "files/group"
263ROOTFS_POSTPROCESS_COMMAND_remove = "systemd_create_users;"
264#
265# In order to prevent generating a system where a dynamicly assigned uid/gid
266# can exist, you should enable the following setting. This will force the
267# system to error out if the user/group name is not defined in the
268# files/passwd or files/group (or specified replacements.)
269# Unfortunately, setting the variable below breaks the build, so do not set it
270# for now
271# USERADD_ERROR_DYNAMIC = "1"
diff --git a/conf/template.xeon-d/conf-notes.txt b/conf/template.xeon-d/conf-notes.txt
index ebd6162..580c5c9 100644
--- a/conf/template.xeon-d/conf-notes.txt
+++ b/conf/template.xeon-d/conf-notes.txt
@@ -1,2 +1,2 @@
1Common targets are: 1Common targets are:
2 enea-nfv-access 2 enea-edge-runtime
diff --git a/conf/template.xeon-d/local.conf.sample b/conf/template.xeon-d/local.conf.sample
index 3b1063e..ace57dd 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,12 +240,29 @@ CONF_VERSION = "1"
239 240
240SKIP_META_VIRT_SANITY_CHECK = "1" 241SKIP_META_VIRT_SANITY_CHECK = "1"
241 242
242# 243# Various packages dynamically add users and groups to the system at package
243# OSTree integration 244# install time. For programs that do not care what the uid/gid is of the
244# 245# resulting users/groups, the order of the install will determine the final
245 246# uid/gid. This can lead to non-deterministic uid/gid values from one build
246SOTA_MACHINE ?= "${MACHINE}" 247# to another. Use the following settings to specify that all user/group adds
247 248# should be created based on a static passwd/group file.
248DISTRO_FEATURES_append = " sota" 249#
249DISTRO_FEATURES_NATIVE_append = " sota" 250# Note, if you enable or disable the useradd-staticids in a configured system,
250INHERIT += " sota" 251# the TMPDIR may contain incorrect uid/gid values. Clearing the TMPDIR
252# will correct this condition.
253#
254# By default the system looks in the BBPATH for files/passwd and files/group
255# the default can be overriden by spefying USERADD_UID/GID_TABLES.
256#
257USERADDEXTENSION = "useradd-staticids"
258USERADD_UID_TABLES = "files/passwd"
259USERADD_GID_TABLES = "files/group"
260ROOTFS_POSTPROCESS_COMMAND_remove = "systemd_create_users;"
261#
262# In order to prevent generating a system where a dynamicly assigned uid/gid
263# can exist, you should enable the following setting. This will force the
264# system to error out if the user/group name is not defined in the
265# files/passwd or files/group (or specified replacements.)
266# Unfortunately, setting the variable below breaks the build, so do not set it
267# for now
268# USERADD_ERROR_DYNAMIC = "1"
diff --git a/files/group b/files/group
new file mode 100644
index 0000000..ffb9c82
--- /dev/null
+++ b/files/group
@@ -0,0 +1,52 @@
1root:x:0:
2daemon:x:1:
3bin:x:2:
4sys:x:3:
5adm:x:4:
6tty:x:5:
7disk:x:6:
8lp:x:7:
9mail:x:8:
10news:x:9:
11uucp:x:10:
12man:x:12:
13proxy:x:13:
14kmem:x:15:
15input:x:19:
16dialout:x:20:
17fax:x:21:
18voice:x:22:
19cdrom:x:24:
20floppy:x:25:
21tape:x:26:
22sudo:x:27:
23audio:x:29:
24dip:x:30:
25www-data:x:33:
26backup:x:34:
27operator:x:37:
28list:x:38:
29irc:x:39:
30src:x:40:
31gnats:x:41:
32shadow:x:42:
33utmp:x:43:
34video:x:44:
35sasl:x:45:
36plugdev:x:46:
37kvm:x:47:qemu
38staff:x:50:
39games:x:60:
40shutdown:x:70:
41users:x:100:
42render:x:983:
43systemd-bus-proxy:x:985:
44systemd-timesync:x:988:
45systemd-journal:x:989:
46sshd:x:991:
47qemu:x:992:
48docker:x:995:
49messagebus:x:996:
50bind:x:998:
51_apt:x:999:
52nogroup:x:65534:
diff --git a/files/passwd b/files/passwd
new file mode 100644
index 0000000..2b3f831
--- /dev/null
+++ b/files/passwd
@@ -0,0 +1,25 @@
1root:x:0:0:root:/home/root:/bin/sh
2daemon:x:1:1:daemon:/usr/sbin:/bin/sh
3bin:x:2:2:bin:/bin:/bin/sh
4sys:x:3:3:sys:/dev:/bin/sh
5sync:x:4:65534:sync:/bin:/bin/sync
6games:x:5:60:games:/usr/games:/bin/sh
7man:x:6:12:man:/var/cache/man:/bin/sh
8lp:x:7:7:lp:/var/spool/lpd:/bin/sh
9mail:x:8:8:mail:/var/mail:/bin/sh
10news:x:9:9:news:/var/spool/news:/bin/sh
11uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
12proxy:x:13:13:proxy:/bin:/bin/sh
13www-data:x:33:33:www-data:/var/www:/bin/sh
14backup:x:34:34:backup:/var/backups:/bin/sh
15list:x:38:38:Mailing List Manager:/var/list:/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
18systemd-bus-proxy:x:989:985::/:/bin/nologin
19systemd-timesync:x:992:988::/:/bin/nologin
20sshd:x:993:991::/var/run/sshd:/bin/false
21qemu:x:994:992::/home/qemu:/bin/sh
22messagebus:x:997:996::/var/lib/dbus:/bin/false
23bind:x:998:998::/var/cache/bind:/bin/sh
24_apt:x:999:999::/nonexistent:/bin/false
25nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
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 "
diff --git a/recipes-core/systemd/files/basic.conf.in b/recipes-core/systemd/files/basic.conf.in
new file mode 100644
index 0000000..6532f64
--- /dev/null
+++ b/recipes-core/systemd/files/basic.conf.in
@@ -0,0 +1,50 @@
1# This file is part of systemd.
2#
3# systemd is free software; you can redistribute it and/or modify it
4# under the terms of the GNU Lesser General Public License as published by
5# the Free Software Foundation; either version 2.1 of the License, or
6# (at your option) any later version.
7
8# The superuser
9u root 0 "Super User" /root
10
11# Administrator group: can *see* more than normal users
12g adm - - -
13
14# Access to certain kernel and userspace facilities
15g kmem - - -
16g tty @TTY_GID@ - -
17g utmp - - -
18
19# Hardware access groups
20g audio - - -
21g cdrom - - -
22g dialout - - -
23g disk - - -
24g input - - -
25g lp - - -
26g tape - - -
27g video - - -
28
29# Default group for normal users
30g users @USERS_GID@ - -
31## ENEA_start ##
32# Handle systemd-sysusers hardcoded users/groups interfering with OSTree upgrades:
33# - nothing in NFVA uses the wheel group, do not create it;
34# - the 'nobody' group was automatically created for the existing 'nobody' user,
35# which is not necessary, NFVA already has 'nogroup' (GID 65534);
36#
37# Administrator group: can *do* more than normal users
38# g wheel - - -
39# The nobody user for NFS file systems
40# u @NOBODY_USER_NAME@ 65534 "Nobody" -
41#
42# Keep the next users/groups in sync with those in <layer>/files/{passwd,group}
43# If an upgrade updates /etc/{passwd,group} then the next users and groups already exist
44# and the next lines will do nothing. If the upgrade did not update /etc/{passwd,group}
45# we must dynamically add them, with fixed ids. Ids are the same as in
46# <layer>/files/{passwd,group}
47g kvm 47 - -
48m qemu kvm
49g render 983 - -
50## ENEA_end ##
diff --git a/recipes-core/systemd/systemd_247.6.bbappend b/recipes-core/systemd/systemd_247.6.bbappend
new file mode 100644
index 0000000..eb2b118
--- /dev/null
+++ b/recipes-core/systemd/systemd_247.6.bbappend
@@ -0,0 +1,25 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3SRC_URI_append_sota = " file://basic.conf.in"
4
5GROUPADD_PARAM_${PN}_append_sota = "; -r render"
6
7# systemd uses certain groups unless configured not to (e.g. journal logs are more
8# broadly available to the 'wheel' group unless told otherwise), while some resources
9# are using to the 'nobody' group. Configure systemd to:
10# - not use the 'wheel' group (journal access will be restriced to root user);
11# - use the proper group for 'nobody', which should have GID 65534 (for NFVA 'nogroup');
12EXTRA_OEMESON += " \
13 -Dwheel-group=false \
14 -Dnobody-group=nogroup \
15"
16
17do_configure_prepend_sota() {
18 cp ${WORKDIR}/basic.conf.in ${S}/sysusers.d/basic.conf.in
19}
20
21do_install_append () {
22 # Update default udev rules for /dev/kvm to be less permissive
23 sed -e 's/\(KERNEL=="kvm".*\)0666/\10660/' \
24 -i ${D}${rootlibexecdir}/udev/rules.d/50-udev-default.rules
25}
diff --git a/scripts/lib/wic/canned-wks/enea-nfv-access-vnf-qemux86-64.wks b/scripts/lib/wic/canned-wks/enea-edge-vnf-qemux86-64.wks
index 89c8e4d..89c8e4d 100644
--- a/scripts/lib/wic/canned-wks/enea-nfv-access-vnf-qemux86-64.wks
+++ b/scripts/lib/wic/canned-wks/enea-edge-vnf-qemux86-64.wks