On Thu, 06 Jan 2005 11:01:50 +0100
Holly Bostick <[EMAIL PROTECTED]> wrote:

> michael higgins wrote:
> 
> > Also, I'm wondering, on a slightly different topic, why, when I
> > recompile a kernel, it overwrites with the new files, which may or
> > may not, work and may or may not force me to recover from the live
> > cd. 
> > 
> > Is there a good way to add a copy of these current, functional, boot
> > files to the bootloaders (grub, lilo), so this will always appear as
> > an alternate option, one not to be replaced when I recompile this
> > same kernel version yet another time?
> > 
> > -- mike higgins
> > 
> > --
> Michael, I think you are mistaken, if you're talking about installing 
> the kernel (unless maybe you're using LiLO and not GRUB).
> 

I know I'm mistaken. '-) I appear to have installed and configured
both, as per the published instructions (see below).

> When you install the kernel, you have two ways of doing it; you can
> use either 'make install' or you can copy the files manually.

I used genkernel. I didn't issue 'make install'. I begin to see this
method is perhaps sub-optimal.

> 
> Naturally, if you're copying the files manually, you rename them so
> they don't overwrite anything. Don't you?

'-)

> 
> If you use 'make install', it doesn't overwrite anything either. All
> it does is copy the files (kernel, system map, config) to /boot, and
> change some symlinks-- vmlinuz, which is linked to the
> currently-running kernel is linked to the new kernel just copied, and
> the currently running kernel is linked to vmlinuz.old. This is
> repeated for the link to system.map and .config as well. 

Where are these files? I feel dense, but I know I'm just lost. Of
course, I could just be dense... how would I know?

I've been reading on lilo, grub and initrd and ramdisks and all, and I
think I have overkill in the boot dept. I followed exactly the x86 quick
install guide,
(http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml) and this
configuration is what I got. On that page just below "Now install a
bootloader.", you install grub and lilo. Code Listing 1.11: Install and
configure GRUB, Code Listing 1.12: Install and configure LILO. 

So, I have both.

 # find /boot
/boot
/boot/lost+found
/boot/boot
/boot/.keep
/boot/kernel-2.6.9-gentoo-r6
/boot/System.map-2.6.9-gentoo-r6
/boot/initrd-2.6.9-gentoo-r6
/boot/grub
/boot/grub/menu.lst
/boot/grub/splash.xpm.gz
/boot/grub/grub.conf.sample
/boot/grub/nbgrub
/boot/grub/pxegrub
/boot/grub/stage2
/boot/grub/stage2.netboot
/boot/grub/e2fs_stage1_5
/boot/grub/fat_stage1_5
/boot/grub/ffs_stage1_5
/boot/grub/jfs_stage1_5
/boot/grub/minix_stage1_5
/boot/grub/reiserfs_stage1_5
/boot/grub/stage1
/boot/grub/vstafs_stage1_5
/boot/grub/xfs_stage1_5
/boot/grub/grub.conf
/boot/boot.0340
/boot/map

