--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2426,6 +2426,17 @@ void wacom_setup_device_quirks(struct wacom *wacom)
}
/*
+ * Hack for the Bamboo One:
+ * the device presents a PAD/Touch interface as most Bamboos and even
+ * sends ghosts PAD data on it. However, later, we must disable this
+ * ghost interface, and we can not detect it unless we set it here
+ * to WACOM_DEVICETYPE_PAD or WACOM_DEVICETYPE_TOUCH.
+ */
+ if (features->type == BAMBOO_PEN &&
+ features->pktlen == WACOM_PKGLEN_BBTOUCH3)
+ features->device_type |= WACOM_DEVICETYPE_PAD;
+
+ /*
* Raw Wacom-mode pen and touch events both come from interface
* 0, whose HID descriptor has an application usage of 0xFF0D
* (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back
--
接着装个 abs,它说用来获取 ABS tree 的脚本,ABS tree 是一个树状的包含了 Arch 所有软件包源文件的目录(总之还是看 Arch Build System - Arch Wiki 吧),用它来获取构建 linux 包所需的源文件(像 PKGBUILD 之类的),然后从 abs 同步下来的 /var/abs/ 里面取出 linux 包的目录,复制到准备对 Linux 进行 魔改 打补丁的目录:
# $Id: PKGBUILD 265148 2016-04-19 06:55:26Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Maintainer: Thomas Baechler <thomas@archlinux.org>
#pkgbase=linux # Build stock -ARCH kernel
pkgbase=linux-Kafuu # Build kernel with a different name
_srcname=linux-4.5
pkgver=4.5.1
pkgrel=1
arch=('i686''x86_64')url="http://www.kernel.org/"license=('GPL2')makedepends=('xmlto''docbook-xsl''kmod''inetutils''bc')options=('!strip')source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz""https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign""https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz""https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"# the main kernel config files
'config''config.x86_64'# standard config files for mkinitcpio ramdisk
'linux.preset''change-default-console-loglevel.patch''fix-Bamboo-ONE-oops.patch')sha256sums=('a40defb401e01b37d6b8c8ad5c1bbab665be6ac6310cdeed59950c96b31a519c''SKIP''060ad091ebfa2b63d62e86beaf68c3a5d4638c506c3ac941c1825ba756e830b1''SKIP''8a8a955f015ee8342701231a63836cec0e300fd7e96d30e8696fde8a383fcdc9''8b60911aad591306336e300e27071f2d108c5016e66a04327b82ac69acbfefff''f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c''1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99''7dec753db812bd8a268e50d97cb1704b4ed097746e423720f6872ecf4a14e78c')validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886'# Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E'# Greg Kroah-Hartman
)_kernelname=${pkgbase#linux}
prepare(){cd"${srcdir}/${_srcname}"# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"# Fix System freeze with Wacom Bamboo One Tablet
# Relevant patch: https://bugzilla.redhat.com/show_bug.cgi?id=1317116#c11
patch -p1 -i "${srcdir}/fix-Bamboo-ONE-oops.patch"if["${CARCH}"="x86_64"]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
if["${_kernelname}" !=""]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
#make menuconfig # CLI menu for configuration
#make nconfig # new CLI menu for configuration
#make xconfig # X-based configuration
#make oldconfig # using old config from previous kernel version
# ... or manually edit .config
# rewrite configuration
yes "" | make config >/dev/null
}
functionhandleFile(){functionextractDataAndDoSomething(f){constcanvas=document.createElement('canvas');constctx=canvas.getContext('2d');constimg=newImage();constfr=newFileReader();img.onload=()=>{canvas.setAttribute('width',img.width);canvas.setAttribute('height',img.height);ctx.drawImage(img,0,0);// store loaded image.
storeMyImage(canvas);};fr.onload=()=>{img.src=fr.result;};fr.readAsDataURL(f);}for(consteachFileofnewArray(...this.refs.fileInput.files)){extractDataAndDoSomething(eachFile);}}
constallPos=getAllpositions(imageData.width,imageData.height);for(const[x,y,index]ofallPos()){imageData.data[index];// Red
imageData.data[index+1];// Green
imageData.data[index+2];// Blue
imageData.data[index+3];// Alpha
}
functiononMessage({data}){constimgd=newImageData(newUint8ClampedArray(data.image.buffer),data.image.width,data.image.height);// do somthing with recived imageData~
}
将前面的任务串起来,分别创建用于 CI 的一次性测试、开发中持续监视与作为后端运行的三个最终使用的任务。
// once
gulp.task('default',function(callback){runSequence(['compile','lint'],'pre-test','serve','test','end-serve',callback);});// develop
gulp.task('dev',function(callback){runSequence('compile','pre-test','serve','test','watch',callback);});// run server
gulp.task('run',function(callback){runSequence('compile','serve',callback);});
# See http://www.mongodb.org/display/DOCS/File+Based+Configuration for format details
# Run mongod --help to see a list of options
port = 27017bind_ip = 127.0.0.1httpinterface = truerest = truequiet = falsedbpath = data/mongodblogpath = data/mongod.loglogappend = true
编写服务端程序
写一个最简单的只会相应 GET 请求的程序(src/app.js),同时在启动的时候连接 MongoDB。