12-04-2010 09:08 AM
#!/bin/sh #chroot-startup #change to a writeable directory cd /usr/local/etc #make the directory we'll chroot into, newroot mkdir -p newroot #change to newroot dir cd /usr/local/etc/newroot #DIRECTORIES #find all the directories (and symlink directories) in the root dir for i in /*; do if [ -d $i ]; then echo $i; fi; done>/tmp/chrootdirs #find all the firmware partitions mounted in /etc/fstab grep /dev/mtdblock /etc/fstab | cut -f 2 >> /tmp/chrootdirs #make empty dirs for overmounting while read i; do mkdir -p `echo $i | cut -c 2-`; done < /tmp/chrootdirs #FILES #find all the files (and symlink files) in the root dir for i in /*; do if [ ! -d $i ]; then echo $i; fi; done>/tmp/chrootfiles #make empty files for overmounting while read i; do touch `echo $i | cut -c 2-`; done </tmp/chrootfiles #OVERMOUNT / mount -o bind time #combine the list of dirs and files to be overmounted cat /tmp/chrootdirs /tmp/chrootfiles >/tmp/chrootbinds #overmount while read i; do mount -o bind $i `echo $i | cut -c 2-`; done </tmp/chrootbinds #CHROOT time chroot /usr/local/etc/newroot
I have tested the above as a script and it works on my system.
now you can mkdir /opt and whatever
I'd be interested in hearing back on this if anyone has an experience to share.
12-06-2010 06:18 PM
If I ever have time, I will try to Redo a firmware of 2.2 without the encrypted image, and get it to work with a new/altered kernal that does not force Secure_boot.
then i can just make a firmware with new links to whatever and a script that can call from usb or a temp dir
12-06-2010 07:00 PM
If you feel like doing something really creative, you throw in the custom kernel, then add onto wig_out's script to erase and then flash back into squashfs, and write a new boot sector.
Have you guys tried any testing using QEMU? I haven't had any time to plug through the source code or test any code, but I might have some free time over the next few weeks.