run a script on startup in an ISO without remastering?

0

Is it possible to mount a partition on the hard drive that somehow is also scanned along with rc.local (or wherever the appropriate startup files go)? I want to boot a live image and have something automatically run but I can't change any files in the Live Image. Is that at all possible?

V_H

Posted 2010-09-20T20:01:19.843

Reputation: 185

Answers

0

It is possible if and only if the live CD explicitly supports it. You could have rc.local on the iso always look for a file on a predefined place on the hard drive; but that's dangerous (if you put the CD in a computer you don't know well, you have no idea what it's going to end up executing) and fragile (how are you going to choose which partitions to mount and so on?). You could also react to a kernel command line argument (i.e. something you'd type on the boot prompt). But there wouldn't be that much point when you could type the script name after booting instead.

I suspect the easiest approach would be to boot from USB instead of CD, and run a script on the USB drive.

Gilles 'SO- stop being evil'

Posted 2010-09-20T20:01:19.843

Reputation: 58 319

Thanks for your answer. I would have to at least remaster to change rc.local though, right? The danger isn't an issue since it is only going to be run as a system to demo an app. That's also why I can't user the kernel command or script after booting - it's meant to run an app and do nothing else. – V_H – 2010-09-21T00:12:13.043