[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFE for password protection
From: |
Yoshinori K. Okuji |
Subject: |
Re: RFE for password protection |
Date: |
Sun, 27 Jan 2002 01:21:34 +0900 |
User-agent: |
Wanderlust/2.6.0 (Twist And Shout) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryoae) APEL/10.3 Emacs/20.7 (i686-pc-linux-gnu) MULE/4.0 (HANANOEN) |
At Sat, 26 Jan 2002 15:21:18 +0100,
Han Holl wrote:
> I distribute a new kernel occasionally, remove the oldest,
> and must declare the newest default.
> Our users must not be allowed to boot the wrong kernel
> accidentally, but I want to keep those as backup.
> This is all done by scripting, and I just have the impression
> that scripting migth be easier with a LILO compatibilty
> mode.
That's true in your case, as you chose the LILO way. Generally
speaking, however, GRUB is much more flexible. I think it always makes
things complex to obtain flexiblity (e.g. consider autoconf vs. imake),
and that's not so bad to have as a trade-off.
Anyway, I can write what you need very easily:
[add-kernel menu.lst title kernel_cmdline]
#! /bin/sh
menu=$1
title=$2
kernel=$3
tmp=/tmp/sed-script-$$
# Find the first occurrence of entries.
where=`sed -n /title/= $menu | head -1`
# Make a sed script temporarily.
cat >$tmp <<EOF
/lock/d
$where i\\
title $title\\
kernel $kernel\\
/title/a\\
lock
EOF
# Execute it.
sed -f $tmp $menu
# Cleanup.
rm -f $tmp
[EOF]
Okuji