diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-core/images | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-core/images')
11 files changed, 453 insertions, 0 deletions
diff --git a/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt new file mode 100644 index 000000000..e7298f2c3 --- /dev/null +++ b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt @@ -0,0 +1,75 @@ + +Installing VirtualBox Guest Additions +===================================== + +In order to use VirtualBox guest additions, they have to be build +first. They may have to be rebuilt each time the time you upgrade to +a new version of VirtualBox. + +Make sure VM is configured with an Optical Drive. + +Please follow these steps to install the VirtualBox Guest Additions on the +Build Appliance VM: + +1. Boot VM, select root "Terminal" instead of the default "Terminal <2>" + +2. Insert Guest additions CD into VM optical drive: + VM menu "Devices"->"Optical Drives"-> Select "VBoxGuestAdditions<version>.iso" + +3. Find your CDROM device. Typically it is /dev/hda for IDE. You can determine + the actual name <cdromedev> by viewing the cdrom info: + + # cat /proc/sys/dev/cdrom/info + + Mount the cdrom drive: + # mount -t iso9660 <cdromdev> /media/cdrom + i.e.: + # mount -t iso9660 /dev/hda /media/cdrom + +4. Build the additions: + + First, we need to build of some prerequisite utilities. + (This is only needed to be done once) + + # cd /lib/modules/<kernel-version>-yocto-standard/build + # make scripts + + Now build the guest additions: + + # /media/cdrom/VBoxLinuxAdditions.run --nox11 + + At this point, providing there were no build errors, the guest additions are + built and installed. + +5. Check if vbox additions running: + + # /etc/init.d/vboxadd status + + If not running, try manually starting: + + # /etc/init.d/vboxadd start + +6. Check if additons actually work, in particular folder sharing. + + Host: Devices->Shared Folders->Shared Folder Settings... + Add any host folder and name it (i.e. "images") + + Guest VM: create mount point for the shared folder, i.e.: + + # mkdir ~/my-host + + Mount the shared folder: (Watch out for spelling: it's vboxsf NOT vboxfs) + + # mount -t vboxsf images ~/my-host + + Verify mount, should see the contents of the shared folder: + + # ls ~/my-host + + + + + + + + diff --git a/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt new file mode 100644 index 000000000..a0aede2fb --- /dev/null +++ b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt @@ -0,0 +1,78 @@ + +Running Toaster in VirtualBox +============================= + +Toaster is launched via the command in VM: + + $ source toaster start webport=<IPADDR:PORT> + +The interaction with Toaster web server is done via a host internet +browser. +The particular steps depend on the actual networking being used +by the VirtualBox. + + +Bridged Network +=============== + +Find out your VM network IP address: + + $ ifconfig + +IP address is listed under eth0 inet addr. +It should be something like: + inet addr:192.168.1.18 + +Launch the Toaster web server in VM: + + $ source toaster start webport=192.168.1.18:8000 + +Interact with the Toaster web server with your host browser using URL: + + http://192.168.1.18:8000 + + +NAT Network +=========== +Find out your VM network IP address: + + $ ifconfig + +IP address is listed under eth0 inet addr. +For NAT network it should be something like: + inet addr:10.0.2.15 + +When using NAT network, the VM web server can be accessed using +Port Forwarding. + +Using the VirtualBox GUI, navigate to: + Settings->Network->Adapter1 + +You should set: + Attached to: NAT + +Select "Advanced", click on "Port Forwarding" + +This will open a new dialog box "Port Forwarding Rules". +Create a new rule that looks like this: + +| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port | ++-------+----------+---------+-----------+----------+------------+ +| Rule1 | TCP | | 8000 | | 8000 | +------------------------------------------------------------------ + +Now we can launch the Toaster web server in VM: + + $ source toaster start webport=10.0.2.15:8000 + +Interact with the Toaster web server with your host browser using URL: + + http://127.0.0.1:8000 + + + + + + + + diff --git a/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx new file mode 100644 index 000000000..6472e8750 --- /dev/null +++ b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx @@ -0,0 +1,46 @@ +.encoding = "UTF-8" +config.version = "8" +virtualHW.version = "10" +numvcpus = "2" +vcpu.hotadd = "TRUE" +memsize = "4096" +mem.hotadd = "TRUE" +sata0.present = "TRUE" +sata0:0.present = "TRUE" +sata0:0.fileName = "Yocto_Build_Appliance.vmdk" +ethernet0.present = "TRUE" +ethernet0.virtualDev = "e1000" +ethernet0.wakeOnPcktRcv = "FALSE" +ethernet0.addressType = "generated" +usb.present = "TRUE" +ehci.pciSlotNumber = "0" +sound.present = "TRUE" +sound.fileName = "-1" +sound.autodetect = "TRUE" +pciBridge0.present = "TRUE" +pciBridge4.present = "TRUE" +pciBridge4.virtualDev = "pcieRootPort" +pciBridge4.functions = "8" +pciBridge5.present = "TRUE" +pciBridge5.virtualDev = "pcieRootPort" +pciBridge5.functions = "8" +pciBridge6.present = "TRUE" +pciBridge6.virtualDev = "pcieRootPort" +pciBridge6.functions = "8" +pciBridge7.present = "TRUE" +pciBridge7.virtualDev = "pcieRootPort" +pciBridge7.functions = "8" +vmci0.present = "TRUE" +hpet0.present = "TRUE" +usb.vbluetooth.startConnected = "TRUE" +displayName = "Yocto Build Appliance" +guestOS = "other3xlinux-64" +virtualHW.productCompatibility = "hosted" +gui.exitOnCLIHLT = "FALSE" +powerType.powerOff = "soft" +powerType.powerOn = "soft" +powerType.suspend = "soft" +powerType.reset = "soft" +extendedConfigFile = "Yocto_Build_Appliance.vmxf" +scsi0:0.present = "FALSE" +floppy0.present = "FALSE" diff --git a/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf new file mode 100644 index 000000000..9e941ff2f --- /dev/null +++ b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<Foundry> +<VM> +<VMId type="string">52 a5 d8 cb ed 6c 85 48-cd 99 68 af cc 30 a0 98</VMId> +<ClientMetaData> +<clientMetaDataAttributes/> +<HistoryEventList/></ClientMetaData> +<vmxPathName type="string">Yocto_Build_Appliance.vmx</vmxPathName></VM></Foundry> diff --git a/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb new file mode 100644 index 000000000..db2f58dfb --- /dev/null +++ b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb @@ -0,0 +1,136 @@ +SUMMARY = "An image containing the build system itself" +DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation." +HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "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 \ + tzdata python3-pip perl-misc" + +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 python3-pip-native" +IMAGE_FSTYPES = "wic.vmdk" + +inherit core-image module-base setuptools3 + +SRCREV ?= "14d62d5c14e3552f2aeabdbd80d1504bb2c6ed64" +SRC_URI = "git://git.yoctoproject.org/poky;branch=sumo \ + file://Yocto_Build_Appliance.vmx \ + file://Yocto_Build_Appliance.vmxf \ + file://README_VirtualBox_Guest_Additions.txt \ + file://README_VirtualBox_Toaster.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 ${IMGDEPLOYDIR}/${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/ + + # Place the README_VirtualBox_Toaster file in builders home folder. + 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 + 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 'export PATH=$PATH:/sbin' >> ${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 + rm -f ${IMAGE_ROOTFS}/sbin/iptables + 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 + + # 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_params="--user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt" + if [ -n "${http_proxy}" ]; then + pip3_install_params="${pip3_install_params} --proxy ${http_proxy}" + fi + pip3 install ${pip3_install_params} + chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.local + chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.cache +} + +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 ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk + zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance + ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/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_image_wic before do_image_complete diff --git a/poky/meta/recipes-core/images/core-image-base.bb b/poky/meta/recipes-core/images/core-image-base.bb new file mode 100644 index 000000000..75a08cfc9 --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-base.bb @@ -0,0 +1,8 @@ +SUMMARY = "A console-only image that fully supports the target device \ +hardware." + +IMAGE_FEATURES += "splash" + +LICENSE = "MIT" + +inherit core-image diff --git a/poky/meta/recipes-core/images/core-image-minimal-dev.bb b/poky/meta/recipes-core/images/core-image-minimal-dev.bb new file mode 100644 index 000000000..93ead2055 --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-minimal-dev.bb @@ -0,0 +1,7 @@ +require core-image-minimal.bb + +DESCRIPTION = "A small image just capable of allowing a device to boot and \ +is suitable for development work." + +IMAGE_FEATURES += "dev-pkgs" + diff --git a/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb b/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb new file mode 100644 index 000000000..6de860e43 --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb @@ -0,0 +1,33 @@ +# Simple initramfs image. Mostly used for live images. +DESCRIPTION = "Small image capable of booting a device. The kernel includes \ +the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ +first 'init' program more efficiently." + +INITRAMFS_SCRIPTS ?= "\ + initramfs-framework-base \ + initramfs-module-setup-live \ + initramfs-module-udev \ + initramfs-module-install \ + initramfs-module-install-efi \ + " + +PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "${MLPREFIX}core-image-minimal-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +BAD_RECOMMENDATIONS += "busybox-syslog" + +# Use the same restriction as initramfs-live-install +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb new file mode 100644 index 000000000..c92234c08 --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb @@ -0,0 +1,7 @@ +require core-image-minimal.bb + +DESCRIPTION = "Small image capable of booting a device with support for the \ +Minimal MTD Utilities, which let the user interact with the MTD subsystem in \ +the kernel to perform operations on flash devices." + +IMAGE_INSTALL += "mtd-utils" diff --git a/poky/meta/recipes-core/images/core-image-minimal.bb b/poky/meta/recipes-core/images/core-image-minimal.bb new file mode 100644 index 000000000..4630026aa --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-minimal.bb @@ -0,0 +1,12 @@ +SUMMARY = "A small image just capable of allowing a device to boot." + +IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}" + +IMAGE_LINGUAS = " " + +LICENSE = "MIT" + +inherit core-image + +IMAGE_ROOTFS_SIZE ?= "8192" +IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}" diff --git a/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb b/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb new file mode 100644 index 000000000..51d08a0cd --- /dev/null +++ b/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb @@ -0,0 +1,43 @@ +# Simple initramfs image artifact generation for tiny images. +DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \ +the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ +first 'init' program more efficiently. core-image-tiny-initramfs doesn't \ +actually generate an image but rather generates boot and rootfs artifacts \ +that can subsequently be picked up by external image generation tools such as wic." + +PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "core-image-tiny-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +# don't actually generate an image, just the artifacts needed for one +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +BAD_RECOMMENDATIONS += "busybox-syslog" + +# Use the same restriction as initramfs-live-install +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" + +python tinyinitrd () { + # Modify our init file so the user knows we drop to shell prompt on purpose + newinit = None + with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init: + newinit = init.read() + newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:') + with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init: + init.write(newinit) +} + +IMAGE_PREPROCESS_COMMAND += "tinyinitrd;" + +QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init" |