commit | c467441d0aa97909f44f73ddc8d98094af75fa98 | [log] [tgz] |
---|---|---|
author | Allen Webb <allenwebb@google.com> | Fri Mar 12 22:44:06 2021 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Mar 24 21:50:39 2021 |
tree | ca0874c26b2690ab429a941cc54019033b522d27 | |
parent | 4647fb0497b07a5db894a299fc01e084fca8335c [diff] |
hypervisor: Add demo_app to the initramfs. BUG=None TEST=tast run <test-host> security.Mantee.real Change-Id: I58dcc5e804b09fa0e65729ea3d6466a0c0604917 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/initramfs/+/2758247 Tested-by: Allen Webb <allenwebb@google.com> Auto-Submit: Allen Webb <allenwebb@google.com> Commit-Queue: Micah Morton <mortonm@chromium.org> Reviewed-by: Micah Morton <mortonm@chromium.org>
Build logic for creating standalone initramfs environments.
See the README files in the respective subdirs for more details.
Normally you wouldn't build in this directory directly. Instead, you would build the chromeos-initramfs package with the right USE flags. e.g.:
$ USE=recovery_ramfs emerge-$BOARD chromeos-initramfs
That will install the cpio initramfs files into the sysroot for you to build into a kernel directly. The various build scripts would then be used to make the right kernel/image using those (e.g. mod_image_for_recovery.sh).
You could build these by hand for quick testing. Inside the chroot:
$ make SYSROOT=/build/$BOARD BOARD=$BOARD <target>
That will create the cpio archives for you.
It is possible to debug few of the initramfs targets in QEMU. Read test/README.md for more information.
Also, here is a shortcut for developing/debugging graphical bits in initramfs, without having to create a full image for every iteration.
After emerge-$BOARD
, find your initramfs package from chroot /build/$BOARD/var/lib/initramfs
and copy to a running DUT, for example /tmp/recovery_ramfs.cpio.xz
, then do followings on DUT over SSH:
mkdir /usr/local/test/; cd /usr/local/test
xzcat /tmp/XXXXXX_ramfs.cpio.xz | toybox cpio -iv
stop ui; kill $(pidof frecon)
for d in dev proc sys tmp; do mount --bind /${d} /usr/local/test/${d} done
chroot /usr/local/test /init