Linux router help needed

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Linux router help needed
# 1  
Old 04-20-2017
Linux router help needed

hi guys.
I have an Kaon router wich runs "Linux version 3.10.24-svn1480 (jskim@jake-205) (gcc version 4.4.7 (Realtek MSDK-4.4.7 Build 1459".
The problem I have it is that its firmware is in early stages and has alot of things messed up.
Wake on lan doesn't work without arp binding and that can be done only via telnet as it's webinterface doesn't have that option.
Its a workaround that works , unfortunately it only lasts untill I reboot the router.
What I was trying to accomplish is creating a script in /etc/init.d that runs the arp bind command.
That's where my troubles really began. I can't create or edit files in /etc/init.d (or /etc for that matter). The filesystem is Ready-only.

I have tried "mount -o remount, rw /" command and the / is still "ro"

here are my mounts. I managed to create a file inside /apps (though that doesn't help much as, as I need it in /etc/init.d
Code:
# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
ramfs on /var type ramfs (rw,relatime)
/dev/mtdblock5 on /apps type jffs2 (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)

any ideeas?
thanks in advance.
# 2  
Old 04-20-2017
This is wrong: mount -o remount, rw /

There's a very important space which shouldn't be there.

mount -o remount,rw /

Actually, though - your mount command says that / is rw now.

What user are you logged in as when you try to edit these files?
# 3  
Old 04-20-2017
Oh, now I see.

Code:
/dev/root on / type squashfs (ro,relatime)

You aren't going to be able to write to this. It's an unwritable compressed filesystem which is stuck the way it's made.

You'll have to copy it elsewhere, extract it all, edit it, and create a new squashfs to replace it with.

If you don't get it exactly, perfectly right, things may go badly. I suggest finding newer firmware instead of hand-editing things yourself.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 04-21-2017
Hi , apoklyps3

Your linux is embedded ( for that Your "rootfs" ( "/") is in like RAM drive/disk ( as temp/pivot root ) -> then you cannot remount for r/w and this only r/w only at runtime ). )

( Your firmware in the flash ( mostly ) loaded to the RAM at the boot stages by bootloader ( like u-boot ).. )

Your "/dev/root" device is mounted to (/) point that is "read-only fs" with squashfs ( compressed ) that located in the flash ( or sometimes sdcard ? )
it should contains all binaries , startup files , default config files and the others....

* Your mount command is wrong as already @Corona688 said this.
* And you cannot re-mount the squahfs for r/w ( try with "/dev/root" lets see what happen or not )


Your device ( /dev/mtdblock5 is read/writable block device ( Flash or disk-on-chip ) with "rootfstype=jffs2" and
then you can read the some configs or other related files from it.
But also you can write via "/dev/mtd5" ( safe way ) char device to flash partiton which is writable side.
Shortly , mount command works via block device and must used via the char device for i/o operations..
Your ( /apps ) mount point is writable and has contains user apps/data/configs ( already i said above ) and these are permanent.
Look at the some details..
Managing flash storage with Linux

( the others are Kernel partitions from RAM or other memory chips ( ssd ? ) .. )

* You can look for the details of the flash partitions ( "cat /proc/mtd" )

Now i m not sure is there a easy way ? , ( because i have no knowlodge about the routers and firmware )
But i can say , you have to create the customized firmware and you must flash it to router for permanent solution.. ( if it has not nvram settings for non-squash filesystem support )
( or you must unsquashfs to extract the contents to writable partition then mksquashfs to create new image from thises and write it to the target mtd device ( like "writemtd.c" codes or image dump tools )

Another try , you maybe update the router firmware with ( open-source ) alternatives like dd-wrt , open-wrt .. ( if your product ( Kaon media ) vendor does not the new firmware..)

But best way as @Corona688 said , you must update the new firmware from original Kaon hardware vendor if there is..

Good lucks
regards
ygemici

Last edited by ygemici; 04-21-2017 at 03:58 AM..
This User Gave Thanks to ygemici For This Post:
# 5  
Old 04-21-2017
thanks guys.
I have managed to unpack the firmware , though it seems kinda risky to pack it back and try to flash it.
any other way I could make squashfs read /etc from another location (ex usb) instead of the default one?
# 6  
Old 04-21-2017
Depends a lot on the drivers available and when they get loaded in the boot procedure. It's the exact same risk for the exact same reason anyway - the slightest mistake will brick it.

There's presumably a sane way to update it but we don't know what it is, being we don't know what distrubution it is. "Linux" is just the name of the 3 megabyte file which loads when you turn it on, everything else is down to the distro. Check for a file like /etc/release which states what it is
# 7  
Old 04-21-2017
Hi apoklyps3

* we have needed some inputs/outputs Smilie
  • could you write what you did ( commands and outputs ) ?
    where did you extract to unpack the firmware ? ( external stroage ? )
    can you see the images/files as separately ( bootloader/kernel/rootfs and the others.. )
  • do you have the orginal firmware image outside the flash ?

* i can try search your hardware but i cannot find any usefull infos.

so i have to learn this :
  1. your device chip details
  2. your flash chip details
  3. cat /proc/mounts ( and fstab ? )
  4. cat /proc/mtd
  5. have you any tools ? ( flash_erase / nandwrite ... )
    ( can you list the your binaries related flash that you have .. )
  6. what is your boot-loader ? any screen output releated booting ?
  7. can you execute the boot-loader commands ( so is there any prompt ? )
  8. can you paste the dmesg or /var/log/messages files ?
  9. did you try the plug in the usb drive and kernel see it ? ( like /dev/sdaX )
  10. are there any kernel configs ( /proc/configXX , /boot/config* )
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect script help needed- script failing if router unavailable

Hey all. Sometimes I'm tasked to change some router configs for the entire network (over 3,000 Cisco routers). Most of the time its a global config parameter so its done with a loop and an IP list as its the same configuration change for all routers. This is working OK. However, sometimes an... (3 Replies)
Discussion started by: mrkz1974
3 Replies

2. Cybersecurity

Help needed in IPTables firewall/router setup - Linux

HI all, I have setup IPTables firewall/Router and my home network, with address space 192.168.10.XXX Form my private network hosts, i can ping the gateway ( 192.168.10.101 ) , but the reverse is not happening. Can someone help me as of what i need to do, so that i can ping my private... (1 Reply)
Discussion started by: chandan_m
1 Replies

3. IP Networking

Linux Router?

I am trying to set up a linux box as a router, but I am a little confused on how to do this. I am using Red Hat 9.0 on a machine that has 2 nic cards. Also, I am using a DSL pppoe connection. I have installed rp-pppoe and I am connected to the internet via the pseudo pppoe interface. I have... (1 Reply)
Discussion started by: cstovall
1 Replies
Login or Register to Ask a Question