diff options
Diffstat (limited to 'arch/x86/boot/Makefile')
-rw-r--r-- | arch/x86/boot/Makefile | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index c70eff69a1fb..fb737ce5888d 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -6,26 +6,24 @@ | |||
6 | # for more details. | 6 | # for more details. |
7 | # | 7 | # |
8 | # Copyright (C) 1994 by Linus Torvalds | 8 | # Copyright (C) 1994 by Linus Torvalds |
9 | # Changed by many, many contributors over the years. | ||
9 | # | 10 | # |
10 | 11 | ||
11 | # ROOT_DEV specifies the default root-device when making the image. | 12 | # ROOT_DEV specifies the default root-device when making the image. |
12 | # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case | 13 | # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case |
13 | # the default of FLOPPY is used by 'build'. | 14 | # the default of FLOPPY is used by 'build'. |
14 | 15 | ||
15 | ROOT_DEV := CURRENT | 16 | ROOT_DEV := CURRENT |
16 | 17 | ||
17 | # If you want to preset the SVGA mode, uncomment the next line and | 18 | # If you want to preset the SVGA mode, uncomment the next line and |
18 | # set SVGA_MODE to whatever number you want. | 19 | # set SVGA_MODE to whatever number you want. |
19 | # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. | 20 | # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. |
20 | # The number is the same as you would ordinarily press at bootup. | 21 | # The number is the same as you would ordinarily press at bootup. |
21 | 22 | ||
22 | SVGA_MODE := -DSVGA_MODE=NORMAL_VGA | 23 | SVGA_MODE := -DSVGA_MODE=NORMAL_VGA |
23 | 24 | ||
24 | # If you want the RAM disk device, define this to be the size in blocks. | 25 | targets := vmlinux.bin setup.bin setup.elf bzImage |
25 | 26 | targets += fdimage fdimage144 fdimage288 image.iso mtools.conf | |
26 | #RAMDISK := -DRAMDISK=512 | ||
27 | |||
28 | targets := vmlinux.bin setup.bin setup.elf zImage bzImage | ||
29 | subdir- := compressed | 27 | subdir- := compressed |
30 | 28 | ||
31 | setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o | 29 | setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o |
@@ -71,17 +69,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ | |||
71 | KBUILD_CFLAGS += $(call cc-option,-m32) | 69 | KBUILD_CFLAGS += $(call cc-option,-m32) |
72 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | 70 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ |
73 | 71 | ||
74 | $(obj)/zImage: asflags-y := $(SVGA_MODE) $(RAMDISK) | 72 | $(obj)/bzImage: asflags-y := $(SVGA_MODE) |
75 | $(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__ | ||
76 | $(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ | ||
77 | $(obj)/bzImage: BUILDFLAGS := -b | ||
78 | 73 | ||
79 | quiet_cmd_image = BUILD $@ | 74 | quiet_cmd_image = BUILD $@ |
80 | cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ | 75 | cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ |
81 | $(obj)/vmlinux.bin $(ROOT_DEV) > $@ | 76 | $(ROOT_DEV) > $@ |
82 | 77 | ||
83 | $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ | 78 | $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE |
84 | $(obj)/vmlinux.bin $(obj)/tools/build FORCE | ||
85 | $(call if_changed,image) | 79 | $(call if_changed,image) |
86 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | 80 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
87 | 81 | ||
@@ -116,9 +110,11 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE | |||
116 | $(obj)/compressed/vmlinux: FORCE | 110 | $(obj)/compressed/vmlinux: FORCE |
117 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 111 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
118 | 112 | ||
119 | # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel | 113 | # Set this if you want to pass append arguments to the |
114 | # bzdisk/fdimage/isoimage kernel | ||
120 | FDARGS = | 115 | FDARGS = |
121 | # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel | 116 | # Set this if you want an initrd included with the |
117 | # bzdisk/fdimage/isoimage kernel | ||
122 | FDINITRD = | 118 | FDINITRD = |
123 | 119 | ||
124 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) | 120 | image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) |
@@ -127,7 +123,7 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in | |||
127 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ | 123 | sed -e 's|@OBJ@|$(obj)|g' < $< > $@ |
128 | 124 | ||
129 | # This requires write access to /dev/fd0 | 125 | # This requires write access to /dev/fd0 |
130 | zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | 126 | bzdisk: $(obj)/bzImage $(obj)/mtools.conf |
131 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync | 127 | MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync |
132 | syslinux /dev/fd0 ; sync | 128 | syslinux /dev/fd0 ; sync |
133 | echo '$(image_cmdline)' | \ | 129 | echo '$(image_cmdline)' | \ |
@@ -135,10 +131,10 @@ zdisk: $(BOOTIMAGE) $(obj)/mtools.conf | |||
135 | if [ -f '$(FDINITRD)' ] ; then \ | 131 | if [ -f '$(FDINITRD)' ] ; then \ |
136 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ | 132 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ |
137 | fi | 133 | fi |
138 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync | 134 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux ; sync |
139 | 135 | ||
140 | # These require being root or having syslinux 2.02 or higher installed | 136 | # These require being root or having syslinux 2.02 or higher installed |
141 | fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | 137 | fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf |
142 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 | 138 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 |
143 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync | 139 | MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync |
144 | syslinux $(obj)/fdimage ; sync | 140 | syslinux $(obj)/fdimage ; sync |
@@ -147,9 +143,9 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf | |||
147 | if [ -f '$(FDINITRD)' ] ; then \ | 143 | if [ -f '$(FDINITRD)' ] ; then \ |
148 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ | 144 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ |
149 | fi | 145 | fi |
150 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync | 146 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux ; sync |
151 | 147 | ||
152 | fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | 148 | fdimage288: $(obj)/bzImage $(obj)/mtools.conf |
153 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 | 149 | dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 |
154 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync | 150 | MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync |
155 | syslinux $(obj)/fdimage ; sync | 151 | syslinux $(obj)/fdimage ; sync |
@@ -158,9 +154,9 @@ fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf | |||
158 | if [ -f '$(FDINITRD)' ] ; then \ | 154 | if [ -f '$(FDINITRD)' ] ; then \ |
159 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ | 155 | MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ |
160 | fi | 156 | fi |
161 | MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync | 157 | MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux ; sync |
162 | 158 | ||
163 | isoimage: $(BOOTIMAGE) | 159 | isoimage: $(obj)/bzImage |
164 | -rm -rf $(obj)/isoimage | 160 | -rm -rf $(obj)/isoimage |
165 | mkdir $(obj)/isoimage | 161 | mkdir $(obj)/isoimage |
166 | for i in lib lib64 share end ; do \ | 162 | for i in lib lib64 share end ; do \ |
@@ -170,7 +166,7 @@ isoimage: $(BOOTIMAGE) | |||
170 | fi ; \ | 166 | fi ; \ |
171 | if [ $$i = end ] ; then exit 1 ; fi ; \ | 167 | if [ $$i = end ] ; then exit 1 ; fi ; \ |
172 | done | 168 | done |
173 | cp $(BOOTIMAGE) $(obj)/isoimage/linux | 169 | cp $(obj)/bzImage $(obj)/isoimage/linux |
174 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg | 170 | echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg |
175 | if [ -f '$(FDINITRD)' ] ; then \ | 171 | if [ -f '$(FDINITRD)' ] ; then \ |
176 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ | 172 | cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ |
@@ -181,12 +177,13 @@ isoimage: $(BOOTIMAGE) | |||
181 | isohybrid $(obj)/image.iso 2>/dev/null || true | 177 | isohybrid $(obj)/image.iso 2>/dev/null || true |
182 | rm -rf $(obj)/isoimage | 178 | rm -rf $(obj)/isoimage |
183 | 179 | ||
184 | zlilo: $(BOOTIMAGE) | 180 | bzlilo: $(obj)/bzImage |
185 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi | 181 | if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi |
186 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi | 182 | if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi |
187 | cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz | 183 | cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz |
188 | cp System.map $(INSTALL_PATH)/ | 184 | cp System.map $(INSTALL_PATH)/ |
189 | if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi | 185 | if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi |
190 | 186 | ||
191 | install: | 187 | install: |
192 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" | 188 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ |
189 | System.map "$(INSTALL_PATH)" | ||