Skip to content

Commit

Permalink
updated ramdisk packers (convenient scripts for debugging)
Browse files Browse the repository at this point in the history
  • Loading branch information
fattire committed Nov 30, 2011
1 parent f2292c2 commit 9d0d820
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
3 changes: 2 additions & 1 deletion encore.mk
Expand Up @@ -128,7 +128,8 @@ PRODUCT_COPY_FILES += \
# SD ramdisk packer script - by request - execute manually as-needed

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/sd_ramdisk_packer.sh:sd_ramdisk_packer.sh
$(LOCAL_PATH)/sd_ramdisk_packer.sh:sd_ramdisk_packer.sh \
$(LOCAL_PATH)/ramdisk_packer.sh:ramdisk_packer.sh

ifeq ($(TARGET_PREBUILT_KERNEL),)
LOCAL_KERNEL := device/bn/encore/prebuilt/boot/kernel32
Expand Down
42 changes: 42 additions & 0 deletions ramdisk_packer.sh
@@ -0,0 +1,42 @@
#!/bin/bash

# ramdisk_packer.sh
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# /system == p2
# /data == p3
# /cache == p5
#
# run this script from $OUT -- basically the place you found it. The
# resulting file "ramdisk.img" can be renamed "uRamdisk" and placed
# in mmcblk0p1 -- the vfat /boot partition.
#
# if you get an error about "mkimage" not being found, you'll need to
# . build/envsetup.sh

if [ ! -f $(which mkimage) ]; then echo "Y U NO Have mkimage?"; exit 0; fi

ROOT=root
INIT=root/init.encore.rc

cd $ROOT
find . -regex "./.*"| cpio -ov -H newc | gzip > ../repacked-ramdisk.cpio.gz
mkimage -A ARM -T RAMDisk -n Image -d ../repacked-ramdisk.cpio.gz ../ramdisk.img
rm ../repacked-ramdisk.cpio.gz
echo -e "\n\nTo install this ramdisk on your device, boot into your NC, then:\n\n"
echo "adb shell"
echo "mkdir -p /data/mnt"
echo "mount -t vfat /dev/block/mmcblk0p1 /data/mnt"
echo "exit"
echo "adb push ramdisk.img /data/mnt/uRamdisk"
echo "adb reboot"
exit
2 changes: 1 addition & 1 deletion sd_ramdisk_packer.sh
Expand Up @@ -43,7 +43,7 @@ echo -e "\n\nTo install this ramdisk on your device, boot into your NC, then:\n\
echo "adb shell"
echo "mount -o rw,remount /"
echo "mkdir -p /mnt/boot"
echo "mount /mnt/block/mmcblk1p1 /mnt/boot"
echo "mount -t vfat /dev/block/mmcblk1p1 /mnt/boot"
echo "exit"
echo "adb push ramdisk.img /mnt/boot/uRamdisk"
echo "adb reboot"
Expand Down

0 comments on commit 9d0d820

Please sign in to comment.