build/debian: Allow booting the kernel directly
In this CL, we update the VM config to load the kernel directly,
as opposed to our current boot process with u-boot.
The motivation behind this is discussed in the linked bug reports.
- We add a `-u` build flag for the build script to generate images
that boot using u-boot instead.
- We remove the unnecessary grub-related packages and configs
from images generated without `-u` build flag.
Bug: 394995493
Bug: 401111452
Test: Tested the images built from each cmd below:
Test: - ./build_in_container.sh -a x86_64
Test: - ./build_in_container.sh -a aarch64
Test: - ./build_in_container.sh -a x86_64 -g
Test: - ./build_in_container.sh -a aarch64 -g
Change-Id: If56e8aecb19a4487694e80c5ddf58c0ab00ca972
diff --git a/build/debian/build_in_container.sh b/build/debian/build_in_container.sh
index 739d2dd..82098ed 100755
--- a/build/debian/build_in_container.sh
+++ b/build/debian/build_in_container.sh
@@ -9,6 +9,7 @@
echo "-g Use Debian generic kernel [default is our custom kernel]"
echo "-r Release mode build"
echo "-s Leave a shell open [default: only if the build fails]"
+ echo "-u Set VM boot mode to u-boot [default is to load kernel directly]"
echo "-w Save temp work directory in the container [for debugging]"
}
@@ -17,8 +18,9 @@
release_flag=
save_workdir_flag=
shell_condition="||"
+uboot_flag=
-while getopts "a:ghrsw" option; do
+while getopts "a:ghrsuw" option; do
case ${option} in
a)
arch="$OPTARG"
@@ -35,6 +37,9 @@
s)
shell_condition=";"
;;
+ u)
+ uboot_flag="-u"
+ ;;
w)
save_workdir_flag="-w"
;;
@@ -58,4 +63,4 @@
-v "$ANDROID_BUILD_TOP/packages/modules/Virtualization:/root/Virtualization" \
--workdir /root/Virtualization/build/debian \
ubuntu:22.04 \
- bash -c "./build.sh -a $arch $release_flag $kernel_flag $save_workdir_flag $shell_condition bash"
+ bash -c "./build.sh -a $arch $release_flag $kernel_flag $uboot_flag $save_workdir_flag $shell_condition bash"