Optware, the right way

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, ... 157, 158, 159  Next
Author Message
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sat Oct 17, 2009 21:44    Post subject: Re: Optware, the right way Reply with quote
DHC_DarkShadow wrote:
Any pointers before I try this on my SD mod? Swap? Partitions?


Mekanik wrote:
Frater,

I've got a working SD card mod too and have the same question. Should I create an ext3 partition and a swap partition in Linux first? Then mount the ext3 partition to /opt, and run the script?


Also, do you mind if I add this to the Optware tutorial?

_________________
The New Me
Sponsor
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Oct 18, 2009 6:50    Post subject: Reply with quote
Creating the partitions is outside the scope....

You only need to mount /opt yourself and fixate this mount. All other partitions (ext2, ext3, fat and swap) will get automounted.
If you're not satisfied with the mountpoints you can just mount them to other mountpoints manually once and rerun the script and the automount will later mount that partition to your preffered mount points.

I wrote a script called "service" which is able to manipulate the services using the service name instead of using the S* script. It will get the name out of the S* script in /opt/etc/init.d and is triggered by an entry starting with 'NAME='

If a script is missed by service because "NAME=" does not exist, you can just manually add it to the S* script. I did this in my prep_optware already with S09named and S10xinetd. In my own scripts they of course exist already.

The commands are:

"service" - show all services (enabled/disabled)
"service <service name>" - if "status" is supported it will run the service-script with "status" as parameter. Otherwise it will just show if script is enabled.
"service <service name> on" - Enable the script (chmod +x /opt/etc/init.d/S<servicescript>)
"service <service name> off" - Disable the script (chmod -x /opt/etc/init.d/S<servicescript>)
"service <service name> <parameter>" - Run the script with the parameter.

Examples:
Code:
service
service pound
service pound off
service pound on
service pound stop



service automount start - mount all partitions
service automount stop - umount all partitions instead of the one to /opt
service automount status - show all partitions
service automount unmount <partition|mountpoint> - unmount that partition and remove it from automount
service automount nomount <partition> - Do not automount this partition
service automount nonomount <partition> - remove this partition from the nomount list

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)


Last edited by frater on Sun Oct 18, 2009 7:09; edited 1 time in total
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sun Oct 18, 2009 7:05    Post subject: Reply with quote
One last question....

I use the backup and restore script by you and hardwarewizard, after installing optware "the right way", will the backup and restore script back this up or will it have to be installed again after reflash or hard reset?

_________________
The New Me
Mekanik
DD-WRT Novice


Joined: 26 May 2009
Posts: 40
Location: Hawaii

PostPosted: Sun Oct 18, 2009 7:11    Post subject: Reply with quote
Fair enough....thanks for doing this. I'll give it a shot.
_________________
WRT54GLv1.1
WRT54GSv1.1
WRT54Gv1.1
WRT54Gv2
WRT54Gv4
WRT54G2v1
WHR-G300N
DIR-615 E3
WNDR3800
WRT300N
WRT54G-TM
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Oct 18, 2009 7:11    Post subject: Reply with quote
If you reflash your router your optware will not be touched.... Everything will be saved to /opt (external flash or harddisk)

rc_startup and rc_shutdown will be saved by the backup-script...
So, yes everything will be covered...

My script will also load "backupessential" to /opt/usr/sbin...
If your modified script resides there with the same name, you should put it and its datafiles to another place before loading prep_optware....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
rhdcheme
DD-WRT User


Joined: 16 Jun 2007
Posts: 168
Location: Northern Virginia, USA

PostPosted: Sun Oct 18, 2009 14:47    Post subject: Re: Optware, the right way Reply with quote
frater wrote:

Everything should go automatically after you enter those 2 commands in the "telnet interface".
It will even automatically mount swap if you partitioned this....

Do use "ext" as your filesystem. At least for optware!


I tried to install but during the install, it asked me something about whether I want to keep the default configuration or the package installer's configuration. I didn't know what to do, so I selected package installer's configuration. Then, it seemed to complete the installation, but i could not access the USB hard drive at all using Windows Explorer (\\192.168.1.1).

Did I do something wrong? In the meantime, I just went back to SlimSamba2 with USB 2.0 deactivated.

BTW, it was a 40 Gb hard drive freshly partitioned with about 2Gb as partition 1 (ext3), 256 Mb as partition2 (linux-swap), and the rest ext3.

_________________
E3000 (converted from WRT610NV2)
ASUS RT-N56U Firmware 1.0.1.4 (reverted from 1.0.1.5)
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sun Oct 18, 2009 16:42    Post subject: Reply with quote
I had to restart the installation several times. I ran it one last time and it said everything was installed and nothing to do. I hope everything configured properly.

Isn't SWAT a web interface for samba? I tried logging into it at 192.168.1.1:901 and all i got was unable to display web page.

Also it was very laborious for the router, load sometimes hit 8.00+, I think that was when it would stall and i would have to restart.

Also noted getting these errors

Code:
/tmp/prep_optware: line 57: /tmp/chng_startup: Permission denied

An error ocurred, return value: 4.
Collected errors:
Cannot find package curl.
Check the spelling or perhaps run 'ipkg update'



prep_optware last run output


df output

Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 5120      5120         0 100% /
/dev/mtdblock/4        1898896    185808   1616628  10% /jffs
/dev/mmc/disc0/part1   1898896    185808   1616628  10% /mmc
/dev/mmc/disc0/part1   1898896    185808   1616628  10% /jffs
/dev/mmc/disc0/part1   1898896    185808   1616628  10% /opt
//SERVER01/router    120053712  56014988  64038724  47% /tmp/smbshare


