[Howto] Install Optware on Atheros units (such as WNDR3700)

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 29, 30, 31  Next
Author Message
Juniorek
DD-WRT User


Joined: 14 Feb 2011
Posts: 72

PostPosted: Sat Dec 31, 2011 17:27    Post subject: Reply with quote
edibg wrote:
The only issue is that when i try to run ipkg i get "Segmentation fault".
What can be wrong ?



i`ve managed to get opkg running based on another tutorial, but somthing was not right;/

when the usb was plugged in, i had weird errors on the web-gui and couldn`t manage my options.
unplugging it fixed it.

on the previous "opkg way" i also had ipkg "seg. fault"

i couldn`t make it run;/

now i`m trying your way...
Sponsor
Juniorek
DD-WRT User


Joined: 14 Feb 2011
Posts: 72

PostPosted: Sat Dec 31, 2011 18:30    Post subject: seg fault Reply with quote
man... i really don`y know what`s wrong...


i managed to install opkg
the weg-gui works fine

but when i try the ipkg or even to stop httpd i get seg fault...

somthings not right;/


any one care to help:?
Xaero252
DD-WRT Novice


Joined: 08 Feb 2010
Posts: 6

PostPosted: Sat Dec 31, 2011 23:34    Post subject: Reply with quote
I have a slightly peculiar situation, and am wondering how I can accomplish what I wish to.

I wish to use optware to install mdadm so that I can use the USB port of this router to backup various systems attached to the router using rsync and cron jobs to a Software Raid 1 using two 1tb disks.
I know it is not favorable to use JFFS since upon firmware upgrade the changes will get overwritten. would it be possible to use a USB Flash drive and a two port hub to the router's USB port and set things up that way (this would over complicate things more than they have already become) or would it be better to just make a startup script to check if the optware is enabled, and if not re-download the packages and install/configure them properly and remount the raid array? I could then backup this script and re-run it on a new install of the firmware? Or, would it be acceptable to just use JFFS2 since my only intention is enabling mdadm, rsync, and a few other small lightweight utilities?

Although the flash media may be useful since I could use it as a (slow) swap medium for the router to utilize since mdadm might become taxing (though I doubt it)

This router only gets updated once yearly (Around the holidays, since that's when I'm around to do maintenance)
Any guidance is greatly appreciated.
edibg
DD-WRT Novice


Joined: 29 Dec 2011
Posts: 3

PostPosted: Sun Jan 01, 2012 11:30    Post subject: Re: seg fault Reply with quote
Juniorek wrote:
somthings not right;/
any one care to help:?

For me the things are working now, I mean the opkg, so I will leave the things as they are now.In future if there is some fix of this may be will try it...
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Sun Jan 01, 2012 13:25    Post subject: mount second partition Reply with quote
Hello
I've r16785 flashed on WNDR 3700 v1.
Mini SD card has 2 partitions : NTFS and ext3,
I want to install optware to second partition
First one (NTFS) is automounted, I can't get the second one to be mounted :
Code:

root@DD-WRT:~# mount -t ext3 -o noatime /dev/sda2 /mnt2
mount: mounting /dev/sda2 on /mnt2 failed: No such file or directory

though sda2 appears in /dev.
What am I doing wrong ?
Thanks
Dmitry Ganin
DD-WRT Novice


Joined: 01 Jan 2012
Posts: 2

PostPosted: Sun Jan 01, 2012 13:52    Post subject: Re: seg fault Reply with quote
Juniorek wrote:
man... i really don`y know what`s wrong...


i managed to install opkg
the weg-gui works fine

but when i try the ipkg or even to stop httpd i get seg fault...

somthings not right;/


any one care to help:?


I get segfault too.

I have Buffalo WZR-HP-AG300H (Atheros 7161 chip). And i change packages URLs and run without segfaults.
Try to find other packages for your chip on http://downloads.openwrt.org



==================================================
For my Buffalo WZR-HP-AG300H (Atheros 7161 chip):

1. Prepare the USB disk
Create an ext3 partition using GParted for instance
I use usb-flash with 3 partitions: ext3, swap, ext3. For packages i use first.

2. Configure DD-WRT
Under Services->Services->Secure Shell:
* Enable SSHd
* Click Apply Settings

Under Services->USB:
* Enable Core USB Support
* Disable USB Printer Support (enable it if you need printing support)
* Enable USB Storage Support
* Enable Automatic Drive Mount
* Set Disk Mount Point to /mnt
* Click Apply Settings

3. Plug the USB drive into the router and reboot it
* SSH into your box using user root and make sure, using mount, that your USB stick was mounted correctly (you can also check this on the web interface under Services->USB).

4. Create and prepare necessary structure
* SSH into your box using user root if not already done at previous step:
*sda_part1 - is directory attached to first partition on my usb-disk.
*If you use only one partition, or on your router partitions get other names - change this.
cd /mnt/sda_part1
mkdir etc opt root
touch optware.enable
chmod 755 etc opt root
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /mnt/sda_part1/etc/
mount -o bind /mnt/sda_part1/etc /etc
mount -o bind /mnt/sda_part1/opt /jffs




