WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to maintain persistence in bootlocal.sh when using only a USB flash drive.  (Read 2816 times)

Offline med458

  • Newbie
  • *
  • Posts: 22
Hello, I have looked all over and done some research and can't answer my question.
I have a computer, booting with just a 2GB USB flash disk, with an older version of TC installed on that flash disk.
My goal is to make permanent changes to /opt/bootlocal.sh.
What I have tried is follows:

1) boot computer
2) right click, go to "system tools", load mount tool
3) mount sda1 (the flash disk itself)
4) cd /mnt/sda1/boot/
5) mkdir extract
6) sudo sh
7) cd extract
8) zcat ../tinycore.gz | cpio -i -H newc -d
9) editor opt/bootlocal.sh (make changes, then save and exit editor)
10) rm ../tinycore.gz
11) find | cpio -o -H newc | gzip >../tinycore.gz
12) reboot

After all this, I find that bootlocal.sh is the same 2-line file as always.  I uncompress my modified tinycore.gz file to find that the changes I made to bootlocal.sh do in fact remain in the gz file, after remastering and reboot.  However, that bootlocal.sh file does not appear to get used?  My guess is that this /opt/bootlocal.sh file is coming from some other place.  I would like to get at that genuine bootlocal.sh file that is used to make permanent changes to bootlocal.sh.  If anyone has suggestions, I would be grateful.  Thank you in advance.

PS: I am taking safety precautions, such as backing up tinycore.gz before overwriting it.  The distilled steps above are just to show what I did without writing too much.  Those are not the exact 12 steps I do, just shortened for the reader's benefit.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
It could be overwritten from restoring backup, in case you haven't excluded such yet.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline med458

  • Newbie
  • *
  • Posts: 22
Thank you for trying to help me.

I am very embarrassed.  Perhaps you might have a laugh.

Another possible explanation is that after I created the USB-HDD install from my TC CDROM, I failed to remove the CDROM from the drive.  I did not realize each time I was booting from the CDROM!!!  I forgot it was in there.  The USB drive kept flashing so I was fooled by that lol!!