#!/sbin/sh
# puppet13th@xda
#dump current installed kernel
mount -t ext4 -o rw /dev/block/bootdevice/by-name/system /system
cp -rf /tmp/modules /system/lib
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/pronto/pronto_wlan.ko /system/lib/modules/wlan.ko
workdir=/tmp/mkboot
dd if=/dev/block/bootdevice/by-name/boot of=$workdir/boot.img
#unpack kernel image
/tmp/mkboot/wrapper $workdir/boot.img $workdir/boot
#make some modification on ramdisk
cp /tmp/kernel/Image.gz $workdir/boot/zImage
#repack kernel image
/tmp/mkboot/wrapper /tmp/mkboot/boot /tmp/mkboot/boot-new.img
#flash new kernel image to device
dd if=/tmp/mkboot/boot-new.img of=/dev/block/bootdevice/by-name/boot