5. Install the required libraries for atheros 71xx and OpenWRT's opkg
* !!!Impotant note - browse http://downloads.openwrt.org and find packages for your chip
cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/libc_0.9.32-99_ar71xx.ipk
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/opkg_618-2_ar71xx.ipk
ipkg install libc_0.9.32-99_ar71xx.ipk opkg_618-2_ar71xx.ipk



Type the following lines to create the configuration file for opkg:

cat > /etc/opkg.conf << EOF
src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages
dest root /opt
dest ram /opt/tmp
lists_dir ext /opt/tmp/var/opkg-lists
EOF

Let's make sure everything works properly:

umount /jffs
mount -o bind /mnt/sda_part1/root /tmp/root
mount -o bind /mnt/sda_part1/opt /opt
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update


6. Set the startup script to make the changes take effect each time upon reboot

Under DD-WRT’s web interface, Administration->Commands, input the following commands in the window then click "Save Startup":
*swapon /dev/sda2 - only if you have swap partition on usb (second partition)

#!/bin/sh

sleep 5
if [ -f /mnt/sda_part1/optware.enable ]; then
swapon /dev/sda2
mount -o bind /mnt/sda_part1/etc /etc
mount -o bind /mnt/sda_part1/root /tmp/root
mount -o bind /mnt/sda_part1/opt /opt
else
exit
fi

if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi

Note that some users have reported issues that they were able to fix by making the script sleep 10 seconds instead of 5.

7. Modification of the profile file

SSH into your box then copy/paste the commands below to PuTTY window to create a script running each time when user root logins:

cat > /mnt/sda_part1/root/.profile << EOF
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib:/opt/usr/local/lib'
export PATH='/sbin:/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/usr/bin:/usr/sbin:/opt/usr/local/bin'
export PS1='\[\033[01;31m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
export TERMINFO='/opt/usr/share/terminfo'
EOF

The above script will set the variables for us and also provide a nice colored command line prompt.

8. Reboot and check

Reboot your device with reboot
When it's back on the track, SSH into your box.
Run opkg update
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Sun Jan 01, 2012 16:27    Post subject: Re: mount second partition Reply with quote
kodo wrote:
furic wrote:
Hello
I've r16785 flashed on WNDR 3700 v1.
Mini SD card has 2 partitions : NTFS and ext3,
I want to install optware to second partition
First one (NTFS) is automounted, I can't get the second one to be mounted :
Code:

root@DD-WRT:~# mount -t ext3 -o noatime /dev/sda2 /mnt2
mount: mounting /dev/sda2 on /mnt2 failed: No such file or directory

though sda2 appears in /dev.
What am I doing wrong ?

I am pretty sure, there is no /mnt2

As I understand I should create mount point first, where do I create it ? Can you please provide sample for mounting 2 partitions ?
Thanks
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Sun Jan 01, 2012 16:39    Post subject: Reply with quote
kodo wrote:
You could use /opt as second mount point

root@DD-WRT:/# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2
root@DD-WRT:~# mount -t ext3 /dev/sda2 /opt
mount: mounting /dev/sda2 on /opt failed: No such device
Sorry, I'm newby
checho
DD-WRT Guru


Joined: 27 Feb 2007
Posts: 527
Location: Bulgaria

PostPosted: Sun Jan 01, 2012 17:19    Post subject: Reply with quote
segmentation fault is because you download a new version of libc.so.0 from openwrt repository and it is not compatible with dd-wrt. After replacing it you make it so that /opt/lib/libc.so.0 takes priority over /lib/libc.so.0 and it seems to crash native dd-wrt applications.
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Sun Jan 01, 2012 19:25    Post subject: Reply with quote
kodo wrote:
try
Code:
mount -t ext2 /dev/sda2 /opt

I'm getting the same result with -t ext2
Juniorek
DD-WRT User


Joined: 14 Feb 2011
Posts: 72

PostPosted: Mon Jan 02, 2012 10:32    Post subject: Reply with quote
furic wrote:
kodo wrote:
try
Code:
mount -t ext2 /dev/sda2 /opt

I'm getting the same result with -t ext2



ehhh {it`s a polish werb;p}

your mmc card is mounted as sda

it has sda_part1 and sda_part2 "dirs" in /mnt

try to ls /mnt and check for shure

if what i say is true then mount the sda_part2 to something else like /opt depended where the first one is mounted


...ad note
i just saw that you mount it in /mnt
so there should be 2 dirs like i said before

i use a startup script that mounts my partition where i want

you can also do somthin like that
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Mon Jan 02, 2012 11:30    Post subject: Reply with quote
Juniorek wrote:
furic wrote:
kodo wrote:
try
Code:
mount -t ext2 /dev/sda2 /opt

I'm getting the same result with -t ext2



ehhh {it`s a polish werb;p}

your mmc card is mounted as sda

it has sda_part1 and sda_part2 "dirs" in /mnt

try to ls /mnt and check for shure

if what i say is true then mount the sda_part2 to something else like /opt depended where the first one is mounted


...ad note
i just saw that you mount it in /mnt
so there should be 2 dirs like i said before

