redhat-list-lilo_user_complains_grubby_complains_cannot_find_suitable_template

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: redhat-list@listman.redhat.com
From: "Michael A. Peters" <mpeters@mac.com>
Subject: grubby complains
Date: 01 Mar 2003 04:48:56 -0800


--=-J07AU30piZZkHg+X3j5A
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Howdy- I am maintaining a kernel for the A7N8X (nforce2) boards with Red
Hat Linux. With kernel 2.4.21pre5 I decided to try and have my kernel
rpm add the kernel to the boot loader automagically, following the
example in the Red Hat kernel rpm spec file.

I use lilo, and it does not seem to work - grubby complains:

grubby fatal error: unable to find a suitable template

The kernel is not added to lilo.
It does seem to properly add it to a grub.conf file, though.

If I install a Red Hat kernel, lilo gets properly updated.
What the hell is going on?

Here is my %post section of the rpm spec file:
%post
if [ `grep -c "i810_audio" /etc/rc.local` -eq 0 ]; then
	echo "/sbin/modprobe i810_audio" >> /etc/rc.local
fi
cd /boot
ln -sf module-info-%{patchversion} module-info
ln -sf System.map-%{patchversion} System.map
ln -sf vmlinuz-%{patchversion} vmlinuz
[ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
[ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth

if [ -x /sbin/new-kernel-pkg ]; then
        /sbin/new-kernel-pkg --mkinitrd --depmod --install
%{patchversion}
fi

The complete spec file is attached.
-- 
Michael A. Peters <mpeters@mac.com>

--=-J07AU30piZZkHg+X3j5A
Content-Disposition: attachment; filename=nforce_kernel.spec
Content-Type: text/plain; name=nforce_kernel.spec; charset=UTF-8
Content-Transfer-Encoding: 7bit

%define name nf_kernel
%define tarname linux
%define majorversion 2.4.20
%define patchversion 2.4.21-pre5
%define release 3
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define kernversion %{majorversion}-%{patchversion}

Name: %{name}
Version: %{majorversion}
Release: %release
License: GPL
Summary: Linux Kernel
Source0: %{tarname}-%{majorversion}.tar.gz
Source1: RedAthConfig-%{majorversion}-%{patchversion}
Source2: module-info
#Source3: NVIDIA_nforce-1.0-0248.tar.gz
NoSource: 0
Patch0: patch-%{patchversion}
Patch1: asusa7n8x_3com.diff
#Patch2: nforce2ide.diff
Patch3: 2.4.21-pre5.mtd.chips.Makefile.patch
Patch4: ieee1394.patch-2.4.21-pre5.patch
Patch5: 2.4.21-pre5.auermain.patch
Group: System Environment/Kernel
URL: http://homepage.mac.com/mpeters/A7N8X/
Packager: Michael A. Peters <mpeters@mac.com>
BuildRoot: %{_tmppath}/%{name}-%{kernversion}-root
BuildArch: athlon
Requires: redhat-release = 8.0

%description
A patched kernel to provide better support for nforc2 chipset

%prep
#%setup -n nforce_kernel -c -a0 -a3
%setup -n nforce_kernel -c -a0
cd %{tarname}-%{majorversion}
%patch0 -p1
%patch1 -p1
#%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
cd ..
mkdir -p $RPM_BUILD_ROOT/boot
mkdir -p $RPM_BUILD_ROOT/lib/modules
mkdir -p $RPM_BUILD_ROOT/var/kernelsource

%build
%{__mv} linux-%{majorversion} linux-%{kernversion}
cd linux-%{kernversion}
%{__make} mrproper
%{__cp} %{_sourcedir}/RedAthConfig-%{majorversion}-%{patchversion} ./.config
%{__make} oldconfig
%{__make} dep
%{__make} bzImage
%{__make} modules

%install
cd linux-%{kernversion}
install -m755 vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{patchversion}
%{__cp} arch/i386/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{patchversion}
chmod 644 $RPM_BUILD_ROOT/boot/vmlinuz-%{patchversion}
%{__install} -m644 System.map %{buildroot}/boot/System.map-%{patchversion}
%{__cp} %{_sourcedir}/module-info %{buildroot}/boot/module-info-%{patchversion}
%{__make} -s INSTALL_MOD_PATH=%{buildroot} modules_install
%{__make} clean
%{__cp} %{_sourcedir}/RedAthConfig-%{majorversion}-%{patchversion} ./.config
cd ..

mv linux-%{kernversion} $RPM_BUILD_ROOT/var/kernelsource/

#fix build symlink
#cd %{buildroot}/lib/modules/%{kernversion}
cd %{buildroot}/lib/modules/%{patchversion}
rm -f build
ln -sf /var/kernelsource/linux-%{majorversion}-%{patchversion} build

#generate filelist
echo "%defattr(-,root,root)" > /tmp/files.list
for a in `find %{buildroot} -print`; do
if [ ! -d $a ]; then
	echo $a |%{__sed} -e s?"^%{buildroot}"?""? >> /tmp/files.list
fi
done;
#echo "/lib/modules/%{kernversion}/build" >> /tmp/files.list
echo "/lib/modules/%{patchversion}/build" >> /tmp/files.list
echo "/var/kernelsource/linux-%{kernversion}/include/asm" >> /tmp/files.list

%clean
rm -rf %{buildroot}
rm -f /tmp/files.list

%pre
/sbin/modprobe loop 2> /dev/null > /dev/null || :
exit 0

%post
if [ `grep -c "i810_audio" /etc/rc.local` -eq 0 ]; then
	echo "/sbin/modprobe i810_audio" >> /etc/rc.local
fi
cd /boot
ln -sf module-info-%{patchversion} module-info
ln -sf System.map-%{patchversion} System.map
ln -sf vmlinuz-%{patchversion} vmlinuz
[ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
[ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth

if [ -x /sbin/new-kernel-pkg ]; then
        /sbin/new-kernel-pkg --mkinitrd --depmod --install %{patchversion}
fi

%preun
/sbin/modprobe loop 2> /dev/null > /dev/null || :
if [ -x /sbin/new-kernel-pkg ]; then
	/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{patchversion}
fi

%files -f /tmp/files.list

%changelog
* Sat Feb 28 2003 Michael A. Peters <mpeters@mac.com>
- updated to 2.4.21-pre5, added ntfs read module, kernel gets added to
- boot loader, added FireWire patch

* Thu Jan 31 2003 Michael A. Peters <mpeters@mac.com>
- updated to 2.4.21-pre4

* Wed Jan 29 2003 Michael A. Peters <mpeters@mac.com>
- created initial spec file

--=-J07AU30piZZkHg+X3j5A--

===

To: redhat-list@listman.redhat.com
From: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>
Subject: RE: grubby complains
Date: Wed, 5 Mar 2003 13:24:39 +1000

ah hello. i got this message too.
grubby fatal error: unable to find a suitable template
when upgradeing the kernel 2.4.18-14 to 2.4.18-24.8.0 the rpm gave this error.
however, after the rpm upgrade i was able to boot to the new kernal that was created in /boot.
i wonder if anyone knows whether thisis really a fatle error as rpm reports it to be.


===

To: redhat-list@listman.redhat.com
From: Michael Fratoni <mfratoni@tuxfan.homeip.net>
Subject: Re: grubby complains
Date: Tue, 4 Mar 2003 23:20:03 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 04 March 2003 10:24 pm, Mirabella, Mathew J wrote:
> ah hello. i got this message too.
> grubby fatal error: unable to find a suitable template
> when upgradeing the kernel 2.4.18-14 to 2.4.18-24.8.0 the rpm gave this
> error. however, after the rpm upgrade i was able to boot to the new
> kernal that was created in /boot. i wonder if anyone knows whether
> thisis really a fatle error as rpm reports it to be.

It sounds like grubby (called from the post install script) doesn't like 
your boot loader config file. Can you post either /etc/lilo.conf, or 
/etc/grub.conf depending on which bootloader you use?

Also, please post the output of 'ls /boot/{vmlinuz*,initrd*}'
and 'rpm -q kernel'


===

To: redhat-list@listman.redhat.com
From: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>
Subject: RE: grubby complains
Date: Wed, 5 Mar 2003 14:53:41 +1000

ok i will do so asap.
i would mention that lilo reports a dirty buffer error whenever i run it.


===

To: redhat-list@listman.redhat.com
From: Michael Fratoni <mfratoni@tuxfan.homeip.net>
Subject: Re: grubby complains
Date: Wed, 5 Mar 2003 00:19:33 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 04 March 2003 11:53 pm, Mirabella, Mathew J wrote:
> ok i will do so asap.
> i would mention that lilo reports a dirty buffer error whenever i run
> it.

Then let's see the output of 'lilo -vv' (that's 2 v's, not a w) as well.


===

To: redhat-list@listman.redhat.com
From: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>
Subject: RE: grubby complains
Date: Thu, 6 Mar 2003 09:24:04 +1000

ok i use lilo.
here is the lilo.conf

prompt
timeout=50
default=linux
boot=/dev/hda5
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.18-14
	label=linux.old
	initrd=/boot/initrd-2.4.18-14.img
	read-only
	append="hdd=ide-scsi root=LABEL=/ speakup_synth=dectlk"

image=/boot/vmlinuz-2.4.18-24.8.0
	label=linux
	initrd=/boot/initrd-2.4.18-24.8.0.img
	read-only
	append="hdd=ide-scsi root=LABEL=/ speakup_synth=dectlk"

the second image is the newer updated kernal.

here is the output from lilo

LILO version 21.4-4, Copyright (C) 1992-1998 Werner Almesberger
'lba32' extensions Copyright (C) 1999,2000 John Coffman

Reading boot sector from /dev/hda5
Merging with /boot/boot.b
Secondary loader: 11 sectors.
Mapping message file /boot/message
Message: 230 sectors.
Boot image: /boot/vmlinuz-2.4.18-14
Setup length is 10 sectors.
Mapped 11000 sectors.
Mapping RAM disk /boot/initrd-2.4.18-14.img
RAM disk: 1275 sectors.
Added linux.old
Boot image: /boot/vmlinuz-2.4.18-24.8.0
Setup length is 10 sectors.
Mapped 10875 sectors.
Mapping RAM disk /boot/initrd-2.4.18-24.8.0.img
RAM disk: 1270 sectors.
Added linux *
/boot/boot.0305 exists - no backup copy made.
Map file size: 30720 bytes.
Writing boot sector.

but at the end, a dirty buffer error appeared, but i think this would have gone to standard error because it did not come out in the file when i redirected lilo to the file with >  maybe i have done the wrong thing here... 

rpm -q kernel gives
kernal-2.4.18-14
kernal-2.4.18-24.8.0

and sorry, i forgot to get the output of 'ls /boot/{vmlinuz*,initrd*}'

anyway can you tell me an easy way to dump the contents of a console to a file...?


===

To: redhat-list@listman.redhat.com
From: Michael Fratoni <mfratoni@tuxfan.homeip.net>
Subject: Re: grubby complains
Date: Wed, 5 Mar 2003 21:44:26 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 05 March 2003 06:24 pm, Mirabella, Mathew J wrote:
> ok i use lilo.
> here is the lilo.conf
>
> prompt
> timeout=50
> default=linux
> boot=/dev/hda5
> map=/boot/map
> install=/boot/boot.b
> message=/boot/message
> lba32
>
> image=/boot/vmlinuz-2.4.18-14
> 	label=linux.old
> 	initrd=/boot/initrd-2.4.18-14.img
> 	read-only
> 	append="hdd=ide-scsi root=LABEL=/ speakup_synth=dectlk"
>
> image=/boot/vmlinuz-2.4.18-24.8.0
> 	label=linux
> 	initrd=/boot/initrd-2.4.18-24.8.0.img
> 	read-only
> 	append="hdd=ide-scsi root=LABEL=/ speakup_synth=dectlk"
>
> the second image is the newer updated kernal.

Did you add the stanza for the new kernel manually, or did the kernel rpm 
scripts do it? I haven't used lilo for a while, but the config looks OK 
to me.

> here is the output from lilo
>
> LILO version 21.4-4, Copyright (C) 1992-1998 Werner Almesberger
> 'lba32' extensions Copyright (C) 1999,2000 John Coffman
[snip]
> but at the end, a dirty buffer error appeared, but i think this would
> have gone to standard error because it did not come out in the file
> when i redirected lilo to the file with >  maybe i have done the wrong
> thing here...

It was mainly the error message I wanted to see. ;) Try this:
lilo -v > lilo.out 2>&1 

That will direct stdout and stderr to the file lilo.out

> rpm -q kernel gives
> kernal-2.4.18-14
> kernal-2.4.18-24.8.0
>
> and sorry, i forgot to get the output of 'ls /boot/{vmlinuz*,initrd*}'

That's fine, I just wanted to be sure the files listed in the config file 
existed in /boot/

> anyway can you tell me an easy way to dump the contents of a console to
> a file...?

You mean redirect output as the command above? 


===

To: redhat-list@listman.redhat.com
From: Michael Fratoni <mfratoni@tuxfan.homeip.net>
Subject: Re: grubby complains
Date: Wed, 5 Mar 2003 22:30:04 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 05 March 2003 10:03 pm, Mirabella, Mathew J wrote:
> ah ok well i have seem the contents of /boot and yes there are files
> called vmlinux-2.4.18-14
> and
> vmlinux-2.4.18-24.8.0
> things do look ok.
>
> but in another post to this list i mentioned that when visiting
> /lib/modules/
> i saw dirs called
> 	linux-2.4.18-14/
> 	linux-2.4.18-24.8.0/
> in the 2.4.18-14 one there was a sym link called build, linked to
> /urr/src/linux-2.4.18-14/

>
> but in the 	/lib/modules/linux-2.4.18-24.8.0 , there was a build sym
> link that was broken. i.e. no target on investigating /usr/src i found
> 	linux-2.4.18-14/
> 	redhat/
> 	linux-2.4 (some kind of symlink)
> but no dir for 	linux-2.4.18-24.8.0

You haven't installed the kernel-source package for the 2.4.18-24 kernel.
The broken link points to where the source should be. The broken link 
isn't a problem, it's used when building kernel modules against the 
current kernel source.

> i do not think the source was built, and so the build sym link was
> created broken. some replies to my post suggested installing the i386
> version of the kernel source (rather than the SRPMs version).  on
> trying this, i still get no dir linux-2.4.18-24.8.0/ being created in
> /usr/src

If you install kernel-source-2.4.18-24.8.0.i386.rpm, the files will be 
installed in /usr/src/linux-2.4.18-24.8.0. /usr/src/linux-2.4 will point 
to that directory.
Try 'rpm -ivh kernel-source-2.4.18-24.8.0.i386.rpm'
Then 'rpm -q kernel-source'


> anyway could this grubby error thing when installing the actual kernel
> be a cause of some difficulties in other things not being placed
> properly?  and could this be the cause of the lilo dirty buffer error?

See my other post on the dirty buffer, it appears to be a non issue. 

As for the template error, had you already modified your lilo.config file 
when you (re) installed the most recent kernel?


===

To: redhat-list@listman.redhat.com
From: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>
Subject: RE: grubby complains
Date: Thu, 6 Mar 2003 14:34:26 +1000

>  As for the template error, had you already modified your
>  lilo.config file when you (re) installed the most recent
>  kernel?

actually no i modified lilo.conf afterwards

and yes i did try to install that kernel source from i386
you mentionedd and no luck,... nothing went into /usr/src
i.e. there was no dir for linux-2.4.18-24.8.0


===

To: redhat-list@listman.redhat.com
From: Michael Fratoni <mfratoni@tuxfan.homeip.net>
Subject: Re: grubby complains
Date: Thu, 6 Mar 2003 00:17:16 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 05 March 2003 11:34 pm, Mirabella, Mathew J wrote:
> >  As for the template error, had you already modified your lilo.config
> > file when you (re) installed the most recent kernel?
>
> actually no i modified lilo.conf afterwards

But you had installed a multitude of kernel packages. None of them were 
added to lilo.conf?

> and yes i did try to install that kernel source from i386 you
> mentionedd and no luck,... nothing went into /usr/src i.e. there was no
> dir for linux-2.4.18-24.8.0

Errors, output from the commands? 
We need details before we can help at all.


===

To: redhat-list@listman.redhat.com
From: "Mirabella, Mathew J" <Mathew.Mirabella@team.telstra.com>
Subject: RE: grubby complains
Date: Thu, 6 Mar 2003 15:38:48 +1000

i did install a number of kernal packages but i did link one
of them into lilo.conf as you saw from the output of
lilo.conf i sent earlier.

i did this modification to lilo.conf manually after the
install of the kernals.  the grubby messages come up on
installing the kernal package..

the kernal source you mentioned did install... at least rpm
did not report any errors at all... it seemed to work fine,
but i cannot find the appropriate dir in /usr/src/ that
should have been created.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu