* Patch: Support for grub at installation time
@ 2001-12-23 14:39 Harald Dunkel
2001-12-23 15:05 ` Keith Owens
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Harald Dunkel @ 2001-12-23 14:39 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
Hi folks,
Below you can find a tiny patch to add 2 new targets to the top level
Makefile: bzgrub and zgrub. This is a suggestion about how the Grub
boot loader could be supported.
It would be nice if you could consider this patch to be included in
one of the future kernels. I am not the kernel patch specialist, so
please excuse if I missed to follow a specific procedure.
Regards
Harri
--
Harald Dunkel | dunkel@Synopsys.COM | Against stupidity the very gods
Synopsys GmbH | Kaiserstr. 100 | Themselves contend in vain.
52134 Herzogenrath, Germany |
+49 2407 9558 (fax? 44: 0) | Schiller, The Maid of Orleans
[-- Attachment #2: grub.patch --]
[-- Type: text/plain, Size: 3925 bytes --]
diff -cr linux.orig/Documentation/kbuild/commands.txt linux/Documentation/kbuild/commands.txt
*** linux.orig/Documentation/kbuild/commands.txt Fri Jul 28 21:50:51 2000
--- linux/Documentation/kbuild/commands.txt Sun Dec 23 14:36:09 2001
***************
*** 24,38 ****
text interface, or 'make xconfig' for an X interface using TCL/TK.
'make bzImage' will leave your new kernel image in arch/i386/boot/bzImage.
! You can also use 'make bzdisk' or 'make bzlilo'.
! See the lilo documentation for more information on how to use lilo.
You can also use the 'loadlin' program to boot Linux from MS-DOS.
Some computers won't work with 'make bzImage', either due to hardware
problems or very old versions of lilo or loadlin. If your kernel image
! is small, you may use 'make zImage', 'make zdisk', or 'make zlilo'
! on theses systems.
If you find a file name 'vmlinux' in the top directory of the source tree,
just ignore it. This is an intermediate file and you can't boot from it.
--- 24,38 ----
text interface, or 'make xconfig' for an X interface using TCL/TK.
'make bzImage' will leave your new kernel image in arch/i386/boot/bzImage.
! You can also use 'make bzdisk', 'make bzgrub' or 'make bzlilo'.
! See the documentation for more information on how to use lilo or grub.
You can also use the 'loadlin' program to boot Linux from MS-DOS.
Some computers won't work with 'make bzImage', either due to hardware
problems or very old versions of lilo or loadlin. If your kernel image
! is small, you may use 'make zImage', 'make zdisk', 'make zgrub', or
! 'make zlilo' on theses systems.
If you find a file name 'vmlinux' in the top directory of the source tree,
just ignore it. This is an intermediate file and you can't boot from it.
diff -cr linux.orig/Documentation/kbuild/makefiles.txt linux/Documentation/kbuild/makefiles.txt
*** linux.orig/Documentation/kbuild/makefiles.txt Tue Feb 13 23:13:42 2001
--- linux/Documentation/kbuild/makefiles.txt Sun Dec 23 14:39:49 2001
***************
*** 427,432 ****
--- 427,433 ----
bootpfile alpha, ia64
bzImage i386, m68k
bzdisk i386
+ bzgrub i386
bzlilo i386
compressed i386, m68k, mips, mips64, sh
dasdfmt s390
***************
*** 446,451 ****
--- 447,453 ----
zImage arm, i386, m68k, mips, mips64, ppc, sh
zImage.initrd ppc
zdisk i386, mips, mips64, sh
+ zgrub i386
zinstall arm
zlilo i386
znetboot.initrd ppc
diff -cr linux.orig/arch/i386/Makefile linux/arch/i386/Makefile
*** linux.orig/arch/i386/Makefile Thu Apr 12 21:20:31 2001
--- linux/arch/i386/Makefile Sun Dec 23 13:37:16 2001
***************
*** 111,116 ****
--- 111,117 ----
FORCE: ;
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
+ zgrub bzgrub \
clean archclean archmrproper archdep
zImage: vmlinux
***************
*** 128,133 ****
--- 129,140 ----
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
+
+ zgrub: vmlinux
+ @$(MAKEBOOT) BOOTIMAGE=zImage zgrub
+
+ bzgrub: vmlinux
+ @$(MAKEBOOT) BOOTIMAGE=bzImage zgrub
zdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zdisk
diff -cr linux.orig/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile
*** linux.orig/arch/i386/boot/Makefile Sun Aug 5 22:13:19 2001
--- linux/arch/i386/boot/Makefile Sun Dec 23 13:48:10 2001
***************
*** 36,41 ****
--- 36,46 ----
cp $(TOPDIR)/System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
+ zgrub: $(CONFIGURE) $(BOOTIMAGE)
+ cat $(BOOTIMAGE) > /boot/vmlinuz-$(KERNELRELEASE)
+ cp $(TOPDIR)/System.map /boot/System.map-$(KERNELRELEASE)
+ if [ -x /sbin/update-grub ]; then /sbin/update-grub; fi
+
install: $(CONFIGURE) $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)"
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Patch: Support for grub at installation time
2001-12-23 14:39 Patch: Support for grub at installation time Harald Dunkel
@ 2001-12-23 15:05 ` Keith Owens
2001-12-23 20:54 ` Harald Dunkel
2001-12-23 15:15 ` Christoph Hellwig
2001-12-24 12:27 ` Chmouel Boudjnah
2 siblings, 1 reply; 7+ messages in thread
From: Keith Owens @ 2001-12-23 15:05 UTC (permalink / raw)
To: harri; +Cc: linux-kernel
On Sun, 23 Dec 2001 15:39:59 +0100,
Harald Dunkel <harri@synopsys.COM> wrote:
>Below you can find a tiny patch to add 2 new targets to the top level
>Makefile: bzgrub and zgrub. This is a suggestion about how the Grub
I am removing all the special targets that have crept into kbuild,
including zlilo, I do not want to add any new boot targets. It is the
job of the kernel makefiles to build the kernel, install the kernel and
modules and that is all. Anything after the kernel and modules have
been installed is not the job of kbuild. There is too much special
case code in the kernel makefiles, some of which only works for a few
users.
All is not lost, however. kbuild 2.5 has a config option to run a
post-install script. You can specify any script that you want and that
script is responsible for doing whatever you want after the kernel and
modules install. There is a sample in scripts/lilo_new_kernel:
#!/bin/sh
#
# This is a sample script to add a new kernel to /etc/lilo.conf. If it
# does not do what you want, copy this script to somewhere outside the
# kernel, change the copy and point your .config at the modified copy.
# Then you do not need to change the script when you upgrade your kernel.
#
label=$(echo "$KERNELRELEASE" | cut -c1-15)
if ! grep "label=$label\$" /etc/lilo.conf > /dev/null
then
ed /etc/lilo.conf > /dev/null 2>&1 <<EODATA
/^image/
i
image=$CONFIG_INSTALL_PREFIX_NAME$CONFIG_INSTALL_KERNEL_NAME
label=$label
optional
.
w
q
EODATA
if [ ! $? ]
then
echo edit of /etc/lilo.conf failed
exit 1
fi
fi
lilo
The problem with embedding boot loader data in kbuild is that everybody
wants their boot to do something slightly different. In the past they
had to patch the kernel makefiles to do what they wanted, which shows
it was a bad design.
In kbuild 2.5, lilo users invoke scripts/lilo_new_kernel as the post
install script. If they want something different, copy lilo_new_kernel
to their own directory and tell kbuild to use the local copy. No more
patching kernel makefiles for local changes.
grub will be handled the same. kbuild 2.5 can supply a sample
scripts/grub_new_kernel which users can use as is or copy and change to
their own requirements. I will take a sample grub script, I will not
take a new target in the makefiles.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Patch: Support for grub at installation time
2001-12-23 15:05 ` Keith Owens
@ 2001-12-23 20:54 ` Harald Dunkel
2001-12-23 21:14 ` Harald Dunkel
2001-12-23 22:17 ` H. Peter Anvin
0 siblings, 2 replies; 7+ messages in thread
From: Harald Dunkel @ 2001-12-23 20:54 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-kernel
Keith Owens wrote:
>
> On Sun, 23 Dec 2001 15:39:59 +0100,
> Harald Dunkel <harri@synopsys.COM> wrote:
> >Below you can find a tiny patch to add 2 new targets to the top level
> >Makefile: bzgrub and zgrub. This is a suggestion about how the Grub
>
> I am removing all the special targets that have crept into kbuild,
> including zlilo, I do not want to add any new boot targets. It is the
> job of the kernel makefiles to build the kernel, install the kernel and
> modules and that is all. Anything after the kernel and modules have
> been installed is not the job of kbuild. There is too much special
> case code in the kernel makefiles, some of which only works for a few
> users.
>
> All is not lost, however. kbuild 2.5 has a config option to run a
> post-install script. You can specify any script that you want and that
> script is responsible for doing whatever you want after the kernel and
> modules install. There is a sample in scripts/lilo_new_kernel:
>
Currently there are just 2 ways to install the freshly build kernel
outside of the source tree: 'make bzlilo' and 'make install'. Both
call lilo, if the executable can be found. Its good to hear that this
is going to be removed.
My patch is not for kbuild 2.5, but for the current Makefiles in the
kernel sources. I am eager to check the new features you provide when
kbuild 2.5 or a newer version is included for one of the future kernels,
but since then I would suggest to consider my patch.
If you have kbuild for 2.4.16 completed, please send me a note. I would
like to try it.
Regards
Harri
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Patch: Support for grub at installation time
2001-12-23 14:39 Patch: Support for grub at installation time Harald Dunkel
2001-12-23 15:05 ` Keith Owens
@ 2001-12-23 15:15 ` Christoph Hellwig
2001-12-24 12:27 ` Chmouel Boudjnah
2 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2001-12-23 15:15 UTC (permalink / raw)
To: Harald Dunkel; +Cc: linux-kernel
In article <3C25ECBF.AF0E819C@Synopsys.COM> you wrote:
> Below you can find a tiny patch to add 2 new targets to the top level
> Makefile: bzgrub and zgrub. This is a suggestion about how the Grub
> boot loader could be supported.
Please provide a grub-specific /sbin/installkernel instead.
The lilo targets should die aswell, IMHO.
> It would be nice if you could consider this patch to be included in
> one of the future kernels. I am not the kernel patch specialist, so
> please excuse if I missed to follow a specific procedure.
No. The kernel build process shouldn't know at all about boot loaders.
Christoph (a happy grub user)
--
Of course it doesn't work. We've performed a software upgrade.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Patch: Support for grub at installation time
2001-12-23 14:39 Patch: Support for grub at installation time Harald Dunkel
2001-12-23 15:05 ` Keith Owens
2001-12-23 15:15 ` Christoph Hellwig
@ 2001-12-24 12:27 ` Chmouel Boudjnah
2 siblings, 0 replies; 7+ messages in thread
From: Chmouel Boudjnah @ 2001-12-24 12:27 UTC (permalink / raw)
To: harri; +Cc: linux-kernel
Harald Dunkel <harri@synopsys.COM> writes:
> It would be nice if you could consider this patch to be included in
> one of the future kernels. I am not the kernel patch specialist, so
> please excuse if I missed to follow a specific procedure.
Looking at your patch :
+ if [ -x /sbin/update-grub ]; then /sbin/update-grub; fi
This is distro specific. We should leave that job to installkernel up
to the vendors to customing it.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-12-24 12:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-23 14:39 Patch: Support for grub at installation time Harald Dunkel
2001-12-23 15:05 ` Keith Owens
2001-12-23 20:54 ` Harald Dunkel
2001-12-23 21:14 ` Harald Dunkel
2001-12-23 22:17 ` H. Peter Anvin
2001-12-23 15:15 ` Christoph Hellwig
2001-12-24 12:27 ` Chmouel Boudjnah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox