WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Passing startup command to vmlinuz not working when booting .iso  (Read 1701 times)

Offline picassotkatt

  • Newbie
  • *
  • Posts: 2
While this sounds weird, this is what I need to do -

From a working Lubuntu system, boot Tiny Core into RAM to do some hardware/OS maintenance.

I have a remastered TC .iso file and that works just fine.
I have this as a stanza in the Lubuntu grub.cfg file -
menuentry "Rebuild" {
        loopback loop /Rebuild.iso
        linux (loop)/boot/vmlinuz autologin rebuilder
        initrd (loop)/boot/core.gz
}

This will indeed load and start TC. But, I also need to pass the command "rebuilder" to TC to automatically run at startup.
The startup command never runs. Just get the default shell prompt.
When done with an installed version TC, (not booting as loop .iso) such things work.
Is there a limitation where you cannot do this when booting the .iso as a loop device?
Also tried modifying the isolinux.cfg file with an "append" line. But when TC launches from grub, syslinux seems to get bypassed. At least the boot menu is never displayed.

Suspecting something obvious is being missed.
Any suggestions greatly appreciated.
Thanks in advance.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Passing startup command to vmlinuz not working when booting .iso
« Reply #1 on: April 04, 2018, 06:56:09 AM »
Hi picassotkatt
If you want the command to always run, try adding it to  /opt/bootlocal.sh.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Passing startup command to vmlinuz not working when booting .iso
« Reply #2 on: April 04, 2018, 06:59:01 AM »
Maybe try adding the  iso=  boot code
Code: [Select]
iso=/mnt/sda1/isos/Rebuild.iso
and maybe the  cde  boot code so it doesn't use any  tce  directory that may be on attached hard drives.
Download a copy and keep it handy: Core book ;)

Offline picassotkatt

  • Newbie
  • *
  • Posts: 2
Re: Passing startup command to vmlinuz not working when booting .iso
« Reply #3 on: April 04, 2018, 07:14:19 AM »
Rich

Thank you, you were 100% right.

For anyone else, maybe save some time and aggravation, as Rich suggested, adding to /opt/bootlocal.sh -
if (grep rebuilder /proc/cmdline) ; then  /usr/local/bin/rebuilder ; fi

Works perfectly.
With the if command you can then pass a different  command and execute it as needed just by parsing /proc/cmdline .

Thanks everyone!!


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Passing startup command to vmlinuz not working when booting .iso
« Reply #4 on: April 04, 2018, 07:27:04 AM »
Hi picassotkatt
You are welcome.
With the if command you can then pass a different  command and execute it as needed just by parsing /proc/cmdline .
If you look at the startup script  /etc/init.d/tc-config  you'll see a  case  command in a loop parsing  /proc/cmdline
and setting flags for use later in the script. This is not to suggest you modify that script,  /opt/bootlocal.sh  is the correct place to
do this.