Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 3b76223

Browse files
committed
driver.sh: Add support for kernel/common
kernel/common is important as it is the base kernel for all Android devices so we should make sure it never regresses with Clang. A couple of implementation details: * URL needs to be overridable because this tree is not on kernel.org. * cuttlefish's x86_64 target needs to be booted to a ramdisk as it does not support '/dev/sda'. It would be nice to test LTO and CFI to avoid issues like ClangBuiltLinux/linux#406 but there is a zero percent chance that the VM could handle that (for both memory and time reasons). I will test these locally. Some TODOs (I can file these as other issues if needed): * Inquire as to why CONFIG_FRAME_WARN is set to 1024, when the default is 2048 for 64-bit. This introduces a few warnings. * Investigate other warnings and backport the necessary fixes to stable. * Maybe run some other tests while booted like the VTS kernel suite? Closes: #91 Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 4ac3482 commit 3b76223

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

driver.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ setup_variables() {
2121

2222
# torvalds/linux is the default repo if nothing is specified
2323
case ${REPO:=linux} in
24+
"common-"*)
25+
branch=android-${REPO##*-}
26+
tree=common
27+
url=https://android.googlesource.com/kernel/${tree} ;;
2428
"linux")
2529
owner=torvalds
2630
tree=linux ;;
@@ -32,7 +36,7 @@ setup_variables() {
3236
branch=linux-${REPO}.y
3337
tree=linux ;;
3438
esac
35-
url=git://git.kernel.org/pub/scm/linux/kernel/git/${owner}/${tree}.git
39+
[[ -z "${url:-}" ]] && url=git://git.kernel.org/pub/scm/linux/kernel/git/${owner}/${tree}.git
3640

3741
# arm64 is the current default if nothing is specified
3842
case ${ARCH:=arm64} in
@@ -74,7 +78,10 @@ setup_variables() {
7478
export CROSS_COMPILE=arm-linux-gnueabi- ;;
7579

7680
"arm64")
77-
config=defconfig
81+
case ${REPO} in
82+
common-*) config=cuttlefish_defconfig ;;
83+
*) config=defconfig ;;
84+
esac
7885
image_name=Image.gz
7986
qemu="qemu-system-aarch64"
8087
qemu_ram=512m
@@ -85,13 +92,19 @@ setup_variables() {
8592
export CROSS_COMPILE=aarch64-linux-gnu- ;;
8693

8794
"x86_64")
88-
config=defconfig
95+
case ${REPO} in
96+
common-*)
97+
config=x86_64_cuttlefish_defconfig
98+
qemu_cmdline=( -append "console=ttyS0"
99+
-initrd "images/x86_64/rootfs.cpio" ) ;;
100+
*)
101+
config=defconfig
102+
qemu_cmdline=( -drive "file=images/x86_64/rootfs.ext4,format=raw,if=ide"
103+
-append "console=ttyS0 root=/dev/sda" ) ;;
104+
esac
89105
image_name=bzImage
90106
qemu="qemu-system-x86_64"
91-
qemu_ram=512m
92-
qemu_cmdline=( -drive "file=images/x86_64/rootfs.ext4,format=raw,if=ide"
93-
-append "console=ttyS0 root=/dev/sda" ) ;;
94-
107+
qemu_ram=512m ;;
95108
"ppc32")
96109
config=ppc44x_defconfig
97110
image_name=zImage

usage.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Environment variables:
2020
4.14
2121
4.9
2222
4.4
23+
common-4.19
24+
common-4.14
25+
common-4.9
26+
common-4.4
2327

2428
Optional parameters:
2529
-c | --clean:

0 commit comments

Comments
 (0)