Samstag, 28. Januar 2012

reset openWRT firmware with fsg-3

Howto restore FSG-3 with OpenWRT default image


prerequisites:
installed openwrt kernel on flash-partition kern1 and rootfilesystem on /dev/sda1
backuped freecom firmware on flash-partition kern2 and rootfilesystem on /dev/sda2


connect serial console to your fsg-3,


hit ^C when booting to start the RedBoot console prompt and stop processing boot script.


to start the old freecom kernel from the second flash kernel image and the second hdd partition

RedBoot> fis load kern2
RedBoot> exec -c "console=ttyS0,115200 root=/dev/hda2 mem=64M@0x00000000"

make a directory in /tmp

mkdir /tmp/rootfs
 
 

mount the first partition with openwrt to this directory

mount /dev/sda1 /tmp/rootfs 
 
remove the openWRT root file system
 
rm -rf *
 
 
create in the directory the new openWRT root filesystem 
 
go to the directory
cd /tmp/rootfs
tar zxvf /home/fsg_files/openwrt-ixp4xx-harddisk-rootfs.tar.gz
 
reboot the rooter 
 
reboot
 
 
Boot OpenWRT 
boot with openwrt kernel kern1 and openwrt rootfilesystem sda1  
 
RedBoot> fis load kern1
RedBoot> exec -c "console=ttyS0,115200 root=/dev/sda1 init=/etc/preinit "


 
 
tada, your filesystem is restored to openWRT defaults
 
 
 
go to /etc/config and edit the network file
 
to the interface lan 
append  
 option gateway  [your gateway IP]
 option dns  [your dns IP]
and edit line 
        option ipaddr [your IP address]
 
now you can disconnect the serial cable
 
reboot your fsg3

telnet to your new changed ip address and use passwd to set the root password.
 
exit from telnet
 
from now on you can only access via SSH
 
install luci
http://wiki.openwrt.org/doc/howto/luci.essentials
 
opkg update 
opkg install luci 
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start


 
mount sda4 partition 
howto from OpenWRT 
http://wiki.openwrt.org/doc/uci/fstab
 
root@fsg3:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/Packages.gz.
Inflating http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/snapshots.
root@fsg3:~# opkg install block-mount
Installing block-mount (0.2.0-7) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/block-mount_0.2.0-7_ixp4xx.ipk.
Installing blkid (1.41.12-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/blkid_1.41.12-2_ixp4xx.ipk.
Installing libuuid (1.41.12-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libuuid_1.41.12-2_ixp4xx.ipk.
Installing libblkid (1.41.12-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libblkid_1.41.12-2_ixp4xx.ipk.
Installing libext2fs (1.41.12-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libext2fs_1.41.12-2_ixp4xx.ipk.
Installing libcom_err (1.41.12-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libcom_err_1.41.12-2_ixp4xx.ipk.
Installing libpthread (0.9.32-103) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libpthread_0.9.32-103_ixp4xx.ipk.
Installing swap-utils (2.13.0.1-4) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/swap-utils_2.13.0.1-4_ixp4xx.ipk.
Configuring libpthread.
Configuring libcom_err.
Configuring libblkid.
Configuring libuuid.
Configuring libext2fs.
Configuring blkid.
Configuring swap-utils.
Configuring block-mount.
root@fsg3:~# /etc/init.d/fstab enable
root@fsg3:~# /etc/init.d/fstab start
root@fsg3:~# 
root@fsg3:/etc/config# vi fstab 
root@fsg3:/# reboot; exit
 
now it should boot up with mounted sda4 directories




install SAMBA
http://wiki.openwrt.org/doc/uci/samba?s[]=samba
http://wiki.openwrt.org/doc/howto/cifs.server?s[]=samba

root@fsg3:~# opkg update
root@fsg3:/# opkg install samba3
Installing samba3 (3.0.37-4) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/samba3_3.0.37-4_ixp4xx.ipk.
Installing libpopt (1.7-5) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libpopt_1.7-5_ixp4xx.ipk.
Configuring libpopt.
Configuring samba3.
root@fsg3:/# opkg install luci-app-samba
Installing luci-app-samba (trunk+svn8189-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/luci-app-samba_trunk+svn8189-1_ixp4xx.ipk.
Configuring luci-app-samba.
root@fsg3:/#
root@fsg3:/# vi /etc/config/samba
/etc/init.d/samba enable 
/etc/init.d/samba start
root@fsg3:/# reboot; exit


Keine Kommentare:

Kommentar veröffentlichen