Samstag, 28. Januar 2012

reset openWRT firmware with fsg-3

Howto restore FSG-3 with OpenWRT default image

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 
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 
 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
opkg update 
opkg install luci 
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

mount sda4 partition 
howto from OpenWRT
root@fsg3:~# opkg update
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...
Installing blkid (1.41.12-2) to root...
Installing libuuid (1.41.12-2) to root...
Installing libblkid (1.41.12-2) to root...
Installing libext2fs (1.41.12-2) to root...
Installing libcom_err (1.41.12-2) to root...
Installing libpthread (0.9.32-103) to root...
Installing swap-utils ( to root...
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:/etc/config# vi fstab 
root@fsg3:/# reboot; exit
now it should boot up with mounted sda4 directories

install SAMBA[]=samba[]=samba

root@fsg3:~# opkg update
root@fsg3:/# opkg install samba3
Installing samba3 (3.0.37-4) to root...
Installing libpopt (1.7-5) to root...
Configuring libpopt.
Configuring samba3.
root@fsg3:/# opkg install luci-app-samba
Installing luci-app-samba (trunk+svn8189-1) to root...
Configuring luci-app-samba.
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