--- uClinux-dist-orig/vendors/Rowetel/IP04/rc 2010-08-26 14:36:46.012211244 +0930 +++ uClinux-dist/vendors/Rowetel/IP04/rc 2010-08-27 16:39:59.700022812 +0930 @@ -26,3 +26,66 @@ done cat /etc/motd + +# Automatic image update without u-boot +# this executes in rc of uImage.mtd0 - hard coded root=/dev/mtdblock0 + +/sbin/flash_eraseall /dev/mtd2 + +echo Flash erased OK, installing root file system.... + +mount /dev/mtdblock2 /mnt +cd /mnt + +# rm all old stuff so we get a clean install + +cd /mnt; rm -Rf etc bin lib tmp home root usr sbin var dev mnt proc sys + +# now copy rootfs across + +cp -a /etc /mnt +cp -a /bin /mnt +cp -a /lib /mnt +cp -a /tmp /mnt +cp -a /home /mnt +cp -a /root /mnt +cp -a /usr /mnt +cp -a /sbin /mnt +cp -a /var /mnt +cp -a /dev /mnt +mkdir /mnt/mnt +mkdir /mnt/proc +mkdir /mnt/sys + +# stops this code running again when we boot from mtdblock0 +cp /etc/rc.normal /mnt/etc/rc + +# tell next image to install packages +touch /mnt/.needs_initial_packages + +echo Installed root file system OK! + +# attempt to download image with hard coded root=/dev/mtdblock2 + +echo Attempting to download uImage_r4.mtd2 from Internet.... + +wget http://rowetel.com/ucasterisk/downloads/uImage_r4.mtd2 +if [ $? -eq 0 ]; then + echo wget OK, flashing new uImage + dd if=uImage_r4.mtd2 of=/dev/mtdblock1 + rm -f uImage_r4.mtd2 +else + echo wget NOT OK, try tftp from local tftp server + tftp -g -r uImage_r4.mtd2 192.168.1.1 + if [ $? -eq 0 ]; then + echo tftp OK, flashing new uImage... + dd if=uImage_r4.mtd2 of=/dev/mtdblock1 + rm -f uImage_r4.mtd2 + else + echo tftp failed too, you need to manually install uImage_r2.mtd2! + exit + fi +fi + +sync +reboot --- uClinux-dist-orig/vendors/Rowetel/IP04/rc.normal 1970-01-01 09:30:00.000000000 +0930 +++ uClinux-dist/vendors/Rowetel/IP04/rc.normal 2010-08-29 09:55:14.692724014 +0930 @@ -0,0 +1,40 @@ +hostname ip04 +mount -t proc proc /proc +[ ! -d /var/tmp ] && mkdir /var/tmp +mount -t ramfs ramfs /var/tmp +mount -t sysfs sysfs /sys +mount -t devpts devpts /dev/pts +[ -d /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb +[ -d /sys/kernel/debug ] && mount -t debugfs debugfs /sys/kernel/debug +[ -d /proc/sys/fs/binfmt_misc ] && mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc +[ -d /sys/kernel/security ] && mount -t securityfs securityfs /sys/kernel/security +grep -qs nfsd /proc/filesystems && mount -t nfsd nfsd /proc/fs/nfsd +if [ -e /bin/mdev ] ; then + echo /bin/mdev 2>/dev/null > /proc/sys/kernel/hotplug + /bin/mdev -s 2> /dev/null +fi +[ ! -d /var/log ] && mkdir /var/log +[ ! -d /var/run ] && mkdir /var/run +[ ! -d /var/lock ] && mkdir /var/lock +ifconfig lo 127.0.0.1 +inetd & + +# start up services + +for i in /etc/rc.d/S*; do + $i start +done + +# automated initial package installation + +if [ -f /.needs_initial_packages ]; then + ipkg update + ipkg install network-static zaptel-sport native-sounds asterisk + ipkg install mini-asterisk-gui + ipkg install commis + rm -f /.needs_initial_packages + reboot +fi + +cat /etc/motd + --- uClinux-dist-orig/vendors/Rowetel/IP04/Makefile 2010-08-26 16:10:47.748711277 +0930 +++ uClinux-dist/vendors/Rowetel/IP04/Makefile 2010-08-27 16:39:59.700022812 +0930 @@ -29,6 +29,7 @@ chmod 1777 $(ROMFSDIR)/tmp $(ROMFSINST) -s bin /sbin $(ROMFSINST) /etc/rc + $(ROMFSINST) /etc/rc.normal $(ROMFSINST) /etc/mdev.conf $(ROMFSINST) /etc/inittab $(ROMFSINST) /etc/services