i use a startup script that mounts my partition where i want

you can also do somthin like that

Thanks for the replay,Juniorek, but /mnt is mounted to /dev/sda1 partition and not to /dev/sda, the /mnt is empty :
Code:

root@DD-WRT:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
devpts on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /mnt type ext3 (rw,relatime,errors=continue,user_xattr,data=writeba                    ck)
root@DD-WRT:~# ls /dev/sd*
/dev/sda   /dev/sda1  /dev/sda2
root@DD-WRT:~# ls /mnt
root@DD-WRT:~#

I've re-formated the MMC (using GParted) to have ext3 as first partition and NTFS as second, I used "msdos" partition tree and ext3 and ntfs are primary partitions .
Still getting the same error :
Code:

root@DD-WRT:~# mount -t ntfs /dev/sda2 /opt
mount: mounting /dev/sda2 on /opt failed: No such device

What am I missing ?
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Mon Jan 02, 2012 11:38    Post subject: Reply with quote
furic wrote:
What am I missing ?

Can it be a probelm with this specific release I'm using (r16785) ?
Juniorek
DD-WRT User


Joined: 14 Feb 2011
Posts: 72

PostPosted: Mon Jan 02, 2012 11:39    Post subject: Reply with quote
hmmm

i`ve got 18024 so maybe the automount system is diferent cause when i use it ot mount my pen to /mnt i get somthin like /mnt/sda_partX

then i manualy mount what i want


you can also do dmesg and search for mount points like

Code:

<6>[  324.440000] scsi0 : usb-storage 1-1:1.0
<5>[  325.460000] scsi 0:0:0:0: Direct-Access     TOSHIBA  TransMemory      5.00 PQ: 0 ANSI: 0 CCS
<5>[  327.180000] sd 0:0:0:0: [sda] 8058880 512-byte logical blocks: (4.12 GB/3.84 GiB)
<5>[  327.190000] sd 0:0:0:0: [sda] Write Protect is off
<7>[  327.190000] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
<3>[  327.190000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<3>[  327.200000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<6>[  327.210000]  sda: sda1
<3>[  327.210000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<5>[  327.220000] sd 0:0:0:0: [sda] Attached SCSI removable disk


and the show us and maybe will get it working;)
furic
DD-WRT Novice


Joined: 27 Dec 2011
Posts: 12

PostPosted: Mon Jan 02, 2012 11:49    Post subject: Reply with quote
Here it is:
Code:


<5>[   13.640000] SCSI subsystem initialized
<6>[   13.830000] Initializing USB Mass Storage driver...
<6>[   13.830000] scsi0 : usb-storage 1-1:1.0
<6>[   13.840000] usbcore: registered new interface driver usb-storage
<6>[   13.840000] USB Mass Storage support registered.
<5>[   14.850000] scsi 0:0:0:0: Direct-Access     USB Mass Storage Device        PQ: 0 ANSI: 0 CCS
<5>[   14.860000] sd 0:0:0:0: [sda] 15954944 512-byte logical blocks: (8.16 GB/7.60 GiB)
<5>[   14.870000] sd 0:0:0:0: [sda] Write Protect is off
<7>[   14.870000] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
<3>[   14.870000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<3>[   14.890000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<6>[   14.890000]  sda: sda1 sda2
<3>[   14.910000] sd 0:0:0:0: [sda] Assuming drive cache: write through
<5>[   14.920000] sd 0:0:0:0: [sda] Attached SCSI removable disk

and later on
Code:

<6>[10191.070000] usb 1-1: new high speed USB device using ar71xx-ehci and address 4
<6>[10191.220000] usb 1-1: New USB device found, idVendor=14cd, idProduct=125a
<6>[10191.220000] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
<6>[10191.230000] usb 1-1: Product: Mass Storage Device
<6>[10191.230000] usb 1-1: Manufacturer: Generic
<6>[10191.240000] usb 1-1: SerialNumber: 812520090519
<6>[10191.260000] scsi2 : usb-storage 1-1:1.0
<5>[10192.280000] scsi 2:0:0:0: Direct-Access     USB Mass Storage Device        PQ: 0 ANSI: 0 CCS
<5>[10192.290000] sd 2:0:0:0: [sda] 15954944 512-byte logical blocks: (8.16 GB/7.60 GiB)
<5>[10192.300000] sd 2:0:0:0: [sda] Write Protect is off
<7>[10192.300000] sd 2:0:0:0: [sda] Mode Sense: 03 00 00 00
<3>[10192.300000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<3>[10192.310000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<6>[10192.320000]  sda: sda1 sda2
<3>[10192.320000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<5>[10192.330000] sd 2:0:0:0: [sda] Attached SCSI removable disk
<6>[10193.700000] kjournald starting.  Commit interval 5 seconds
<4>[10193.710000] EXT3-fs (sda1): warning: maximal mount count reached, running e2fsck is recommended
<6>[10193.720000] EXT3-fs (sda1): using internal journal
<6>[10193.720000] EXT3-fs (sda1): mounted filesystem with writeback data mode

Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 29, 30, 31  Next Display posts from previous:    Page 15 of 31
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum