0

I know i can make my script run at boot time in runlevel 2 by putting it in /etc/init.d/ and creating a symbolic to it in /etc/rc2.d but thats when Linux is on hard drive.

I want to run my script from a flashdrive such that when a user plug in a flashdrive and powers ON the machine, it may start booting from the OS in flash drive and eventually executing my script.

How can I achieve such a functionality?

I have tried burning OS to flashdrive but I never succeeded in booting OS from flashdrive.

Uthman
  • 1,037

2 Answers2

1

Your question seems like two questions: how can I boot off a flash drive, and how can I run a script while its booting.

Flash Drive Booting

The ability to boot off a flash drive is dependent upon whether the hardware supports booting from USB. Its common on newer hardware, not so common on hardware that is two or three years old.

Init Script

On Debian, I use /etc/rc.local to run simple shell scripts.

For more information, check out NODOWS and Mindeb, the sites have lots of notes on creating small distribution sizes using SquashFS:

http://www.nodows.com/ http://www.mindeb.com/

Hope that helps!

Docunext
  • 206
0

You can boot linux from the flashdrive -- does that solve your question?

nik
  • 57,042