[solved] startup script extensions

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Feb 25, 2010 14:28    Post subject: [solved] startup script extensions Reply with quote
alone with Special scripts (.if .ipup .ipdown) not working on k2.4

Using build 13972 on Asus RT-N16 .startup doen't work ether for k2.6

@phuzi0n dunno if you want to add to your ticket or me start another for k2.6

http://svn.dd-wrt.com:8000/dd-wrt/ticket/1403

_________________
The New Me


Last edited by DHC_DarkShadow on Fri Feb 26, 2010 12:28; edited 1 time in total
Sponsor
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Feb 25, 2010 19:28    Post subject: Reply with quote
What location are you testing the .startup script at?

Code:
133    /* SeG dd-wrt addition for module startup scripts */
134    int
135    start_modules (void)
136    {
137      runStartup ("/etc/config", ".startup");
138    
139    #ifdef HAVE_RB500
140      runStartup ("/usr/local/etc/config", ".startup");     //if available
141    #elif HAVE_X86
142      runStartup ("/usr/local/etc/config", ".startup");     //if available
143    #else
144      runStartup ("/jffs/etc/config", ".startup");  //if available
145      runStartup ("/mmc/etc/config", ".startup");   //if available
146    #endif
147      return 0;
148    }


ie. for broadcom the only user locations for startup scripts is /jffs/etc/config and /mmc/etc/config

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Feb 25, 2010 20:16    Post subject: Reply with quote
/jffs/etc/config is were my.startup resides. This is exactly where is resides on my 54G-TM, with the same exact script inside. 54G-TM has no problem running it every startup. My RT-N16 does not start it.

Code:
#!/bin/ash

if [ -d /tmp/www ]; then rm -rf /tmp/www; fi
ln -s /opt/www /tmp/www

_________________
The New Me
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Feb 25, 2010 20:33    Post subject: Reply with quote
Try a minimal test case using touch like in my ticket to make sure it's not a timing thing or other problem with the commands you're running. Does the script work fine when run manually?
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Feb 25, 2010 20:46    Post subject: Reply with quote
yes, I also have it saved to startup without "#!/bin/ash" on my RT-N16 as we speak to get it to run.

So I might need a sleep 1?

_________________
The New Me
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Feb 25, 2010 20:59    Post subject: Reply with quote
Never mind, I found it. Seems as though someone on my config team has forgotten to change the file permissions. :oops:



EDIT: What? Yea I am my config team. And I am gonna kick my a$$ later. Laughing

_________________
The New Me
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Feb 25, 2010 21:38    Post subject: Reply with quote
Laughing
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Tue Mar 30, 2010 8:34    Post subject: Reply with quote
phuzi0n wrote:
What location are you testing the .startup script at?
.....
ie. for broadcom the only user locations for startup scripts is /jffs/etc/config and /mmc/etc/config

Would a .startup script excute properly if the script is stored in a samba mounted /jffs/etc/config folder?

I didn't create a jffs partition on my USB-stick when implementing the "Optware the right way".

Another option would be to "steal" some NVRAM by enable jffs in the GUI I guess. Since I have an ASUS RT-N16 there should be enough space.

Need to run same script as DarkShadow.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Mar 30, 2010 10:01    Post subject: Reply with quote
wabe wrote:
Would a .startup script excute properly if the script is stored in a samba mounted /jffs/etc/config folder?

I didn't create a jffs partition on my USB-stick when implementing the "Optware the right way".

Another option would be to "steal" some NVRAM by enable jffs in the GUI I guess. Since I have an ASUS RT-N16 there should be enough space.

Need to run same script as DarkShadow.

I doubt that a samba share would be mounted by the time the startup scripts are executed. Even if it is, there's no guarantee that the share will always be available.

When talking about these routers, nvram refers to a very small 32KB page of the flash memory which is separate from JFFS. JFFS is a filesystem format for using flash memory to store files in a way that reduces wear on it. Your router has plenty of flash space that is being unused, a JFFS is the best place for your scripts to go.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Tue Mar 30, 2010 17:15    Post subject: Reply with quote
phuzi0n wrote:
Your router has plenty of flash space that is being unused, a JFFS is the best place for your scripts to go.

Thanks for this information! I enabled jffs in the web GUI and it is visible in console. Two questions:
- I cannot create any subfolders it seems jffs is read-only. Is any additional tasks necessary (formatting?) GUI say something like 5.7 Mb space/0 available
- Is there a way to control how much memory is allocated to jffs from flash memory?
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Mar 30, 2010 21:05    Post subject: Reply with quote
Read the wiki about JFFS.
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
wabe
DD-WRT Guru


Joined: 17 Jun 2006
Posts: 889

PostPosted: Wed Mar 31, 2010 8:20    Post subject: Reply with quote
I was too quick both in checking the jffs partition and posting here. Took a while to initialize. Everything OK! (and I did actually read the wiki before posting in this thread...)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum