#linuxbox# gdb --args fastboot flash system system.img
...
#linuxbox# mkdir /system
#linuxbox# mount -o loop,ro system.img /system
#linuxbox# ls -l /system
total 208
drwxr-xr-x 106 root root 8192 Sep 17 22:24 app
drwxr-xr-x 3 root 2000 8192 Sep 26 21:08 bin
-rw-r--r-- 1 root root 6847 Sep 12 16:59 build.prop
drwxr-xr-x 19 root root 4096 Sep 26 21:08 etc
drwxr-xr-x 2 root root 4096 Aug 11 22:27 fonts
drwxr-xr-x 4 root root 4096 Sep 12 16:56 framework
drwxr-xr-x 10 root root 16384 Sep 12 16:59 lib
drwxr-xr-x 2 root root 4096 Jan 1 1970 lost+found
drwxr-xr-x 3 root root 4096 Aug 11 22:18 media
drwxr-xr-x 59 root root 4096 Aug 11 22:29 priv-app
-rw-r--r-- 1 root root 126951 Aug 1 2008 recovery-from-boot.p
drwxr-xr-x 3 root root 4096 Aug 11 21:02 scripts
drwxr-xr-x 3 root root 4096 Aug 11 21:02 tts
drwxr-xr-x 11 root root 4096 Sep 26 21:08 usr
drwxr-xr-x 8 root 2000 4096 Aug 11 22:29 vendor
drwxr-xr-x 2 root 2000 4096 Sep 26 21:09 xbin
#linuxbox# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 2048M new_system.img /system
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label:
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 2666/131072 inodes and 375014/524288 blocks
#linuxbox# fastboot flash system new_system.img
erasing 'system'...
OKAY [ 0.064s]
sending 'system' (2088960 KB)...
^C
#linuxbox# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 1536M new_system.img /system
#linuxbox# ./fastboot flash system system.img
erasing 'system'...
OKAY [ 0.065s]
sending 'system' (1572864 KB)...
OKAY [ 51.039s]
writing 'system'...
OKAY [235.080s]
finished. total time: 286.183s
#linuxbox# unzip -l /opt/vendor/Asus/firmware/UL-K01E-WW-12.16.1.12-user.zip |\
grep boot.img$
7368704 2011-03-22 11:21 boot.img
$linuxbox$ mkdir rootfs
$linuxbox$ cd rootfs
$linuxbox$ abootimg -x /path/to/boot.img
$linuxbox$ ls -l
bootimg.cfg
initrd.img
zImage
$linuxbox$ mkdir initrd
$linuxbox$ cd initrd
$linuxbox$ gzip -cd ../initrd.img | cpio -ivd
...
$linuxbox$ vi default.prop
First, let'sI set up default.prop
to be root onwhen the booted kernel boots:
I also copied the /system/bin/sh
(from the over-the-air Asus .zip file) into /sbin/sh
- from the over-the-air Asus .zip file. I did the same forwith busybox - quite handy tool.
$busybox$ find . | cpio --create --format='newc' | gzip -9 > ../initrd.custom.gz
$busybox$ cd ..
$busybox$ abootimg --create ../new_boot_busybox.img \
-f bootimg.cfg -k zImage -r initrd.custom.gz
linuxbox# fastboot boot new_boot_busybox.img
And...and witness the following...
#linuxbox# adb logcat
- exec '/system/bin/sh' failed: Permission denied (13) -
#linuxbox# adb shell
- exec '/system/bin/sh' failed: Permission denied (13) -
#linuxbox# adb root
restarting adbd as root
#linuxbox# adb shell
- exec '/system/bin/sh' failed: Permission denied (13) -
#linuxbox# adb shell
- exec '/sbin/sh' failed: Permission denied (13) -
#linuxbox# adb pull /proc/partitions
15 KB/s (1272 bytes in 0.079s)
#linuxbox# adb pull /proc/mounts
16 KB/s (1358 bytes in 0.079s)
#linuxbox# grep system mounts
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 rw,seclabel,relatime,data=ordered 0 0
#linuxbox# adb pull /system
remote object '/system' does not exist
#linuxbox# adb pull /proc/kmsg
failed to copy '/proc/kmsg' to './kmsg': Operation not permitted
#linuxbox# adb push /sbin/sh /system/bin/sh
failed to copy '/sbin/sh' to '/system/bin/sh': Permission denied