WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Boot Code runonboot=/path/to/file_to_run  (Read 1833 times)

Offline genec

  • Full Member
  • ***
  • Posts: 240
Boot Code runonboot=/path/to/file_to_run
« on: May 14, 2011, 01:03:26 PM »
Has anyone considered doing something like this?  I'm entertaining the idea of modifying /etc/init.d/tc-config to do exactly this.  At the moment, I'm running purely from multiple initrd-loaded CPIO.GZ archives with the fresh .dep files from the repo.  I'd like to rebuild those deps based on the running kernel before tce-setup does its dep check.  The advantage of this is that I can have one set of CPIO.GZ files and just swap out the kernel/root/kernel modules at boot time from 32-bit x86 to 64-bit x86-64 (aka x64).

I'd figure there may be a desire to also do something else so I'd consider doing it just after the parsing of /proc/cmdline.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Boot Code runonboot=/path/to/file_to_run
« Reply #1 on: May 14, 2011, 01:47:09 PM »
Such a bootcode wouldn't be very useful, because where it needs to be called would vary by the use-case.

For your case, how about editing /init to do what you need? It's called before tc-config.
The only barriers that can stop you are the ones you create yourself.

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: Boot Code runonboot=/path/to/file_to_run
« Reply #2 on: May 14, 2011, 10:55:51 PM »
That's a part of what was running through my mind of how early is the right time.

/init (a script) is the first one called by the kernel which then turns around and starts the real init after adjusting inittab if needed.  That would certainly work.  I was just trying to think of a way to minimize the differences from the official root archives.

Next up is looking at what tce-audit does and how it can affect timing versus just doing it myself.