Problems with install of opkg

Post new topic   Reply to topic    DD-WRT Forum Index -> ARM or PPC based Hardware
Author Message
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Mon Jan 25, 2016 8:02    Post subject: Problems with install of opkg Reply with quote
Hi,

I have a lot of trouble to get optware opkg to work. Of course i followed all the guides zou can find concentrated to them for the R7000.

After changing the url ins the scripts and everzthink went through or manuell installation it always ends in:

can't create folder /usr/lib - read only or permission denied at ipkg update or opkg - not found.

/opt is mounted to external hdd
/jffs is mounted to external hdd
Both have it's own partition.

If i try to install manuelly an ipk package (ipkg install file.ipk) than it ends up with ipkg-install-something file not found.

I really like to get this implemented, manuell ipk install would be enough, online would be a dream!

Can anybody help please?

Regards,

Thomas

--- /dev/sda1
Block device, size 1.999 GiB (2146435072 bytes)
Ext2 file system
Volume name "OPT"
UUID 949EBB70-8F4F-D101-109A-BA708F4FD101 (NCS)
Volume size 1.999 GiB (2146435072 bytes, 2096128 blocks of 1 KiB)
/dev/sda1 mounted to /opt

--- /dev/sda2
Block device, size 256 MiB (268435456 bytes)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 256.0 MiB (268427264 bytes, 65534 pages of 4 KiB)
/dev/sda2 mounted to swap

--- /dev/sda3
Block device, size 927.2 GiB (995604037632 bytes)
Ext4 file system
Volume name "data"
UUID 90ABDF96-F64F-D101-90AB-C396F64FD101 (DCE, v13)
Last mounted at "/tmp/mnt/sda3"
Volume size 927.2 GiB (995604037632 bytes, 243067392 blocks of 4 KiB)
/dev/sda3 mounted to /tmp/mnt/sda3

--- /dev/sda4
Block device, size 2 GiB (2147483648 bytes)
Ext2 file system
Volume name "JFFS"
UUID F8EF5F90-8F4F-D101-50CC-5F908F4FD101 (NCS)
Volume size 2 GiB (2147483648 bytes, 2097152 blocks of 1 KiB)
/dev/sda4 mounted to /jffs
Sponsor
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Mon Jan 25, 2016 13:18    Post subject: Reply with quote
I looked into the script optware_setup.

first i needed to modify the web links to the files. Mostly just newer version number. two downloads had to manually becuase it ended in bad request http 400.

Does sombody see what is wrong?

By executing the script it comes to an error at line 81,

-sh: opkg: Permission denied

in line 81 is this comand:

/opt/bin/opkg -f /opt/etc/opkg.conf update





Code:
#!/bin/sh

[ -z "`grep -o ARMv7.*v7l /proc/cpuinfo`" ] && echo "Your processor is not an ARMv7l; this is not the right repository for you." && exit
#[ -z "`grep -o kongac /tmp/loginprompt`" ] && echo "This is not a Kong K3-AC-ARM build; this is not the right repository for you." && exit

echo "Checking we can reach the repository..."
[ -z "`curl -sfI http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/base/Packages.gz`" ] && echo "Could not download Packages.gz, connectivity problem?" && exit

cd /opt
mkdir -p /opt/etc >/dev/null 2>&1
mkdir -p /opt/var/opkg-lists >/dev/null 2>&1
mkdir -p /opt/usr/bin >/dev/null 2>&1
mkdir -p /opt/var/lock >/dev/null 2>&1
cat > /opt/usr/bin/optware_boottime << 'EOF'
#!/bin/sh
# If we have /jffs/opt but no /opt, then bind mount on startup (does nothing if USB in use)
[ -z "$(grep /opt /proc/mounts)" ] && [ ! -z "$(grep jffs2 /proc/mounts)" ] && [ -d "/jffs/opt" ] && mount --bind /jffs/opt /opt
# Add alias to set desired switched to opkg
echo 'alias opkg="opkg -f /opt/etc/opkg.conf --force-depends"' >>/tmp/root/.profile
# Hack to stop kmod.* postinst scripts, we don't have the /lib/functions.sh anyways
echo 'export IPKG_INSTROOT="/opt"' >>/tmp/root/.profile
echo 'PATH="/opt/usr/bin:/opt/usr/sbin:/opt/bin:/opt/sbin:$PATH"' >>/tmp/root/.profile
#echo 'LD_LIBRARY_PATH="/opt/lib:/opt/usr/lib:$LD_LIBRARY_PATH"' >>/tmp/root/.profile
EOF
chmod 700 /opt/usr/bin/optware_boottime
#cat /opt/usr/bin/optware_boottime | sh
# this is not permanent
alias opkg="opkg -f /opt/etc/opkg.conf --force-depends"
IPKG_INSTROOT=/opt
echo "Making sure we have an initial opkg"
[ -x /opt/bin/opkg ] || cd /opt \
         `/usr/bin/wget https://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-10_bcm53xx.ipk -O opkg.ipk` \
      `/bin/mkdir -p /opt/lib` \
      `/usr/bin/wget https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/functions.sh -O /opt/lib/functions.sh` \
      EXTB=`tar zxvf opkg.ipk` \
      EXTC=`tar zxvf data.tar.gz` \
      REMOVE=`rm -rf opkg.ipk data.tar.gz control.tar.gz debian-binary` \
      echo "Install complete. You can now use opkg to install additional packages."

