PDA

View Full Version : How to autorun a script in runlevel2 with a new boot option



Blue
01-18-2004, 01:56 PM
I want to autorun the knoppix installer when Knoppix boots in runlevel 2 (using the 'knoppix 2' boot option). I also want this to happen ONLY when Knoppix is booted with a new boot option - 'knoppix install'.
I will add the 2 and the install options in isolinux.cfg so the user should type only 'knoppix'.
How to do this?
Thanks in advance !

haaribaer
01-20-2004, 11:49 AM
You can write a script with the following beginning:



#!/bin/bash

if [ `cat /proc/cmdline | grep "install"` ]
then
...... run here the commands you want to install knoppix .....
fi


This script looks in /proc/cmdline if the bootoption "install" ist entered at boottime and can then run your commands to install knoppix.

You can put this script in /etc/init.d and make a symlink in /etc/rc2.d.