During the restarts of the install, I also got multiple input/output errors. Should I wipe it all and start over?

_________________
The New Me


Last edited by DHC_DarkShadow on Thu Oct 22, 2009 15:11; edited 1 time in total
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Oct 18, 2009 17:19    Post subject: Reply with quote
That swat isn't installed yet....
Will do this later on...
Thanks for the feedback...

The thing that went wrong here was adding the startup of optware to the rc_startup variable....
I also discovered I forgot to manipulate rc_shutdown.
This has been fixed too.....
You need to do this manually now...

I just modified prep_optware....

If you haven't done major modifications it should be safe to just run it again....

I've been very busy with the scripts itself... The prep_optware script to load all these suffered from this...
Please continue feedback on the modified script...
Version: Sun Oct 18 19:24:09 CEST 2009

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Oct 18, 2009 18:25    Post subject: Reply with quote
Swat needs xinetd which is missing the RPATH.
It's therefore in conflict with DD-WRT's smaller library.

This will replace the xinetd startup script and modify /opt/etc/xinetd.d/swat

Code:
wget -qO /opt/etc/init.d/S10xinetd        http://wd.mirmana.com/S10xinetd
# widen subnet of swat
sed -ie 's/192.168.1.0\/24/192.168.0.0\/16/' /opt/etc/xinetd.d/swat

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Masterman
DD-WRT Guru


Joined: 24 Aug 2009
Posts: 2070
Location: South Florida

PostPosted: Sun Oct 18, 2009 19:31    Post subject: Reply with quote
Can't seem to get xinetd to execute the sed script:

Code:
root@Asus:~# service xinetd on
Enable service "xinetd" (/opt/etc/init.d/S10xinetd)
root@Asus:~# service
Service:             automount (/opt/etc/init.d/S35automount)
Service:                 pound (/opt/etc/init.d/S80pound) disabled
Service:              asterisk (/opt/etc/init.d/S90asterisk) disabled
Service:   transmission-daemon (/opt/etc/init.d/S90transmission) disabled
Service:                 samba (/opt/etc/init.d/S80samba)
Service:                xinetd (/opt/etc/init.d/S10xinetd)
root@Asus:~# sed -ie 's/192.168.1.0\/24/192.168.0.0\/16/' /opt/etc/xinetd.d/swat
sed: can't read /opt/etc/xinetd.d/swat: No such file or directory
root@Asus:~#

_________________
Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Oct 18, 2009 19:56    Post subject: Reply with quote
That's because you ran an early script of mine which installed 'samba' instead of 'samba2'.
They are both samba version 2, but the 'samba2' package includes swat and a xinetd config file (/opt/etc/xinetd.d/swat).

This config-file has a 192.168.1.0/24 access scope configured which is only valid for a few users. A 192.168.0.0/16 is just as safe but works for those that have a different subnet than the default one.

Those running totally different subnets should also have enough knowledge to do this themselves.....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Oct 18, 2009 20:03    Post subject: Reply with quote
@frater...

This is marvelous work.. Thanks for sharing. I've learned a lot from your posts and following your guides.

I am in the midst of using a mmc modded tm to work with your posted scripts..

Again.. Thank you for sharing.. This stuff is cool, and a lot of fun.

_________________
[Moderator Deleted] Shocked
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sun Oct 18, 2009 21:28    Post subject: Reply with quote
Let me know when you get swat in, cause I'm a GUI kinda guy. Laughing

Errors noticed:

cannot access `/opt/etc/init.d/S08samba': No such file or directory



prep_optware output

_________________
The New Me


Last edited by DHC_DarkShadow on Thu Oct 22, 2009 15:22; edited 1 time in total
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sun Oct 18, 2009 21:34    Post subject: Reply with quote
frater wrote:
Swat needs xinetd which is missing the RPATH.
It's therefore in conflict with DD-WRT's smaller library.

This will replace the xinetd startup script and modify /opt/etc/xinetd.d/swat

Code:
wget -qO /opt/etc/init.d/S10xinetd        http://wd.mirmana.com/S10xinetd
# widen subnet of swat
sed -ie 's/192.168.1.0\/24/192.168.0.0\/16/' /opt/etc/xinetd.d/swat


Did you intend this to be run alone or is it supposed to be inserted somewhere?

_________________
The New Me
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sun Oct 18, 2009 21:50    Post subject: Reply with quote
code from a couple posts above output

Code:
BusyBox v1.13.4 (2009-09-30 10:16:35 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@WRT54G-TMv11:~# wget -qO /opt/etc/init.d/S10xinetd        http://wd.mirmana

.com/S10xinetd
root@WRT54G-TMv11:~# # widen subnet of swat
root@WRT54G-TMv11:~# sed -ie 's/192.168.1.0\/24/192.168.0.0\/16/' /opt/etc/xinet

d.d/swat


prep_optware output

reboot output

Code:
root@WRT54G-TMv11:~# reboot
/opt/etc/asterisk/asterisk.conf not found.. exiting
pound already stopped
Try to unmount "/dev/mmc/disc0/part1 on /jffs"
umount  /dev/mmc/disc0/part1
Try to unmount "/dev/mmc/disc0/part1 on /mmc"
umount  /dev/mmc/disc0/part1
Oct 18 17:46:19  optware.info /opt/etc/init.d/K99optware: Optware shutdown finis
hed

_________________
The New Me


Last edited by DHC_DarkShadow on Thu Oct 22, 2009 15:25; edited 2 times in total
Goto page Previous  1, 2, 3, ... 157, 158, 159  Next Display posts from previous:    Page 2 of 159
Post new topic   This topic is locked: you cannot edit posts or make replies.    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