-if [ -z "$jdev" ]; then
- echo -n "Creating jffs2 partition... "
- mtd erase OpenWrt >&- 2>&-
- mount -t jffs2 /dev/mtdblock/4 /jffs
+ echo -n "setting up symlinks... "
+ for file in $(cd $2; find . -xdev -type f;); do
+ case "$file" in
+ "./rom/note") ;; #nothing
+ "./etc/config"|\
+ "./etc/resolv.conf"|\
+ "./usr/lib/ipkg/info") cp -af $2/$file $file;;
+ *) ln -sf /rom/${file#./*} $file;;
+ esac
+ done
+ for file in $(cd $2; find . -xdev -type l;); do
+ cp -af $2/${file#./*} $file
+ done