[lkml]   [2001]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: is 2.4.15 really available at (Michael H. Warfield)  wrote on 23.11.01 in <>:

> I typically keep 4 to six fall back versions in each of the
> 2.2 and 2.4 lines active and want (or occasionally need) to target specific
> versions, especially when I'm testing preX kernels and my device driver.
> You are way TOO simple.

I keep more (though I really don't need that many) ... and I *do* add text
to kernel names myself.

So I wrote a (very quick-and-dirty) little Perl script. Maybe a variant of
that works for other people, too.

Features: label is (hopefully sensibly) shortened image name. Also, a
number is used as an alias; it's easier to select "1" than some lengthy
string. Kernels are (hopefully) sorted chronologically (this doesn't work
if EXTRAVERSION starts with a letter).

WARNING: this makes some assumptions about my system. You need to adapt
that part.

WARNING: the sort routine only works on a Debian system. If you live on
something else, adapt the sorter.

The script asks before overwriting your lilo.conf and keeps backups, so
you have a chance of looking at the result and tweaking the script before
committing to it.

License: public domain.
#! /usr/bin/perl -w

use strict;

open LILO, "> /etc/lilo.conf.gen" or die $!;
print LILO <<headend;
# LILO configuration created by $0 @{[scalar localtime]}

boot = /dev/sda
delay = 100 # optional, for systems that boot very quickly
#vga = normal # force sane state
vga = ask
root = current # use "current" root
#root = /dev/sdc1
#other = /dev/sda1
# table = /dev/sda
# label = dos


my $sorter = sub {
my ($aa, $bb) = ($a, $b);
$aa =~ tr/+/-/;
$bb =~ tr/+/-/;
$aa eq $bb? 0:
system('/usr/bin/dpkg', '--compare-versions', $aa, 'lt', $bb)? -1: 1;

opendir BOOT, "/boot/" or die $!;
my @kernels = sort $sorter grep m/linu/i, readdir BOOT;
close BOOT;

my $n = 0;

for my $kernel (@kernels) {
my ($version) = ($kernel =~ m/^[-a-z]*(.*)$/);
$version =~ s/.*(.{15})$/$1/ if length($version) > 15;
if ($n > 9) {
print "Ignoring $kernel ($n)\n";
print LILO <<imageend;

image = /boot/$kernel
label = $version
alias = $n
append = " hisax=3,2,10, "


close LILO;

system('/bin/mv', '-vib', '/etc/lilo.conf.gen', '/etc/lilo.conf');


MfG Kai
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.075 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site