> Kernels older
> than the new kernel just compiled and the currently-running kernel
> remain untouched in /boot, and in fact, every kernel you've ever
> installed into /boot is there, and can be used by its full name
> (linux-2.6.10-gentoo-r3, or whatever, as make install copies the
> kernel and suppemental files and names them according to the revision
> and EXTRAVERSION information.
> 

Yes, but I'm recompiling the same kernel with different options, four
or five times now - and ./boot has but one linux-2.6.9* file. If the
kernel (re-)build fails, I have a problem.

However, following advice from Christoph Eckert, "If you really want to
do audio, take the 2.6 sources from Gentoo, additionally apply the LSM
linux-2.6.10-rt2.patch and enable it in the kernel config, and you'll
have a great audio box" 

So, I've found how to get the right kernel sources for this patch and
have patched. Now, you've assured me that I if I can successfully build
and install this, I'll still have all the needed files for my currently
working kernel still available to me.

Obviously, I'll have to add the new kernel to the bootloader config(s)?
which should be a piece of cake, since only the version number changes.

> So nothing is overwritten except the symlinks, which is not a problem.

My goal _was_ to copy all the needed files as *-default and make a new
(or, I guess two new) boot menu entries. Now my goal is to build a newer
kernel and add that without losing the option of using this working one.

> 
> Now as to the bootloader config-- I guess you must be using LiLO,
> which 'make install' does seem to edit (or be capable of editing,
> since it does look for /etc/lilo.conf as if it would edit it if the
> process found it), but I really doubt that the changes are
> destructive, if the process is in fact attempting to edit the file. It
> may just be looking for /sbin/lilo to run it, since you have to run
> /sbin/lilo when installing a new kernel if you use LiLO. I just assume
> that it's trying to edit because I get a message saying that I use
> GRUB and I should edit my GRUB config (which is not at all necessary
> if you set up /boot/grub/grub.conf for minimal menu information rather
> than maximal, as many other list users will tell you).

Here's grub.conf.

 # cat /boot/grub/grub.conf
default 0
timeout 15
splashimage=(hd1,0)/grub/splash.xpm.gz

title=Gentoo Linux
    root (hd1,0)
    kernel /kernel-2.6.9-gentoo-r6 root=/dev/ram0 init=/linuxrc
real_root=/dev/hdb3 splash=verbose,theme:emergence
video=vesafb:ywrap,mtrr,[EMAIL PROTECTED]    initrd /initrd-2.6.9-gentoo-r6

And here's lilo.conf

 # cat /etc/lilo.conf
boot=/dev/hdb
prompt
timeout=180
default=gentoo

image=/boot/kernel-2.6.9-gentoo-r6
    label=gentoo
    read-only
    append="init=/linuxrc real_root=/dev/hdb3
splash=verbose,theme:emergence video=vesafb:ywrap,mtrr,[EMAIL PROTECTED]"  
 root=/dev/ram0    initrd=/boot/initrd-2.6.9-gentoo-r6

other=/dev/hda1
    label=winblows
    boot-as=0x80

Again, done as per the quick install guide, and the framebuffer how-to,
which also gives code listing for editing both files. I know lilo must
be booting, 'cause that's where I get the 'winblows' option, still
required for my dayjob.

> 
> I never used LiLO under Gentoo, but there's a good chance that it is 
> also set up for 'minimal' menus (meaning that the name of the default 
> kernel entry contains no specific version information), and that the 
> kernel is named as /boot/vmlinuz (which is a symlink to the last 
> installed kernel, whatever it may be). 

User panic: I don't see this file (/boot listing above).

> Thus no editing would be needed
> except to add a menu entry for "The Previous kernel" linking to 
> /boot/vmlinuz.old-- once (because that symlink will also be updated 
> whenever you install a new kernel), and try to remember which kernel 
> "Current" and "Previous" actually refer to. You can also add an entry 
> for a yet older kernel (if you have one) using more detailed
> information if you like, because kernels older than vmlinuz.old won't
> be symlinked, but are referred to statically by full name (so the
> entry won't need to be updated, ever; "Kernel 2.6.9" linking to
> linux-2.6.9-ck5 will always be valid, unless you physically remove the
> kernel from /boot.

You've been very informative, but, there's some variance obviously.
Whenever I've installed a 'new' kernel, it's just the same kernel
(from the same sources) but with different options (frambuffer splash/no
alsa, etc). Just new to me but genkernel installed it named the same as
the old. If this fails (and sometimes it just fails), then I have a
non-working system. All I wanted to do was avoid having to rescue from
the live cd and be forced to build a kernel to get into my system when
this happens.

> 
> So unless you're thinking that 'make install' overwriting the vmlinuz 
> symlinks is overwriting the files (it isn't), or you're manually
> copying the kernel bzImage to /boot without renaming it something
> logical (thus overwriting your last bzImage with your new one), I'm
> not quite sure what you're on about ;-) .

I hope it's clearer now.

> 
> But I hope this helps clear up some confusion-- at least to the extent
> that if it doesn't answer your question, you can explain what you
> mean.

I hope so too. It's not as easy as I thought. '-) Thankfully my real
work is slow enough for me. '-)

-- mike higgins


--
gentoo-user@gentoo.org mailing list

Reply via email to