Build Appliance tweaks
cover Build Appliance tweaks
The Build Appliance recipe needs several tweaks in order for the BA to build and to function.
1. Use native pip3: Do not rely on pip3 being installed on host. This, of course, assumes there is already python-pip3-native support available. (a previous patch)
2. Remove symlinks before creating them to avid build errors, otherwise we may run into "File already exists" build errors.
3. Ensure pod2man is present in the BA image, toaster will not run without it.
Even with all these changes, it may not be possible to use BA to build any image, unless the sanity.bbclass accepts /bin/bash.bash as a viable shell. This has already been addressed in another patch. The BA then needs to be rebuilt with SRCREV containing the sanity.bbclass patch.
Juro Bystricky (3):
build-appliance-image: use pip3-native
build-appliance-image: fix build errors
build-appliance-image: ensure pod2man present in BA
meta/recipes-core/images/build-appliance-image_15.0.0.bb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 build-appliance-image: use pip3-native
Do not rely on pip3 being installed on the host.
Use pip3-native instead.
[YOCTO#10909]
[YOCTO#11022]
--- meta/recipes-core/images/build-appliance-image_15.0.0.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/images/build-appliance-image_15.0.0.bb +4 -2
@@ -18,10 +18,10 @@ IMAGE_ROOTFS_EXTRA_SPACE = "41943040" # Do a quiet boot with limited console messages APPEND += "rootfstype=ext4 quiet" -DEPENDS = "zip-native" +DEPENDS = "zip-native python3-pip-native" IMAGE_FSTYPES = "vmdk" -inherit core-image module-base +inherit core-image module-base setuptools3 SRCREV ?= "8343ed93c4278715aa1582d3cadedf8f197b4089" SRC_URI = "git://git.yoctoproject.org/poky;branch=master \
@@ -95,6 +95,8 @@ fakeroot do_populate_poky_src () { echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc # Install modules needed for toaster + export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} + export STAGING_INCDIR=${STAGING_INCDIR_NATIVE} export HOME=${IMAGE_ROOTFS}/home/builder mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip pip3 install --user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt
Signature · 1 line
2.7.4
Re: [PATCH 1/3] build-appliance-image: use pip3-native
Quoted 36 lines · Juro Bystricky
Do not rely on pip3 being installed on the host.
Use pip3-native instead.[YOCTO#10909]
[YOCTO#11022]Signed-off-by Juro Bystricky <[email protected]>---
meta/recipes-core/images/build-appliance-image_15.0.0.bb | 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)meta/recipes-core/images/build-appliance-image_15.0.0.bb +0
-0@@ -18,10 +18,10 @@ IMAGE_ROOTFS_EXTRA_SPACE = "41943040" # Do a quiet boot with limited console messagesAPPEND += "rootfstype=ext4 quiet"
meta/recipes-core/images/build-appliance-image_15.0.0.bb +1
-1-DEPENDS = "zip-native" +DEPENDS = "zip-native python3-pip-native"IMAGE_FSTYPES = "vmdk"
meta/recipes-core/images/build-appliance-image_15.0.0.bb +1
-1-inherit core-image module-base +inherit core-image module-base setuptools3
SRCREV ?= "8343ed93c4278715aa1582d3cadedf8f197b4089"SRC_URI= "git://git.yoctoproject.org/poky;branch=master\meta/recipes-core/images/build-appliance-image_15.0.0.bb +0
-0@@ -95,6 +95,8 @@ fakeroot do_populate_poky_src () {echo 'gtk-theme-name = "Clearlooks"' >
${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
# Install modules needed for toastermeta/recipes-core/images/build-appliance-image_15.0.0.bb +2
-0+ export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} + export STAGING_INCDIR=${STAGING_INCDIR_NATIVE}
Quoted 4 lines
export HOME=${IMAGE_ROOTFS}/home/builder
mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip pip3 install --user -I -U -v -r${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt
Looks good, thanks. Can you also drop "pip" from bitbake.conf's HOSTTOOLS_NONFATAL please?
Cheers,
Richard
Re: [PATCH 1/3] build-appliance-image: use pip3-native
sure, no problem
________________________________________
From: Richard Purdie [[email protected]]
Sent: Wednesday, March 15, 2017 3:16 PM
To: Bystricky, Juro; [email protected]
Cc: [email protected]
Subject: Re: [PATCH 1/3] build-appliance-image: use pip3-native
Quoted 39 lines · Juro Bystricky
Do not rely on pip3 being installed on the host.
Use pip3-native instead.[YOCTO#10909]
[YOCTO#11022]Signed-off-by Juro Bystricky <[email protected]>--- meta/recipes-core/images/build-appliance-image_15.0.0.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)meta/recipes-core/images/build-appliance-image_15.0.0.bb +2
-2@@ -18,10 +18,10 @@ IMAGE_ROOTFS_EXTRA_SPACE = "41943040" # Do a quiet boot with limited console messages APPEND += "rootfstype=ext4 quiet" -DEPENDS = "zip-native" +DEPENDS = "zip-native python3-pip-native" IMAGE_FSTYPES = "vmdk" -inherit core-image module-base +inherit core-image module-base setuptools3 SRCREV ?= "8343ed93c4278715aa1582d3cadedf8f197b4089" SRC_URI = "git://git.yoctoproject.org/poky;branch=master \@@ -95,6 +95,8 @@ fakeroot do_populate_poky_src () { echo 'gtk-theme-name = "Clearlooks"' >${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
# Install modules needed for toaster
meta/recipes-core/images/build-appliance-image_15.0.0.bb +2
-0+ export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} + export STAGING_INCDIR=${STAGING_INCDIR_NATIVE} export HOME=${IMAGE_ROOTFS}/home/builder mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip pip3 install --user -I -U -v -r
Quoted 1 line
${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt
Looks good, thanks. Can you also drop "pip" from bitbake.conf's HOSTTOOLS_NONFATAL please?
Cheers,
Richard
PATCH 2/3 build-appliance-image: fix build errors
In reply to Juro BystrickyRemove any symlinks before creating new ones to avoid potential build errors such as:
FileExistsError: [Errno 17] File exists: '../../usr/src/kernel' -> ... '
--- meta/recipes-core/images/build-appliance-image_15.0.0.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-core/images/build-appliance-image_15.0.0.bb +2 -0
@@ -60,6 +60,7 @@ fakeroot do_populate_poky_src () { cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ # Create a symlink, needed for out-of-tree kernel modules build + rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
@@ -87,6 +88,7 @@ fakeroot do_populate_poky_src () { echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers # Load tap/tun at startup + rm -f ${IMAGE_ROOTFS}/sbin/iptables lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
Signature · 1 line
2.7.4
PATCH 3/3 build-appliance-image: ensure pod2man present in BA
In reply to Juro Bystricky"pod2man" went missing from BA, but it is required. This patch fixes the Toaster error:
<...>
ERROR: These tools appear to be unavailable in PATH, please install
them in order to proceed:
pod2man
<...>
[YOCTO#11144]
--- meta/recipes-core/images/build-appliance-image_15.0.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/images/build-appliance-image_15.0.0.bb +1 -1
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \ - tzdata python3-pip" + tzdata python3-pip perl-misc" IMAGE_FEATURES += "x11-base package-management splash"
Signature · 1 line
2.7.4