[ -x /opt/bin/opkg ] || exit

echo "Creating the opkg config file in /opt/etc/opkg"
cat > /opt/etc/opkg.conf <<EOF
src/gz chaos_calmer_base http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/base
#src/gz chaos_calmer_luci http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/luci
#src/gz chaos_calmer_management http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/management
src/gz chaos_calmer_packages http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/telephony
dest root /opt
dest ram /tmp
lists_dir ext var/opkg-lists
option overlay_root /opt/overlay
arch all 1
arch noarch 1
arch bcm53xx 5
EOF



#echo "Updating opkg itself from new repository"
#opkg --force-reinstall install opkg >/dev/null 2>&1


# this is not permanent, silences kmod-* postinst scripts
export IPKG_INSTROOT="/opt"

echo "You are now ready to install packages using opkg (this session only)."
echo "I've installed a script, optware_boottime, to run on boot and make the opkg settings persistent."
echo "I'll add this to the end of rc_startup in nvram for you."
nvram get rc_startup | grep -v "optware_boottime" > /tmp/rcstartup
echo "/opt/usr/bin/optware_boottime" >> /tmp/rcstartup
nvram set rc_startup="`cat /tmp/rcstartup`"
#rm -f /tmp/rcstartup
#nvram get rc_startup
#echo "Updating opkg lists from new repository"
#[ -x /opt/bin/opkg ] && opkg update
rm -f /opt/etc/opkg/distfeeds.conf
#alias opkg="opkg -f /opt/etc/opkg.conf --force-depends"
/opt/usr/bin/optware_boottime
/opt/bin/opkg -f /opt/etc/opkg.conf update
echo "Minimal setup is complete. You should now have a working opkg."
echo "We have created some aliases in your ~/.profile to make everything work."
echo "Please either 'source .profile' or LOG OUT and LOG IN AGAIN before proceeding."
#echo "Installing libc package to silence dependencies"
#opkg --force-overwrite install https://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/base/libc_1.1.11-1_bcm53xx.ipk


I think here is may the main problem and here are the to location wich i needed to download manually:


[/code]
[ -x /opt/bin/opkg ] || cd /opt \
`/usr/bin/wget https://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-10_bcm53xx.ipk -O opkg.ipk` \
`/bin/mkdir -p /opt/lib` \
`/usr/bin/wget https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/functions.sh -O /opt/lib/functions.sh` \
EXTB=`tar zxvf opkg.ipk` \
EXTC=`tar zxvf data.tar.gz` \
REMOVE=`rm -rf opkg.ipk data.tar.gz control.tar.gz debian-binary` \
echo "Install complete. You can now use opkg to install additional packages."

[ -x /opt/bin/opkg ] || exit
Code:
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Tue Jan 26, 2016 11:13    Post subject: Reply with quote
Nobody who want to help here?
rejogc
DD-WRT Novice


Joined: 28 Jan 2016
Posts: 3

PostPosted: Fri Jan 29, 2016 0:03    Post subject: Reply with quote
I installed opkg after looking at the thread entitled 'ootrw (opkg optware the right way)'.

It talks about installing optware and in particular there's a script called ootrwsetup.sh that installs optware.

The first thing the script does is install opkg.

Before that the script finds the version of opkg that is suitable for your architecture.

When I first executed the script it went and added a whole lot of software I wasn't really interested in. And worse that software conflicted with something in my router that ended up killing internet access. Fortunately there was a uninstall script.

The second time I ran the script I let it go till it installed opkg and quickly hit Ctrl-C to prevent it from installing the additional packages.

So opkg installed and ran nicely until I re-booted the router. Then I discovered the install script sets up the run time environment for opkg by copying files and mounting some /opt directories over /jffs.

I'm working on this right now so sorry if it all sounds kind of unclear. I'll follow-up as soon as I'm done.

Good luck.
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Fri Jan 29, 2016 0:06    Post subject: Reply with quote
Can you post the link to be sure its the same i tried to use please?

Thank you!!
rejogc
DD-WRT Novice


Joined: 28 Jan 2016
Posts: 3

PostPosted: Fri Jan 29, 2016 7:35    Post subject: Reply with quote
Here's the link http://www.dd-wrt.com/phpBB2/viewtopic.php?t=260926

Here's the commands to make parts of the /opt directories executable. Before installing opkg to /opt do this:

