diff options
| author | Matei Valeanu <Matei.Valeanu@enea.com> | 2021-09-09 14:22:56 +0200 |
|---|---|---|
| committer | Matei Valeanu <Matei.Valeanu@enea.com> | 2021-09-09 14:22:56 +0200 |
| commit | 8f49f61ef6df2db30b2b124b7ee5893124c70180 (patch) | |
| tree | de596077e8b7925f42fffd38d25486b47177c336 | |
| parent | 1a0d008b62062b3bdfa97ec4761347c0d0c4e652 (diff) | |
| parent | 06cb3727c2a013ff6927f85b9cdd708177e17609 (diff) | |
| download | meta-el-nfv-access-8f49f61ef6df2db30b2b124b7ee5893124c70180.tar.gz | |
Merge branch 'develop'demo_CPDX-3644demo_CPDX-3634
Change-Id: I75bd22a68d9de4d96b65586be3c14fda7892b803
38 files changed, 283 insertions, 550 deletions
diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..39fc438 --- /dev/null +++ b/.gitreview | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | [gerrit] | ||
| 2 | host=gerrit.enea.se | ||
| 3 | port=29418 | ||
| 4 | project=linux/meta-el-nfv-access.git | ||
| 5 | track=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 @@ | |||
| 1 | GRUB_GRAPHICS ?= "console=tty0" | ||
| 2 | |||
| 3 | python 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 @@ | |||
| 1 | efi_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 | |||
| 9 | OSTREE_ROOTFS="${WORKDIR}/ostree-root" | ||
| 10 | do_image_ostree[dirs] = "${OSTREE_ROOTFS}" | ||
| 11 | do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" | ||
| 12 | do_image_ostree[subimages] = "rootfs.ostree.tar.bz2" | ||
| 13 | do_image_ostree[imgsuffix] = "." | ||
| 14 | export OSTREE_ROOTFS | ||
| 15 | |||
| 16 | IMAGE_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 | |||
| 9 | OSTREE_REPO = "${WORKDIR}/ostree-repo" | ||
| 10 | PHYS_SYSROOT = "${WORKDIR}/ota-sysroot" | ||
| 11 | |||
| 12 | do_image_otaimg[dirs] = "${PHYS_SYSROOT}" | ||
| 13 | do_image_otaimg[cleandirs] = "${PHYS_SYSROOT}" | ||
| 14 | |||
| 15 | IMAGE_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 | |||
| 99 | IMAGE_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 | ||
| 2 | efi_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 | ||
| 5 | WKS_FILE_sota = "efiimage-sota.wks" | 5 | WKS_FILE_sota = "efiimage-sota.wks" |
| 6 | 6 | ||
| 7 | OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" | 7 | OSTREE_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 |
| 10 | ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.otaimg" | 10 | ROOTFS_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 |
| 13 | OSTREE_KERNEL_ARGS ?= "rw" | 13 | OSTREE_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 | ||
| 5 | WKS_FILE_sota = "efiimage-sota.wks" | 5 | WKS_FILE_sota = "efiimage-sota.wks" |
| 6 | 6 | ||
| 7 | OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" | 7 | OSTREE_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 |
| 10 | ROOTFS_sota = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.otaimg" | 10 | ROOTFS_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 |
| 13 | OSTREE_KERNEL_ARGS ?= "rw" | 13 | OSTREE_KERNEL_ARGS ?= "rw" |
diff --git a/conf/distro/eneanfvaccess.conf b/conf/distro/eneanfvaccess.conf index ae26b2d..13845e9 100644 --- a/conf/distro/eneanfvaccess.conf +++ b/conf/distro/eneanfvaccess.conf | |||
| @@ -1,20 +1,31 @@ | |||
| 1 | require conf/distro/enea.conf | 1 | require conf/distro/enea.conf |
| 2 | 2 | ||
| 3 | DISTRO_NAME = "Enea NFV Access" | 3 | DISTRO_NAME = "Enea Edge Runtime" |
| 4 | DISTRO_VERSION_MAJOR ??= "2.4" | 4 | DISTRO_VERSION_MAJOR ??= "2.5" |
| 5 | DISTRO_VERSION_MINOR ??= ".0" | 5 | DISTRO_VERSION_MINOR ??= ".0" |
| 6 | DISTRO_VERSION = "${DISTRO_VERSION_MAJOR}${DISTRO_VERSION_MINOR}" | 6 | DISTRO_VERSION = "${DISTRO_VERSION_MAJOR}${DISTRO_VERSION_MINOR}" |
| 7 | 7 | ||
| 8 | SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" | 8 | SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" |
| 9 | 9 | ||
| 10 | # OSTree integration | ||
| 11 | require ${@bb.utils.contains('SOTA_MACHINE', '${MACHINE}', 'conf/distro/sota.conf.inc', '', d)} | ||
| 12 | |||
| 10 | INHERIT += "distrooverrides" | 13 | INHERIT += "distrooverrides" |
| 11 | DISTRO_FEATURES_append = " odm efi-secure-boot" | 14 | DISTRO_FEATURES_append = " odm efi-secure-boot usrmerge" |
| 15 | DISTRO_FEATURES_remove = "x11 opengl wayland vulkan pulseaudio alsa" | ||
| 12 | DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot" | 16 | DISTRO_FEATURES_OVERRIDES += "odm efi-secure-boot" |
| 13 | 17 | ||
| 14 | PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native" | 18 | PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native" |
| 15 | PREFERRED_PROVIDER_virtual/java-native = "jamvm-native" | 19 | PREFERRED_PROVIDER_virtual/java-native = "jamvm-native" |
| 16 | PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native" | 20 | PREFERRED_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 | ||
| 23 | EFI_PREFIX_df-efi-secure-boot = "/boot/efi" | ||
| 18 | SBFOLDER = "bootloader" | 24 | SBFOLDER = "bootloader" |
| 19 | 25 | ||
| 20 | HOSTTOOLS_append = " scp" | 26 | HOSTTOOLS_append = " scp" |
| 27 | |||
| 28 | BB_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" | |||
| 11 | BBFILE_PATTERN_el-nfv-access = "^${LAYERDIR}/" | 11 | BBFILE_PATTERN_el-nfv-access = "^${LAYERDIR}/" |
| 12 | BBFILE_PRIORITY_el-nfv-access = "7" | 12 | BBFILE_PRIORITY_el-nfv-access = "7" |
| 13 | LAYERDEPENDS_el-nfv-access = "nfv-access-common enea-virtualization" | 13 | LAYERDEPENDS_el-nfv-access = "nfv-access-common enea-virtualization" |
| 14 | LAYERSERIES_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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 60e8955..b96bf48 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 | ||
| 158 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | 159 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" |
| 159 | 160 | ||
| 160 | # | 161 | # |
| @@ -241,16 +242,6 @@ CONF_VERSION = "1" | |||
| 241 | 242 | ||
| 242 | SKIP_META_VIRT_SANITY_CHECK = "1" | 243 | SKIP_META_VIRT_SANITY_CHECK = "1" |
| 243 | 244 | ||
| 244 | # | ||
| 245 | # OSTree integration | ||
| 246 | # | ||
| 247 | |||
| 248 | SOTA_MACHINE ?= "${MACHINE}" | ||
| 249 | |||
| 250 | DISTRO_FEATURES_append = " sota" | ||
| 251 | DISTRO_FEATURES_NATIVE_append = " sota" | ||
| 252 | INHERIT += " 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 |
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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 b015f43..c6cbdba 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 | ||
| 155 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | 156 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" |
| 156 | 157 | ||
| 157 | # | 158 | # |
| @@ -238,16 +239,6 @@ CONF_VERSION = "1" | |||
| 238 | 239 | ||
| 239 | SKIP_META_VIRT_SANITY_CHECK = "1" | 240 | SKIP_META_VIRT_SANITY_CHECK = "1" |
| 240 | 241 | ||
| 241 | # | ||
| 242 | # OSTree integration | ||
| 243 | # | ||
| 244 | |||
| 245 | SOTA_MACHINE ?= "${MACHINE}" | ||
| 246 | |||
| 247 | DISTRO_FEATURES_append = " sota" | ||
| 248 | DISTRO_FEATURES_NATIVE_append = " sota" | ||
| 249 | INHERIT += " 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 |
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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 6474a37..4be1706 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 | ||
| 159 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | 160 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" |
| 160 | 161 | ||
| 161 | # | 162 | # |
| @@ -242,16 +243,6 @@ CONF_VERSION = "1" | |||
| 242 | 243 | ||
| 243 | SKIP_META_VIRT_SANITY_CHECK = "1" | 244 | SKIP_META_VIRT_SANITY_CHECK = "1" |
| 244 | 245 | ||
| 245 | # | ||
| 246 | # OSTree integration | ||
| 247 | # | ||
| 248 | |||
| 249 | SOTA_MACHINE ?= "${MACHINE}" | ||
| 250 | |||
| 251 | DISTRO_FEATURES_append = " sota" | ||
| 252 | DISTRO_FEATURES_NATIVE_append = " sota" | ||
| 253 | INHERIT += " 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 |
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 @@ | |||
| 1 | Common targets are: | 1 | Common 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 5cfebf5..a1a874d 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 | ||
| 156 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | 157 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" |
| 157 | 158 | ||
| 158 | # | 159 | # |
| @@ -239,16 +240,6 @@ CONF_VERSION = "1" | |||
| 239 | 240 | ||
| 240 | SKIP_META_VIRT_SANITY_CHECK = "1" | 241 | SKIP_META_VIRT_SANITY_CHECK = "1" |
| 241 | 242 | ||
| 242 | # | ||
| 243 | # OSTree integration | ||
| 244 | # | ||
| 245 | |||
| 246 | SOTA_MACHINE ?= "${MACHINE}" | ||
| 247 | |||
| 248 | DISTRO_FEATURES_append = " sota" | ||
| 249 | DISTRO_FEATURES_NATIVE_append = " sota" | ||
| 250 | INHERIT += " 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 |
diff --git a/files/group b/files/group index 99cb628..ffb9c82 100644 --- a/files/group +++ b/files/group | |||
| @@ -34,23 +34,19 @@ utmp:x:43: | |||
| 34 | video:x:44: | 34 | video:x:44: |
| 35 | sasl:x:45: | 35 | sasl:x:45: |
| 36 | plugdev:x:46: | 36 | plugdev:x:46: |
| 37 | kvm:x:47:qemu | ||
| 37 | staff:x:50: | 38 | staff:x:50: |
| 38 | games:x:60: | 39 | games:x:60: |
| 39 | shutdown:x:70: | 40 | shutdown:x:70: |
| 40 | users:x:100: | 41 | users:x:100: |
| 42 | render:x:983: | ||
| 41 | systemd-bus-proxy:x:985: | 43 | systemd-bus-proxy:x:985: |
| 42 | systemd-resolve:x:986: | ||
| 43 | systemd-network:x:987: | ||
| 44 | systemd-timesync:x:988: | 44 | systemd-timesync:x:988: |
| 45 | systemd-journal:x:989: | 45 | systemd-journal:x:989: |
| 46 | lock:x:990: | ||
| 47 | sshd:x:991: | 46 | sshd:x:991: |
| 48 | qemu:x:992: | 47 | qemu:x:992: |
| 49 | polkitd:x:993: | ||
| 50 | ntp:x:994: | ||
| 51 | docker:x:995: | 48 | docker:x:995: |
| 52 | messagebus:x:996: | 49 | messagebus:x:996: |
| 53 | netdev:x:997: | ||
| 54 | bind:x:998: | 50 | bind:x:998: |
| 55 | _apt:x:999: | 51 | _apt:x:999: |
| 56 | nogroup:x:65534: | 52 | nogroup:x:65534: |
diff --git a/files/passwd b/files/passwd index 2c21e09..2b3f831 100644 --- a/files/passwd +++ b/files/passwd | |||
| @@ -16,13 +16,9 @@ list:x:38:38:Mailing List Manager:/var/list:/bin/sh | |||
| 16 | irc:x:39:39:ircd:/var/run/ircd:/bin/sh | 16 | irc:x:39:39:ircd:/var/run/ircd:/bin/sh |
| 17 | gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh | 17 | gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh |
| 18 | systemd-bus-proxy:x:989:985::/:/bin/nologin | 18 | systemd-bus-proxy:x:989:985::/:/bin/nologin |
| 19 | systemd-resolve:x:990:986::/:/bin/nologin | ||
| 20 | systemd-network:x:991:987::/:/bin/nologin | ||
| 21 | systemd-timesync:x:992:988::/:/bin/nologin | 19 | systemd-timesync:x:992:988::/:/bin/nologin |
| 22 | sshd:x:993:991::/var/run/sshd:/bin/false | 20 | sshd:x:993:991::/var/run/sshd:/bin/false |
| 23 | qemu:x:994:992::/home/qemu:/bin/sh | 21 | qemu:x:994:992::/home/qemu:/bin/sh |
| 24 | polkitd:x:995:993::/etc/polkit-1:/bin/sh | ||
| 25 | ntp:x:996:994::/var/lib/ntp:/bin/false | ||
| 26 | messagebus:x:997:996::/var/lib/dbus:/bin/false | 22 | messagebus:x:997:996::/var/lib/dbus:/bin/false |
| 27 | bind:x:998:998::/var/cache/bind:/bin/sh | 23 | bind:x:998:998::/var/cache/bind:/bin/sh |
| 28 | _apt:x:999:999::/nonexistent:/bin/false | 24 | _apt:x:999:999::/nonexistent:/bin/false |
diff --git a/images/core-image-minimal-initramfs.bbappend b/images/core-image-minimal-initramfs.bbappend index 67ab251..88dd198 100644 --- a/images/core-image-minimal-initramfs.bbappend +++ b/images/core-image-minimal-initramfs.bbappend | |||
| @@ -1,12 +1,16 @@ | |||
| 1 | PACKAGE_INSTALL += " nfv-installer kernel-modules ixgbe" | 1 | PACKAGE_INSTALL += " nfv-installer kernel-modules" |
| 2 | 2 | ||
| 3 | # ostree-switchroot is used by the init script to switch root to the | 3 | INITRAMFS_SCRIPTS = " \ |
| 4 | # ostree version specified in the kernel command line | 4 | initramfs-framework-base \ |
| 5 | PACKAGE_INSTALL_append_sota = " ostree-switchroot" | 5 | initramfs-module-udev \ |
| 6 | initramfs-module-setup-live \ | ||
| 7 | " | ||
| 6 | 8 | ||
| 7 | # run-postinsts does not belong in the minimal initramfs | 9 | # run-postinsts does not belong in the minimal initramfs |
| 8 | PACKAGE_INSTALL_remove = "run-postinsts" | 10 | PACKAGE_INSTALL_remove = "run-postinsts" |
| 9 | 11 | ||
| 12 | PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras" | ||
| 13 | |||
| 10 | create_enea_symlink() { | 14 | create_enea_symlink() { |
| 11 | # enea image used in bare metal installation | 15 | # enea image used in bare metal installation |
| 12 | cd ${DEPLOY_DIR_IMAGE} | 16 | cd ${DEPLOY_DIR_IMAGE} |
diff --git a/images/enea-nfv-access-common.inc b/images/enea-edge-common.inc index 5472056..b174064 100644 --- a/images/enea-nfv-access-common.inc +++ b/images/enea-edge-common.inc | |||
| @@ -10,6 +10,8 @@ IMAGE_INSTALL += " \ | |||
| 10 | # run-postinsts duplicates dpkg-configure if package_deb is used | 10 | # run-postinsts duplicates dpkg-configure if package_deb is used |
| 11 | PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}" | 11 | PACKAGE_INSTALL_remove = "${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'run-postinsts', '', d)}" |
| 12 | 12 | ||
| 13 | PACKAGE_EXCLUDE_x86-64_sota += "grub-common-extras" | ||
| 14 | |||
| 13 | # After installing packages inside the rootfs, remove backup DPKG status file | 15 | # After installing packages inside the rootfs, remove backup DPKG status file |
| 14 | rootfs_postinstall_dpkg_cleanup () { | 16 | rootfs_postinstall_dpkg_cleanup () { |
| 15 | if ${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'true', 'false', d)}; then | 17 | if ${@bb.utils.contains('PACKAGE_CLASSES', 'package_deb', 'true', 'false', d)}; then |
| @@ -18,9 +20,21 @@ rootfs_postinstall_dpkg_cleanup () { | |||
| 18 | } | 20 | } |
| 19 | ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;" | 21 | ROOTFS_POSTINSTALL_COMMAND_append += " rootfs_postinstall_dpkg_cleanup;" |
| 20 | 22 | ||
| 21 | IMAGE_FSTYPES = "ext4 ext4.gz tar.gz" | 23 | IMAGE_FSTYPES += "ext4 ext4.gz tar.gz" |
| 22 | 24 | ||
| 23 | # Add ostree specific image types if sota support is set | 25 | # Remove aktualizr packages from the image, we don't use it and creates odd dependencies, e.g. |
| 24 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'otaimg wic', ' ', d)}" | 26 | # it creates a systemd unit that depends on network-online.target, which leads to enabling |
| 25 | SOTA_CLIENT = "" | 27 | # NetworkManager-wait-online.service, delaying boot up. |
| 26 | SOTA_CLIENT_PROV = "" | 28 | SOTA_CLIENT_PROV = "" |
| 29 | IMAGE_INSTALL_remove_sota = " \ | ||
| 30 | aktualizr \ | ||
| 31 | aktualizr-info \ | ||
| 32 | " | ||
| 33 | |||
| 34 | # We currently don't use automatic push/sign/check to a backend server, so skip running useless | ||
| 35 | # OSTree tasks during image build. | ||
| 36 | IMAGE_FSTYPES_remove_sota = " \ | ||
| 37 | ostreepush \ | ||
| 38 | garagesign \ | ||
| 39 | garagecheck \ | ||
| 40 | " | ||
diff --git a/images/enea-edge-host-common.inc b/images/enea-edge-host-common.inc new file mode 100644 index 0000000..3df6cb9 --- /dev/null +++ b/images/enea-edge-host-common.inc | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | IMAGE_FSTYPES += "hddimg" | ||
| 2 | IMAGE_FSTYPES_remove = "wic" | ||
| 3 | |||
| 4 | REQUIRE_FILES = " \ | ||
| 5 | images/enea-edge-common.inc \ | ||
| 6 | " | ||
| 7 | REQUIRE_FILES_append_df-efi-secure-boot = " \ | ||
| 8 | classes/override_live-vm-common.inc \ | ||
| 9 | images/secure-boot.inc \ | ||
| 10 | " | ||
| 11 | |||
| 12 | require ${REQUIRE_FILES} | ||
| 13 | |||
| 14 | IMAGE_INSTALL += " \ | ||
| 15 | packagegroup-enea-virtualization-host \ | ||
| 16 | packagegroup-enea-virtualization-4gusb-modems \ | ||
| 17 | " | ||
| 18 | |||
| 19 | # Set labels for GRUB and SYSLINUX | ||
| 20 | LABELS_LIVE = "installer live-boot" | ||
| 21 | |||
| 22 | # Append default parameters for x86-64 targets | ||
| 23 | APPEND_x86-64 = "quiet console=tty0 console=ttyS0,115200" | ||
| 24 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" | ||
| 25 | |||
| 26 | # Skip menu and boot installer immediately | ||
| 27 | GRUB_TIMEOUT_x86-64 = "0" | ||
| 28 | AUTO_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 | ||
| 32 | python __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 | ||
| 40 | python 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 | ||
| 55 | IMAGE_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 | |||
| 74 | IMAGE_CMD_ota_prepend () { | ||
| 75 | ## ENEA_start ## | ||
| 76 | if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then | ||
| 77 | # Upstream bbclass creates /boot/grub2, complement it with /boot/grub | ||
| 78 | # Note: /boot/grub2 is a dir with /boot/grub2/grub.cfg -> ../loader/grub.cfg symlink | ||
| 79 | # while /boot/grub -> loader is a symlink to also account for /boot/grub/grubenv | ||
| 80 | mkdir -p ${OTA_SYSROOT}/boot | ||
| 81 | ln -s loader ${OTA_SYSROOT}/boot/grub | ||
| 82 | fi | ||
| 83 | ## ENEA_end ## | ||
| 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 @@ | |||
| 1 | DESCRIPTION = "Image for the host side of the Enea Edge Runtime with ODM and NETCONF Edgelink customizations" | ||
| 2 | |||
| 3 | require images/enea-edge-host-common.inc | ||
| 4 | |||
| 5 | IMAGE_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 @@ | |||
| 1 | DESCRIPTION = "Image for building the SDK for the host side of the Enea NFV Access Platform with ODM customizations" | 1 | DESCRIPTION = "Image for building the SDK for the host side of the Enea Edge Runtime with ODM customizations" |
| 2 | 2 | ||
| 3 | require images/enea-nfv-access-host-common.inc | 3 | require images/enea-edge-host-common.inc |
| 4 | 4 | ||
| 5 | IMAGE_INSTALL += " \ | 5 | IMAGE_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 @@ | |||
| 1 | DESCRIPTION = "Image for the host side of the Enea Edge Runtime with ODM and NETCONF Edgelink customizations" | ||
| 2 | |||
| 3 | require images/enea-edge-host-common.inc | ||
| 4 | |||
| 5 | IMAGE_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 @@ | |||
| 1 | DESCRIPTION = "VNF image of the Enea Edge Runtime, includes kernel, rootfs and boot parameters" | ||
| 2 | |||
| 3 | require images/enea-edge-common.inc | ||
| 4 | |||
| 5 | IMAGE_FSTYPES += "wic.qcow2" | ||
| 6 | WKS_FILE = "enea-edge-vnf-qemux86-64.wks" | ||
| 7 | |||
| 8 | CLOUDINITPKGS = "cloud-init util-linux-blkid" | ||
| 9 | |||
| 10 | IMAGE_INSTALL += " \ | ||
| 11 | packagegroup-enea-virtualization-guest \ | ||
| 12 | nfv-init \ | ||
| 13 | iperf3 \ | ||
| 14 | ${CLOUDINITPKGS} \ | ||
| 15 | " | ||
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 @@ | |||
| 1 | DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM and NETCONF Edgelink customizations" | ||
| 2 | |||
| 3 | require images/enea-nfv-access-host-common.inc | ||
| 4 | |||
| 5 | IMAGE_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 @@ | |||
| 1 | REQUIRE_FILES = " \ | ||
| 2 | images/enea-nfv-access-common.inc \ | ||
| 3 | classes/override_grub-efi.inc \ | ||
| 4 | " | ||
| 5 | REQUIRE_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 | |||
| 12 | require ${REQUIRE_FILES} | ||
| 13 | |||
| 14 | IMAGE_INSTALL += " \ | ||
| 15 | packagegroup-enea-virtualization-host \ | ||
| 16 | packagegroup-enea-virtualization-4gusb-modems \ | ||
| 17 | " | ||
| 18 | |||
| 19 | # Set labels for GRUB and SYSLINUX | ||
| 20 | LABELS_LIVE = "installer live-boot" | ||
| 21 | |||
| 22 | GRUB_GFXSERIAL_x86-64 = "1" | ||
| 23 | # Append default parameters for x86-64 targets | ||
| 24 | APPEND_x86-64 = "quiet" | ||
| 25 | SYSLINUX_DEFAULT_CONSOLE_x86-64 = "console=ttyS0,115200" | ||
| 26 | |||
| 27 | # Skip menu and boot installer immediately | ||
| 28 | GRUB_TIMEOUT_x86-64 = "0" | ||
| 29 | AUTO_SYSLINUXMENU_x86-64 = "0" | ||
| 30 | |||
| 31 | # grub-efi-native is needed in recipe-sysroot-native to generate the initial | ||
| 32 | # configuration file for grub | ||
| 33 | DEPENDS_append += " grub-efi-native" | ||
| 34 | |||
| 35 | # If building with sota enabled, build the otaimg before the hddimg, because | ||
| 36 | # the hddimg needs it as a base image | ||
| 37 | python __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 | ||
| 43 | python 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 | ||
| 56 | python __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 | ||
| 63 | IMAGE_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 @@ | |||
| 1 | DESCRIPTION = "VNF image of the Enea NFV Access Platform, includes kernel, rootfs and boot parameters" | ||
| 2 | |||
| 3 | require images/enea-nfv-access-common.inc | ||
| 4 | |||
| 5 | IMAGE_FSTYPES += "wic.qcow2" | ||
| 6 | WKS_FILE = "enea-nfv-access-vnf-qemux86-64.wks" | ||
| 7 | |||
| 8 | CLOUDINITPKGS = "cloud-init util-linux-blkid" | ||
| 9 | CLOUDINITPKGS += " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'cloud-init-systemd', '', d)}" | ||
| 10 | |||
| 11 | IMAGE_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 @@ | |||
| 1 | DESCRIPTION = "Image for the host side of the Enea NFV Access Platform with ODM and NETCONF Edgelink customizations" | ||
| 2 | |||
| 3 | require images/enea-nfv-access-host-common.inc | ||
| 4 | |||
| 5 | IMAGE_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 | ||
| 9 | u root 0 "Super User" /root | ||
| 10 | |||
| 11 | # Administrator group: can *see* more than normal users | ||
| 12 | g adm - - - | ||
| 13 | |||
| 14 | # Access to certain kernel and userspace facilities | ||
| 15 | g kmem - - - | ||
| 16 | g tty @TTY_GID@ - - | ||
| 17 | g utmp - - - | ||
| 18 | |||
| 19 | # Hardware access groups | ||
| 20 | g audio - - - | ||
| 21 | g cdrom - - - | ||
| 22 | g dialout - - - | ||
| 23 | g disk - - - | ||
| 24 | g input - - - | ||
| 25 | g lp - - - | ||
| 26 | g tape - - - | ||
| 27 | g video - - - | ||
| 28 | |||
| 29 | # Default group for normal users | ||
| 30 | g 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} | ||
| 47 | g kvm 47 - - | ||
| 48 | m qemu kvm | ||
| 49 | g 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 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
| 2 | |||
| 3 | SRC_URI_append_sota = " file://basic.conf.in" | ||
| 4 | |||
| 5 | GROUPADD_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'); | ||
| 12 | EXTRA_OEMESON += " \ | ||
| 13 | -Dwheel-group=false \ | ||
| 14 | -Dnobody-group=nogroup \ | ||
| 15 | " | ||
| 16 | |||
| 17 | do_configure_prepend_sota() { | ||
| 18 | cp ${WORKDIR}/basic.conf.in ${S}/sysusers.d/basic.conf.in | ||
| 19 | } | ||
| 20 | |||
| 21 | do_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 | |||
