Help installing entware and keeping it after reboot [SOLVED]

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
jifffy
DD-WRT User


Joined: 08 Jun 2020
Posts: 58

PostPosted: Wed Feb 24, 2021 20:41    Post subject: Help installing entware and keeping it after reboot [SOLVED] Reply with quote
I am running a Linksys 3200 ACM with DD-WRT v3.0-r45219 std (12/31/20) firmware. I used this guide to install entware https://gist.github.com/dreamcat4/6e58639288c1a1716b85 and the installation is successful. root@DD-WRT:/tmp/mnt/usb_hdd# which opkg
/opt/bin/opkg
I don't know how to do this *Info: Add /opt/bin & /opt/sbin to your PATH variable* Once I reboot the router I no longer have entware root@DD-WRT:~# opkg --help
-sh: opkg: not found
I have to reinstall it. What am I doing wrong ? How can I keep the entware install through a reboot?
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12882
Location: Netherlands

PostPosted: Wed Feb 24, 2021 20:53    Post subject: Reply with quote
Have a look at the ddwrt wiki:
https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
jifffy
DD-WRT User


Joined: 08 Jun 2020
Posts: 58

PostPosted: Wed Feb 24, 2021 20:56    Post subject: Reply with quote
egc wrote:
Have a look at the ddwrt wiki:
https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

I followed those instructions to the tee and I still can't keep entware installed during a reboot. Something is missing. I installed one app called htop, after a reboot I can use htop, so that works, but the entware installation is missing.

I tried to install again and I got some errors.
Code:
root@DD-WRT:/opt# sh generic.sh
Info: Checking for prerequisites and creating folders...
Warning: Folder /opt exists!
Info: Opkg package manager deployment...
Connecting to bin.entware.net (104.21.91.83:80)
saving to '/opt/bin/opkg'
'/opt/bin/opkg' saved
Connecting to bin.entware.net (104.21.91.83:80)
saving to '/opt/etc/opkg.conf'
'/opt/etc/opkg.conf' saved
Info: Basic packages installation...
Downloading http://bin.entware.net/armv7sf-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing entware-opt (227000-3) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /opt, pkg entware-opt needs 3
 * opkg_install_cmd: Cannot install package entware-opt.
Info: Congratulations!
Info: If there are no errors above then Entware was successfully initialized.
Info: Add /opt/bin & /opt/sbin to $PATH variable
Info: Add "/opt/etc/init.d/rc.unslung start" to startup script for Entware services to start
Info: Found a Bug? Please report at https://github.com/Entware/Entware/issues
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Wed Feb 24, 2021 23:10    Post subject: Reply with quote
You don't need to reinstall Entware. The problem is that you haven't correctly configured your login environment.

When you login, the system looks for the file .profile in your home directory and executes it. It's there where you can make your PATH changes. Or as I do, have the .profile file source the .bashrc file (the latter, by convention, is the preferred location for such changes).

You can add something like the following to the startup script. Then every time you login, your environment will be setup correctly. I also added some aliases just to illustrate what else is possible.

Code:
cat << "EOF" > /tmp/root/.profile
[ -f "${HOME}/.bashrc" ] && . "${HOME}/.bashrc"
EOF

cat << "EOF" > /tmp/root/.bashrc
PATH=.:/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
unalias -a
alias ls='$(which ls) --color'
alias l='ls -lFA'
alias ll='ls -lF'
alias dir='ls'
alias lip='nvram get lan_ipaddr'
alias gip='nvram get wan_gateway'
alias wip='nvram get wan_ipaddr'
alias pip='wget -qO - http://ipinfo.io/ip'
EOF

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
jifffy
DD-WRT User


Joined: 08 Jun 2020
Posts: 58

PostPosted: Thu Feb 25, 2021 11:34    Post subject: Reply with quote
eibgrad wrote:
You don't need to reinstall Entware. The problem is that you haven't correctly configured your login environment.

When you login, the system looks for the file .profile in your home directory and executes it. It's there where you can make your PATH changes. Or as I do, have the .profile file source the .bashrc file (the latter, by convention, is the preferred location for such changes).

You can add something like the following to the startup script. Then every time you login, your environment will be setup correctly. I also added some aliases just to illustrate what else is possible.

Code:
cat << "EOF" > /tmp/root/.profile
[ -f "${HOME}/.bashrc" ] && . "${HOME}/.bashrc"
EOF

cat << "EOF" > /tmp/root/.bashrc
PATH=.:/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
unalias -a
alias ls='$(which ls) --color'
alias l='ls -lFA'
alias ll='ls -lF'
alias dir='ls'
alias lip='nvram get lan_ipaddr'
alias gip='nvram get wan_gateway'
alias wip='nvram get wan_ipaddr'
alias pip='wget -qO - http://ipinfo.io/ip'
EOF


I have no idea where any of that stuff goes. I tried putting it in my start up script with sleep 10
/opt/etc/init.d/rc.unslung start

But that did not work, after a reboot I had no entware, please be more specific with your answer as I am a noob and I don't understand what you are telling me. I tried adding it with my ssh session, just copy and paste what you wrote and then rebooting, but still no entware.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6436
Location: UK, London, just across the river..

