diff options
author | Juro Bystricky <juro.bystricky@intel.com> | 2016-04-09 13:11:51 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-11 09:03:58 +0100 |
commit | faaeaf98c790c35c18fd9aadc8257634dc7a1597 (patch) | |
tree | 99e196d757f7c9715a37b30fe82a960b61f502f6 /meta | |
parent | 778121ab844af623a215430ba579a5fb3947928b (diff) | |
download | poky-faaeaf98c790c35c18fd9aadc8257634dc7a1597.tar.gz |
build-appliance-image: Support for VirtualBox guest additions
Add support for VirtualBox guest additions.
The additions are built inside the Build Appliance VM.
For this to be possible, the environment for out-of-tree kernel module builds
must be present and set up properly.
A README file with detailed steps on how to build the guest additions is placed
in the home directory of the user "builder" as well.
The main purpose of the guest additions is to allow sharing folders between
the host and Build Appliance VM.
[YOCTO #8073]
(From OE-Core rev: a11c9fd6e3ca9a76c866f13fcc12b8d2e60a4097)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt | 75 | ||||
-rw-r--r-- | meta/recipes-core/images/build-appliance-image_14.0.0.bb | 14 |
2 files changed, 87 insertions, 2 deletions
diff --git a/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt b/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt new file mode 100644 index 0000000000..e7298f2c3c --- /dev/null +++ b/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | |||
2 | Installing VirtualBox Guest Additions | ||
3 | ===================================== | ||
4 | |||
5 | In order to use VirtualBox guest additions, they have to be build | ||
6 | first. They may have to be rebuilt each time the time you upgrade to | ||
7 | a new version of VirtualBox. | ||
8 | |||
9 | Make sure VM is configured with an Optical Drive. | ||
10 | |||
11 | Please follow these steps to install the VirtualBox Guest Additions on the | ||
12 | Build Appliance VM: | ||
13 | |||
14 | 1. Boot VM, select root "Terminal" instead of the default "Terminal <2>" | ||
15 | |||
16 | 2. Insert Guest additions CD into VM optical drive: | ||
17 | VM menu "Devices"->"Optical Drives"-> Select "VBoxGuestAdditions<version>.iso" | ||
18 | |||
19 | 3. Find your CDROM device. Typically it is /dev/hda for IDE. You can determine | ||
20 | the actual name <cdromedev> by viewing the cdrom info: | ||
21 | |||
22 | # cat /proc/sys/dev/cdrom/info | ||
23 | |||
24 | Mount the cdrom drive: | ||
25 | # mount -t iso9660 <cdromdev> /media/cdrom | ||
26 | i.e.: | ||
27 | # mount -t iso9660 /dev/hda /media/cdrom | ||
28 | |||
29 | 4. Build the additions: | ||
30 | |||
31 | First, we need to build of some prerequisite utilities. | ||
32 | (This is only needed to be done once) | ||
33 | |||
34 | # cd /lib/modules/<kernel-version>-yocto-standard/build | ||
35 | # make scripts | ||
36 | |||
37 | Now build the guest additions: | ||
38 | |||
39 | # /media/cdrom/VBoxLinuxAdditions.run --nox11 | ||
40 | |||
41 | At this point, providing there were no build errors, the guest additions are | ||
42 | built and installed. | ||
43 | |||
44 | 5. Check if vbox additions running: | ||
45 | |||
46 | # /etc/init.d/vboxadd status | ||
47 | |||
48 | If not running, try manually starting: | ||
49 | |||
50 | # /etc/init.d/vboxadd start | ||
51 | |||
52 | 6. Check if additons actually work, in particular folder sharing. | ||
53 | |||
54 | Host: Devices->Shared Folders->Shared Folder Settings... | ||
55 | Add any host folder and name it (i.e. "images") | ||
56 | |||
57 | Guest VM: create mount point for the shared folder, i.e.: | ||
58 | |||
59 | # mkdir ~/my-host | ||
60 | |||
61 | Mount the shared folder: (Watch out for spelling: it's vboxsf NOT vboxfs) | ||
62 | |||
63 | # mount -t vboxsf images ~/my-host | ||
64 | |||
65 | Verify mount, should see the contents of the shared folder: | ||
66 | |||
67 | # ls ~/my-host | ||
68 | |||
69 | |||
70 | |||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
diff --git a/meta/recipes-core/images/build-appliance-image_14.0.0.bb b/meta/recipes-core/images/build-appliance-image_14.0.0.bb index a34a621c4c..eeb301df57 100644 --- a/meta/recipes-core/images/build-appliance-image_14.0.0.bb +++ b/meta/recipes-core/images/build-appliance-image_14.0.0.bb | |||
@@ -6,7 +6,7 @@ LICENSE = "MIT" | |||
6 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | 6 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ |
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 kernel-dev kernel-devsrc " |
10 | 10 | ||
11 | IMAGE_FEATURES += "x11-base package-management splash" | 11 | IMAGE_FEATURES += "x11-base package-management splash" |
12 | 12 | ||
@@ -19,12 +19,13 @@ APPEND += "rootfstype=ext4 quiet" | |||
19 | DEPENDS = "zip-native" | 19 | DEPENDS = "zip-native" |
20 | IMAGE_FSTYPES = "vmdk" | 20 | IMAGE_FSTYPES = "vmdk" |
21 | 21 | ||
22 | inherit core-image | 22 | inherit core-image module-base |
23 | 23 | ||
24 | SRCREV ?= "00c4c9bf0007b964dfa4559fe8fc8687f14cdec3" | 24 | SRCREV ?= "00c4c9bf0007b964dfa4559fe8fc8687f14cdec3" |
25 | SRC_URI = "git://git.yoctoproject.org/poky \ | 25 | SRC_URI = "git://git.yoctoproject.org/poky \ |
26 | file://Yocto_Build_Appliance.vmx \ | 26 | file://Yocto_Build_Appliance.vmx \ |
27 | file://Yocto_Build_Appliance.vmxf \ | 27 | file://Yocto_Build_Appliance.vmxf \ |
28 | file://README_VirtualBox_Guest_Additions.txt \ | ||
28 | " | 29 | " |
29 | BA_INCLUDE_SOURCES ??= "0" | 30 | BA_INCLUDE_SOURCES ??= "0" |
30 | 31 | ||
@@ -49,6 +50,12 @@ fakeroot do_populate_poky_src () { | |||
49 | rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_* | 50 | rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_* |
50 | fi | 51 | fi |
51 | 52 | ||
53 | # Place the README_VirtualBox_Guest_Additions file in builders home folder. | ||
54 | cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ | ||
55 | |||
56 | # Create a symlink, needed for out-of-tree kernel modules build | ||
57 | ln -snr ${IMAGE_ROOTFS}/usr/src/kernel ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build | ||
58 | |||
52 | echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone | 59 | echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone |
53 | echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf | 60 | echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf |
54 | mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo | 61 | mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo |
@@ -70,6 +77,9 @@ fakeroot do_populate_poky_src () { | |||
70 | chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky | 77 | chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky |
71 | chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky | 78 | chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky |
72 | 79 | ||
80 | # Assume we will need CDROM to install guest additions | ||
81 | mkdir -p ${IMAGE_ROOTFS}/media/cdrom | ||
82 | |||
73 | # Allow builder to use sudo to setup tap/tun | 83 | # Allow builder to use sudo to setup tap/tun |
74 | echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers | 84 | echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers |
75 | 85 | ||