From: John Weber <weber@nyc.rr.com>
To: linux-kernel@vger.kernel.org
Subject: Re: system.map
Date: Wed, 02 Jan 2002 16:14:58 -0500 [thread overview]
Message-ID: <3C337852.1050109@nyc.rr.com> (raw)
In-Reply-To: <fa.ephh22v.1ljqarg@ifi.uio.no> <fa.hmqrtsv.13jqup8@ifi.uio.no>
Timothy Covell wrote:
> On Wednesday 02 January 2002 13:39, Tony Hoyle wrote:
>
>>Timothy Covell wrote:
>>
>>> Of course, you can copy over the new System.map
>>>file to /boot, but their is no (easy) way of having more than
>>>one active version via "lilo" or "grub". And that could be
>>>considered a deficiency of the Linux OS.
>>>
>>???? Just call it System.map-2.2.17, System.map-2.5.1, etc. Sounds
>>pretty 'easy' to me.
>>
>>'make install' does all this for you, btw.
>>
>>Tony
>>
>
> Not on grub. I quote:
> It is also possible to do "make install" if you have lilo
> installed to suit the kernel makefiles,
> but you may want to check your particular lilo setup first.
>
> But, on my grub based system, I have to:
>
> 1. "make bzlilo" which creates vmlinuz and System.map
> and puts them in / and not in /boot. (make bzlilo is easier to use
> than bzimage)
>
> 2. cp /vmlinuz /boot/vmlinuz-x.y.x ; cp /System.map /boot/System.map-x.y.z
>
> 3. rm /boot/System.map ; ln -s /boot/System.map-x.y.z /boot/System.map
>
> 4. vi /boot/grub.conf (or /etc/grub.conf) and put in new kernel boot entry.
>
> 5. sync;sync;shutdown -r now
>
None of this sounds incredibly complicated, and, in fact, a scripting
language (e.g. perl) does quite nicely.
I wrote a little script that does the whole thing for me;
I can think of a bunch of improvements (like writing a new
/etc/lilo.conf file) that can be added with minimal effort:
I'm curious to know what the standard approach to this is.
What other scripts are out there?
#!/usr/bin/perl
# ----------------------------------------------------
# Program: kernel-install
# Description: This script installs a kernel after it
# has been built, since "make install"
# doesn't do it the way I like it.
# ----------------------------------------------------
$srcdir = "/usr/src/linux";
# Origin Files
$kernel = "$srcdir/arch/i386/boot/bzImage";
$map = "$srcdir/System.map";
$header = "$srcdir/include/linux/kernel.h";
# Destination Directory
$destdir= "/boot";
# Make sure all the files exist
if( !((-e $srcdir) && (-e $header) && (-e $kernel)) ) {
exit(-1);
}
# getversion will return $version
&getversion;
# Start copying stuff
system("cp $kernel $destdir/vmlinuz-$version");
system("cp $header $destdir/kernel.h-$version");
if( -e $map ) {
system("cp $map $destdir/System.map-$version");
}
# Remove existing softlinks
if( -e "$destdir/vmlinuz" ) {
unlink("$destdir/vmlinuz");
}
if( -e "$destdir/kernel.h" ) {
unlink("$destdir/kernel.h");
}
if( -e "$destdir/System.map") {
unlink("$destdir/System.map");
}
# Recreate links
symlink("$destdir/vmlinuz-$version","$destdir/vmlinuz");
symlink("$destdir/kernel.h-$version","$destdir/kernel.h");
if( -e $map ) {
symlink("$destdir/System.map-$version","$destdir/System.map");
}
# Run LILO
system("lilo");
# ----------------------------------------------------
# Subroutine: get_kernel_version
# Description: The kernel version for the kernel build
# can be found in the main Makefile.
# ----------------------------------------------------
sub getversion
{
$version = "";
local($makefile) = "$srcdir/Makefile";
if( !(-e $makefile) ) {
exit(-1);
}
open(MAKE,$makefile);
# We only need the first three lines
$i = 0;
local($line);
while( ($line = <MAKE>) && ($i++ < 4) ) {
# Grab the name value pairs by splitting line by =
(local($name), local($value)) = split(/=/, $line, 2);
# RegExp: Remove whitespace from value
$_ = $value;
s/^\s*(.*)\s*$/\1/;
# Add . between version & level, and level & sublevel
$version .= $1;
if( ($i==1) || ($i==2) ) {
$version .= ".";
}
}
close(MAKE);
}
next parent reply other threads:[~2002-01-02 21:15 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.ephh22v.1ljqarg@ifi.uio.no>
[not found] ` <fa.hmqrtsv.13jqup8@ifi.uio.no>
2002-01-02 21:14 ` John Weber [this message]
2002-01-02 21:42 ` system.map Keith Owens
2007-10-14 17:07 System.map Philip
2007-10-14 18:45 ` System.map Jan Engelhardt
-- strict thread matches above, loose matches on Subject: below --
2005-07-12 16:34 system.map vacant2005
2005-07-13 10:21 ` system.map Jan Engelhardt
[not found] ` <200507131244.08336.vacant2005@o2.pl>
2005-07-13 10:45 ` system.map Jacek Jabłoński
2005-07-13 10:56 ` system.map Arjan van de Ven
2005-07-13 11:04 ` system.map Jan Engelhardt
2005-07-13 11:27 ` system.map Russell King
2005-07-13 11:33 ` system.map Arjan van de Ven
2004-12-06 17:34 System.map Anoop T
2004-12-07 11:43 ` System.map Jan Engelhardt
2002-01-02 19:11 system.map adrian kok
2002-01-02 19:26 ` system.map Timothy Covell
2002-01-02 19:39 ` system.map Tony Hoyle
2002-01-02 20:03 ` system.map Timothy Covell
2002-01-02 20:19 ` system.map Kilobug
2002-01-02 20:35 ` system.map Timothy Covell
2002-01-02 21:14 ` system.map Eric S. Johnson
2002-01-03 9:43 ` system.map Miquel van Smoorenburg
2002-01-02 20:25 ` system.map Tony Hoyle
2002-01-02 20:45 ` system.map Timothy Covell
2002-01-02 21:10 ` system.map Alan Cox
2002-01-02 23:07 ` system.map Nicholas Harring
2002-01-03 2:14 ` system.map Daniel Phillips
2002-01-03 15:54 ` system.map Albert D. Cahalan
2002-01-02 19:51 ` system.map Horst von Brand
2002-01-02 20:54 ` system.map Keith Owens
2002-01-02 21:13 ` system.map Timothy Covell
2002-01-02 23:01 ` system.map skidley
2002-01-02 23:14 ` system.map Timothy Covell
2002-01-02 21:17 ` system.map Albert D. Cahalan
2002-01-02 21:31 ` system.map Keith Owens
2002-01-02 22:09 ` system.map Nicholas Knight
2002-03-09 0:21 ` system.map H. Peter Anvin
2002-01-02 22:23 ` system.map Albert D. Cahalan
2002-01-02 23:38 ` system.map Marcel J.E. Mol
2002-01-02 19:30 ` system.map Sebastian Roth
2002-01-02 21:25 ` system.map Lionel Bouton
2002-01-02 22:15 ` system.map David Golden
2002-01-02 22:21 ` system.map Nick LeRoy
2002-01-02 22:29 ` system.map Lionel Bouton
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=3C337852.1050109@nyc.rr.com \
--to=weber@nyc.rr.com \
--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