浏览代码

add pxe feature to dnsmasq

Waldemar Brodkorb 10 年之前
父节点
当前提交
e4444fd756

+ 6 - 1
package/dnsmasq/Makefile

@@ -5,13 +5,18 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		dnsmasq
 PKG_VERSION:=		2.69
-PKG_RELEASE:=		2
+PKG_RELEASE:=		3
 PKG_MD5SUM:=		c5a1152e646eb54db4f33f8e0deee180
 PKG_DESCR:=		lightweight DNS and DHCP server
 PKG_SECTION:=		dns
 PKG_URL:=		http://thekelleys.org.uk/dnsmasq/
 PKG_SITES:=		http://thekelleys.org.uk/dnsmasq/
 
+PKG_FLAVOURS_DNSMASQ:=	PXE
+PKGFD_PXE:=		enable PXE network boot
+PKGFS_PXE:=		pxelinux
+PKGFB_PXE:=		syslinux
+
 include ${TOPDIR}/mk/package.mk
 
 $(eval $(call PKG_template,DNSMASQ,dnsmasq,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))

+ 3 - 0
package/dnsmasq/files/dnsmasq.conf

@@ -39,3 +39,6 @@ dhcp-option=42,0.0.0.0
 # nfsroot example for a host
 #dhcp-host=00:0c:42:0a:7d:d3,10.0.0.4,net:rb532
 #dhcp-option=rb532,option:root-path,/nfsroot/rb532,nfsvers=3
+
+# pxeboot example
+dhcp-boot=pxelinux.0

+ 15 - 2
package/syslinux/Makefile

@@ -6,22 +6,27 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=		syslinux
 PKG_VERSION:=		6.02
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		1df6ff6e4a82b9d7d71a9e7cb5851a5f
+PKG_MD5SUM:=		6f275813a1b08cf852e55c0a3f8fbc78
 PKG_DESCR:=		lightweight bootloaders
 PKG_SECTION:=		boot
 HOST_BUILDDEP:=		nasm-host
 PKG_URL:=		http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project
 PKG_SITES:=		http://www.kernel.org/pub/linux/utils/boot/syslinux/
 
-PKG_CFLINE_SYSLINUX:=	depends on ADK_HOST_ONLY
+PKG_SUBPKGS:=		PXELINUX
+PKGSD_PXELINUX:=	pxelinux
 
 include $(TOPDIR)/mk/host.mk
 include $(TOPDIR)/mk/package.mk
 
 $(eval $(call HOST_template,SYSLINUX,syslinux,$(PKG_VERSION)-${PKG_RELEASE}))
+$(eval $(call PKG_template,PXELINUX,pxelinux,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
 HOST_STYLE:=		manual
 HOST_ALL_TARGET:=	bios installer
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
 
 host-build:
 	(cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
@@ -35,5 +40,13 @@ syslinux-hostinstall:
 	$(CP) $(WRKBUILD)/bios/com32/elflink/ldlinux/ldlinux.c32 \
 		$(STAGING_HOST_DIR)/usr/share/syslinux
 
+pxelinux-install:
+	$(INSTALL_DIR) ${IDIR_PXELINUX}/tftpboot/pxelinux.cfg
+	$(CP) $(WRKBUILD)/bios/core/pxelinux.0 \
+		${IDIR_PXELINUX}/tftpboot
+	$(CP) $(WRKBUILD)/bios/com32/elflink/ldlinux/ldlinux.c32 \
+		${IDIR_PXELINUX}/tftpboot
+	$(CP) ./files/default ${IDIR_PXELINUX}/tftpboot/pxelinux.cfg
+
 include ${TOPDIR}/mk/host-bottom.mk
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 4 - 0
package/syslinux/files/default

@@ -0,0 +1,4 @@
+DEFAULT x86
+PROMPT 0
+LABEL x86
+  KERNEL kernel

+ 0 - 19
package/syslinux/patches/patch-MCONFIG

@@ -1,19 +0,0 @@
---- syslinux-4.03.orig/MCONFIG	2010-10-20 21:25:38.000000000 +0200
-+++ syslinux-4.03/MCONFIG	2011-01-22 00:19:37.688658635 +0100
-@@ -39,14 +39,14 @@ UPX	 = upx
- 
- CHMOD	 = chmod
- 
--CC	 = gcc
-+CC	 ?= gcc
- gcc_ok   = $(shell tmpf=gcc_ok.$$$$.tmp; \
- 		   if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
- 			-o $$tmpf 2>/dev/null ; \
- 		   then echo '$(1)'; else echo '$(2)'; fi; \
- 		   rm -f $$tmpf)
- 
--LD	 = ld
-+LD	 ?= ld
- OBJDUMP	 = objdump
- OBJCOPY  = objcopy
- AR       = ar

+ 0 - 12
package/syslinux/patches/patch-MCONFIG_build

@@ -1,12 +0,0 @@
---- syslinux-4.03.orig/MCONFIG.build	2010-10-20 21:25:38.000000000 +0200
-+++ syslinux-4.03/MCONFIG.build	2011-01-22 00:21:14.348658474 +0100
-@@ -18,7 +18,8 @@ include $(topdir)/MCONFIG
- 
- OPTFLAGS   = -g -Os
- INCLUDES   =
--CFLAGS     = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
-+CFLAGS	  ?=
-+CFLAGS     += -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
-              $(OPTFLAGS) $(INCLUDES)
- LDFLAGS    =
- LIBS	   =

+ 0 - 27
package/syslinux/patches/patch-com32_lib_MCONFIG

@@ -1,27 +0,0 @@
---- syslinux-4.03.orig/com32/lib/MCONFIG	2010-10-20 21:25:38.000000000 +0200
-+++ syslinux-4.03/com32/lib/MCONFIG	2011-01-22 00:29:01.978658237 +0100
-@@ -11,10 +11,10 @@ GCCOPT += $(call gcc_ok,-fPIE,-fPIC)
- GCCOPT += $(call gcc_ok,-fno-exceptions,)
- GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,)
- GCCOPT += $(call gcc_ok,-fno-strict-aliasing,)
--GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
--GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
--GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
--GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
-+GCCOPT += $(call gcc_ok,-falign-functions=0,)
-+GCCOPT += $(call gcc_ok,-falign-jumps=0,)
-+GCCOPT += $(call gcc_ok,-falign-labels=0,)
-+GCCOPT += $(call gcc_ok,-falign-loops=0,)
- GCCOPT += $(call gcc_ok,-mpreferred-stack-boundary=2,)
- 
- INCLUDE	= -I.
-@@ -37,7 +37,8 @@ OPTFLAGS  = -Os -march=i386 -falign-func
- 	    -falign-labels=0 -ffast-math -fomit-frame-pointer
- WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
- 
--CFLAGS  = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
-+CFLAGS ?=
-+CFLAGS  += $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
- LDFLAGS	= -m elf32_i386
- 
- .SUFFIXES: .c .o .a .so .lo .i .S .s .ls .ss .lss