-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·43 lines (38 loc) · 1.59 KB
/
Copy pathrun
File metadata and controls
executable file
·43 lines (38 loc) · 1.59 KB
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
#!/bin/bash
device='0b0a41d90297661a'
cmdline='console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead androidboot.selinux=permissive user_debug=31 msm_watchdog_v2.enable=1'
#bootimage='android-boot.img'
bootimage='recovery.img'
rootfs='alarm'
bootimage_folder=${bootimage%.img}
kernel=${bootimage_folder}/${bootimage}-zImage
ramdisk=${bootimage%.img}/${bootimage}-ramdisk.gz
ramdisk_folder=${ramdisk%.gz}
# Clean up, make sure we're starting fresh
rm -rf ${bootimage_folder} && mkdir -p ${bootimage_folder}
rm -rf gnu-initramfs.cpio.gz
# Prepare gnu-boot.img using kernel from ${bootimage} and gnu-initramfs
./bin/unpackbootimg -i ${bootimage} -o ${bootimage_folder}
./bin/unpackinitramfs ${ramdisk}
./bin/mkinitramfs gnu-initramfs
./bin/mkbootimg \
--pagesize 2048 \
--ramdiskaddr 0x2900000 \
--cmdline "${cmdline}" \
--base 0x00008000 \
--board "panda" \
--kernel ${kernel} \
--ramdisk gnu-initramfs.cpio.gz \
-o gnu-boot.img
# Start copying files over adb
./bin/adb-setup ${device}
adb -s ${device} shell mkdir -p /data/gnu/
rsync -avr --progress --stats ${rootfs} rsync://localhost:1337/data/gnu/
rsync -avr --progress --stats ${ramdisk_folder} rsync://localhost:1337/data/gnu/android/
#adb -s ${device} push alarm/init /data/gnu/
#adb -s ${device} shell rm -rf /data/gnu/android/ && mkdir -p /data/gnu/android/
#adb -s ${device} push ${ramdisk_folder} /data/gnu/android/
#adb -s ${device} shell mkdir /data/gnu/android/{dev,proc,sys,system}
#adb -s ${device} shell chmod -R 0500 /data/gnu/android/
#adb -s ${device} shell chmod -R 0755 /data/gnu/system/
#adb -s ${device} shell chown -R root /data/gnu/system