Created
July 11, 2018 06:48
-
-
Save jcmvbkbc/a81707eff276fff0c9465eb1e82046ad to your computer and use it in GitHub Desktop.
android kernel/emulator tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -ex | |
# VER=3.18|4.4|4.9 ./rebuild-kernels | |
declare -A defconfig | |
declare -A cross | |
defconfig=([arm64]="ranchu64_defconfig" [x86_64]="x86_64_ranchu_defconfig") | |
cross=([arm64]="aarch64-linux-gnu-" [x86_64]="x86_64-linux-gnu-") | |
for check in 0 1 ; do | |
for arch in arm64 x86_64 ; do | |
for debug in "" -debug ; do | |
builddir="`pwd`/build${debug}-${arch}-${VER}" | |
case $check in | |
0) | |
if [ ! -d "$builddir" ] ; then | |
ARCH=$arch CROSS_COMPILE=${cross[$arch]} make -C goldfish/ O="$builddir" ${defconfig[$arch]} | |
sed -i "$builddir/.config" -e "s/# CONFIG_XRP.*/CONFIG_XRP=y/" | |
ARCH=$arch CROSS_COMPILE=${cross[$arch]} make -C goldfish/ O="$builddir" oldconfig | |
fi | |
;; | |
1) | |
ARCH=$arch CROSS_COMPILE=${cross[$arch]} make -C goldfish/ O="$builddir" -j8 all | |
;; | |
esac | |
done | |
done | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -ex | |
for a in \ | |
bin64 \ | |
emulator \ | |
emulator64-arm \ | |
emulator64-crash-service \ | |
emulator64_img2simg \ | |
emulator64_make_ext4fs \ | |
emulator64-mips \ | |
emulator64_simg2img \ | |
emulator64-x86 \ | |
emulator-check \ | |
lib \ | |
lib64 \ | |
qemu \ | |
resources ; do | |
cp -a emulator-builds/external/qemu/objs/$a android-emulator/linux-x86_64 | |
done | |
cd android-emulator | |
git commit -a -s -F - <<EOF | |
update prebuilt android emulator | |
Built from the following revisions: | |
- QEMU: `( cd ../emulator-builds/external/qemu ; git log --format=%H -1 )` | |
- emulator repo: `( cd ../emulator-builds/.repo/manifests ; git log --format=%H -1 )` | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -ex | |
declare -A linux_arch | |
declare -A image_name | |
linux_arch=([x86_64]=x86 [arm64]=arm64) | |
image_name=([x86_64]=bzImage [arm64]=Image) | |
for ver in 3.18 4.4 4.9 ; do | |
for arch in x86_64 arm64 ; do | |
for debug in "" -debug ; do | |
cp kernel-builds/build$debug-$arch-$ver/arch/${linux_arch[$arch]}/boot/${image_name[$arch]} qemu-kernel/$arch/$ver/kernel-qemu2$debug | |
done | |
done | |
done | |
cd qemu-kernel | |
git commit -a -s -F - <<EOF | |
update prebuilt arm64/x86_64 kernels | |
Built from revision `( cd ../kernel-builds/goldfish ; git log --format=%H -1 )` of | |
the goldfish kernel | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment