#! /bin/sh -e
## netboot.dpatch by Peter De Schrijver <p2@mind.be>
##
## DP: patches to enable booting via tftp

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"

if [ $# -lt 1 ]; then
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
fi

case "$1" in
	-patch) patch $patch_opts -p1 < $0;;
	-unpatch) patch $patch_opts -p1 -R < $0;;
	*)
		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
		exit 1;;
esac

exit 0
@DPATCH@

diff -wruN sibyl-2.4.2/loader/Makefile sibyl-2.4.2.my/loader/Makefile
--- sibyl-2.4.2/loader/Makefile	2004-07-25 22:37:59.000000000 +0200
+++ sibyl-2.4.2.my/loader/Makefile	2004-07-25 21:57:59.000000000 +0200
@@ -43,21 +43,21 @@
 CPPFLAGS += -I. -Ilib/c -Ilib/net -Ilib/cfe \
 	-DVERSION_MAJOR=$(VERSION_MAJOR) \
 	-DVERSION_MINOR=$(VERSION_MINOR) \
-	-DVERSION_MINUTE=$(VERSION_MINUTE)
+	-DVERSION_MINUTE=$(VERSION_MINUTE) \
+	-DCONFIG_NETWORK
+
 LDFLAGS  += -Llib/net -Llib/c -Llib/cfe
 
 OBJCOPY = objcopy
 OBJDUMP = objdump
 
 # all objects built in this directory 
-OBJS = init.o main.o malloc.o stringops.o getfile.o parse_config.o port.o
+OBJS = init.o main.o malloc.o stringops.o getfile.o parse_config.o port.o tftp_fileops.o
 
 ifeq ($(strip ${DISK_SUPPORT}),1)
 OBJS += partition.o ext2_fileops.o
 CPPFLAGS += -DCONFIG_BLOCKDEV -I/usr/include/ext2fs
 LDFLAGS += -lext2fs -lstandalone -lnet -lcfe $$($(CC) -print-libgcc-file-name)
-else
-OBJS += tftp_fileops.o
 endif
 
 .PHONY: disk
