# HG changeset patch # User Pascal Bellard # Date 1468996190 -7200 # Node ID e5cfd000e4a6ebda559d672bf353c88ee1bd29ff # Parent cda63f13344cabd145b0ec6cb513183cd41aa648 linux: add jsclipboard.ko diff -r cda63f13344c -r e5cfd000e4a6 gpxe/receipt --- a/gpxe/receipt Sat May 21 17:52:27 2016 +0200 +++ b/gpxe/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -3,7 +3,7 @@ PACKAGE="gpxe" VERSION="0.9.3" CATEGORY="network" -SHORT_DESC="Forward PXE to SliTaz Web Boot" +SHORT_DESC="Forward PXE to Slitaz Web Boot" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL" WEB_SITE="http://boot.slitaz.org/" diff -r cda63f13344c -r e5cfd000e4a6 hardware-ibm-6272/receipt --- a/hardware-ibm-6272/receipt Sat May 21 17:52:27 2016 +0200 +++ b/hardware-ibm-6272/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -3,7 +3,7 @@ PACKAGE="hardware-ibm-6272" VERSION="1.0" CATEGORY="meta" -GROUP="system" +GROUP="ststem" MAINTAINER="devel@slitaz.org" LICENSE="BSD" SHORT_DESC="IBM 300GL 6272/6282 (P75-233 ISA/PCI/USB/ETH desktop) hardware support" @@ -23,7 +23,7 @@ chmod +x $1/etc/init.d/pnp.sh cat >> $1/etc/init.d/pnp.sh < /etc/isapnp.conf.base for io in \$(seq 360 -10 250); do for irq in IRQ_CS89X0_LIST; do @@ -43,6 +43,8 @@ done ; done > /dev/null 2>&1 && rm -f /etc/isapnp.conf.base status EOT + grep -q '^# CONFIG_PRINTK is not set' $1/boot/config && + sed -i '/CS8920/d' $1/etc/init.d/pnp.sh grep pnp.sh $1/etc/rcS.conf || sed -i 's/EARLY_RUN_SCRIPTS="/&pnp.sh /' $1/etc/rcS.conf list="" diff -r cda63f13344c -r e5cfd000e4a6 jslinux-config/receipt --- a/jslinux-config/receipt Sat May 21 17:52:27 2016 +0200 +++ b/jslinux-config/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -1,17 +1,36 @@ # SliTaz package receipt. PACKAGE="jslinux-config" -VERSION="1.0" -CATEGORY="system" +VERSION="2.6.14" +CATEGORY="base-system" +GROUP="driver" SHORT_DESC="Tiny SliTaz configuration files for jslinux" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" WEB_SITE="http://tiny.slitaz.org/" DEPENDS="custom-console" +WANTED="linux" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs/dev + local path + export src=$WOK/$WANTED/source/linux-$VERSION + export _pkg=$WOK/$WANTED/install + path=lib/modules/$(ls $_pkg/lib/modules)/kernel + mkdir -p $fs/$path $fs/dev + $src/slitaz/list_modules.sh drivers/char/jsclipboard.ko | while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done mknod -m 660 $fs/dev/clipboard c 10 231 } + +# Post install/remove commands for Tazpkg. +post_install() +{ + for i in jsclipboard ; do + grep -qs ^$i$ $1/modules || echo $i >> $1/modules + done +} diff -r cda63f13344c -r e5cfd000e4a6 linux/receipt --- a/linux/receipt Sat May 21 17:52:27 2016 +0200 +++ b/linux/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -15,7 +15,8 @@ AUTO_SELECTION="always" DEPENDS="" -BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2 advancecomp" +BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2" +BUILD_SUGGESTED="advancecomp zopfli" case "$TARGET" in i486) SUGGESTED="memtest ipxe";; # bundle may install a boot menu @@ -28,6 +29,7 @@ wget --no-check-certificate -O $SRC/$(basename $PATCH) $PATCH bzcat $SRC/$(basename $PATCH) | patch -p1 patch -p0 < $stuff/linux-2.6.14-unpack.u + patch -p0 < $stuff/jsclipboard.u sed -i 's|\([>\.]\)val|\1u.val|;s|\([>\.]\)next|\1u.next|;216s|};|} u;|' lib/inflate.c sed '/DEBUG/,/* kstrdup/d' < mm/slab.c > mm/kstrdup.c echo 'obj-y += kstrdup.o' >> mm/Makefile @@ -35,6 +37,8 @@ sed -i 's/O_CREAT/&|O_TRUNC/' init/initramfs.c which advdef 2> /dev/null && sed -i 's|gzip)|&\n advdef -z4 $@|' usr/Makefile arch/i386/boot/compressed/Makefile + which zopfli 2> /dev/null && + sed -i 's|gzip -f -9 <|time zopfli --i100 -c|' scripts/Makefile.lib if [ ! -s $WOK/busybox/source/busybox*/rootfs.cpio ]; then tazwok cook busybox diff -r cda63f13344c -r e5cfd000e4a6 linux/stuff/jsclipboard.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux/stuff/jsclipboard.u Wed Jul 20 08:29:50 2016 +0200 @@ -0,0 +1,212 @@ +--- drivers/char/Kconfig ++++ drivers/char/Kconfig +@@ -1001,5 +1001,11 @@ + + source "drivers/char/tpm/Kconfig" + ++config JSCLIPBOARD ++ tristate "Javascript clipboard support (JS/Linux device)" ++ default n ++ help ++ Javascript clipboard support for JS/Linux ++ + endmenu + +--- drivers/char/Makefile ++++ drivers/char/Makefile +@@ -92,6 +92,7 @@ + + obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o + obj-$(CONFIG_TCG_TPM) += tpm/ ++obj-$(CONFIG_JSCLIPBOARD) += jsclipboard.o + # Files generated that shall be removed upon make clean + clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c + +--- drivers/char/jsclipboard.c ++++ drivers/char/jsclipboard.c +@@ -0,0 +1,174 @@ ++/* ++ JS clipboard support for JS/Linux ++ (c) 2011 Fabrice Bellard ++*/ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#define JSCLIPBOARD_MINOR 231 ++ ++#define JSCLIPBOARD_PORT 0x3c0 ++ ++static int io_port = JSCLIPBOARD_PORT; ++static int minor = JSCLIPBOARD_MINOR; ++static struct semaphore open_sem; ++static int need_cache_sync; ++ ++module_param(io_port, int, 0); ++MODULE_PARM_DESC(io_port, "IO port"); ++ ++module_param(minor, int, 0); ++MODULE_PARM_DESC(minor, "minor number"); ++ ++static ssize_t jsclipboard_read(struct file *file, char __user *buf, ++ size_t count1, loff_t *ppos) ++{ ++ uint32_t pos, total_length, v; ++ uint8_t b; ++ size_t count, l; ++ ++ /* set read position */ ++ pos = *ppos; ++ outl(pos, io_port + 4); ++ total_length = inl(io_port + 0); ++ ++ if (!access_ok(VERIFY_WRITE, buf, count1)) ++ return -EFAULT; ++ ++ if (pos < total_length) ++ l = total_length - pos; ++ else ++ l = 0; ++ if (count1 > l) ++ count1 = l; ++ count = count1; ++ while (count >= 4) { ++ v = inl(io_port + 8); ++ if (__put_user(v, (uint32_t *)buf)) ++ return -EFAULT; ++ buf += 4; ++ count -= 4; ++ } ++ ++ while (count != 0) { ++ b = inb(io_port + 8); ++ if (__put_user(b, buf)) ++ return -EFAULT; ++ buf++; ++ count--; ++ } ++ ++ *ppos = pos + count1; ++ ++ return count1; ++} ++ ++static ssize_t jsclipboard_write(struct file *file, const char *buf, ++ size_t count1, loff_t *ppos) ++{ ++ size_t count; ++ uint8_t b; ++ uint32_t v; ++ ++ if (!access_ok(VERIFY_READ, buf, count1)) ++ return -EFAULT; ++ if (*ppos == 0) { ++ /* flush clipboard */ ++ outl(0, io_port); ++ } ++ ++ need_cache_sync = 1; ++ ++ count = count1; ++ while (count >= 4) { ++ if (__get_user(v, (uint32_t *)buf)) ++ return -EFAULT; ++ outl(v, io_port + 8); ++ buf += 4; ++ count -= 4; ++ } ++ ++ while (count != 0) { ++ if (__get_user(b, buf)) ++ return -EFAULT; ++ outb(b, io_port + 8); ++ buf++; ++ count--; ++ } ++ *ppos += count1; ++ return count1; ++} ++ ++static int jsclipboard_open(struct inode *inode, struct file *file) ++{ ++ if (down_trylock(&open_sem)) ++ return -EBUSY; ++ need_cache_sync = 0; ++ return 0; ++} ++ ++static int jsclipboard_release(struct inode *inode, struct file *file) ++{ ++ if (need_cache_sync) { ++ outl(0, io_port + 12); ++ } ++ up(&open_sem); ++ return 0; ++} ++ ++static const struct file_operations jsclipboard_fops = { ++ .owner = THIS_MODULE, ++ .read = jsclipboard_read, ++ .write = jsclipboard_write, ++ .open = jsclipboard_open, ++ .release = jsclipboard_release, ++}; ++ ++static struct miscdevice jsclipboard_dev = { ++ .minor = JSCLIPBOARD_MINOR, ++ .name = "jsclipboard", ++ .fops = &jsclipboard_fops, ++}; ++ ++static int __init jsclipboard_init(void) ++{ ++ if (!request_region(io_port, 16, "jsclipboard")) ++ return -ENODEV; ++ sema_init(&open_sem, 1); ++ if (misc_register(&jsclipboard_dev)) { ++ return -ENODEV; ++ } ++ printk(KERN_INFO "JS clipboard: I/O at 0x%04x\n", io_port); ++ return 0; ++} ++ ++static void __exit jsclipboard_exit (void) ++{ ++ misc_deregister(&jsclipboard_dev); ++ release_region(io_port, 16); ++} ++ ++module_init(jsclipboard_init); ++module_exit(jsclipboard_exit); ++ ++MODULE_AUTHOR("Fabrice Bellard"); ++MODULE_LICENSE("GPL"); +--- drivers/serial/8250.c ++++ drivers/serial/8250.c +@@ -68,7 +68,7 @@ + #define DEBUG_INTR(fmt...) do { } while (0) + #endif + +-#define PASS_LIMIT 256 ++#define PASS_LIMIT (256 * 100) + + /* + * We default to IRQ0 for the "no irq" hack. Some diff -r cda63f13344c -r e5cfd000e4a6 module-vfat/receipt --- a/module-vfat/receipt Sat May 21 17:52:27 2016 +0200 +++ b/module-vfat/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -19,7 +19,7 @@ export _pkg=$WOK/$WANTED/install path=lib/modules/$(ls $_pkg/lib/modules)/kernel mkdir -p $fs/$path $fs/etc - $src/slitaz/list_modules.sh fs/${PACKAGE#*-} | while read module; do + $src/slitaz/list_modules.sh fs/${PACKAGE#*-} fs/nls | while read module; do dir=$path/$(dirname $module) [ -d $fs/$dir ] || mkdir -p $fs/$dir cp -a $_pkg/$path/$module $fs/$dir @@ -30,7 +30,7 @@ # Post install/remove commands for Tazpkg. post_install() { - for i in nls_base fat vfat ; do + for i in $(cd $1/lib/modules/*/kernel/fs/nls; ls nls*) fat vfat ; do grep -qs ^$i$ $1/modules || echo $i >> $1/modules done for i in vfat fat msdos ; do diff -r cda63f13344c -r e5cfd000e4a6 telnet-config/receipt --- a/telnet-config/receipt Sat May 21 17:52:27 2016 +0200 +++ b/telnet-config/receipt Wed Jul 20 08:29:50 2016 +0200 @@ -2,7 +2,8 @@ PACKAGE="telnet-config" VERSION="1.0" -CATEGORY="network" +CATEGORY="meta" +GROUP="network" SHORT_DESC="Enable Telnet server" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" @@ -19,6 +20,7 @@ { grep -q inetd $1/etc/rcS.conf || sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf + sed -i '/#telnet/d' $1/etc/inetd.conf grep -q telnetd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <