Author
Message
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Fri May 07, 2021 10:07 Post subject: [SOLVED] Problems to change Profile
Hello...
I installed entware on my R7800 and now I like to change the PATH variabe.
But it doesn't work.
I build a file named ModifiedProfile in /opt
Then I wrote this in my startup:
Code:
mount --bind /opt/ModifiedProfile /etc/profile
sleep 5
/opt/etc/init.d/rc.unslung start
But after a reboot the profile is still the old standard one.
Back to top
Sponsor
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Tue May 11, 2021 13:48 Post subject:
I have installed Entware and I thought now it works. NOT! One of the final output lines of the installation script says something like "Congratulations...", but before that is are a couple of lines about changing or adding to the $PATH variable. If you check the $PATH variable after installation it will show that the "/opt paths" where Entware is installed are in the path. But there's a problem. They're at the end of the path which means any binaries or programs that are included with the DD-WRT firmware will be used before the Entware versions. The result is that stuff just doesn't work from the command line properly. Even changing the $PATH variable with:
Code:
export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin
will not help the situation after a reboot. Simply setting the $PATH variable in a startup script via the GUI won't help either in terms of issuing Entware commands at the command line. It has to do with the "profile" variable (DD-WRT default path: /etc/profile).
But even I write a Script file like in my first post nothing change.
Please help.
Back to top
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Wed May 12, 2021 9:53 Post subject:
can nobody help me ? Where are you gurus ?
Please...
Back to top
yoyoma2 DD-WRT User Joined: 24 Sep 2016 Posts: 372
Posted: Wed May 12, 2021 13:39 Post subject:
I put this in my Administration->Commands->Startup
Code: /bin/sh -c 'until [ -f /opt/etc/init.d/rc.unslung ]; do sleep 1 ; done'
/opt/etc/init.d/rc.unslung start
/opt/bin/myStartup.sh
Then customize anything as follows in myStartup.sh (make sure it's executable)
Code: # setup a ~/.profile file
OUTFILE=/tmp/root/.profile
rm -f $OUTFILE
echo "export PATH=\$PATH:." >> $OUTFILE
echo "alias la='ls -lahrt'" >> $OUTFILE
echo "alias h='history'" >> $OUTFILE
Some people like to prepare a user .profile and copy it in place but I prefer to generate it on the fly.
Back to top
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Thu May 13, 2021 13:08 Post subject:
Thanks.
I will Test ist..
Back to top
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Sun May 16, 2021 14:00 Post subject:
Hi...
Is not running. Maybe I make a fault
This is in my Startup File.
Code:
[size=9]#!/bin/sh
# setup a ~/.profile file
OUTFILE=/tmp/root/.profile
#new profile
rm -f $OUTFILE
#echo "export PATH=\$PATH:." >> $OUTFILE
echo "alias la='ls -lahrt'" >> $OUTFILE
echo "alias h='history'" >> $OUTFILE
echo "export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin" >> $OUTFILE
echo "export LD_LIBRARY_PATH=/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib" >> $OUTFILE
echo "export PS1='\u@\h:\w\$ '" >> $OUTFILE[/size]
And it shows also in .profile.
But Path is the old one.
Code:
root@DD-WRT:~# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
Back to top
yoyoma2 DD-WRT User Joined: 24 Sep 2016 Posts: 372
Posted: Sun May 16, 2021 23:49 Post subject:
If you 'source /tmp/root/.profile' do you get any errors? Do your other custom settings like prompt, aliases, LD_LIBRARY_PATH variable work?
If you log in too quickly after rebooting, it's possible for the /tmp/root/.profile to not be in place in time.
Is your build recent? I've heard of /tmp/root/.profile not being read/processed correctly in some old builds.
Since your /tmp/root/.profile appears I assume that your startup commands are successfully running your startup script on boot.
Back to top
drnorton DD-WRT User Joined: 08 Dec 2009 Posts: 137
Posted: Mon May 17, 2021 8:03 Post subject:
Hi...
now its working.
I don't know why. I think you are right.
Need time after the router is starting.
Thanks for your help.
Jucheee....
Back to top