build/debian: Build and use our custom Debian kernel
In this CL, we introduce a new flag `-k` to allow building our own Debian kernel (as opposed to using the default cloud kernel) in our FAI workflow.
- Add a new `avf` kernel flavour based on the existing `cloud` flavour
- Build `avf-amd64` (or `avf-arm64`) headers and image, and generate `.deb` packages
- Copy `.deb` packages to FAI's `localdebs` location and add package names to `package_config/AVF` for FAI to pick up during installation
Bug: 380176863
Change-Id: Ic3737746ff8b8949173fea79a6b6d0173fda058c
Test: ./build_in_container.sh -k
Test: ./build_in_container.sh -a aarch64 -k
diff --git a/build/debian/build_in_container.sh b/build/debian/build_in_container.sh
index 5028b74..967f5ab 100755
--- a/build/debian/build_in_container.sh
+++ b/build/debian/build_in_container.sh
@@ -6,17 +6,19 @@
echo "Options:"
echo "-h Print usage and this help message and exit."
echo "-a ARCH Architecture of the image [default is host arch: $(uname -m)]"
+ echo "-k Build and use our custom kernel [default is cloud kernel]"
echo "-r Release mode build"
echo "-s Leave a shell open [default: only if the build fails]"
echo "-w Save temp work directory in the container [for debugging]"
}
arch="$(uname -m)"
+kernel_flag=
release_flag=
save_workdir_flag=
shell_condition="||"
-while getopts "a:rsw" option; do
+while getopts "a:hkrsw" option; do
case ${option} in
a)
arch="$OPTARG"
@@ -24,6 +26,9 @@
h)
show_help ; exit
;;
+ k)
+ kernel_flag="-k"
+ ;;
r)
release_flag="-r"
;;
@@ -53,4 +58,4 @@
-v "$ANDROID_BUILD_TOP/packages/modules/Virtualization:/root/Virtualization" \
--workdir /root/Virtualization/build/debian \
ubuntu:22.04 \
- bash -c "/root/Virtualization/build/debian/build.sh -a $arch $release_flag $save_workdir_flag $shell_condition bash"
+ bash -c "/root/Virtualization/build/debian/build.sh -a $arch $release_flag $kernel_flag $save_workdir_flag $shell_condition bash"