2 # arch/x86_64/boot/Makefile
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
8 # Copyright (C) 1994 by Linus Torvalds
10 # 2007 by Linus Torvalds
12 # 20070816 Kevin Pedretti <ktpedre@sandia.gov>
13 # Modifications for Kitten. Remove unneeded stuff.
16 # ROOT_DEV specifies the default root-device when making the image.
17 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
18 # the default of FLOPPY is used by 'build'.
22 targets := vmlwk.bin bootsect bootsect.o \
27 hostprogs-y := tools/build
28 HOST_EXTRACFLAGS += $(LWKINCLUDE)
29 subdir- := compressed/ #Let make clean descend in compressed/
30 # ---------------------------------------------------------------------------
32 $(obj)/bzImage: IMAGE_OFFSET := 0x100000
33 $(obj)/bzImage: EXTRA_AFLAGS := -traditional -D__BIG_KERNEL__
34 $(obj)/bzImage: BUILDFLAGS := -b
36 quiet_cmd_image = BUILD $@
37 cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
38 $(obj)/vmlwk.bin $(ROOT_DEV) > $@
40 $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
41 $(obj)/vmlwk.bin $(obj)/tools/build FORCE
42 $(call if_changed,image)
43 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
45 $(obj)/vmlwk.bin: $(obj)/compressed/vmlwk FORCE
46 $(call if_changed,objcopy)
48 LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
49 LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
51 $(obj)/setup $(obj)/bootsect: %: %.o FORCE
54 $(obj)/compressed/vmlwk: FORCE
55 $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
57 # Set this if you want to pass append arguments to the isoimage kernel
58 FDARGS = console=serial debug_mptable=1 init_argv="one two three" init_envp="one=1 two=2 three=3"
59 # Set this if you want an initrd included with the isoimage kernel
61 FDINITRD = /opt/vmm-tools/isos/puppy.iso
66 image_cmdline = default lwk $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
68 # This requires being root or having syslinux 2.02 or higher installed
69 isoimage: $(BOOTIMAGE) $(FDINITRD)
70 -rm -rf $(obj)/isoimage
72 for i in lib lib64 share end ; do \
73 if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
74 cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
77 if [ $$i = end ] ; then exit 1 ; fi ; \
79 cp $(BOOTIMAGE) $(obj)/isoimage/lwk
80 echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
81 if [ -f '$(FDINITRD)' ] ; then \
82 cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
84 mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
85 -no-emul-boot -boot-load-size 4 -boot-info-table \
87 rm -rf $(obj)/isoimage