Skip to content

Commit e17ce7a

Browse files
committed
added a script to build all sapphire kernels, as well as the anykernel template
1 parent 764de41 commit e17ce7a

File tree

10 files changed

+3594
-0
lines changed

10 files changed

+3594
-0
lines changed

anykernel.tpl/META-INF/CERT.RSA

1.67 KB
Binary file not shown.

anykernel.tpl/META-INF/CERT.SF

Lines changed: 1734 additions & 0 deletions
Large diffs are not rendered by default.

anykernel.tpl/META-INF/MANIFEST.MF

Lines changed: 1733 additions & 0 deletions
Large diffs are not rendered by default.
250 KB
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ui_print("AnyKernel Updater by Koush.");
2+
ui_print("Kernels by CVPCS");
3+
ui_print(" Credit to P3Droid for original kernel");
4+
ui_print(" Credit to Bekit for OC information");
5+
ui_print("Built for Sapphire ROM");
6+
ui_rpint("sapphire.cvpcs.org");
7+
set_progress(1.000000);
8+
mount("MTD", "system", "/system");
9+
show_progress(0.100000,0);
10+
ui_print("Extracting System Files...");
11+
package_extract_dir("system", "/system");
12+
show_progress(0.300000,0);
13+
ui_print "Setting System Permissions");
14+
set_perm_recursive(0, 0, 0755, 0644, "/system/etc/wifi");
15+
set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules");
16+
show_progress(0.100000,0);
17+
unmount("/system");
18+
ui_print("Extracting Kernel files...");
19+
package_extract_dir("kernel", "/tmp");
20+
show_progress(0.100000,0);
21+
ui_print("Installing kernel...");
22+
set_perm(0, 0, 0777, "/tmp/dump_image");
23+
set_perm(0, 0, 0777, "/tmp/mkbootimg.sh");
24+
set_perm(0, 0, 0777, "/tmp/mkbootimg");
25+
set_perm(0, 0, 0777, "/tmp/unpackbootimg");
26+
show_progress(0.100000,0);
27+
run_program("/tmp/dump_image", "boot", "/tmp/boot.img");
28+
show_progress(0.100000,0);
29+
run_program("/tmp/unpackbootimg", "/tmp/boot.img", "/tmp/");
30+
show_progress(0.100000,0);
31+
run_program("/tmp/mkbootimg.sh");
32+
show_progress(0.100000,0);
33+
write_raw_image("/tmp/newboot.img", "boot");
34+
show_progress(0.100000,0);
35+
ui_print("Your Kernel Has Been Installed");
36+
ui_print("Thank you for supporting sapphire!");

anykernel.tpl/kernel/dump_image

74.3 KB
Binary file not shown.

anykernel.tpl/kernel/mkbootimg

74.3 KB
Binary file not shown.

anykernel.tpl/kernel/mkbootimg.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/sbin/sh
2+
echo \#!/sbin/sh > /tmp/createnewboot.sh
3+
echo /tmp/mkbootimg --kernel /tmp/zImage --ramdisk /tmp/boot.img-ramdisk.gz --cmdline \"$(cat /tmp/boot.img-cmdline)\" --base $(cat /tmp/boot.img-base) --output /tmp/newboot.img >> /tmp/createnewboot.sh
4+
chmod 777 /tmp/createnewboot.sh
5+
/tmp/createnewboot.sh
6+
return $?

anykernel.tpl/kernel/unpackbootimg

65.2 KB
Binary file not shown.

scripts/build_all_sapphires

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
if [ "${ARCH}" != "arm" ] ; then
4+
echo "you must export ARCH as 'arm'"
5+
exit 1
6+
fi
7+
8+
if [ "${HOST_PLATFORM}" != "zoom2" ] ; then
9+
echo "you must export HOST_PLATFORM as 'zoom2'"
10+
exit 1
11+
fi
12+
13+
if [ -z "${KERNEL_DIR}" ] ; then
14+
echo "you must export your KERNEL_DIR"
15+
exit 1
16+
fi
17+
18+
if [ -z "${CROSS_COMPILE}" ] ; then
19+
echo "you must export CROSS_COMPLIE as 'arm-eabi-'"
20+
exit 1
21+
fi
22+
23+
if [ -z "${ANDROID_BUILD_TOP}" ] ; then
24+
echo "you must run build/envsetup.sh as well as lunch, to set some android envs"
25+
exit 1
26+
fi
27+
28+
olddir=$(pwd)
29+
30+
for i in $(ls -1 arch/arm/configs/*sapphire*_defconfig | sed -r "s/^.*\/([^\/]+)$/\1/"); do
31+
# move to the kernel directory
32+
cd "${KERNEL_DIR}"
33+
34+
# clean the tree
35+
make mrproper
36+
37+
# load the config
38+
make "${i}"
39+
40+
# make the kernel/modules
41+
make
42+
43+
# create an output directory
44+
mkdir tmpdir
45+
46+
# copy the kernel image
47+
cp arch/arm/boot/zImage tmpdir/
48+
# copy all of the modules to that directory
49+
for j in $(find . -name "*.ko"); do
50+
cp "${j}" tmpdir/
51+
done
52+
53+
# now we go make our wireless module
54+
cd "${ANDROID_BUILD_TOP}/system/wlan/ti/wilink_6_1/platforms/os/linux"
55+
# clean an existing wireless module
56+
make clean
57+
# make the module
58+
make
59+
# copy it to our output
60+
cp tiwlan_drv.ko "${KERNEL_DIR}/tmpdir/"
61+
62+
# return to the kernel directory
63+
cd "${KERNEL_DIR}"
64+
65+
# now we begin to build our anykernel
66+
67+
# copy the anykernel stuff
68+
cp -a anykernel.tpl tmpdir/anykernel
69+
# put the kernel in the right spot
70+
cp tmpdir/zImage tmpdir/anykernel/kernel/zImage
71+
# copy all of our modules
72+
for j in tmpdir/*.ko; do
73+
cp "${j}" tmpdir/anykernel/system/lib/modules/
74+
done
75+
# zip the file
76+
cd tmpdir/anykernel
77+
zip -r "${KERNEL_DIR}/${i}.zip" .
78+
cd "${KERNEL_DIR}"
79+
80+
# clean temp
81+
rm -fr tmpdir
82+
83+
# move back to the old directory
84+
cd "${olddir}"
85+
done

0 commit comments

Comments
 (0)