forked from CyanogenMod/android_device_hp_tenderloin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makemulti.sh
executable file
·46 lines (40 loc) · 1.46 KB
/
makemulti.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# This is a convenience tool to make new uMulti images for quick testing and custom boot images.
#
# Default behavior is to create normal boot.img (from $OUT/root)
#
# use -r to make a clockworkmod recovery.img (from $OUT/recovery/root)
if [ -d "$HOME/android/system/out/target/product/tenderloin" ]; then
OUT=~/android/system/out/target/product/tenderloin
echo "setting \$OUT to $OUT..."
fi
if [ ! -d "$OUT" ]; then
echo -e "\$OUT is unset or set incorrectly. Re-build CM or type\nexport OUT=/path/to/out"
exit 0
fi
# OS X users change the line below to point to mkimage
MKIMAGE=$OUT/../../../host/linux-x86/bin/mkimage
KERNEL=~/gh/CyanogenMod/hp-kernel-tenderloin/
ROOT=$OUT/root
CPIO_TARGET=ramdisk.img
UBOOTED_RAMDISK=ramdisk.ub
TARGET=boot.img
if [ "$1" = "-r" ]; then
ROOT=$OUT/recovery/root
CPIO_TARGET=recovery-ramdisk.img
UBOOTED_RAMDISK=recovery-ramdisk.ub
TARGET=recovery.img
fi
if [ ! -d "$ROOT" ]; then
echo -e "$ROOT is not an existing folder. Re-build CM or type\nexport OUT=/path/to/out"
exit 0
fi
cd $ROOT
echo "Making $CPIO_TARGET..."
find . |cpio -R 0:0 -H newc -o --quiet |gzip -9c > $OUT/$CPIO_TARGET
echo "Making $UBOOTED_RAMDISK..."
$MKIMAGE -A ARM -T RAMDisk -C none -n Image -d $OUT/$CPIO_TARGET $OUT/$UBOOTED_RAMDISK
echo "Making $TARGET from kernel and $UBOOTED_RAMDISK..."
$MKIMAGE -A arm -T multi -C none -n 'test-multi-image' -d $OUT/kernel:$OUT/$UBOOTED_RAMDISK $OUT/$TARGET
echo "Result is $OUT/$TARGET."