Week1

Clone the Jailhouse-images repository which contains the script that will build you the image for your device -
$ git clone https://github.com/siemens/jailhouse-images.git


Permit the build-images.sh file to be executed
$ chmod +x build-images.sh


Call the script
$ ./build-images.sh

Available images demo images:
1: QEMU/KVM Intel-x86 virtual target
2: QEMU ARM64 virtual target
3: Orange Pi Zero (256 MB edition)
4: Intel NUC (NUC6CAY, 8 GB RAM)
5: Marvell ESPRESSObin (1 GB edition)
6: Marvell MACCHIATObin
7: LeMaker HiKey (Kirin 620 SoC, 2 GB edition)
8: Avnet Ultra96
9: Raspberry Pi 4 (1 GB edition)
10: Pine64+ (Allwinner A64, 2GB edition)
0: all (may take hours...)

Select images to build (space-separated index list):


You’ll get the above output to which you will have to input the no. next to the device for which you want to build the image ( which in this case is 9 ) - This will start the build process.

-------------
Error Maybe !
-------------
If you are running this script as root , then you may face error at some point during the build process .
Reason being ,
If the kas build container is started as root, the host-tar configure step in buildroot will bail out. Beside accidental manual invocation as root, some CI setup may generate such a scenario. Avoid that failure by setting the env variable that the configure step suggests.

Change directory to /recipes-core/non-root-initramfs/files/debian
In debian folder there is a file named - rules
Add the following to the rules file : -

export FORCE_UNSAFE_CONFIGURE=1
override_dh_auto_configure:
cp ../.config .
${MAKE} olddefconfig


Your image should build smoothly but give it like a half an hr to be done.
You will get the image file here -> build/tmp/deploy/images/rpi4/demo-image-jailhouse-demo-rpi4.wic.img


Flash this image on an empty sd card to make a bootable sd-card so you can load it


You need to find the location and name of the microsd card as read by your computer. To list info of all block devices run this -
$ lsblk

Your usb will be listed under sdb
For example -
sdb 8:16 1 14.9G 0 disk
├─sdb1 8:17 1 60.9M 0 part /media/root/boot
└─sdb2 8:18 1 5.7G 0 part /media/root/root

Unmount the blocks under sdb
$ sudo umount dev/sdb/


Use dd to flash the img to sd card
$ dd if= of= bs=4M status=progress && sync

where ,
if = build/tmp/deploy/images/rpi4/demo-image-jailhouse-demo-rpi4.wic.img
and,
of = dev/sdb

Insert the bootable microsd card in your raspi4 and power it up.
The display will open up a console on which you can now run jailhouse.