Tiny Core Linux
Tiny Core Base => Micro Core => Topic started by: kirin-rex on August 19, 2019, 09:49:22 PM
-
I want to add to bootlocal.sh but when I open in editor and try to save, I get permission denied.
I know NOTHING about linux or tiny core or micro-core. An employee installed micro-core on a bunch of ancient laptops for me because I didn't want to just chuck 'em. You know? But he's no longer with us.
So now, where I work, has a hidden wifi ssid, so I googled and found a bootlocal.sh code ... but I'm not sure if "editor" is even what to use.
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
I googled and found some codes that were supposed to be for permissions:
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chown 775 /opt/bootlocal.sh
but was not sure where or how to use them. I tried the terminal, but to no effect.
Now, I'm not 100% useless. I've been using computer for over 35 years, since before windows. I mean, I had a sinclair computer that I played with as a kid ... so I remember old dos commands, etc.
But still, I'm out of my element here. Can anybody give a clueless newb some advice?
Thanks!
-
Hi kirin-rex
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Editor is what I use when editing files.
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to SystemTools->ControlPanel. Click the Backup/Restore button. The Backup Maintenance app will open.
[EDIT]: Crossed out the incorrect answer I gave. Rich
-
Hi kirin-rex
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Editor is what I use when editing files.
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to SystemTools->ControlPanel. Click the Backup/Restore button. The Backup Maintenance app will open.
Thank you for your answer!
For these codes, how do I use them? Do I add them to bootlocal.sh with editor? Do I use terminal? I tried terminal, but it didn't fix the permissions on bootlocal as far as I can tell.
I also looked at backup/restore, and opened the backup maintenance tool, but didn't see options to add something to bootlocal, but am not terribly worried since you mentioned that editor can make those changes.
-
Hi kirin-rex
You enter these commands from a terminal:
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
You can check it's correct with the ls command:
tc@box:~$ ls -l /opt/bootlocal.sh
-rwxrwxr-x 1 root staff 132 Feb 28 2012 /opt/bootlocal.sh
tc@box:~$
-
Thank you very much. I was able to successfully edit the bootlocal.sh.
However, I'm still having trouble connecting to a hidden wifi. When I click the wifi icon, of course my workplace wifi doesn't show up.
I looked at this thread:
http://forum.tinycorelinux.net/index.php?topic=19453.0
Thank's nitram.
Your solution may work, but I was not able to open the SSID for evaluation. But finally I've found this solution.
The way is to use the manual config, wifi.sh can't be used at all. The issue was that wpa need to scan ssid's and test them.
I'm using the channel 11 and it takes roughly 12 seconds.
This is my tutorial:
First need to be created the config file, for example /tmp/wifi.cfg.
network={
scan_ssid=1
ssid="yourwifiname"
psk="yourwifipassword"
}
The most important is the scan_ssid=1 parameter which executes the network scan and enables the connection to the hidden networks. This function is not supported by wifi.sh script. The psk may be used in encrypted format generated via wpa_passphrase.
Than need to be created some script for wpa execution and ip querry. This script may be added to bootlocal.sh for automated execution at boot.
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c/tmp/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
The first line may not be necessary at all cases, but some my dongles need it.
The -t 10 parameter is important to safely obtain the ip, because the wpa need pretty long time to scan all the channels as mentioned above. This gives 10 queries with 3 seconds delay, totally 30 second.
This works well and i'ts simple.
I found though that putting the newly created wifi.cfg in /tmp/ was a bad idea since that gets cleaned out on reboot, so I put it in /home/.
However, I still don't have it working. However, I really don't know what I'm doing. I'm just not knowledgeable enough to know if this is the right thing to do.
-
Hi kirin-rex
The first question is did you install wpa_supplicant.tcz ?
-
No, I haven't, but I know I saw a reference to that recently, but unfortunately, today I was working on deadlines and didn't have time to research it, but the little bit I read indicated I have a lot more research to do.
1. May I assume this is something I need to download? If so, I'm pretty sure I know how to do that.
-
Hi kirin-rex
... 1. May I assume this is something I need to download? If so, I'm pretty sure I know how to do that. ...
Yes. Without that extension (and its dependencies) none of that will work. If you have a wired network connection available for
that machine, you can click on the Apps icon to install it.
-
Hi kirin-rex
----~ SNIP ~----
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to SystemTools->ControlPanel. Click the Backup/Restore button. The Backup Maintenance app will open.
----~ SNIP ~----
I also looked at backup/restore, and opened the backup maintenance tool, but didn't see options to add something to bootlocal, but am not terribly worried since you mentioned that editor can make those changes.
That's because that answer was just plain wrong and the clown that gave it should have his keyboard taken away. ;D
-
Thank you for taking time to help me learn this. I really appreciate it.
I used a wired connection to install wpa_supplicant.tcz ... and in case you're wondering why I don't use a wired connection all the time, it's because I'm going to be running multiple computers and wifi is easier than wiring them all.
Unfortunately, after rebooting, I still don't have wifi. As a side note: before my workplace installed our new lan system, with new ssid and password and hidden ssid, I could connect the wifi from the same pc using the wifi icon, and the wifi.db had the information saved.
So here's what I've got so far:
1. Installed wpa=supplicant.tcz
2. added the following code to bootlocal.sh and saved
if config wlan0 up
wpa_supplicant -iwlan0 -c/home/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
I'm wondering if wlan0 (zero) is correct ... I have only whatever wifi capabilities came with the laptop. It's not a wifi chip. Would that be zero, then?
3. created a document in editor called wifi.cfg and saved it in the /home/ folder, and later to /home/tc/ as well. In it is the following script
network={
scan_ssid=1
ssid="wifiname"
psk="password"
}
and substituted my actual wifiname and password. I put the wifiname and password in quotations. Is that what I'm supposed to do, or do I leave them quotation marks off? I've tried both ways, and neither worked so far.
4. I used the code you game me earlier
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Which allowed me to finally save the changes to bootlocal.sh
5. I tried manually modifying wifi.db with the new name and pw. I'm wondering now if I should delete wifi.db. Could it be conflicting somewhere?
Because rebooting and trying to run firefox still didn't get me connected ...
6. I tried running the code I posted earlier:
wpa_supplicant iwlan0 -c/home/wifi.cfg -Dwext -B
directly into terminal.
This gave me the following message:
successfully initialized wpa=supplicant
ioct1[SIOCSIWPMKSA] Operation Not Permitted
ioct1[WIOCSIWMODE] Operation not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
12=packet=init: socket(PF=PACKET) Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
could not set interface wlan0 flags (DOWN): Operation Not Permitted
Seems I have a general problem with permissions ...
-
Hi kirin-rex
... 2. added the following code to bootlocal.sh and saved
if config wlan0 up
wpa_supplicant -iwlan0 -c/home/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
Shouldn't that be:
wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
... 6. I tried running the code I posted earlier:
wpa_supplicant iwlan0 -c/home/wifi.cfg -Dwext -B
directly into terminal.
This gave me the following message:
successfully initialized wpa=supplicant
ioct1[SIOCSIWPMKSA] Operation Not Permitted
ioct1[WIOCSIWMODE] Operation not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
12=packet=init: socket(PF=PACKET) Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
could not set interface wlan0 flags (DOWN): Operation Not Permitted
It's possible you may need to run that as root.
-
Does that mean add sudo at the beginning?
If so, I tried that. No errors this time, but no internet. I'll have to try again when I'm less busy. I read something about wicd ... I downloaded it, clicked on it, nothing happened. Probably doing to uninstall it ...
When I have time, I'll come back and see if I can make progress.
Thank you so much for your help.
-
Hi kirin-rex
Are you sure wifi.cfg is in /home and not in /home/tc ?
-
Okay! Mission accomplished!
Finally had some time and came back to it. I had to modify my code just a little to get it to work. Here's what I eventually did (and I successfully got a second computer up and running on this method, so I feel fairly confident the results work now).
1. Installed wpa=supplicant.tcz using a wired connection.
2. I used terminal to enter the following codes
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
which allows me to save changes to bootlocal.sh
3. added the following code to bootlocal.sh (in /opt/) and saved
sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10
Here I made two changes to the earlier code, deleting a space after "-i" and after "-t" in the third line. That's where I think my code was going wrong.
3. created a document in editor called wifi.cfg and saved it in the /home/tc/ folder. In it is the following script
network={
scan_ssid=1
ssid="wifiname"
psk="password"
}
and substituted my actual wifiname and password. I put the wifiname and password in quotations.
I not only got the first laptop running wifi, but successfully got a second wifi up and running in a few minutes. Amazing how important a single space can be.
Rich, thank you for your help and patience. I appreciate it a lot, and really honestly couldn't have done it without your help. Thank you! Thank you also to the other people who post in these forums, whose posts I read, and whose information led me to get wifi working on my ancient tiny-core laptops.
Thanks again!
-
Hi kirin-rex
Just a few minor details:
... 2. I used terminal to enter the following codes
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
which allows me to save changes to bootlocal.sh ...
There's no need to execute that first line (sudo chown root:staff /opt/bootlocal.sh), the second 2 commands are sufficient.
3. added the following code to bootlocal.sh (in /opt/) and saved
sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10
Here I made two changes to the earlier code, deleting a space after "-i" and after "-t" in the third line. That's where I think my code was going wrong. ...
Commands in bootlocal.sh do not require sudo.
The first line should be
ifconfig wlan0 up
not
if config wlan0 up
I don't think a space is required after "-i" and after "-t". If you look in /etc/init.d/dhcp.sh you'll see there is no space after the "-i".
The help flag also suggests it is not required. Run this:
udhcpc --help
-
Hi, thank you for the clarification. I can understand about the terminal codes and sudo. Thank you.
The "ifconfig" was a typo. The actual code I used had no space there.
As for the spaces in "udhcpc -i wlan0 -t10", I don't know what to tell you. All I know is that after deleting the spaces, I connected to the wifi. Maybe it was just a fluke, but I repeated the process on all the laptops and they all connected.
-
I went back and tried it your way. Got rid of "sudo" and put back the spaces in the final bootlocal.sh code ... and it still worked! Not sure why that didn't work last time I tried it (must be some other error I was making), and actually surprised it worked without the spaces. Either way, wifi is working on all computers with the proper codes. So for future reference, let's see if I have this straight now ...
1. Install wpa=supplicant.tcz using a wired connection.
2. in order to save changes to bootlocal.sh, use terminal to enter the following codes
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
3. add the following code to bootlocal.sh (in /opt/) and save
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
3. create a document in editor called wifi.cfg and save it in the /home/tc/ folder. In it is the following script
network={
scan_ssid=1
ssid="wifiname"
psk="password"
}
and substitute my actual wifiname and password. I put the wifiname and password in quotations.
Again, thanks for clarifying all this for me, and for helping me do this the right way, skip unnecessary things, and get the code right.
[/quote]
-
Hi kirin-rex
I went back and tried it your way. Got rid of "sudo" and put back the spaces in the final bootlocal.sh code ... and it still worked! Not sure why that didn't work last time I tried it ...
I've had the same thing happen to me. Something doesn't work. Change it, it works. Change it back, it still works.
... So for future reference, let's see if I have this straight now ...
That looks right.
... Again, thanks for clarifying all this for me, and for helping me do this the right way, skip unnecessary things, and get the code right.
You are welcome.