Skip to content

Commit

Permalink
add installer support for target build
Browse files Browse the repository at this point in the history
While "installer-support" in DISTRO_FEATURES, it enable
features of target build.

The target build requires:

- add dmthin.scc and crypt.scc to kernel config

- add distro feature check of systemd and ldconfig

- add rpm packages check

- emit target image env to help installation

Signed-off-by: Hongxu Jia <[email protected]>
  • Loading branch information
hongxu-jia committed Nov 20, 2017
1 parent ca542f8 commit 190f6f5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
29 changes: 29 additions & 0 deletions classes/installer_support_image.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FEATURE_PACKAGES_installer-support = "packagegroup-installer-support"
IMAGE_FEATURES_append = " installer-support"
EXTRA_IMAGEDEPENDS += "grub grub-efi"

EXTRA_IMAGEDEPENDS += "glibc-locale"

# Generate filesystem images for image copy install
IMAGE_FSTYPES += "ext4"

IMAGE_POSTPROCESS_COMMAND_append = " emit_image_env;"

inherit distro_features_check
REQUIRED_DISTRO_FEATURES = "systemd ldconfig"

python emit_image_env () {
localdata = bb.data.createCopy(d)

# Export DISTRO for installer build
localdata.setVarFlag("DISTRO", "unexport", "")

dumpfile = d.expand("${TOPDIR}/installersupport_${PN}")
with open(dumpfile , "w") as f:
bb.data.emit_env(f, localdata, True)
}

python __anonymous () {
if not bb.utils.contains("PACKAGE_CLASSES", "package_rpm", True, False, d):
raise bb.parse.SkipPackage('Target build requires RPM packages to be the default in PACKAGE_CLASSES.')
}
2 changes: 2 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ SRC_DISTRIBUTE_LICENSES += "FLTK"

LAYER_PATH_meta-installer = "${LAYERDIR}"

KERNEL_CLASSES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'installer-support', ' installer_support_kernel', '', d)}"
IMAGE_CLASSES_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'installer-support', ' installer_support_image', '', d)}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
DESCRIPTION = "Packages required by target build to help the installation"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit packagegroup

RDEPENDS_${PN} = " \
sudo \
kernel-image \
grubby \
shadow \
efibootmgr \
kmod \
util-linux-mount \
init-ifupdown \
libuser \
dracut \
cryptsetup \
sed \
grep \
dosfstools \
e2fsprogs \
btrfs-tools \
"

0 comments on commit 190f6f5

Please sign in to comment.