さて。
gin:/# tar cf - lib/modules |(cd /usr/local/buffalo; tar xvf -) lib/modules/ lib/modules/usblp.ko : : lib/modules/mv7dxu2_0.ko lib/modules/mv7dxu2_1.ko lib/modules/mv7dxu2_2.ko lib/modules/mv7dxu2_3.ko lib/modules/mv7dxu2_d.ko lib/modules/averusb.ko lib/modules/v4l1-compat.ko lib/modules/v4l2-common.ko lib/modules/videodev.ko gin:/#
gin:/# chroot /usr/local/buffalo insmod "/lib/modules/usblp.ko" chroot: cannot run command `insmod': No such file or directory gin:/#insmod がない。これはオオゴトになりそうだ。
gin:/# mkdir /tmp/root gin:/# mount /dev/sdb2 /tmp/root gin:/# ls /tmp/root bin boot dev etc home lib lost+found mnt proc root sbin share tmp usr var www gin:/#/sbin/insmod をジェイルにコピーする。
gin:/tmp/root# tar cf - sbin/insmod |(cd /usr/local/buffalo/; tar xvf -) sbin/insmod gin:/tmp/root#多分、/sbin/insmod だけではあかんやろな。
gin:/tmp/root# chroot /usr/local/buffalo insmod "/lib/modules/usblp.ko" gin:/tmp/root#できた。
gin:/tmp/root# ls -l sbin/lsmod gin:/tmp/root# tar cf - sbin/lsmod |(cd /usr/local/buffalo/; tar xvf -) sbin/lsmod gin:/tmp/root#実行
gin:/tmp/root# chroot /usr/local/buffalo lsmod Opening /proc/modules: No such file or directory gin:/tmp/root# chroot /usr/local/buffalo mount /proc chroot: cannot run command `mount': No such file or directory gin:/tmp/root#はまりそう。やめとこ。
gin:/tmp/root# less /var/log/messages : : Feb 3 18:14:39 gin kernel: usbcore: registered new driver usblp Feb 3 18:14:39 gin kernel: drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver :ちゃんとロードできているみたい。
Feb 3 18:19:32 gin kernel: usb 1-1: new full speed USB device using ehci_platform and address 2 Feb 3 18:19:33 gin kernel: usb 1-1: configuration #1 chosen from 1 choice Feb 3 18:19:33 gin kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005イケそうだ。
gin:/tmp/root# cd / gin:/# umount /tmp/root gin:/#
gin:/# cd /etc/init.d/ gin:/etc/init.d# vi usblp : : gin:/etc/init.d# cat usblp #!/bin/sh case "$1" in start) chroot /usr/local/buffalo insmod "/lib/modules/usblp.ko" ;; stop) ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 gin:/etc/init.d# chmod 755 usblp gin:/etc/init.d#起動順は?
yasunari@sil:/etc$ ls rc*/*lprng* rc0.d/K20lprng rc1.d/K20lprng rc2.d/S20lprng rc3.d/S20lprng rc4.d/S20lprng rc5.d/S20lprng rc6.d/K20lprng yasunari@sil:/etc$S20lprng なので、それより早く起動が必要。
yasunari@sil:/etc$ cd rc2.d/ yasunari@sil:/etc/rc2.d$ ls README S15bind9 S20inetd S20openbsd-inetd S23ntp S90buffalodaemon S99stop-bootlogd S10sysklogd S20dhcp S20lprng S20rsync S89atd S99rc.local S11klogd S20exim4 S20makedev S20samba S89cron S99rmnologin yasunari@sil:/etc/rc2.d$S16 だな。
gin:/etc/init.d# cd ../rc2.d/ gin:/etc/rc2.d# ln -s ../init.d/usblp S16usblp gin:/etc/rc2.d# ls -l S16usblp lrwxrwxrwx 1 root root 15 Feb 3 18:37 S16usblp -> ../init.d/usblp gin:/etc/rc2.d# ./S16usblp Usage: ./S16usblp {start|stop} gin:/etc/rc2.d#他の run lebel は手抜きで省略。
さて、ここからは、 Windows 向けプリンタサーバの手順に戻る。
gin:~# apt-get install lprng Reading package lists... Done Building dependency tree... Done Suggested packages: magicfilter lprng-doc The following NEW packages will be installed: lprng 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 1891kB of archives. After unpacking 4047kB of additional disk space will be used. Get:1 http://ftp2.jp.debian.org etch/main lprng 3.8.28dfsg.1-1.1 [1891kB] Fetched 1891kB in 2s (823kB/s) Preconfiguring packages ...Start lpd (Printer Daemon) at boot? には YES と答える。
Selecting previously deselected package lprng. (Reading database ... 11886 files and directories currently installed.) Unpacking lprng (from .../lprng_3.8.28dfsg.1-1.1_arm.deb) ... preinst called with unknown argument `' Setting up lprng (3.8.28dfsg.1-1.1) ... gin:~#
gin:~# vi /etc/printcap : : gin:~# cat /etc/printcap # /etc/printcap lp:\ :sd=/var/spool/lpd/lp:\ :mx#0:\ :sh:\ :lp=/dev/usb/lp0: gin:~#
gin:~# chgrp lp /dev/usb/lp0 gin:~# chmod 666 /dev/usb/lp0 gin:~#
gin:~# /etc/init.d/lprng start Starting LPRNG printer spooler: lpd. gin:~#
gin:~# cd /etc/samba/ gin:/etc/samba# mv smb.conf smb.conf.orig gin:/etc/samba# cp smb.conf.orig smb.conf gin:/etc/samba# vi smb.conf : : gin:/etc/samba# diff -c smb.conf.orig smb.conf *** smb.conf.orig Sun Feb 3 09:52:28 2008 --- smb.conf Sun Feb 3 20:26:58 2008 *************** *** 161,168 **** # lpr(ng) printing. You may wish to override the location of the # printcap file ! ; printing = bsd ! ; printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cupsys-client package. --- 161,168 ---- # lpr(ng) printing. You may wish to override the location of the # printcap file ! printing = bsd ! printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cupsys-client package. *************** *** 267,272 **** --- 267,273 ---- public = no writable = no create mode = 0700 + use client driver = yes # Windows clients look for this share name as a source of downloadable # printer drivers gin:/etc/samba#
gin:/etc/samba# /etc/init.d/samba reload Reloading /etc/samba/smb.conf: smbd only. gin:/etc/samba#
Windows 向けプリンタサーバのページを直さなあかな。
|
← 新型 HS-DHGL にハックキット(8)Windows 向けプリンタサーバ |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 新型 HS-DHGL にハックキット(10)開発環境のインストール |