NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Boot, write info to file, shutdown



I'd like to install NetBSD (amd64 in this case) onto a USB key so the portable system will:

- boot as quickly as possible
- run a shell script automatically as soon as it boots
- print some information about the machine's hardware to a file
- print a message to the console
- shut down automatically

all without human intervention.

Initially I thought it wouldn't be necessary to boot into multi-user mode, but the only way I know to run a script automatically at startup is to use cron's @reboot time, and cron doesn't start in single-user mode.  Is there a way to launch a script automatically in single-user mode?

Even when using @reboot it was necessary to use the full path to one of the programs that extracts hardware information (dmidecode, which is installed in /usr/local/sbin) in the script.  It seems that the path isn't setup at that stage?

In an effort to reduce the boot time I moved many files, such as ones related to networking, from /etc/rc.d to another directory.  That caused rcorder to generate lots of errors.  What's the best way of stopping daemons starting?

What's the best way of printing a message (spread over several lines) to the console?


Ray


Home | Main Index | Thread Index | Old Index