diff options
Diffstat (limited to 'arch/i386/boot/Makefile')
-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 |