Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. UCLIBC_VERSION = 0.9.11
  2. UCLIBC = uClibc-$(UCLIBC_VERSION)
  3. $(UCLIBC)_SOURCE = http://www.uclibc.org/downloads/$(UCLIBC).tar.bz2
  4. UCLIBC_INSTALL = $(CURDIR)/uClibc
  5. UDHCP_VERSION = 0.9.7
  6. UDHCP = udhcp-$(UDHCP_VERSION)
  7. $(UDHCP)_SOURCE = http://udhcp.busybox.net/source/$(UDHCP).tar.gz
  8. BUSYBOX_VERSION = 0.60.3
  9. BUSYBOX = busybox-$(BUSYBOX_VERSION)
  10. $(BUSYBOX)_SOURCE = http://www.busybox.net/downloads/$(BUSYBOX).tar.bz2
  11. LINUX_WLAN_VERSION = 0.1.13
  12. LINUX_WLAN = linux-wlan-ng-$(LINUX_WLAN_VERSION)
  13. $(LINUX_WLAN)_SOURCE = ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/$(LINUX_WLAN).tar.gz
  14. MKNBI_VERSION = 1.2
  15. MKNBI = mknbi-$(MKNBI_VERSION)
  16. $(MKNBI)_SOURCE = http://belnet.dl.sourceforge.net/sourceforge/etherboot/$(MKNBI).tar.gz
  17. export PATH := $(UCLIBC_INSTALL)/bin:$(PATH)
  18. all : utils initrd-skel mknbi mknbi-linux
  19. # Run "make tftpboot/initrd-kernel_module.img" to generate a suitable initrd
  20. # Run "make tftpboot/boot-kernel_module.nbi" to generate a suitable NBI
  21. # Run "make all-nbi" to generate a complete set of NBIs
  22. %.tar.bz2 :
  23. [ -d $* ] || wget $($*_SOURCE)
  24. [ -f $*.t*gz ] && ( gunzip $*.t*gz ; bzip2 -9 $*.tar ) || true
  25. UTILS = udhcpc busybox wlanctl
  26. utils : $(UTILS)
  27. clean : partlyclean
  28. rm -rf uClibc
  29. rm -rf $(UCLIBC)
  30. rm -rf tftpboot/*
  31. partlyclean :
  32. rm -rf $(UDHCP)
  33. rm -rf $(BUSYBOX)
  34. rm -rf $(LINUX_WLAN)
  35. rm -rf $(MKNBI)
  36. rm -rf initrd-skel
  37. rm -f *.img *.ird *.nbi insert-modules
  38. rm -f $(UTILS) mknbi-linux
  39. rm -f *.uClibc *.busybox *.udhcpc *.wlanctl
  40. .PHONY : all utils clean partlyclean
  41. uClibc : $(UCLIBC)
  42. rm -rf $@
  43. $(MAKE) -C $(UCLIBC) install
  44. $(UCLIBC) : $(UCLIBC).tar.bz2
  45. [ -d $@ ] || tar xvjf $<
  46. [ -f $(UCLIBC)/Config ] || perl -pe 's/^(INCLUDE_RPC).*/$$1 = true/ ;' \
  47. -e 's{^(DEVEL_PREFIX).*}{$$1 = $(UCLIBC_INSTALL)} ;' \
  48. -e 's{^(SHARED_LIB_LOADER_PATH).*}{$$1 = /lib} ;' \
  49. $(UCLIBC)/extra/Configs/Config.i386 > $(UCLIBC)/Config
  50. # Stripping out spurious CVS directories (screws up local cvs update)
  51. rm -rf `find $(UCLIBC) -name CVS`
  52. $(MAKE) -C $(UCLIBC)
  53. install -m 644 $(UCLIBC)/COPYING.LIB COPYING.uClibc
  54. udhcpc : $(UDHCP)
  55. install -m 755 -s $(UDHCP)/$@ $@
  56. $(UDHCP) : $(UDHCP).tar.bz2 uClibc
  57. [ -d $@ ] || tar xvjf $<
  58. if [ ! -f $@/.script.c.patch ]; then \
  59. patch -d $@ -b -z .orig < script.c.patch ; \
  60. touch $@/.script.c.patch ; \
  61. fi
  62. $(MAKE) LDFLAGS+=-static -C $(UDHCP)
  63. install -m 644 $(UDHCP)/AUTHORS AUTHORS.udhcpc
  64. install -m 644 $(UDHCP)/COPYING COPYING.udhcpc
  65. busybox : $(BUSYBOX)
  66. install -m 755 -s $(BUSYBOX)/$@ $@
  67. $(BUSYBOX) : $(BUSYBOX).tar.bz2 uClibc
  68. [ -d $@ ] || tar xvjf $<
  69. perl -pi.orig -e \
  70. 's/^.*(#define BB_(FEATURE_NFSMOUNT|INSMOD|PIVOT_ROOT|IFCONFIG|ROUTE)).*/$$1/' \
  71. $(BUSYBOX)/Config.h
  72. perl -pi.orig -e \
  73. 's/^(DOSTATIC).*$$/$$1 = true/' \
  74. $(BUSYBOX)/Makefile
  75. $(MAKE) -C $(BUSYBOX)
  76. install -m 644 $(BUSYBOX)/AUTHORS AUTHORS.busybox
  77. install -m 644 $(BUSYBOX)/LICENSE LICENSE.busybox
  78. wlanctl : $(LINUX_WLAN)
  79. install -m 755 -s $(LINUX_WLAN)/src/wlanctl/$@ $@
  80. $(LINUX_WLAN) : $(LINUX_WLAN).tar.bz2 uClibc linux-wlan.cfg
  81. [ -d $@ ] || tar xvjf $<
  82. cd $(LINUX_WLAN) ; ./Configure -d ../linux-wlan.cfg
  83. perl -pi.orig -e \
  84. 's/(-o wlanctl)/-static $$1/' \
  85. $(LINUX_WLAN)/src/wlanctl/Makefile
  86. $(MAKE) -C $(LINUX_WLAN)/src/wlanctl
  87. install -m 644 $(LINUX_WLAN)/COPYING COPYING.wlanctl
  88. install -m 644 $(LINUX_WLAN)/LICENSE LICENSE.wlanctl
  89. install -m 644 $(LINUX_WLAN)/THANKS THANKS.wlanctl
  90. mknbi-linux : $(MKNBI)
  91. mknbi : $(MKNBI)
  92. $(MKNBI) : $(MKNBI).tar.bz2
  93. [ -d $@ ] || tar xvjf $<
  94. if [ ! -f $@/.mknbi-encap.patch ]; then \
  95. patch -d $@ -b -z .orig < mknbi-encap.patch ; \
  96. touch $@/.mknbi-encap.patch ; \
  97. fi
  98. make -C $(MKNBI) LIBDIR=`pwd`/$(MKNBI) mknbi
  99. install -m 755 $(MKNBI)/mknbi mknbi-linux
  100. make -C $(MKNBI) clean
  101. make -C $(MKNBI)
  102. initrd-skel : $(UTILS) linuxrc udhcpc-post include-modules
  103. rm -rf $@
  104. mkdir -p $@
  105. mkdir -p $@/dev
  106. mkdir -p $@/etc
  107. mkdir -p $@/bin
  108. mkdir -p $@/lib
  109. mkdir -p $@/lib/modules
  110. mkdir -p $@/proc
  111. mkdir -p $@/sysroot
  112. ln -s bin $@/sbin
  113. install -m 755 busybox $@/bin/
  114. install -m 755 udhcpc $@/bin/
  115. install -m 755 wlanctl $@/bin/
  116. ln -s busybox $@/bin/sh
  117. ln -s busybox $@/bin/echo
  118. ln -s busybox $@/bin/mknod
  119. ln -s busybox $@/bin/chmod
  120. ln -s busybox $@/bin/insmod
  121. ln -s busybox $@/bin/ifconfig
  122. ln -s busybox $@/bin/route
  123. ln -s busybox $@/bin/mount
  124. ln -s busybox $@/bin/pivot_root
  125. ln -s busybox $@/bin/umount
  126. ln -s busybox $@/bin/[
  127. ln -s busybox $@/bin/sleep
  128. ln -s busybox $@/bin/grep
  129. install -m 755 linuxrc $@/linuxrc
  130. install -m 755 udhcpc-post $@/bin/udhcpc-post
  131. tftpboot/initrd-%.img : initrd-skel
  132. ./mkinitrd-net -l `echo $* | tr . " "`
  133. tftpboot/boot-%.nbi : tftpboot/initrd-%.img mknbi-linux
  134. ./mknbi-linux --format=nbi --target=linux /boot/vmlinuz $< > $@
  135. sudo cp $@ $(tftpbootdir)
  136. all-nbi : all
  137. ./mknbi-set -l -v
  138. ls tftpboot
  139. prefix = /usr
  140. sysconfdir = /etc
  141. bindir = $(prefix)/bin
  142. libdir = $(prefix)/lib
  143. mandir = $(prefix)/share/man
  144. docdir = $(prefix)/share/doc
  145. tftpbootdir = /var/lib/tftpboot
  146. initrdskeldir = $(prefix)/lib/mkinitrd-net/initrd-skel
  147. install :
  148. mkdir -p $(libdir)/mknbi
  149. mkdir -p $(bindir)
  150. mkdir -p $(sysconfdir)
  151. mkdir -p $(tftpbootdir)
  152. mkdir -p $(initrdskeldir)
  153. install -m 755 mkinitrd-net include-modules mknbi-set $(bindir)/
  154. cp -a initrd-skel/* $(initrdskeldir)/
  155. install -m 644 mknbi-set.conf dhcpd.conf.etherboot.include $(sysconfdir)
  156. make -C $(MKNBI) INSTPREFIX=$(prefix) MANDIR=$(mandir)/man1 \
  157. DOCDIR=$(docdir)/$(MKNBI) install