WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Where to put startup script when remastering iso?  (Read 3303 times)

Offline yesdnil5

  • Newbie
  • *
  • Posts: 3
Where to put startup script when remastering iso?
« on: September 29, 2014, 12:05:16 PM »
Hello!  I'm super new to tinycore, so I'm sorry if these questions are silly or can be found somewhere else.

I'm remastering the corepure64 iso.  I'm adding a couple of extensions that were made from rpms.  Once I mount the iso, I need to install and run one of the extensions that I added and run a couple of commands unsupervised.

I'm running into some issues, the first being accessing the extensions.  I found that I had to mount /mnt/sr0 to access the cde directory.  I figured I would include that in the script but I'm not quite sure if there is an easier way.

Once I mount /mnt/sr0, I need to install the extensions and run the extensions.  I came up with a script that is similar to this (hpacucli is an extensions that I included):

Code: (bash) [Select]
sudo mount /mnt/sr0
cd /mnt/sr0/cde/optional
tce-load -i *.tcz
sudo hpacucli <commands>

I cannot figure out where to put this script.  Once I mount the iso, I need it to run by itself. 

Any advice would be appreciated!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Where to put startup script when remastering iso?
« Reply #1 on: September 29, 2014, 12:59:00 PM »
Extensions to load at boot are in the onboot.lst file.
Commands to run after boot are in the /opt/bootlocal.sh file.

Please read the book.
http://tinycorelinux.net/book.html

Offline yesdnil5

  • Newbie
  • *
  • Posts: 3
Re: Where to put startup script when remastering iso?
« Reply #2 on: September 29, 2014, 01:08:25 PM »
I've read the book.  The extensions don't load when added to the onboot list.  I haven't changed the bootloader.  Would that be the problem?  I also added the commands to bootlocal but it doesn't do anything other than mount /mnt/sr0 when I add the commands I listed.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Where to put startup script when remastering iso?
« Reply #3 on: September 29, 2014, 01:31:05 PM »
You don't need to mount the CD manually.  The cde boot option will accomplish that.
It sounds like you did not properly remaster the ISO.
Check out the remastering section of the wiki.
There are several remastering tools.  You should probably try ezremaster which is included ont the coreplus CD.

Offline yesdnil5

  • Newbie
  • *
  • Posts: 3
Re: Where to put startup script when remastering iso?
« Reply #4 on: September 29, 2014, 02:22:53 PM »
I'm pretty sure I am remastering it correctly.  I've been all over the wiki and the book.  The documentation isn't all that great to people who are a bit new to this stuff.

I can't use a gui remastering software because I need to automate the remaster process eventually.

This is my code for remastering the iso:

Code: (bash) [Select]
mkdir /mnt/tmp
sudo mount tiny.iso(renamed corepure64.iso) /mnt/tmp -o loop,ro
cd /mnt/tmp
sudo cp -a /mnt/tmp /tmp/newiso
cd /tmp
sudo umount /mnt/tmp
sudo rm -rf /mnt/tmp
mkdir extract
sudo mv newiso/boot/corepure64.gz extract/
cd /tmp/extract
sudo zcat corepure64.gz | sudo cpio -i -H newc -d
sudo rm -rf corepure64.gz
cd /tmp/
#add my extensions to /tmp/newiso/cde/optional
#replace on onboot.lst with my added extensions
#add code to bootlocal.lst
cd /tmp/extract
sudo find | cpio -o -H newc | gzip -2 > ../corepure64.gz
mv /tmp/corepure64.gz /tmp/newiso/boot
cd /tmp
mkisofs -l -J -r -V TC-custom -no-emul-boot \
-boot-load-size 4 \
-boot-info-table -b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat -o TC-remastered.iso newiso

I totally get if you don't want to debug my code.  I'm just stuck.  When I load my iso, all the files I've added and extensions I added are there.

I'm a bit confused as to where to change the bootcodes in the iso.  I looked at /proc/cmdline and I saw that it just had "cde" without it pointing to anything.  Is that where I should point to /mnt/sr0?

When I when the iso booted and physically run the script in my previous post, it works fine.

I really appreciate your help!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11040
Re: Where to put startup script when remastering iso?
« Reply #5 on: September 29, 2014, 03:30:42 PM »
Try adding the bootcodes "showapps pause" temporarily (press tab at the bootloader prompt, etc). It will show you which extensions get loaded.
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)