PostPosted: Thu Feb 25, 2021 12:04    Post subject: Reply with quote
yep, its suppose to be in start up script...
do keep in mind, your router is Marvell based and those entware specific issues should be posted to Marvell forum section, there you can get a better advise...

If i was you i would ve start form the scratch...

format that USB to ext2/ext3 or ext4 --- (i prefer ext2) ...
make sure it doesn't have any corrupted sectors, so try another USB...
than, once its formatted, name your partition to opt or jffs, depends what you want to use...
than enable USB form GUI, start auto-mount, so named opt or jffs partitions will be auto-mounted...
do keep in mind if you have more USB's connected, they may interfere if they have the same opt or jffs names...
than install the appropriate version of entware for your router... as its not Broadcom or Atheros i guess you must use dual-core/Arm7 version...(please refer in Marvell section what to use)...i have no experience whit Marvell based entware installations...

than install your package and configure it, as it requires...
very likely you use that line in start up script to start what ever is in opt...

/opt/etc/init.d/rc.unslung start

but sometimes, it may need a different command
like this one for example (in may case)..

/opt/etc/init.d/S61stubby.sh start

good to add this line in shutdown script too
sleep 10
/opt/etc/init.d/rc.unslung stop

if everything is configured as it should, it must be working...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913


Last edited by Alozaros on Thu Feb 25, 2021 12:08; edited 1 time in total
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Feb 25, 2021 12:06    Post subject: Reply with quote
If you followed the instructions in the following link to install Entware to a USB flash drive ...

https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

... there's no reason it shouldn't persist and be available after a reboot once the same USB flash drive is remounted. And that should be confirmable by going to the USB page and confirming the automount took place successfully. And if it did, use a shell (telnet or ssh) to log into the router and confirm the /opt directory is NOT empty.

Code:
ls /opt

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
jifffy
DD-WRT User


Joined: 08 Jun 2020
Posts: 58

PostPosted: Thu Feb 25, 2021 14:23    Post subject: Reply with quote
eibgrad wrote:
If you followed the instructions in the following link to install Entware to a USB flash drive ...

https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

... there's no reason it shouldn't persist and be available after a reboot once the same USB flash drive is remounted. And that should be confirmable by going to the USB page and confirming the automount took place successfully. And if it did, use a shell (telnet or ssh) to log into the router and confirm the /opt directory is NOT empty.

Code:
ls /opt


Following this wiki I get the following:

Code:
root@DD-WRT:~# cd /opt
root@DD-WRT:/opt# wget http://bin.entware.net/armv7sf-k3.2/installer/generic.sh
Connecting to bin.entware.net (104.21.91.83:80)
wget: can't open 'generic.sh': Read-only file system
root@DD-WRT:/opt# sh generic.sh
sh: can't open 'generic.sh': No such file or directory


And in my router I get this
Code:
--- /dev/sda
Block device, size 115.5 GiB (124017180672 bytes)
DOS/MBR partition map
Partition 1: 115.5 GiB (124016132096 bytes, 242219008 sectors from 2048)
Type 0x83 (Linux)
Ext4 file system
UUID 56B4A5F6-08B4-4567-8E3D-B4EC94DB5776 (DCE, v4)
Last mounted at "/tmp/mnt/sda1"
Volume size 115.5 GiB (124016132096 bytes, 30277376 blocks of 4 KiB)
/dev/sda not mounted Unsupported Filesystem

--- /dev/sda1
Block device, size 115.5 GiB (124016132096 bytes)
Ext4 file system
UUID 56B4A5F6-08B4-4567-8E3D-B4EC94DB5776 (DCE, v4)
Last mounted at "/tmp/mnt/sda1"
Volume size 115.5 GiB (124016132096 bytes, 30277376 blocks of 4 KiB)
/dev/sda1 mounted to /tmp/mnt/sda1


Ok I saw the problem, I fixed it, now it mounts to /opt on my router automatically. Problem solved. Thanks guys. It stayed installed after reboot. Success!
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Thu Feb 25, 2021 15:30    Post subject: Reply with quote
In case someone else gets stuck in a similar way, what is the problem that you fixed and how?
jifffy
DD-WRT User


Joined: 08 Jun 2020
Posts: 58

PostPosted: Thu Feb 25, 2021 15:56    Post subject: Reply with quote
blkt wrote:
In case someone else gets stuck in a similar way, what is the problem that you fixed and how?


The problem was with the thumbdrive itself, it wasn't mounting as /opt but rather as /tmp/mnt/sda1 in the router. I took a fresh drive, formatted it as Optware ext4 and this mounted itself as /opt in the router.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6436
Location: UK, London, just across the river..

PostPosted: Thu Feb 25, 2021 21:28    Post subject: Reply with quote
if the name is not OPT, USB normally mounts as /tmp/mnt/sda1, to mount it on opt if it doesn't have OPT name, you have to mount it manually, copy/paste its UUID number to either opt or jffs...boxes save and apply and wait or reboot...
Otherwise just name partitions OPT or JFFS and use auto-mount option... Laughing

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum