wok-tiny rev 119

linux: add jsclipboard.ko
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 20 08:29:50 2016 +0200 (2016-07-20)
parents cda63f13344c
children cac560977fad
files gpxe/receipt hardware-ibm-6272/receipt jslinux-config/receipt linux/receipt linux/stuff/jsclipboard.u module-vfat/receipt telnet-config/receipt
line diff
     1.1 --- a/gpxe/receipt	Sat May 21 17:52:27 2016 +0200
     1.2 +++ b/gpxe/receipt	Wed Jul 20 08:29:50 2016 +0200
     1.3 @@ -3,7 +3,7 @@
     1.4  PACKAGE="gpxe"
     1.5  VERSION="0.9.3"
     1.6  CATEGORY="network"
     1.7 -SHORT_DESC="Forward PXE to SliTaz Web Boot"
     1.8 +SHORT_DESC="Forward PXE to Slitaz Web Boot"
     1.9  MAINTAINER="pascal.bellard@slitaz.org"
    1.10  LICENSE="GPL"
    1.11  WEB_SITE="http://boot.slitaz.org/"
     2.1 --- a/hardware-ibm-6272/receipt	Sat May 21 17:52:27 2016 +0200
     2.2 +++ b/hardware-ibm-6272/receipt	Wed Jul 20 08:29:50 2016 +0200
     2.3 @@ -3,7 +3,7 @@
     2.4  PACKAGE="hardware-ibm-6272"
     2.5  VERSION="1.0"
     2.6  CATEGORY="meta"
     2.7 -GROUP="system"
     2.8 +GROUP="ststem"
     2.9  MAINTAINER="devel@slitaz.org"
    2.10  LICENSE="BSD"
    2.11  SHORT_DESC="IBM 300GL 6272/6282 (P75-233 ISA/PCI/USB/ETH desktop) hardware support"
    2.12 @@ -23,7 +23,7 @@
    2.13  	chmod +x $1/etc/init.d/pnp.sh
    2.14  	cat >> $1/etc/init.d/pnp.sh <<EOT
    2.15  
    2.16 -grep -qs CS8920 /var/log/dmesg.log &&
    2.17 +dmesg | grep -qs CS8920 &&
    2.18  echo -n "Switching on cs89x0 isa pnp ethernet card " &&
    2.19  pnpdump > /etc/isapnp.conf.base
    2.20  for io in \$(seq 360 -10 250); do for irq in IRQ_CS89X0_LIST; do
    2.21 @@ -43,6 +43,8 @@
    2.22  done ; done > /dev/null 2>&1 && rm -f /etc/isapnp.conf.base
    2.23  status
    2.24  EOT
    2.25 +	grep -q '^# CONFIG_PRINTK is not set' $1/boot/config &&
    2.26 +	sed -i '/CS8920/d' $1/etc/init.d/pnp.sh
    2.27  	grep pnp.sh $1/etc/rcS.conf ||
    2.28  	sed -i 's/EARLY_RUN_SCRIPTS="/&pnp.sh /' $1/etc/rcS.conf
    2.29  	list=""
     3.1 --- a/jslinux-config/receipt	Sat May 21 17:52:27 2016 +0200
     3.2 +++ b/jslinux-config/receipt	Wed Jul 20 08:29:50 2016 +0200
     3.3 @@ -1,17 +1,36 @@
     3.4  # SliTaz package receipt.
     3.5  
     3.6  PACKAGE="jslinux-config"
     3.7 -VERSION="1.0"
     3.8 -CATEGORY="system"
     3.9 +VERSION="2.6.14"
    3.10 +CATEGORY="base-system"
    3.11 +GROUP="driver"
    3.12  SHORT_DESC="Tiny SliTaz configuration files for jslinux"
    3.13  MAINTAINER="pascal.bellard@slitaz.org"
    3.14  LICENSE="BSD"
    3.15  WEB_SITE="http://tiny.slitaz.org/"
    3.16  DEPENDS="custom-console"
    3.17 +WANTED="linux"
    3.18  
    3.19  # Rules to gen a SliTaz package suitable for Tazpkg.
    3.20  genpkg_rules()
    3.21  {
    3.22 -	mkdir -p $fs/dev
    3.23 +	local path
    3.24 +	export src=$WOK/$WANTED/source/linux-$VERSION
    3.25 +	export _pkg=$WOK/$WANTED/install
    3.26 +	path=lib/modules/$(ls $_pkg/lib/modules)/kernel
    3.27 +	mkdir -p $fs/$path $fs/dev
    3.28 +	$src/slitaz/list_modules.sh drivers/char/jsclipboard.ko | while read module; do
    3.29 +		dir=$path/$(dirname $module)
    3.30 +		[ -d $fs/$dir ] || mkdir -p $fs/$dir
    3.31 +		cp -a $_pkg/$path/$module $fs/$dir
    3.32 +	done
    3.33  	mknod -m 660 $fs/dev/clipboard c 10 231
    3.34  }
    3.35 +
    3.36 +# Post install/remove commands for Tazpkg.
    3.37 +post_install()
    3.38 +{
    3.39 +	for i in jsclipboard ; do
    3.40 +		grep -qs ^$i$ $1/modules || echo $i >> $1/modules
    3.41 +	done
    3.42 +}
     4.1 --- a/linux/receipt	Sat May 21 17:52:27 2016 +0200
     4.2 +++ b/linux/receipt	Wed Jul 20 08:29:50 2016 +0200
     4.3 @@ -15,7 +15,8 @@
     4.4  AUTO_SELECTION="always"
     4.5  
     4.6  DEPENDS=""
     4.7 -BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2 advancecomp"
     4.8 +BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2"
     4.9 +BUILD_SUGGESTED="advancecomp zopfli"
    4.10  
    4.11  case "$TARGET" in
    4.12  	i486) SUGGESTED="memtest ipxe";;  # bundle may install a boot menu
    4.13 @@ -28,6 +29,7 @@
    4.14  	wget --no-check-certificate -O $SRC/$(basename $PATCH) $PATCH
    4.15  	bzcat $SRC/$(basename $PATCH) | patch -p1
    4.16  	patch -p0 < $stuff/linux-2.6.14-unpack.u
    4.17 +	patch -p0 < $stuff/jsclipboard.u
    4.18  	sed -i 's|\([>\.]\)val|\1u.val|;s|\([>\.]\)next|\1u.next|;216s|};|} u;|' lib/inflate.c
    4.19  	sed '/DEBUG/,/* kstrdup/d' < mm/slab.c > mm/kstrdup.c
    4.20  	echo 'obj-y += kstrdup.o' >> mm/Makefile
    4.21 @@ -35,6 +37,8 @@
    4.22  	sed -i 's/O_CREAT/&|O_TRUNC/' init/initramfs.c
    4.23  	which advdef 2> /dev/null &&
    4.24  	sed -i 's|gzip)|&\n	advdef -z4 $@|' usr/Makefile arch/i386/boot/compressed/Makefile
    4.25 +	which zopfli 2> /dev/null &&
    4.26 +	sed -i 's|gzip -f -9 <|time zopfli --i100 -c|' scripts/Makefile.lib
    4.27  
    4.28  	if [ ! -s $WOK/busybox/source/busybox*/rootfs.cpio ]; then
    4.29  		tazwok cook busybox
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/linux/stuff/jsclipboard.u	Wed Jul 20 08:29:50 2016 +0200
     5.3 @@ -0,0 +1,212 @@
     5.4 +--- drivers/char/Kconfig
     5.5 ++++ drivers/char/Kconfig
     5.6 +@@ -1001,5 +1001,11 @@
     5.7 + 
     5.8 + source "drivers/char/tpm/Kconfig"
     5.9 + 
    5.10 ++config JSCLIPBOARD
    5.11 ++	tristate "Javascript clipboard support (JS/Linux device)"
    5.12 ++	default n
    5.13 ++	help
    5.14 ++	  Javascript clipboard support for JS/Linux
    5.15 ++
    5.16 + endmenu
    5.17 + 
    5.18 +--- drivers/char/Makefile
    5.19 ++++ drivers/char/Makefile
    5.20 +@@ -92,6 +92,7 @@
    5.21 + 
    5.22 + obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o
    5.23 + obj-$(CONFIG_TCG_TPM) += tpm/
    5.24 ++obj-$(CONFIG_JSCLIPBOARD) += jsclipboard.o
    5.25 + # Files generated that shall be removed upon make clean
    5.26 + clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c
    5.27 + 
    5.28 +--- drivers/char/jsclipboard.c
    5.29 ++++ drivers/char/jsclipboard.c
    5.30 +@@ -0,0 +1,174 @@
    5.31 ++/* 
    5.32 ++   JS clipboard support for JS/Linux
    5.33 ++   (c) 2011 Fabrice Bellard
    5.34 ++*/
    5.35 ++#include <linux/interrupt.h>
    5.36 ++#include <linux/module.h>
    5.37 ++#include <linux/kernel.h>
    5.38 ++#include <linux/types.h>
    5.39 ++#include <linux/miscdevice.h>
    5.40 ++#include <linux/ioport.h>
    5.41 ++#include <linux/fcntl.h>
    5.42 ++#include <linux/mc146818rtc.h>
    5.43 ++#include <linux/init.h>
    5.44 ++#include <linux/poll.h>
    5.45 ++#include <linux/proc_fs.h>
    5.46 ++#include <linux/seq_file.h>
    5.47 ++#include <linux/spinlock.h>
    5.48 ++#include <linux/sysctl.h>
    5.49 ++#include <linux/wait.h>
    5.50 ++#include <linux/bcd.h>
    5.51 ++#include <linux/delay.h>
    5.52 ++
    5.53 ++#include <asm/current.h>
    5.54 ++#include <asm/uaccess.h>
    5.55 ++#include <asm/system.h>
    5.56 ++
    5.57 ++#define JSCLIPBOARD_MINOR 231
    5.58 ++
    5.59 ++#define JSCLIPBOARD_PORT 0x3c0
    5.60 ++
    5.61 ++static int io_port = JSCLIPBOARD_PORT;
    5.62 ++static int minor = JSCLIPBOARD_MINOR;
    5.63 ++static struct semaphore open_sem;
    5.64 ++static int need_cache_sync;
    5.65 ++
    5.66 ++module_param(io_port, int, 0);
    5.67 ++MODULE_PARM_DESC(io_port, "IO port");
    5.68 ++
    5.69 ++module_param(minor, int, 0);
    5.70 ++MODULE_PARM_DESC(minor, "minor number");
    5.71 ++
    5.72 ++static ssize_t jsclipboard_read(struct file *file, char __user *buf,
    5.73 ++                                size_t count1, loff_t *ppos)
    5.74 ++{
    5.75 ++        uint32_t pos, total_length, v;
    5.76 ++        uint8_t b;
    5.77 ++        size_t count, l;
    5.78 ++        
    5.79 ++        /* set read position */
    5.80 ++        pos = *ppos;
    5.81 ++        outl(pos, io_port + 4);
    5.82 ++        total_length = inl(io_port + 0);
    5.83 ++        
    5.84 ++        if (!access_ok(VERIFY_WRITE, buf, count1))
    5.85 ++                return -EFAULT;
    5.86 ++        
    5.87 ++        if (pos < total_length) 
    5.88 ++                l = total_length - pos;
    5.89 ++        else
    5.90 ++                l = 0;
    5.91 ++        if (count1 > l)
    5.92 ++                count1 = l;
    5.93 ++        count = count1;
    5.94 ++        while (count >= 4) {
    5.95 ++                v = inl(io_port + 8);
    5.96 ++                if (__put_user(v, (uint32_t *)buf))
    5.97 ++                        return -EFAULT;
    5.98 ++                buf += 4;
    5.99 ++                count -= 4;
   5.100 ++        }
   5.101 ++        
   5.102 ++        while (count != 0) {
   5.103 ++                b = inb(io_port + 8);
   5.104 ++                if (__put_user(b, buf))
   5.105 ++                        return -EFAULT;
   5.106 ++                buf++;
   5.107 ++                count--;
   5.108 ++        }
   5.109 ++
   5.110 ++        *ppos = pos + count1;
   5.111 ++
   5.112 ++        return count1;
   5.113 ++}
   5.114 ++
   5.115 ++static ssize_t jsclipboard_write(struct file *file, const char *buf, 
   5.116 ++                                 size_t count1, loff_t *ppos)
   5.117 ++{
   5.118 ++        size_t count;
   5.119 ++        uint8_t b;
   5.120 ++        uint32_t v;
   5.121 ++
   5.122 ++        if (!access_ok(VERIFY_READ, buf, count1))
   5.123 ++                return -EFAULT;
   5.124 ++        if (*ppos == 0) {
   5.125 ++                /* flush clipboard */
   5.126 ++                outl(0, io_port);
   5.127 ++        }
   5.128 ++
   5.129 ++        need_cache_sync = 1;
   5.130 ++
   5.131 ++        count = count1;
   5.132 ++        while (count >= 4) {
   5.133 ++                if (__get_user(v, (uint32_t *)buf))
   5.134 ++                        return -EFAULT;
   5.135 ++                outl(v, io_port + 8);
   5.136 ++                buf += 4;
   5.137 ++                count -= 4;
   5.138 ++        }
   5.139 ++
   5.140 ++        while (count != 0) {
   5.141 ++                if (__get_user(b, buf))
   5.142 ++                        return -EFAULT;
   5.143 ++                outb(b, io_port + 8);
   5.144 ++                buf++;
   5.145 ++                count--;
   5.146 ++        }
   5.147 ++        *ppos += count1;
   5.148 ++        return count1;
   5.149 ++}
   5.150 ++
   5.151 ++static int jsclipboard_open(struct inode *inode, struct file *file)
   5.152 ++{
   5.153 ++	if (down_trylock(&open_sem))
   5.154 ++		return -EBUSY;
   5.155 ++        need_cache_sync = 0;
   5.156 ++	return 0;
   5.157 ++}
   5.158 ++
   5.159 ++static int jsclipboard_release(struct inode *inode, struct file *file)
   5.160 ++{
   5.161 ++        if (need_cache_sync) {
   5.162 ++                outl(0, io_port + 12);
   5.163 ++        }
   5.164 ++	up(&open_sem);
   5.165 ++	return 0;
   5.166 ++}
   5.167 ++
   5.168 ++static const struct file_operations jsclipboard_fops = {
   5.169 ++	.owner		= THIS_MODULE,
   5.170 ++	.read		= jsclipboard_read,
   5.171 ++	.write		= jsclipboard_write,
   5.172 ++	.open		= jsclipboard_open,
   5.173 ++        .release        = jsclipboard_release,
   5.174 ++};
   5.175 ++
   5.176 ++static struct miscdevice jsclipboard_dev = {
   5.177 ++	.minor		= JSCLIPBOARD_MINOR,
   5.178 ++	.name		= "jsclipboard",
   5.179 ++	.fops		= &jsclipboard_fops,
   5.180 ++};
   5.181 ++
   5.182 ++static int __init jsclipboard_init(void)
   5.183 ++{
   5.184 ++        if (!request_region(io_port, 16, "jsclipboard")) 
   5.185 ++                return -ENODEV;
   5.186 ++	sema_init(&open_sem, 1);
   5.187 ++	if (misc_register(&jsclipboard_dev)) {
   5.188 ++                return -ENODEV;
   5.189 ++	}
   5.190 ++	printk(KERN_INFO "JS clipboard: I/O at 0x%04x\n", io_port);
   5.191 ++	return 0;
   5.192 ++}
   5.193 ++
   5.194 ++static void __exit jsclipboard_exit (void)
   5.195 ++{
   5.196 ++	misc_deregister(&jsclipboard_dev);
   5.197 ++        release_region(io_port, 16);
   5.198 ++}
   5.199 ++
   5.200 ++module_init(jsclipboard_init);
   5.201 ++module_exit(jsclipboard_exit);
   5.202 ++
   5.203 ++MODULE_AUTHOR("Fabrice Bellard");
   5.204 ++MODULE_LICENSE("GPL");
   5.205 +--- drivers/serial/8250.c
   5.206 ++++ drivers/serial/8250.c
   5.207 +@@ -68,7 +68,7 @@
   5.208 + #define DEBUG_INTR(fmt...)	do { } while (0)
   5.209 + #endif
   5.210 + 
   5.211 +-#define PASS_LIMIT	256
   5.212 ++#define PASS_LIMIT	(256 * 100)
   5.213 + 
   5.214 + /*
   5.215 +  * We default to IRQ0 for the "no irq" hack.   Some
     6.1 --- a/module-vfat/receipt	Sat May 21 17:52:27 2016 +0200
     6.2 +++ b/module-vfat/receipt	Wed Jul 20 08:29:50 2016 +0200
     6.3 @@ -19,7 +19,7 @@
     6.4  	export _pkg=$WOK/$WANTED/install
     6.5  	path=lib/modules/$(ls $_pkg/lib/modules)/kernel
     6.6  	mkdir -p $fs/$path $fs/etc
     6.7 -	$src/slitaz/list_modules.sh fs/${PACKAGE#*-} | while read module; do
     6.8 +	$src/slitaz/list_modules.sh fs/${PACKAGE#*-} fs/nls | while read module; do
     6.9  		dir=$path/$(dirname $module)
    6.10  		[ -d $fs/$dir ] || mkdir -p $fs/$dir
    6.11  		cp -a $_pkg/$path/$module $fs/$dir
    6.12 @@ -30,7 +30,7 @@
    6.13  # Post install/remove commands for Tazpkg.
    6.14  post_install()
    6.15  {
    6.16 -	for i in nls_base fat vfat ; do
    6.17 +	for i in $(cd $1/lib/modules/*/kernel/fs/nls; ls nls*) fat vfat ; do
    6.18  		grep -qs ^$i$ $1/modules || echo $i >> $1/modules
    6.19  	done
    6.20  	for i in vfat fat msdos ; do
     7.1 --- a/telnet-config/receipt	Sat May 21 17:52:27 2016 +0200
     7.2 +++ b/telnet-config/receipt	Wed Jul 20 08:29:50 2016 +0200
     7.3 @@ -2,7 +2,8 @@
     7.4  
     7.5  PACKAGE="telnet-config"
     7.6  VERSION="1.0"
     7.7 -CATEGORY="network"
     7.8 +CATEGORY="meta"
     7.9 +GROUP="network"
    7.10  SHORT_DESC="Enable Telnet server"
    7.11  MAINTAINER="pascal.bellard@slitaz.org"
    7.12  LICENSE="BSD"
    7.13 @@ -19,6 +20,7 @@
    7.14  {
    7.15  	grep -q inetd $1/etc/rcS.conf ||
    7.16  	sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
    7.17 +	sed -i '/#telnet/d' $1/etc/inetd.conf
    7.18  	grep -q telnetd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
    7.19  telnet	stream	tcp	nowait	root	telnetd	telnetd -i
    7.20  EOT