diff options
Diffstat (limited to 'arch/x86_64/boot/Makefile')
-rw-r--r-- | arch/x86_64/boot/Makefile | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile index 29f8396ed151..43ee6c50c277 100644 --- a/arch/x86_64/boot/Makefile +++ b/arch/x86_64/boot/Makefile | |||
@@ -60,8 +60,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE | |||
60 | $(obj)/compressed/vmlinux: FORCE | 60 | $(obj)/compressed/vmlinux: FORCE |
61 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ | 61 | $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ |
62 | 62 | ||
63 | # Set this if you want to pass append arguments to the zdisk/fdimage kernel | 63 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel |
64 | FDARGS = | 64 | FDARGS = |
65 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel | ||
66 | FDINITRD = | ||
67 | |||
68 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) | ||
65 | 69 | ||
66 | $(obj)/mtools.conf: $(src)/mtools.conf.in | 70 | $(obj)/mtools.conf: $(src)/mtools.conf.in |
67 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ | 71 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ |
@@ -70,8 +74,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in | |||
70 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | 74 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf |
71 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync | 75 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync |
72 | syslinux /dev/fd0 ; sync | 76 | syslinux /dev/fd0 ; sync |
73 | echo 'default linux $(FDARGS)' | \ | 77 | echo '$(image_cmdline)' | \ |
74 | MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg | 78 | MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg |
79 | if [ -f '$(FDINITRD)' ] ; then \ | ||
80 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ | ||
81 | fi | ||
75 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync | 82 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync |
76 | 83 | ||
77 | # These require being root or having syslinux 2.02 or higher installed | 84 | # These require being root or having syslinux 2.02 or higher installed |
@@ -79,18 +86,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | |||
79 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 | 86 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 |
80 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync | 87 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync |
81 | syslinux $(obj)/fdimage ; sync | 88 | syslinux $(obj)/fdimage ; sync |
82 | echo 'default linux $(FDARGS)' | \ | 89 | echo '$(image_cmdline)' | \ |
83 | MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg | 90 | MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg |
91 | if [ -f '$(FDINITRD)' ] ; then \ | ||
92 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ | ||
93 | fi | ||
84 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync | 94 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync |
85 | 95 | ||
86 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | 96 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf |
87 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 | 97 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 |
88 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync | 98 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync |
89 | syslinux $(obj)/fdimage ; sync | 99 | syslinux $(obj)/fdimage ; sync |
90 | echo 'default linux $(FDARGS)' | \ | 100 | echo '$(image_cmdline)' | \ |
91 | MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg | 101 | MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg |
102 | if [ -f '$(FDINITRD)' ] ; then \ | ||
103 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ | ||
104 | fi | ||
92 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync | 105 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync |
93 | 106 | ||
107 | isoimage: $(BOOTIMAGE) | ||
108 | -rm -rf $(obj)/isoimage | ||
109 | mkdir $(obj)/isoimage | ||
110 | cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \ | ||
111 | $(obj)/isoimage | ||
112 | cp $(BOOTIMAGE) $(obj)/isoimage/linux | ||
113 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg | ||
114 | if [ -f '$(FDINITRD)' ] ; then \ | ||
115 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ | ||
116 | fi | ||
117 | mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \ | ||
118 | -no-emul-boot -boot-load-size 4 -boot-info-table \ | ||
119 | $(obj)/isoimage | ||
120 | rm -rf $(obj)/isoimage | ||
121 | |||
94 | zlilo: $(BOOTIMAGE) | 122 | zlilo: $(BOOTIMAGE) |
95 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi | 123 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi |
96 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi | 124 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi |