OpenWrt Forum Archive

Topic: opkg.conf file destroyed, possible to reset?

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,
I got a problem. Today the new Wlan Router TL-WDR3600 arrived. i installed the OpenWrt: openwrt-ar71xx-generic-tl-wdr3600-v1-squashfs-factory.bin with LuCI and CUP for the printer. Then there wasn't enough space to install the printer driver: hplip
I heard about extroot and the possibility to change the installation destination for opkg...
-> http://wiki.openwrt.org/doc/techref/opkg

wiki wrote:

Detailed Instructions

First mount an external filesystem, see Mounting Filesystems for help with that. Then edit /etc/opkg.conf:

    Add the line dest usb /opt to the bottom of the file
    Execute the following command (assuming that /mnt/sda1 is the path to the mount point of your external filesystem):

    ln -s /mnt/sda1 /opt

    Edit /etc/profile and add the new mount point to your paths variables:

    export PATH=<current default path>:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
    export LD_LIBRARY_PATH=<current default LD library path>:/opt/lib:/opt/usr/lib

    From here, you should be able to install new packages to your new mount point as follows:

    opkg update
    opkg -dest usb install asterisk14  # or whatever else you want…

    If you install packages to external filesystems that have a startup script under /etc/init.d and (if enabled) under /etc/rc.d you need to set a sysmlink to /etc/init.d, e.g.:

     ln -s /usb/etc/init.d/openvpn /etc/init.d/openvpn

    Libraries installed along with those packages are also installed to the external filesystem. This causes the programm not to start during bootup. You need to manually set the LD_LIBRARY_PATH in each 'external' startup script:

     export LD_LIBRARY_PATH=/lib:/usr/lib:/tmp/lib:/tmp/usr/lib:/usb/lib:/usb/usr/lib

I made a mistake in /etc/profile maybe the LD_LIBRARY_PATH was wrong. I did not correct it. Instead of it, I started to reload the openWrt firmware to get a new fresh system without all the unnecessary installed packages.
After the reboot the webinterface was not reachabel as supposed.
But i can directly connect with SSH and my old password and most commands do not work now...

login as: root
root@192.168.1.1's password:


BusyBox v1.19.4 (2013-07-23 12:12:48 PDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r37514)
-----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
-----------------------------------------------------
-ash: export: line 5: path:/opt/lib:/opt/usr/lib: bad variable name
~ #
~ #
~ #
~ # opkg update
-ash: opkg: not found
~ # cat /etc/profile
-ash: cat: not found
~ # vi /etc/profile
-ash: vi: not found
~ # cd /etc
/etc # ./profile
-ash: ./profile: Permission denied
/etc # ls
-ash: ls: not found
/etc #

Is there a way to reset this. Most of the commands don't work.

I am looking forward to hearing from you. Thanks!

Lex

Run:

mtd -r erease rootfs_data

And you can start over from scratch with a clean state :-)

Thank you, it worked.

The discussion might have continued from here.