diff options
-rw-r--r-- | arch/x86/Makefile | 27 | ||||
-rw-r--r-- | arch/x86/boot/Makefile | 29 |
2 files changed, 24 insertions, 32 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 1836191839ee..43bd89c67e3a 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -153,34 +153,23 @@ endif | |||
153 | 153 | ||
154 | boot := arch/x86/boot | 154 | boot := arch/x86/boot |
155 | 155 | ||
156 | PHONY += zImage bzImage compressed zlilo bzlilo \ | 156 | BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage install |
157 | zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install | 157 | |
158 | PHONY += bzImage $(BOOT_TARGETS) | ||
158 | 159 | ||
159 | # Default kernel to build | 160 | # Default kernel to build |
160 | all: bzImage | 161 | all: bzImage |
161 | 162 | ||
162 | # KBUILD_IMAGE specify target image being built | 163 | # KBUILD_IMAGE specify target image being built |
163 | KBUILD_IMAGE := $(boot)/bzImage | 164 | KBUILD_IMAGE := $(boot)/bzImage |
164 | zImage zlilo zdisk: KBUILD_IMAGE := $(boot)/zImage | ||
165 | 165 | ||
166 | zImage bzImage: vmlinux | 166 | bzImage: vmlinux |
167 | $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) | 167 | $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) |
168 | $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot | 168 | $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot |
169 | $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ | 169 | $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ |
170 | 170 | ||
171 | compressed: zImage | 171 | $(BOOT_TARGETS): vmlinux |
172 | 172 | $(Q)$(MAKE) $(build)=$(boot) $@ | |
173 | zlilo bzlilo: vmlinux | ||
174 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo | ||
175 | |||
176 | zdisk bzdisk: vmlinux | ||
177 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk | ||
178 | |||
179 | fdimage fdimage144 fdimage288 isoimage: vmlinux | ||
180 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ | ||
181 | |||
182 | install: | ||
183 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install | ||
184 | 173 | ||
185 | PHONY += vdso_install | 174 | PHONY += vdso_install |
186 | vdso_install: | 175 | vdso_install: |
@@ -208,4 +197,4 @@ endef | |||
208 | 197 | ||
209 | CLEAN_FILES += arch/x86/boot/fdimage \ | 198 | CLEAN_FILES += arch/x86/boot/fdimage \ |
210 | arch/x86/boot/image.iso \ | 199 | arch/x86/boot/image.iso \ |
211 | arch/x86/boot/mtools.conf | 200 | arch/x86/boot/mtools.conf \ No newline at end of file |
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 57a29fecf6bb..2a3db75b35c3 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -109,9 +109,11 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE | |||
109 | $(obj)/compressed/vmlinux: FORCE | 109 | $(obj)/compressed/vmlinux: FORCE |
110 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 110 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
111 | 111 | ||
112 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel | 112 | # Set this if you want to pass append arguments to the |
113 | # bzdisk/fdimage/isoimage kernel | ||
113 | FDARGS = | 114 | FDARGS = |
114 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel | 115 | # Set this if you want an initrd included with the |
116 | # bzdisk/fdimage/isoimage kernel | ||
115 | FDINITRD = | 117 | FDINITRD = |
116 | 118 | ||
117 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) | 119 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) |
@@ -120,7 +122,7 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in | |||
120 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ | 122 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ |
121 | 123 | ||
122 | # This requires write access to /dev/fd0 | 124 | # This requires write access to /dev/fd0 |
123 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | 125 | bzdisk: $(obj)/bzImage $(obj)/mtools.conf |
124 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync | 126 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync |
125 | syslinux /dev/fd0 ; sync | 127 | syslinux /dev/fd0 ; sync |
126 | echo '$(image_cmdline)' | \ | 128 | echo '$(image_cmdline)' | \ |
@@ -128,10 +130,10 @@ zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | |||
128 | if [ -f '$(FDINITRD)' ] ; then \ | 130 | if [ -f '$(FDINITRD)' ] ; then \ |
129 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ | 131 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ |
130 | fi | 132 | fi |
131 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync | 133 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux ; sync |
132 | 134 | ||
133 | # These require being root or having syslinux 2.02 or higher installed | 135 | # These require being root or having syslinux 2.02 or higher installed |
134 | fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | 136 | fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf |
135 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 | 137 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 |
136 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync | 138 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync |
137 | syslinux $(obj)/fdimage ; sync | 139 | syslinux $(obj)/fdimage ; sync |
@@ -140,9 +142,9 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | |||
140 | if [ -f '$(FDINITRD)' ] ; then \ | 142 | if [ -f '$(FDINITRD)' ] ; then \ |
141 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ | 143 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ |
142 | fi | 144 | fi |
143 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync | 145 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux ; sync |
144 | 146 | ||
145 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | 147 | fdimage288: $(obj)/bzImage $(obj)/mtools.conf |
146 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 | 148 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 |
147 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync | 149 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync |
148 | syslinux $(obj)/fdimage ; sync | 150 | syslinux $(obj)/fdimage ; sync |
@@ -151,9 +153,9 @@ fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | |||
151 | if [ -f '$(FDINITRD)' ] ; then \ | 153 | if [ -f '$(FDINITRD)' ] ; then \ |
152 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ | 154 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ |
153 | fi | 155 | fi |
154 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync | 156 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux ; sync |
155 | 157 | ||
156 | isoimage: $(BOOTIMAGE) | 158 | isoimage: $(obj)/bzImage |
157 | -rm -rf $(obj)/isoimage | 159 | -rm -rf $(obj)/isoimage |
158 | mkdir $(obj)/isoimage | 160 | mkdir $(obj)/isoimage |
159 | for i in lib lib64 share end ; do \ | 161 | for i in lib lib64 share end ; do \ |
@@ -163,7 +165,7 @@ isoimage: $(BOOTIMAGE) | |||
163 | fi ; \ | 165 | fi ; \ |
164 | if [ $$i = end ] ; then exit 1 ; fi ; \ | 166 | if [ $$i = end ] ; then exit 1 ; fi ; \ |
165 | done | 167 | done |
166 | cp $(BOOTIMAGE) $(obj)/isoimage/linux | 168 | cp $(obj)/bzImage $(obj)/isoimage/linux |
167 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg | 169 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg |
168 | if [ -f '$(FDINITRD)' ] ; then \ | 170 | if [ -f '$(FDINITRD)' ] ; then \ |
169 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ | 171 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ |
@@ -174,12 +176,13 @@ isoimage: $(BOOTIMAGE) | |||
174 | isohybrid $(obj)/image.iso 2>/dev/null || true | 176 | isohybrid $(obj)/image.iso 2>/dev/null || true |
175 | rm -rf $(obj)/isoimage | 177 | rm -rf $(obj)/isoimage |
176 | 178 | ||
177 | zlilo: $(BOOTIMAGE) | 179 | bzlilo: $(obj)/bzImage |
178 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi | 180 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi |
179 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi | 181 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi |
180 | cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz | 182 | cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz |
181 | cp System.map $(INSTALL_PATH)/ | 183 | cp System.map $(INSTALL_PATH)/ |
182 | if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi | 184 | if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi |
183 | 185 | ||
184 | install: | 186 | install: |
185 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" | 187 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ |
188 | System.map "$(INSTALL_PATH)" | ||