diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-03-26 04:36:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:53 -0500 |
commit | 841b8a46bffec232377d2de157f971e812be4fe4 (patch) | |
tree | f54548f3734235676d5c9956b43b32bf81e2e6b3 /arch/i386/boot | |
parent | 5a3a5a98b6422d05c39eaa32c8b3f83840c7b768 (diff) |
[PATCH] x86: "make isoimage" support; FDINITRD= support; minor cleanups
Add a "make isoimage" to i386 and x86-64, which allows the automatic
creation of a bootable CD image. It also adds an option FDINITRD= to
include an initrd of the user's choice in generated floppy- or CD boot
images. Finally, some minor cleanups of the image generation code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/boot')
-rw-r--r-- | arch/i386/boot/Makefile | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile index f136752563b1..33e55476381b 100644 --- a/arch/i386/boot/Makefile +++ b/arch/i386/boot/Makefile | |||
@@ -62,8 +62,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE | |||
62 | $(obj)/compressed/vmlinux: FORCE | 62 | $(obj)/compressed/vmlinux: FORCE |
63 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ | 63 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ |
64 | 64 | ||
65 | # Set this if you want to pass append arguments to the zdisk/fdimage kernel | 65 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel |
66 | FDARGS = | 66 | FDARGS = |
67 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel | ||
68 | FDINITRD = | ||
69 | |||
70 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) | ||
67 | 71 | ||
68 | $(obj)/mtools.conf: $(src)/mtools.conf.in | 72 | $(obj)/mtools.conf: $(src)/mtools.conf.in |
69 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ | 73 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ |
@@ -72,8 +76,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in | |||
72 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | 76 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf |
73 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync | 77 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync |
74 | syslinux /dev/fd0 ; sync | 78 | syslinux /dev/fd0 ; sync |
75 | echo 'default linux $(FDARGS)' | \ | 79 | echo '$(image_cmdline)' | \ |
76 | MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg | 80 | MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg |
81 | if [ -f '$(FDINITRD)' ] ; then \ | ||
82 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ | ||
83 | fi | ||
77 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync | 84 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync |
78 | 85 | ||
79 | # These require being root or having syslinux 2.02 or higher installed | 86 | # These require being root or having syslinux 2.02 or higher installed |
@@ -81,18 +88,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | |||
81 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 | 88 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 |
82 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync | 89 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync |
83 | syslinux $(obj)/fdimage ; sync | 90 | syslinux $(obj)/fdimage ; sync |
84 | echo 'default linux $(FDARGS)' | \ | 91 | echo '$(image_cmdline)' | \ |
85 | MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg | 92 | MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg |
93 | if [ -f '$(FDINITRD)' ] ; then \ | ||
94 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ | ||
95 | fi | ||
86 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync | 96 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync |
87 | 97 | ||
88 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | 98 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf |
89 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 | 99 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 |
90 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync | 100 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync |
91 | syslinux $(obj)/fdimage ; sync | 101 | syslinux $(obj)/fdimage ; sync |
92 | echo 'default linux $(FDARGS)' | \ | 102 | echo '$(image_cmdline)' | \ |
93 | MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg | 103 | MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg |
104 | if [ -f '$(FDINITRD)' ] ; then \ | ||
105 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ | ||
106 | fi | ||
94 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync | 107 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync |
95 | 108 | ||
109 | isoimage: $(BOOTIMAGE) | ||
110 | -rm -rf $(obj)/isoimage | ||
111 | mkdir $(obj)/isoimage | ||
112 | cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \ | ||
113 | $(obj)/isoimage | ||
114 | cp $(BOOTIMAGE) $(obj)/isoimage/linux | ||
115 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg | ||
116 | if [ -f '$(FDINITRD)' ] ; then \ | ||
117 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ | ||
118 | fi | ||
119 | mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \ | ||
120 | -no-emul-boot -boot-load-size 4 -boot-info-table \ | ||
121 | $(obj)/isoimage | ||
122 | rm -rf $(obj)/isoimage | ||
123 | |||
96 | zlilo: $(BOOTIMAGE) | 124 | zlilo: $(BOOTIMAGE) |
97 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi | 125 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi |
98 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi | 126 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi |