patch-2.4.23 linux-2.4.23/arch/alpha/boot/Makefile

Next file: linux-2.4.23/arch/alpha/boot/bootpz.c
Previous file: linux-2.4.23/arch/alpha/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/alpha/boot/Makefile linux-2.4.23/arch/alpha/boot/Makefile
@@ -7,6 +7,21 @@
 #
 # Copyright (C) 1994 by Linus Torvalds
 #
+# Creating a compressed kernel image (arch/alpha/boot/vmlinux.gz)
+# is done via:
+#
+#	make boot
+#
+# Creating a BOOTP image (arch/alpha/boot/bootpfile or bootpzfile)
+# is done via:
+#
+#	make bootpfile		# using an uncompressed kernel
+#	make bootpzfile		# using a compressed kernel
+#
+# Adding an INITRD image to a BOOTP file (arch/alpha/boot/bootpzfile)
+# can be done, e.g, via:
+#
+# INITRD=`pwd`/initrd.img make bootpzfile
 
 LINKFLAGS = -static -T bootloader.lds #-N -relax
 
@@ -17,6 +32,7 @@
 
 OBJECTS = head.o main.o
 BPOBJECTS = head.o bootp.o
+BPZOBJECTS = head.o bootpz.o misc.o
 TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
 VMLINUX = $(TOPDIR)/vmlinux
 OBJSTRIP = tools/objstrip
@@ -41,6 +57,12 @@
 	cat $(INITRD) >> bootpfile
 endif
 
+bootpzfile:	tools/bootpzh vmlinux.nh.gz
+	cat tools/bootpzh vmlinux.nh.gz > bootpzfile
+ifdef INITRD
+	cat $(INITRD) >> bootpzfile
+endif
+
 srmboot:	bootdevice bootimage
 	dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1
 	tools/mkbb $(BOOTDEV) tools/lxboot
@@ -48,16 +70,31 @@
 bootdevice:
 	@test "$(BOOTDEV)" != ""  || (echo You must specify BOOTDEV ; exit -1)
 
-vmlinux.gz: vmlinux
-	gzip -fv9 vmlinux
+vmlinux.gz: $(TOPDIR)/vmlinux
+	gzip -fv9c $(TOPDIR)/vmlinux > vmlinux.gz
+
+vmlinux.nh.gz: vmlinux.nh
+	gzip -fv9c vmlinux.nh > vmlinux.nh.gz
 
 main.o: ksize.h
 
 bootp.o: ksize.h
 
+bootpz.o: kzsize.h
+
 ksize.h: vmlinux.nh dummy
 	echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T
 ifdef INITRD
+	[ ! \( -f $(INITRD) \) ] || exit 1
+	echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
+endif
+	cmp -s $@T $@ || mv -f $@T $@
+	rm -f $@T
+
+kzsize.h: vmlinux.nh.gz dummy
+	echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T
+	echo "#define KERNEL_Z_SIZE `ls -l vmlinux.nh.gz | awk '{print $$5}'`" >> $@T
+ifdef INITRD
 	[ -f $(INITRD) ] || exit 1
 	echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
 endif
@@ -67,7 +104,7 @@
 vmlinux.nh: $(VMLINUX) $(OBJSTRIP)
 	$(OBJSTRIP) -v $(VMLINUX) vmlinux.nh
 
-vmlinux: $(TOPDIR)/vmlinux
+vmlinux: $(VMLINUX)
 	$(STRIP) -o vmlinux $(VMLINUX)
 
 tools/lxboot: $(OBJSTRIP) bootloader
@@ -79,6 +116,9 @@
 tools/bootph: bootpheader $(OBJSTRIP)
 	$(OBJSTRIP) -vb bootpheader tools/bootph
 
+tools/bootpzh: bootpzheader $(OBJSTRIP)
+	$(OBJSTRIP) -vb bootpzheader tools/bootpzh
+
 $(OBJSTRIP): $(OBJSTRIP).c
 	$(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP)
 
@@ -91,6 +131,11 @@
 bootpheader: $(BPOBJECTS)
 	$(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader
 
+bootpzheader: $(BPZOBJECTS)
+	$(LD) $(LINKFLAGS) $(BPZOBJECTS) $(LIBS) -o bootpzheader
+
+misc.o: misc.c $(TOPDIR)/lib/inflate.c
+
 clean:
 	rm -f $(TARGETS) bootloader bootimage bootpfile bootpheader
 	rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)