public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kaih@khms.westfalen.de (Kai Henningsen)
To: linux-kernel@vger.kernel.org
Subject: Re: is 2.4.15 really available at www.kernel.org?
Date: 24 Nov 2001 12:01:00 +0200	[thread overview]
Message-ID: <8DUadXKmw-B@khms.westfalen.de> (raw)
In-Reply-To: <20011123185407.A3499@alcove.wittsend.com>
In-Reply-To: <20011123185407.A3499@alcove.wittsend.com>

mhw@wittsend.com (Michael H. Warfield)  wrote on 23.11.01 in <20011123185407.A3499@alcove.wittsend.com>:

> 	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.

make-lilo.conf.pl:
#! /usr/bin/perl -w

use strict;

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

linear
boot = /dev/sda
compact
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

headend

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;
	$n++;
	if ($n > 9) {
		print "Ignoring $kernel ($n)\n";
		next;
	}
	print LILO <<imageend;
	
image = /boot/$kernel
  label = $version
  alias = $n
  append = " hisax=3,2,10, "

imageend
}

close LILO;

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

system('/sbin/lilo');


MfG Kai

  reply	other threads:[~2001-11-24 12:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-23  8:58 is 2.4.15 really available at www.kernel.org? rpjday
2001-11-23  9:28 ` Keith Owens
2001-11-23  9:41   ` rpjday
2001-11-23  9:43     ` Jochen Striepe
2001-11-23  9:48       ` Rik van Riel
2001-11-23 10:00         ` Oliver.Neukum
2001-11-25  0:41         ` Cameron Simpson
2001-11-23 10:33       ` Flavio Stanchina
2001-11-23 16:05         ` Michael H. Warfield
2001-11-23 16:27           ` Jeff Garzik
2001-11-23 17:25             ` Michael H. Warfield
2001-11-23 19:19               ` Stephen Frost
2001-11-23 20:00                 ` J Sloan
2001-11-23 21:08           ` Mike Fedyk
2001-11-23 23:54             ` Michael H. Warfield
2001-11-24 10:01               ` Kai Henningsen [this message]
2001-11-24 13:35                 ` Keith Owens
2001-11-24 13:56                   ` Christoph Hellwig
2001-11-24 22:29                     ` H. Peter Anvin
2001-11-24 23:57                     ` Keith Owens
2001-11-25  9:59                       ` Kai Henningsen
2001-11-25 10:15               ` Mike Fedyk
2001-11-23  9:46     ` Christian Haugan Toldnes
2001-11-23 10:27       ` rpjday
2001-11-23 12:32         ` Stefan Smietanowski
2001-11-23 13:30           ` rpjday
2001-11-23 15:51             ` kees
2001-11-23 16:37             ` Michael H. Warfield
2001-11-23 20:10         ` Ross Vandegrift
2001-11-24  1:14           ` H. Peter Anvin
2001-11-23 20:28     ` Kristofer T. Karas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8DUadXKmw-B@khms.westfalen.de \
    --to=kaih@khms.westfalen.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox