wok-tiny view gpxe/receipt @ rev 187

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