cd /opt
mkdir optware logs data
cd /opt/optware
mkdir lib etc root tmp
cp -a /etc/* /opt/optware/etc/
cp -a /tmp/root /opt/optware

Then enter these after. Put these in a script and execute after every boot.

mkdir /tmp/logs
mount -o bind /opt/optware/ /jffs/
mount -o bind /opt/optware/etc/ /etc/
mount -o bind /opt/optware/root/ /tmp/root/
mount -o bind /opt/logs/ /tmp/logs/

A couple of things to note:

1. Since this bind mounts over /jffs it should not be used as a mount point for a USB drive
2. The script you create should have a .startup file extension.
3. I'm working on finding where to put this script so it runs on startup. Let me know if you find out where.

Best regards
[/url]
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Fri Jan 29, 2016 9:15    Post subject: Reply with quote
I found this tutorial:

http://lifehacker.com/5756233/get-more-out-of-your-dd-wrt-router-with-an-external-drive

it looks almost like here discribed.

Code:

nvram set rc_startup="`nvram get rc_startup` && /mnt/mount.sh"


by this we start the script pre startup.

what about not to mount /opt /jffs seperatly? is there any benefit out of mounting it from seperat partitions?
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Fri Jan 29, 2016 11:50    Post subject: Reply with quote
whatever i do /jffs is alwazs mounted at startup to usb. I I deaktivate automount than it is not possible at all to mount and i can just see the swap partition for mount.
If automount active but without setting th uid to mount for /opt and /jffs mount dropes out this:

Code:

root@GATEWAY:~# mount
/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 /opt type ext4 (rw,relatime,data=ordered)
/dev/sda4 on /jffs type ext4 (rw,relatime,data=ordered)
/dev/sda3 on /tmp/mnt/sda3 type ext4 (rw,relatime,data=ordered)

So you can see that both opt and jffs are mounted to usb drive WITHOUT telling to do so?!
rejogc
DD-WRT Novice


Joined: 28 Jan 2016
Posts: 3

PostPosted: Fri Jan 29, 2016 18:25    Post subject: Reply with quote
I formatted my usb with 1 partition named 'opt' and specified its uuid in the GUI[/img]
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Fri Jan 29, 2016 18:37    Post subject: I will pay the person who to fix this and teach my how to! Reply with quote
I will pay you if i get the right help and teached "How to"

Hi,

thank's for all the work!

I used to many weeks now to get this solved so i will pay the pro wich helps me out. Are you the person wich have fill controle? than write me a pm!

May it's special with my Netgear AC1900 R7000 or wht ever.

I still have a lot's of problems installing opkg.

after trying it the first time i got error read-only filesytem on /usr/lib and so on. I did preperation by:

One external disk with 4 partitions:

sda1 - /opt
sda2 - swap
sda3 - /jffs
sda4 - /tmp/mnt/sda4 for dlna and NAS

Mr. Rejogc in the post ( http://www.dd-wrt.com/phpBB2/viewtopic.php?p=1005486#1005486 ) wrote the following preperations to me wich I followed:

From the post:
Here's the commands to make parts of the /opt directories executable. Before installing opkg to /opt do this:

cd /opt
mkdir optware logs data
cd /opt/optware
mkdir lib etc root tmp
cp -a /etc/* /opt/optware/etc/
cp -a /tmp/root /opt/optware

Then enter these after. Put these in a script and execute after every boot.

mkdir /tmp/logs
mount -o bind /opt/optware/ /jffs/
mount -o bind /opt/optware/etc/ /etc/
mount -o bind /opt/optware/root/ /tmp/root/
mount -o bind /opt/logs/ /tmp/logs/

A couple of things to note:

1. Since this bind mounts over /jffs it should not be used as a mount point for a USB drive
2. The script you create should have a .startup file extension.
3. I'm working on finding where to put this script so it runs on startup. Let me know if you find out where.

From the post END.

I get errors from the ootrwsetup.sh "could not bla bla at /usr/*** - read only filesystem"

So i tried to move /usr as well to /opt by
Code:
cp -a  /usr /opt/
and bind it with
Code:
mount --bind /usr /opt/usr
before install.

after install with the
Code:
sh ootrwsetup.sh -r https://downloads.openwrt.org/chaos_calmer/15.05/
i couldn't access the web-gui anymore and resolving names where as well not possible anymore.

So i made so many things that i canceld now investigating errors and just reflashed my last backup and config.

I came no so long that if somebody really help me to get opkg running without any preinstall's so I can choose by my selv what I like to install and teach me by the way "how to" and what's happening (and I am not the first time in touch with linux and my router) I pay this person if it works and I know how to install it again!
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6867
Location: Romerike, Norway

PostPosted: Fri Jan 29, 2016 22:15    Post subject: Reply with quote
R7000 is a Broadcom based router, so you will get better response posting in the Broadcom Forum.
Firma@pruefer.no
DD-WRT Novice


Joined: 06 Jan 2016
Posts: 32

PostPosted: Fri Jan 29, 2016 22:18    Post subject: Reply with quote
Here is just a copy. I have the same posted under the guide.

Thx
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> ARM or PPC 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