Tiny Core Base > Micro Core

bootlocal.sh permission denied

<< < (3/4) > >>

Rich:
Hi kirin-rex

--- Quote from: kirin-rex on August 22, 2019, 09:29:47 PM --- ... 2.  added the following code to bootlocal.sh and saved

--- Code: ---if config wlan0 up
wpa_supplicant -iwlan0 -c/home/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
--- End code ---

--- End quote ---
Shouldn't that be:

--- Code: ---wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
--- End code ---


--- Quote from: kirin-rex on August 22, 2019, 09:29:47 PM --- ... 6.  I tried running the code I posted earlier:

--- Code: ---wpa_supplicant iwlan0 -c/home/wifi.cfg -Dwext -B
--- End code ---
directly into terminal.

This gave me the following message:

--- Quote ---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
--- End quote ---

--- End quote ---
It's possible you may need to run that as root.

kirin-rex:
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.

Rich:
Hi kirin-rex
Are you sure  wifi.cfg   is in  /home  and not in  /home/tc ?

kirin-rex:
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


--- Code: ---sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
--- End code ---

which allows me to save changes to bootlocal.sh

3.  added the following code to bootlocal.sh (in /opt/) and saved


--- Code: ---sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10
--- End code ---

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


--- Code: ---network={
scan_ssid=1
ssid="wifiname"
psk="password"
}
--- End code ---

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!

Rich:
Hi kirin-rex
Just a few minor details:

--- Quote from: kirin-rex on October 08, 2019, 02:51:08 AM --- ... 2.  I used terminal to enter the following codes


--- Code: ---sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
--- End code ---

which allows me to save changes to bootlocal.sh ...
--- End quote ---
There's no need to execute that first line (sudo chown root:staff /opt/bootlocal.sh), the second 2 commands are sufficient.


--- Quote ---3.  added the following code to bootlocal.sh (in /opt/) and saved


--- Code: ---sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10
--- End code ---

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. ...
--- End quote ---
Commands in  bootlocal.sh  do not require  sudo.

The first line should be

--- Code: ---ifconfig wlan0 up
--- End code ---
not

--- Code: ---if config wlan0 up
--- End code ---

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:

--- Code: ---udhcpc --help
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version