wok-tiny view module-sg/receipt @ rev 143

Add some SCSI modules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 31 18:58:32 2019 +0200 (2019-08-31)
parents
children a28c45a86936
line source
1 # SliTaz package receipt.
3 PACKED_SIZE="60.0K"
4 UNPACKED_SIZE="176.0K"
5 PACKAGE="module-sg"
6 VERSION="2.6.14"
7 CATEGORY="base-system"
8 GROUP="driver,scsi"
9 SHORT_DESC="Kernel module for the SCSI generic (sg) driver"
10 MAINTAINER="pascal.bellard@slitaz.org"
11 LICENSE="GPL"
12 WEB_SITE="http://tiny.slitaz.org/"
13 WANTED="linux"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 local path
19 export src=$WOK/$WANTED/source/linux-$VERSION
20 export _pkg=$WOK/$WANTED/install
21 path=lib/modules/$(ls $_pkg/lib/modules)/kernel
22 mkdir -p $fs/$path
23 $src/slitaz/list_modules.sh drivers/scsi/${PACKAGE#*-}* | while read module; do
24 dir=$path/$(dirname $module)
25 [ -d $fs/$dir ] || mkdir -p $fs/$dir
26 cp -a $_pkg/$path/$module $fs/$dir
27 done
28 }
30 # Post install/remove commands for Tazpkg.
31 post_install()
32 {
33 if !grep -qs "^${PACKAGE#*-}|" $1/modules; then
34 echo -n "${PACKAGE#*-}|allow_dio=" >> $1/modules
35 echo -n "$([ "$SG_ALLOW_DIO" ] && echo 1 || echo 0)|" >> $1/modules
36 echo "def_reserved_size=${SG_DEFRESSZ:--1}" >> $1/modules
37 fi
38 }
40 config_form()
41 {
42 cat <<EOT
43 <h4>SCSI generic driver</h4>
44 <table>
45 <tr>
46 <td>Size of buffer reserved for each fd</td>
47 <td><input type="text" name="SG_DEFRESSZ" ${SG_DEFRESSZ:+value="$SG_DEFRESSZ" }/></td>
48 </tr>
49 <tr>
50 <td><input type="checkbox" name="SG_ALLOW_DIO" ${SG_ALLOW_DIO:+checked=checked }> allow direct I/O
51 </td><td></td>
52 </tr>
53 </table>
54 EOT
55 }