This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
civilinfrastructureplatform:cipsystembuildhowto [2017/07/04 11:51] rajmarshall correct path |
civilinfrastructureplatform:cipsystembuildhowto [2018/11/21 16:06] (current) rajmarshall better line spacing |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Build the CIP System and Artifacts (4/5) ====== | ====== Build the CIP System and Artifacts (4/5) ====== | ||
- | This set of instructions assumes you have already Setup and Configured the B@D Virtual Machine. If that is not the case please go back to the [[beagleboneblackboard | Beaglebone Black Setup & Configuration]]. | + | This set of instructions assumes you have already Setup and Configured the B@D Virtual Machine. If that is not the case please go back to the [[beagleboneblackboard | Beaglebone Black Setup & Configuration]] or the [[renesasboard| IWG20M Setup & Configuration]] depending on which board you are using. |
- | ===== Creating an initramfs with BusyBox for the Beaglebone Black ===== | + | ===== Creating an initramfs with BusyBox for the board ===== |
BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. BusyBox provides a fairly complete environment from which to boot any embedded system. | BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. BusyBox provides a fairly complete environment from which to boot any embedded system. | ||
Line 11: | Line 11: | ||
**Prerequisites:** | **Prerequisites:** | ||
- | You must have the CIP Board-at-Desk Single-Developer (B@D) v0.9 Virtual Machine set up with make, gcc and the arm cross compilers. | + | You must have the CIP Board-at-Desk Single-Developer (B@D) Virtual Machine set up with make, gcc and the arm cross compilers. |
1. Connect to the B@D Virtual Machine. | 1. Connect to the B@D Virtual Machine. | ||
Line 35: | Line 35: | ||
4. Download the busybox source code and unzip it. | 4. Download the busybox source code and unzip it. | ||
- | ''vagrant@guest:~/work$ **wget https://www.busybox.net/downloads/busybox-1.26.2.tar.bz2**'' | + | ''vagrant@guest:~/work$ **wget http://busybox.net/downloads/busybox-1.28.0.tar.bz2**'' |
- | ''vagrant@guest:~/work$ **tar -xvf busybox-1.26.2.tar.bz2**'' | + | ''vagrant@guest:~/work$ **tar -xvf busybox-1.28.0.tar.bz2**'' |
- | ''vagrant@guest:~/work$ **cd busybox-1.26.2**'' | + | ''vagrant@guest:~/work$ **cd busybox-1.28.0**'' |
5. Create the default configuration | 5. Create the default configuration | ||
- | ''vagrant@guest:~/work/busybox-1.26.2$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig**'' | + | ''vagrant@guest:~/work/busybox-1.28.0$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig**'' |
6. Configure and make the ''initramfs'' | 6. Configure and make the ''initramfs'' | ||
- | ''vagrant@guest:~/work/busybox-1.26.2$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig**'' | + | ''vagrant@guest:~/work/busybox-1.28.0$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig**'' |
7. Select the following settings: **Busybox Settings -> Build Options -> Build Busybox as a static binary (no shared libs)** | 7. Select the following settings: **Busybox Settings -> Build Options -> Build Busybox as a static binary (no shared libs)** | ||
Line 60: | Line 60: | ||
11. Execute the following commands for building the ''initramfs'' | 11. Execute the following commands for building the ''initramfs'' | ||
- | ''vagrant@guest:~/work/busybox-1.26.2$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_PREFIX=/home/vagrant/work/initramfs /home/vagrant/work/initramfs install**'' | + | ''vagrant@guest:~/work/busybox-1.28.0$ **make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_PREFIX=/home/vagrant/work/initramfs /home/vagrant/work/initramfs install**'' |
- | ''vagrant@guest:~/work/busybox-1.26.2$ **cd ..**'' | + | ''vagrant@guest:~/work/busybox-1.28.0$ **cd ../initramfs**'' |
- | ''vagrant@guest:~/work$ **cd initramfs**'' | ||
//Note:// | //Note:// | ||
Line 70: | Line 69: | ||
//After the successful completion of the above commands, you can see 3 directories (''bin'', ''sbin'', ''usr'') and one file, ''linuxrc'' created in your ''initramfs'' directory.// | //After the successful completion of the above commands, you can see 3 directories (''bin'', ''sbin'', ''usr'') and one file, ''linuxrc'' created in your ''initramfs'' directory.// | ||
- | **The ''/dev'' Directory:** | ||
- | 12. Create the ''/dev'' directory and create some special files under it. | + | 12. Create the ''initramfs.cpio.gz'' |
- | ''vagrant@guest:~/work/initramfs$ **mkdir dev**'' | + | ''vagrant@guest:~/work/initramfs$ /vagrant/scripts/configure_initramfs.sh '' |
- | ''vagrant@guest:~/work/initramfs$ **sudo mknod dev/console c 5 1**'' | ||
- | ''vagrant@guest:~/work/initramfs$ **sudo mknod dev/null c 1 3**'' | + | **Make it available for the LAVA testing environment:** |
- | ''vagrant@guest:~/work/initramfs$ **sudo mknod dev/zero c 1 5**'' | + | 13. Copy the ''initramfs.cpio.gz'' to the ''initramfs'' directory where it can be retrieved by LAVA. |
- | + | ||
- | + | ||
- | //Note:// | + | |
- | + | ||
- | - // /dev/console, is the place which the kernel uses for interaction. // | + | |
- | + | ||
- | - // /dev/null behaves like an empty file and is used to suppress the output from commands/programs. // | + | |
- | + | ||
- | - // /dev/zero contains sequence of zeros used to fill up the memory regions. // | + | |
- | + | ||
- | + | ||
- | **The ''/lib'' and ''/usr/lib'' Directories:** | + | |
- | + | ||
- | 13. For the static libraries, copy from the ARM cross compiler toolchain path. | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **mkdir lib usr/lib**'' | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **rsync -a /usr/arm-linux-gnueabihf/lib/ ./lib/**'' | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **rsync -a /usr/arm-linux-gnueabihf/lib/ ./usr/lib/**'' | + | |
- | + | ||
- | + | ||
- | **The ''/proc'', ''/sys'', and ''/root'' Directories:** | + | |
- | + | ||
- | 14. Create directories for mounting the virtual filesystems ''procfs'', ''sysfs'' and ''root'' directory. | + | |
- | + | ||
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **mkdir proc sys root**'' | + | |
- | + | ||
- | + | ||
- | **The ''/etc'' Directory:** | + | |
- | + | ||
- | 15. Create ''/etc'' and then, create additional files inside this directory. | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **mkdir etc**'' | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **nano etc/inittab**'' | + | |
- | + | ||
- | null::sysinit:/bin/mount -a | + | |
- | null::sysinit:/bin/hostname -F /etc/hostname | + | |
- | null::respawn:/bin/cttyhack /bin/login root | + | |
- | null::restart:/sbin/reboot | + | |
- | + | ||
- | 16. Create another file called ''fstab'' and populate it. This file will mount the virtual file systems. | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **nano etc/fstab**'' | + | |
- | + | ||
- | proc /proc proc defaults 0 0 | + | |
- | sysfs /sys sysfs defaults 0 0 | + | |
- | + | ||
- | 17. Create the ''hostname'' file. | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **nano etc/hostname**'' | + | |
- | + | ||
- | beagleboneblack | + | |
- | + | ||
- | 18. Create the ''passwd'' file. | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **nano etc/passwd**'' | + | |
- | + | ||
- | root::0:0:root:/root:/bin/sh | + | |
- | + | ||
- | 19. Create an ''init'' file. | + | |
- | ''vagrant@guest:~/work/initramfs$ ** touch init**'' | + | |
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ ** chmod +x init**'' | + | |
- | + | ||
- | Edit init giving it the following contents: | + | |
- | https://gitlab.com/cip-project/cip-testing/testing/snippets/1666441 | + | |
- | + | ||
- | + | ||
- | 20. Create the ''initramfs.cpio.gz'' | + | |
- | + | ||
- | + | ||
- | ''vagrant@guest:~/work/initramfs$ **find . -depth -print | cpio -ocvB | gzip -c > ../initramfs.cpio.gz**'' | + | |
- | + | ||
- | + | ||
- | **Test it on the Beaglebone Black:** | + | |
- | + | ||
- | 21. Copy the ''initramfs.cpio.gz'' to the ''initramfs'' directory where it can be retrieved by LAVA. | + | |
''vagrant@guest:~/work/initramfs$ **sudo cp ../initramfs.cpio.gz /var/www/images/kernel-ci/initramfs**'' | ''vagrant@guest:~/work/initramfs$ **sudo cp ../initramfs.cpio.gz /var/www/images/kernel-ci/initramfs**'' | ||
- | 22. In the LAVA web-based frontend, click on **Scheduler** -> **Submit Job** | ||
- | |||
- | 23. Copy the Beaglebone Black Health Check Job and paste it into the Job Definition box. | ||
- | |||
- | 24. Change the link for the ''initramfs.cpio.gz'' file to the VM's IP Address and the path to the file: | ||
- | ramdisk: | ||
- | url: http://localhost:8010/initramfs/initramfs.cpio.gz | ||
- | compression: gz | ||
---- | ---- | ||
Line 180: | Line 89: | ||
==== Prerequisites: ==== | ==== Prerequisites: ==== | ||
- | * A working CIP Board-at-Desk Single-Developer (B@D) v0.9 Virtual Machine | + | * A working CIP Board-at-Desk Single-Developer (B@D) Virtual Machine |
==== Procedure: ==== | ==== Procedure: ==== | ||
Line 200: | Line 109: | ||
'' vagrant@guest:~/git-repos$ **git clone [[git://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-cip.git]]** '' | '' vagrant@guest:~/git-repos$ **git clone [[git://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-cip.git]]** '' | ||
- | 4. Find the branch of the kernel version you want (We will use '4.4.69-cip4' for this example) | + | 4. Find the branch of the kernel version you want (We will use '4.4.83-cip8' for this example) |
'' vagrant@guest:~/git-repos$ **cd linux-cip** '' | '' vagrant@guest:~/git-repos$ **cd linux-cip** '' | ||
Line 210: | Line 119: | ||
v4.4.55-cip3 | v4.4.55-cip3 | ||
v4.4.69-cip4 | v4.4.69-cip4 | ||
+ | v4.4.75-cip5 | ||
+ | v4.4.75-cip6 | ||
+ | v4.4.75-cip7 | ||
+ | v4.4.83-cip8 | ||
+ | etc. | ||
- | 5. Create a new branch using the latest CIP tag. | + | 5. Create a new branch using the latest CIP tag. For example: |
- | '' vagrant@guest:~/git-repos/linux-cip$ **git checkout -b cip_v4.4.69 v4.4.69-cip4** '' | + | '' vagrant@guest:~/git-repos/linux-cip$ **git checkout -b cip_v4.4.83 v4.4.83-cip8** '' |
6. Set the environment variables. You can create a tree name that describes your project. Select the Architecture of the target device (i.e. arm, arm64, mips, i386, amd64, etc.). Choose the cross compiler you need for that architecture. | 6. Set the environment variables. You can create a tree name that describes your project. Select the Architecture of the target device (i.e. arm, arm64, mips, i386, amd64, etc.). Choose the cross compiler you need for that architecture. | ||
Line 225: | Line 139: | ||
//Note: Don't forget the dash (-) at the end of the ''CROSS_COMPILE'' line!// | //Note: Don't forget the dash (-) at the end of the ''CROSS_COMPILE'' line!// | ||
- | 7. Execute the ''build.py'' command, passing in the Beaglebone Black configuration. | + | 7. If using the Beaglebone Black execute the ''build.py'' command, passing in the Beaglebone Black configuration. |
''vagrant@guest:~/git-repos/linux-cip$ **~/kernelci-build/build.py -c omap2plus_defconfig -p CIP-KernelCI**'' | ''vagrant@guest:~/git-repos/linux-cip$ **~/kernelci-build/build.py -c omap2plus_defconfig -p CIP-KernelCI**'' | ||
Line 235: | Line 149: | ||
INFO: published artifacts | INFO: published artifacts | ||
... | ... | ||
- | cip-example/cip_v4.4.69/v4.4.69-cip4/arm/omap2plus_defconfig/dtbs/am335x-boneblack.dtb | + | cip-example/cip_v4.4.83/v4.4.83-cip8/arm/omap2plus_defconfig/dtbs/am335x-boneblack.dtb |
... | ... | ||
INFO: triggering build | INFO: triggering build | ||
202 | 202 | ||
- | 8. Start the Kernel CI web server | + | 8. If using the Renesas IWG20M execute the ''build.py'' command, passing in the IWG20M configuration. |
+ | |||
+ | ''vagrant@guest:~/git-repos/linux-cip$ **~/kernelci-build/build.py -c shmobile_defconfig -p CIP-KernelCI**'' | ||
+ | |||
+ | make -j4 -k -s ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=build-arm shmobile_defconfig | ||
+ | make -j4 -k -s ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=build-arm | ||
+ | INFO: published artifacts | ||
+ | |||
+ | ... | ||
+ | cip-example/cip4.4.126/v4.4.126-cip22/arm/shmobile_defconfig/dtbs/r8a7743-iwg20d-q7.dtb | ||
+ | ... | ||
+ | INFO: triggering build | ||
+ | 202 | ||
+ | |||
+ | 9. Start the Kernel CI web server | ||
''vagrant@guest:**/vagrant/scripts/start_webserver.sh &**'' | ''vagrant@guest:**/vagrant/scripts/start_webserver.sh &**'' | ||
- | 9. On your host machine, open a web browser and enter the following in the address box: | + | 10. On your host machine, open a web browser and enter the following in the address box: |
''**<nowiki>http://localhost:5000</nowiki>**'' | ''**<nowiki>http://localhost:5000</nowiki>**'' | ||
- | 10. You will see the KernelCI Website home page from which, you can navigate to the different builds and Trees that you've created (see the **Example Builds** section below). | + | //Note that if you are using Windows 10 as a host you will need to use either Chrome or Firefox as a browser for the Windows browsers do not work with the KernelCI webserver.// |
+ | |||
+ | 11. You will see the KernelCI Website home page from which you can navigate to the different builds and Trees that you've created (see the **Example Builds** section below). | ||
- | 11. Click on the **Jobs** button at the top of the page and you will see all of the available Trees | + | 12. Click on the **Jobs** button at the top of the page and you will see all of the available Trees |
- | 12. Click on the **Tree name** (cip-example) and you will see the list of available builds, or kernel versions for that tree. | + | 13. Click on the **Tree name** (cip-example) and you will see the list of available builds, or kernel versions for that tree. |
- | 13. Click on the **v4.4.69** kernel and you will see the list of build configurations (omap2plus). | + | 14. Click on the (for example) **v4.4.83** kernel and you will see the list of build configurations (for example omap2plus). |
- | 14. The files that resulted from the build are available in the KernelCI website by navigating to the Tree Name, Kernel version, and Configuration. They are stored on the hard drive at: | + | 15. The files that resulted from the build are available in the KernelCI website by navigating to the Tree Name, Kernel version, and Configuration. They are stored on the hard drive at: |
''/var/www/images/kernel-ci/TREE_NAME/KERNEL_VERSION/BRANCH/ARCH/CONFIG'' | ''/var/www/images/kernel-ci/TREE_NAME/KERNEL_VERSION/BRANCH/ARCH/CONFIG'' | ||
Line 262: | Line 192: | ||
=== Example Builds === | === Example Builds === | ||
- | 15. For instance, for the build with the following parameters: | + | 16. For instance, for the build with the following parameters: |
* TREE_NAME: **cip-example** | * TREE_NAME: **cip-example** | ||
- | * KERNEL_VERSION: **v4.4.69-cip4** | + | * KERNEL_VERSION: **v4.4.83-cip8** |
- | * BRANCH: **cip_v4.4.69** (This came from the name we used in the ''git checkout'' step.) | + | * BRANCH: **cip_v4.4.83** (This came from the name we used in the ''git checkout'' step.) |
* ARCH: **arm** | * ARCH: **arm** | ||
* CONFIG: **omap2plus** | * CONFIG: **omap2plus** | ||
Line 272: | Line 202: | ||
The files will be located at: | The files will be located at: | ||
- | ''/var/www/images/kernel-ci/cip-example/v4.4.69-cip4/cip_v4.4.69/arm/omap2plus'' | + | ''/var/www/images/kernel-ci/cip-example/v4.4.83-cip8/cip_v4.4.83/arm/omap2plus'' |
- | 16. Kernel CI generates the following files. Make a note of the ones in **bold**. They will be needed for testing the CIP Kernel: | + | 17. Kernel CI generates the following files. Make a note of the ones in **bold**. They will be needed for testing the CIP Kernel: |
* ''build.log'' shows the output of the build process to help track down any issues in compilation. | * ''build.log'' shows the output of the build process to help track down any issues in compilation. | ||
Line 288: | Line 218: | ||
* ''**dtbs**'' directory which holds all of the generated Device Tree Binary's. | * ''**dtbs**'' directory which holds all of the generated Device Tree Binary's. | ||
- | 17. Check the [[civilinfrastructureplatform/ciptestingreferencetestcases|reference test cases]] and try them as reference examples. | + | 18. Check the [[civilinfrastructureplatform/ciptestingreferencetestcases|reference test cases]] and try them as reference examples. |