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."
#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:
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.
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.
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?!
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!