Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: Raven72 on November 27, 2018, 06:58:23 PM
-
Hi All,
New to the forum and Tiny Core LInux (but have experience with Puppy Linux)
I would like to add simple commands to bootlocal.sh in the /opt/ folder such as cd / .... mount mnt/sda1 .... vi some.txt (to automatically open a text file in vi) and other simple shell comands
My problem is that bootlocal.sh is write protected and I have been unable to change the permission with chmod
I have looked at the FAQ and are more confused than when I started
any assistance would be appriciated
Cheers,
Matt
-
Hi Raven72
Did you try:
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
-
thank you this worked for saving the changes to bootlocal.sh - the only issue now is when I re-boot the changes are not there and bootlocal.sh has gone back to it's 'default' file
-
Hi Raven72
Sounds like you didn't run a backup. Make your changes again, then run:
filetool.sh -bvI would also suggest you take an hour to read this really fine book:
http://tinycorelinux.net/book.html
-
and where is filetool.sh located?
-
Hi Raven72
filetool.sh is the script that performs your backup and is located in /usr/bin/.
-
does sda1 need to be mounted with a directory to save the changes to?
I got filetool.sh -b to work (without v) - but on reboot the changes were not saved - is there any particular shutdown procedure I need to perform, or just a ctrl-alt-del reboot is fine (I am working command line only without a GUI) ?
-
Hi Raven72
... is there any particular shutdown procedure I need to perform ...
You can run:
exitcheck.sh rebootor
exitcheck.sh shutdown
What is the result for this command:
showbootcodes
-
still will not save the changes for reboot
showbootcodes returns:-
initrd=ubninit loglevel=3 BOOT_IMAGE=/ubnkern
on the bootup screen there are 3 choices:-
default
microcore
mc
is there any diffrence between them as far as saving the bootlocal.sh for reboot?
-
Success!!!!!
I needed the bootcodes "waitusb=5 tce=sda1" for the USB drive to be ready to save/load things, i think - at any rate, I think i understand how everything is working together
Now, I was wondering if lines can be added to bootlocal.sh like:-
cd /
cd bin
vi
in order to start vi at bootup, kind of like an MS DOS autoexec.bat file?
-
If you want bootlocal to run a script, it is perhaps better to call a separate script, for example:
$ cat /opt/bootlocal.sh
~/myscript.sh..be aware that bootlocal runs as root.
-
I think the good variant to run user startup progs as $USER ( probably tc) is to add commands to "~/.profile".
-
Bootlocal is backgrounded, so you absolutely don't want to start an editor like vi there.