Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / arch / i386 / boot / Makefile
index aa7064a..e979466 100644 (file)
@@ -25,8 +25,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
 
 #RAMDISK := -DRAMDISK=512
 
-targets                := vmlinux.bin bootsect bootsect.o setup setup.o \
-                  zImage bzImage
+targets                := vmlinux.bin bootsect bootsect.o \
+                  setup setup.o zImage bzImage
 subdir-        := compressed
 
 hostprogs-y    := tools/build
@@ -48,7 +48,7 @@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
 $(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
                              $(obj)/vmlinux.bin $(obj)/tools/build FORCE
        $(call if_changed,image)
-       @echo 'Kernel: $@ is ready'
+       @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
 
 $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
        $(call if_changed,objcopy)
@@ -62,8 +62,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
 $(obj)/compressed/vmlinux: FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
 
-# Set this if you want to pass append arguments to the zdisk/fdimage kernel
+# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
 FDARGS = 
+# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
+FDINITRD =
+
+image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
 
 $(obj)/mtools.conf: $(src)/mtools.conf.in
        sed -e 's|@OBJ@|$(obj)|g' < $< > $@
@@ -72,8 +76,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
 zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
        MTOOLSRC=$(obj)/mtools.conf mformat a:                  ; sync
        syslinux /dev/fd0                                       ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux  ; sync
 
 # These require being root or having syslinux 2.02 or higher installed
@@ -81,18 +88,44 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
        MTOOLSRC=$(obj)/mtools.conf mformat v:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux  ; sync
 
 fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
        dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
        MTOOLSRC=$(obj)/mtools.conf mformat w:                  ; sync
        syslinux $(obj)/fdimage                                 ; sync
-       echo 'default linux $(FDARGS)' | \
+       echo '$(image_cmdline)' | \
                MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
+       fi
        MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux  ; sync
 
+isoimage: $(BOOTIMAGE)
+       -rm -rf $(obj)/isoimage
+       mkdir $(obj)/isoimage
+       for i in lib lib64 share end ; do \
+               if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
+                       cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
+                       break ; \
+               fi ; \
+               if [ $$i = end ] ; then exit 1 ; fi ; \
+       done
+       cp $(BOOTIMAGE) $(obj)/isoimage/linux
+       echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
+       if [ -f '$(FDINITRD)' ] ; then \
+               cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
+       fi
+       mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
+               -no-emul-boot -boot-load-size 4 -boot-info-table \
+               $(obj)/isoimage
+       rm -rf $(obj)/isoimage
+
 zlilo: $(BOOTIMAGE)
        if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
        if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
@@ -100,5 +133,5 @@ zlilo: $(BOOTIMAGE)
        cp System.map $(INSTALL_PATH)/
        if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
 
-install: $(BOOTIMAGE)
-       sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
+install:
+       sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"