wok-tiny view gpxe/receipt @ rev 141

linux: pack setup (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 07 11:56:18 2018 +0200 (2018-07-07)
parents e5cfd000e4a6
children a28c45a86936
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 LICENSE="GPL"
9 WEB_SITE="http://boot.slitaz.org/"
10 DEPENDS="base-tiny udhcpd-config"
11 CONFIG_FILES="/etc/rcS.conf /etc/udhcpd.conf /etc/inetd.conf"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 while read pkg file ; do
17 if [ ! -s $pkg*/fs$file ]; then
18 tazpkg get $pkg
19 tazpkg extract $pkg*.tazpkg
20 fi
21 mkdir -p $DESTDIR$(dirname $file)
22 mv $pkg*/fs$file $DESTDIR$(dirname $file) || return 1
23 done << EOT
24 gpxe-pxe /usr/share/boot/gpxe.pxe
25 EOT
26 }
28 # Rules to gen a SliTaz package suitable for Tazpkg.
29 genpkg_rules()
30 {
31 cp -a $install/. $fs
32 }
34 post_install()
35 {
36 [ -n "$URLS" ] && \
37 echo "$URLS" | dos2unix | sed 's/$/,/' | cat - /dev/null | \
38 dd of=$1/usr/share/boot/gpxe.pxe bs=1 seek=5 count=256 2> /dev/null
39 grep -q inetd $1/etc/rcS.conf ||
40 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
41 grep -q udhcpd $1/etc/rcS.conf ||
42 sed -i 's/^RUN_DAEMONS="/&udhcpd /' $1/etc/rcS.conf
43 sed -i '/#tftp/d' $1/etc/inetd.conf
44 grep -q tftpd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
45 tftp dgram udp wait root tftpd tftpd -r /usr/share/boot
46 EOT
47 cat >> $1/etc/udhcpd.conf <<EOT
48 opt bootfile gpxe.pxe
49 EOT
50 }
52 config_form()
53 {
54 [ -n "$URLS" ] ||
55 URLS="$(dd if=$1/usr/share/boot/gpxe.pxe bs=1 skip=5 count=256 2> /dev/null | \
56 strings | sed s'/,/\n/g')"
57 cat <<EOT
58 Boot url list :
59 <textarea name="URLS" cols="60" rows="5" wrap="off">
60 ${URLS:-$(dd if=$1/usr/share/boot/gpxe.pxe bs=1 skip=5 count=256 2>/dev/null | \
61 strings | sed s'/,/\n/g')}
62 </textarea>
63 EOT
64 }