wok-tiny view gpxe/receipt @ rev 86

Add lpd-config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 21 19:04:10 2012 +0200 (2012-08-21)
parents 44490bf52c19
children a6d2ddc65590
line source
1 # SliTaz package receipt.
3 PACKAGE="gpxe"
4 VERSION="0.9.3"
5 CATEGORY="network"
6 SHORT_DESC="Forward PXE to Slitaz Web Boot"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://boot.slitaz.org/"
9 DEPENDS="base-tiny udhcpd-config"
10 CONFIG_FILES="/etc/rcS.conf /etc/udhcpd.conf /etc/inetd.conf"
12 # Rules to configure and make the package.
13 compile_rules()
14 {
15 while read pkg file ; do
16 if [ ! -s $pkg*/fs$file ]; then
17 tazpkg get $pkg
18 tazpkg extract $pkg*.tazpkg
19 fi
20 mkdir -p fs$(dirname $file)
21 mv $pkg*/fs$file fs$(dirname $file) || return 1
22 done << EOT
23 gpxe-pxe /usr/share/boot/gpxe.pxe
24 EOT
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 cp -a fs/. $fs
31 }
33 post_install()
34 {
35 [ -n "$URLS" ] && \
36 echo "$URLS" | dos2unix | sed 's/$/,/' | cat - /dev/null | \
37 dd of=$1/usr/share/boot/gpxe.pxe bs=1 seek=5 count=256 2> /dev/null
38 grep -q inetd $1/etc/rcS.conf ||
39 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
40 grep -q udhcpd $1/etc/rcS.conf ||
41 sed -i 's/^RUN_DAEMONS="/&udhcpd /' $1/etc/rcS.conf
42 grep -q tftpd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
43 tftp dgram udp wait root /usr/bin/tftpd /usr/bin/tftpd -r /usr/share/boot
44 EOT
45 cat >> $1/etc/udhcpd.conf <<EOT
46 opt bootfile gpxe.pxe
47 EOT
48 }
50 config_form()
51 {
52 [ -n "$URLS" ] ||
53 URLS="$(dd if=$1/usr/share/boot/gpxe.pxe bs=1 skip=5 count=256 2> /dev/null | \
54 strings | sed s'/,/\n/g')"
55 cat <<EOT
56 Boot url list :
57 <textarea name="URLS" cols="60" rows="5" wrap="off">
58 $URLS
59 </textarea>
60 EOT
61 }