Joined: 22 Jun 2008 Posts: 2440 Location: Am now Dark_Shadow
Posted: Sat Oct 17, 2009 21:44 Post subject: Re: Optware, the right way
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
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
Joined: 22 Jun 2008 Posts: 2440 Location: Am now Dark_Shadow
Posted: Sun Oct 18, 2009 7:05 Post subject:
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
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
Joined: 16 Jun 2007 Posts: 168 Location: Northern Virginia, USA
Posted: Sun Oct 18, 2009 14:47 Post subject: Re: Optware, the right way
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)
Joined: 22 Jun 2008 Posts: 2440 Location: Am now Dark_Shadow
Posted: Sun Oct 18, 2009 16:42 Post subject:
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'
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
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
Joined: 24 Aug 2009 Posts: 2070 Location: South Florida
Posted: Sun Oct 18, 2009 19:31 Post subject:
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
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