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