require systemd.inc PROVIDES = "udev" PE = "1" DEPENDS = "intltool-native gperf-native libcap util-linux python3-jinja2-native" SECTION = "base/shell" inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages features_check # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so # that we don't build both udev and systemd in world builds. REQUIRED_DISTRO_FEATURES = "systemd" SRC_URI += "file://touchscreen.rules \ file://00-create-volatile.conf \ ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \ file://init \ file://99-default.preset \ file://systemd-pager.sh \ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0003-implment-systemd-sysv-install-for-OE.patch \ file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ file://0001-resolve-Use-sockaddr-pointer-type-for-bind.patch \ " # patches needed by musl SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}" SRC_URI_MUSL = "\ file://0003-missing_type.h-add-comparison_fn_t.patch \ file://0004-add-fallback-parse_printf_format-implementation.patch \ file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \ file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \ file://0008-add-missing-FTW_-macros-for-musl.patch \ file://0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch \ file://0010-Use-uintmax_t-for-handling-rlim_t.patch \ file://0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \ file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ file://0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch \ file://0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \ file://0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \ file://0018-avoid-redefinition-of-prctl_mm_map-structure.patch \ file://0021-test-json.c-define-M_PIl.patch \ file://0022-do-not-disable-buffer-in-writing-files.patch \ file://0025-Handle-__cpu_mask-usage.patch \ file://0026-Handle-missing-gshadow.patch \ file://0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \ file://0001-pass-correct-parameters-to-getdents64.patch \ file://0002-Add-sys-stat.h-for-S_IFDIR.patch \ file://0001-Adjust-for-musl-headers.patch \ " PAM_PLUGINS = " \ pam-plugin-unix \ pam-plugin-loginuid \ pam-plugin-keyinit \ " PACKAGECONFIG ??= " \ ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit seccomp', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \ backlight \ binfmt \ gshadow \ hibernate \ hostnamed \ idn \ ima \ kmod \ localed \ logind \ machined \ myhostname \ networkd \ nss \ nss-mymachines \ nss-resolve \ quotacheck \ randomseed \ resolved \ set-time-epoch \ sysusers \ sysvinit \ timedated \ timesyncd \ userdb \ utmp \ vconsole \ wheel-group \ zstd \ " PACKAGECONFIG:remove:libc-musl = " \ gshadow \ idn \ localed \ myhostname \ nss \ nss-mymachines \ nss-resolve \ sysusers \ userdb \ utmp \ " # https://github.com/seccomp/libseccomp/issues/347 PACKAGECONFIG:remove:mipsarch = "seccomp" CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 " # Some of the dependencies are weak-style recommends - if not available at runtime, # systemd won't fail but the library-related feature will be skipped with a warning. # Use the upstream systemd serial-getty@.service and rely on # systemd-getty-generator instead of using the OE-core specific # systemd-serialgetty.bb - not enabled by default. PACKAGECONFIG[serial-getty-generator] = "" PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl" PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit" PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false" PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false" PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2" PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid" PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false" PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup" PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device" PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus" PACKAGECONFIG[efi] = "-Defi=true,-Defi=false" PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi" PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils" PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false" PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false" PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false" # Sign the journal for anti-tampering PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt" PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls" PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false" PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false" PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=falsSUMMARY = "An image containing the build system itself" DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation." HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client" IMAGE_FEATURES += "x11-base package-management splash" # Ensure there's enough space to do a core-image-sato build, with rm_work enabled IMAGE_ROOTFS_EXTRA_SPACE = "41943040" # Do a quiet boot with limited console messages APPEND += "rootfstype=ext4 quiet" DEPENDS = "zip-native" IMAGE_FSTYPES = "vmdk" inherit core-image module-base SRCREV ?= "b6d61ec9977b5625865d711eff3f0fc960d949ec" SRC_URI = "git://git.yoctoproject.org/poky;branch=master \ file://Yocto_Build_Appliance.vmx \ file://Yocto_Build_Appliance.vmxf \ file://README_VirtualBox_Guest_Additions.txt \ " BA_INCLUDE_SOURCES ??= "0" IMAGE_CMD_ext4_append () { # We don't need to reserve much space for root, 0.5% is more than enough tune2fs -m 0.5 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4 } fakeroot do_populate_poky_src () { # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo # will become invalid in the target. rm -rf ${WORKDIR}/git/.git rm -f ${WORKDIR}/git/.gitignore cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads if [ ${BA_INCLUDE_SOURCES} != 0 ]; then cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/ # Remove the git2_* tarballs -- this is ok since we still have the git2/. rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_* fi # Place the README_VirtualBox_Guest_Additions file in builders home folder. cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ # Create a symlink, needed for out-of-tree kernel modules 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 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc # Also save (for reference only) the actual SRCREV used to create this image echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# If working behind a proxy and using the provided oe-git-proxy script" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# you need to set ALL_PROXY based on your proxy settings." >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# Example ALL_PROXY values:" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# export ALL_PROXY=https://proxy.example.com:8080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# export ALL_PROXY=socks://socks.example.com:1080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky # Assume we will need CDROM to install guest additions mkdir -p ${IMAGE_ROOTFS}/media/cdrom # Allow builder to use sudo echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers # Load tap/tun at startup lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables echo "tun" >> ${IMAGE_ROOTFS}/etc/modules # Use Clearlooks GTK+ theme mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0 echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc } IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " addtask rootfs after do_unpack python () { # Ensure we run these usually noexec tasks d.delVarFlag("do_fetch", "noexec") d.delVarFlag("do_unpack", "noexec") } create_bundle_files () { cd ${WORKDIR} mkdir -p Yocto_Build_Appliance cp *.vmx* Yocto_Build_Appliance ln -sf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance.zip } create_bundle_files[vardepsexclude] = "DATETIME" python do_bundle_files() { bb.build.exec_func('create_bundle_files', d) } addtask bundle_files after do_vmimg before do_build do_bundle_files[nostamp] = "1"
SUMMARY = "An image containing the build system itself" DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation." HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client" IMAGE_FEATURES += "x11-base package-management splash" # Ensure there's enough space to do a core-image-sato build, with rm_work enabled IMAGE_ROOTFS_EXTRA_SPACE = "41943040" # Do a quiet boot with limited console messages APPEND += "rootfstype=ext4 quiet" DEPENDS = "zip-native" IMAGE_FSTYPES = "vmdk" inherit core-image module-base SRCREV ?= "b6d61ec9977b5625865d711eff3f0fc960d949ec" SRC_URI = "git://git.yoctoproject.org/poky;branch=master \ file://Yocto_Build_Appliance.vmx \ file://Yocto_Build_Appliance.vmxf \ file://README_VirtualBox_Guest_Additions.txt \ " BA_INCLUDE_SOURCES ??= "0" IMAGE_CMD_ext4_append () { # We don't need to reserve much space for root, 0.5% is more than enough tune2fs -m 0.5 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4 } fakeroot do_populate_poky_src () { # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo # will become invalid in the target. rm -rf ${WORKDIR}/git/.git rm -f ${WORKDIR}/git/.gitignore cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads if [ ${BA_INCLUDE_SOURCES} != 0 ]; then cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/ # Remove the git2_* tarballs -- this is ok since we still have the git2/. rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_* fi # Place the README_VirtualBox_Guest_Additions file in builders home folder. cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ # Create a symlink, needed for out-of-tree kernel modules 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 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc # Also save (for reference only) the actual SRCREV used to create this image echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# If working behind a proxy and using the provided oe-git-proxy script" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# you need to set ALL_PROXY based on your proxy settings." >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# Example ALL_PROXY values:" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# export ALL_PROXY=https://proxy.example.com:8080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc echo "# export ALL_PROXY=socks://socks.example.com:1080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky # Assume we will need CDROM to install guest additions mkdir -p ${IMAGE_ROOTFS}/media/cdrom # Allow builder to use sudo echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers # Load tap/tun at startup lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables echo "tun" >> ${IMAGE_ROOTFS}/etc/modules # Use Clearlooks GTK+ theme mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0 echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc } IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " addtask rootfs after do_unpack python () { # Ensure we run these usually noexec tasks d.delVarFlag("do_fetch", "noexec") d.delVarFlag("do_unpack", "noexec") } create_bundle_files () { cd ${WORKDIR} mkdir -p Yocto_Build_Appliance cp *.vmx* Yocto_Build_Appliance ln -sf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance.zip } create_bundle_files[vardepsexclude] = "DATETIME" python do_bundle_files() { bb.build.exec_func('create_bundle_files', d) } addtask bundle_files after do_vmimg before do_build do_bundle_files[nostamp] = "1"