diff options
| author | Juro Bystricky <juro.bystricky@intel.com> | 2016-12-30 13:35:32 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-16 18:05:12 +0000 |
| commit | 4028407326f18c9059d6227de150100962656310 (patch) | |
| tree | f5842911abfea0d8d5d2ed38c673e30c1164d643 | |
| parent | b138a8bba504734f6c2660442f71a8ecc17b8f7c (diff) | |
| download | poky-4028407326f18c9059d6227de150100962656310.tar.gz | |
build-appliance-image: support for Toaster
Various changes needed to enable to run Toaster in the
Build Appliance:
1. Pre-install packages as specified by the file
"bitbake/toaster-requirements.txt"
2. Include pip3 in the image
3. Include tzdata in the image (needed by django)
4. Bump SRCREV to a commit with proper settings.py (ALLOWED_HOSTS)
for Django 1.8.16
5. Added README_VirtualBox_Toaster.txt to provide steps for
configuring VirtualBox network adapters (NAT or Bridged)
and steps to launch Toaster
[YOCTO#10767]
(From OE-Core rev: dffbac64bbf86c91247ba7373b3b5bd6af24103f)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt | 78 | ||||
| -rw-r--r-- | meta/recipes-core/images/build-appliance-image_15.0.0.bb | 18 |
2 files changed, 93 insertions, 3 deletions
diff --git a/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt b/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt new file mode 100644 index 0000000000..a0aede2fbf --- /dev/null +++ b/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | |||
| 2 | Running Toaster in VirtualBox | ||
| 3 | ============================= | ||
| 4 | |||
| 5 | Toaster is launched via the command in VM: | ||
| 6 | |||
| 7 | $ source toaster start webport=<IPADDR:PORT> | ||
| 8 | |||
| 9 | The interaction with Toaster web server is done via a host internet | ||
| 10 | browser. | ||
| 11 | The particular steps depend on the actual networking being used | ||
| 12 | by the VirtualBox. | ||
| 13 | |||
| 14 | |||
| 15 | Bridged Network | ||
| 16 | =============== | ||
| 17 | |||
| 18 | Find out your VM network IP address: | ||
| 19 | |||
| 20 | $ ifconfig | ||
| 21 | |||
| 22 | IP address is listed under eth0 inet addr. | ||
| 23 | It should be something like: | ||
| 24 | inet addr:192.168.1.18 | ||
| 25 | |||
| 26 | Launch the Toaster web server in VM: | ||
| 27 | |||
| 28 | $ source toaster start webport=192.168.1.18:8000 | ||
| 29 | |||
| 30 | Interact with the Toaster web server with your host browser using URL: | ||
| 31 | |||
| 32 | http://192.168.1.18:8000 | ||
| 33 | |||
| 34 | |||
| 35 | NAT Network | ||
| 36 | =========== | ||
| 37 | Find out your VM network IP address: | ||
| 38 | |||
| 39 | $ ifconfig | ||
| 40 | |||
| 41 | IP address is listed under eth0 inet addr. | ||
| 42 | For NAT network it should be something like: | ||
| 43 | inet addr:10.0.2.15 | ||
| 44 | |||
| 45 | When using NAT network, the VM web server can be accessed using | ||
| 46 | Port Forwarding. | ||
| 47 | |||
| 48 | Using the VirtualBox GUI, navigate to: | ||
| 49 | Settings->Network->Adapter1 | ||
| 50 | |||
| 51 | You should set: | ||
| 52 | Attached to: NAT | ||
| 53 | |||
| 54 | Select "Advanced", click on "Port Forwarding" | ||
| 55 | |||
| 56 | This will open a new dialog box "Port Forwarding Rules". | ||
| 57 | Create a new rule that looks like this: | ||
| 58 | |||
| 59 | | Name | Protocol | Host IP | Host Port | Guest IP | Guest Port | | ||
| 60 | +-------+----------+---------+-----------+----------+------------+ | ||
| 61 | | Rule1 | TCP | | 8000 | | 8000 | | ||
| 62 | ------------------------------------------------------------------ | ||
| 63 | |||
| 64 | Now we can launch the Toaster web server in VM: | ||
| 65 | |||
| 66 | $ source toaster start webport=10.0.2.15:8000 | ||
| 67 | |||
| 68 | Interact with the Toaster web server with your host browser using URL: | ||
| 69 | |||
| 70 | http://127.0.0.1:8000 | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
diff --git a/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/meta/recipes-core/images/build-appliance-image_15.0.0.bb index 5bb655530b..34327e3153 100644 --- a/meta/recipes-core/images/build-appliance-image_15.0.0.bb +++ b/meta/recipes-core/images/build-appliance-image_15.0.0.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SUMMARY = "An image containing the build system itself" | 1 | SUMMARY = "An image containing the build system itself" |
| 2 | DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation." | 2 | DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation." |
| 3 | HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" | 3 | HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" |
| 4 | 4 | ||
| 5 | LICENSE = "MIT" | 5 | LICENSE = "MIT" |
| @@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d | |||
| 7 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 7 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
| 8 | 8 | ||
| 9 | IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ | 9 | IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ |
| 10 | kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client" | 10 | kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \ |
| 11 | tzdata python3-pip" | ||
| 11 | 12 | ||
| 12 | IMAGE_FEATURES += "x11-base package-management splash" | 13 | IMAGE_FEATURES += "x11-base package-management splash" |
| 13 | 14 | ||
| @@ -22,11 +23,12 @@ IMAGE_FSTYPES = "vmdk" | |||
| 22 | 23 | ||
| 23 | inherit core-image module-base | 24 | inherit core-image module-base |
| 24 | 25 | ||
| 25 | SRCREV ?= "ee6ee913aae5ac55ccb9125e03d07d3a767e4157" | 26 | SRCREV ?= "7c3a47ed8965c3a3eb90a9a4678d5caedbba6337" |
| 26 | SRC_URI = "git://git.yoctoproject.org/poky;branch=master \ | 27 | SRC_URI = "git://git.yoctoproject.org/poky;branch=master \ |
| 27 | file://Yocto_Build_Appliance.vmx \ | 28 | file://Yocto_Build_Appliance.vmx \ |
| 28 | file://Yocto_Build_Appliance.vmxf \ | 29 | file://Yocto_Build_Appliance.vmxf \ |
| 29 | file://README_VirtualBox_Guest_Additions.txt \ | 30 | file://README_VirtualBox_Guest_Additions.txt \ |
| 31 | file://README_VirtualBox_Toaster.txt \ | ||
| 30 | " | 32 | " |
| 31 | BA_INCLUDE_SOURCES ??= "0" | 33 | BA_INCLUDE_SOURCES ??= "0" |
| 32 | 34 | ||
| @@ -54,6 +56,9 @@ fakeroot do_populate_poky_src () { | |||
| 54 | # Place the README_VirtualBox_Guest_Additions file in builders home folder. | 56 | # Place the README_VirtualBox_Guest_Additions file in builders home folder. |
| 55 | cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ | 57 | cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ |
| 56 | 58 | ||
| 59 | # Place the README_VirtualBox_Toaster file in builders home folder. | ||
| 60 | cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ | ||
| 61 | |||
| 57 | # Create a symlink, needed for out-of-tree kernel modules build | 62 | # Create a symlink, needed for out-of-tree kernel modules build |
| 58 | lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build | 63 | lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build |
| 59 | 64 | ||
| @@ -88,6 +93,13 @@ fakeroot do_populate_poky_src () { | |||
| 88 | # Use Clearlooks GTK+ theme | 93 | # Use Clearlooks GTK+ theme |
| 89 | mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0 | 94 | mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0 |
| 90 | echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc | 95 | echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc |
| 96 | |||
| 97 | # Install modules needed for toaster | ||
| 98 | export HOME=${IMAGE_ROOTFS}/home/builder | ||
| 99 | mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip | ||
| 100 | pip3 install --user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt | ||
| 101 | chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.local | ||
| 102 | chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.cache | ||
| 91 | } | 103 | } |
| 92 | 104 | ||
| 93 | IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " | 105 | IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " |
