次はプリンタサーバ。
HS-DHGL ファームウェア 1.10 の目玉がプリンタサーバ。
ハックキットでも使えるようにする。
Jul 15 00:26:07 sil kernel: usb 1-1: new full speed USB device using ehci_platform and address 2 Jul 15 00:26:07 sil kernel: usb 1-1: configuration #1 chosen from 1 choiceプリンタと認識できていない。
insmod "/lib/modules/usblp.ko"という記述ががあった。これだ!
ロードしてみる
sil:~# chroot /mnt/buffalo/ sil:/# insmod "/lib/modules/usblp.ko" sil:/# exit exit sil:~# less /var/log/messages : : Jul 15 00:28:16 sil kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005 Jul 15 00:28:16 sil kernel: usbcore: registered new driver usblp Jul 15 00:28:16 sil kernel: drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver :認識したの?
Jul 15 00:30:53 sil kernel: usb 1-1: USB disconnect, address 3 Jul 15 00:30:53 sil kernel: drivers/usb/class/usblp.c: usblp0: removed刺すと
Jul 15 00:31:01 sil kernel: usb 1-1: new full speed USB device using ehci_platform and address 4 Jul 15 00:31:01 sil kernel: usb 1-1: configuration #1 chosen from 1 choice Jul 15 00:31:01 sil kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005ちゃんと認識できているようだ。
sil:/etc/init.d# diff -c buffalodaemon.orig buffalodaemon
*** buffalodaemon.orig 2007-07-01 03:38:57.785866000 +0900
--- buffalodaemon 2007-07-15 00:34:07.381772735 +0900
***************
*** 3,8 ****
--- 3,9 ----
case "$1" in
start)
chroot /usr/local/buffalo mount /proc
+ chroot /usr/local/buffalo insmod "/lib/modules/usblp.ko"
for prog in httpd.sh pcastd.sh epg.sh clientUtil_servd.sh ltbootd.sh
do
sil:/etc/init.d#
sil:~# LANG=ja_JP.EUC-JP sil:~# export LANG sil:~# apt-get install lprng パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています... 完了 提案パッケージ: magicfilter lprng-doc 以下のパッケージが新たにインストールされます: lprng アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。 1891kB のアーカイブを取得する必要があります。 展開後に追加で 4047kB のディスク容量が消費されます。 取得:1 http://ftp2.jp.debian.org etch/main lprng 3.8.28dfsg.1-1.1 [1891kB] 1891kB を 1s で取得しました (966kB/s) :「システム起動時に lpd (プリンタデーモン) を立ち上げますか?」には 「はい」と答えた。
未選択パッケージ lprng を選択しています。 (データベースを読み込んでいます ... 現在 11776 個のファイルとディレクトリがインストールされています。) (.../lprng_3.8.28dfsg.1-1.1_arm.deb から) lprng を展開しています... preinst called with unknown argument `' lprng (3.8.28dfsg.1-1.1) を設定しています ... sil:~#
sil:~# ls -l /etc/printcap ls: /etc/printcap: そのようなファイルやディレクトリはありません sil:~#ないので、HD-HLAN からコピーする。
sil:~# cd /etc sil:/etc# ftp link Connected to link.yamasita.jp. 220 ProFTPD 1.2.10rc1 Server (ProFTPD Default Installation) [link] Name (link:yasunari): 331 Password required for yasunari. Password: 230 User yasunari logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /etc 250 CWD command successful ftp> get printcap local: printcap remote: printcap 200 PORT command successful 150 Opening BINARY mode data connection for printcap (354 bytes) 226 Transfer complete. 354 bytes received in 0.00 secs (639.0 kB/s) ftp> bye 221 Goodbye. sil:/etc#試しに標準ファームの printcap も見てみた。
sil:/etc# cd /mnt/buffalo/etc
sil:/mnt/buffalo/etc# cat printcap
lp:\
:ml=0:\
:mx=0:\
:sd=/mnt/disk1/spool/lp:\
:sh:\
:lp=/dev/usb/lp0:
lp-ps:\
:ml=0:\
:mx=0:\
:sd=/mnt/disk1/spool/lp:\
:sh:\
:lp=/dev/usb/lp0:
sil:/mnt/buffalo/etc# cat /etc/printcap
# /etc/printcap
#
# Please don't edit this file directly unless you know what you are doing!
# Be warned that the control-panel printtool requires a very strict format!
# Look at the printcap(5) man page for more info.
#
# This file can be edited with the printtool in the control-panel.
lp:\
:sd=/var/spool/lpd/lp:\
:mx#0:\
:sh:\
:lp=/dev/usb/lp0:
sil:/mnt/buffalo/etc#
良さそう。
sil:/mnt/buffalo/etc# ls | lp request id is root@sil+991 sil:/mnt/buffalo/etc#プリンタはうんともすんとも言わない。
sil:/mnt/buffalo/etc# lpq Printer: lp@sil Queue: 1 printable job Server: pid 27001 active Unspooler: pid 27002 active Status: cannot open '/dev/usb/lp0' - '許可がありません', attempt 1, sleeping 10 at 01:06:26.806 Rank Owner/ID Pr/Class Job Files Size Time active root@sil+991 A 991 (STDIN) 741 01:06:26 sil:/mnt/buffalo/etc#許可がないと。
sil:/mnt/buffalo/etc# ls -l /mnt/buffalo/dev/usb/lp0 crw-rw-rw- 1 root lp 180, 0 2006-12-08 15:30 /mnt/buffalo/dev/usb/lp0 sil:/mnt/buffalo/etc#グループが lp, モードは 666.
sil:/mnt/buffalo/etc# ls -l /dev/usb/lp0 crw-rw---- 1 root root 180, 0 2005-03-02 04:10 /dev/usb/lp0 sil:/mnt/buffalo/etc#グループとモードが違う。
sil:/mnt/buffalo/etc# ls -l /var/spool/lpd/ 合計 4 drwx------ 2 daemon lp 4096 2007-07-15 01:07 lp sil:/mnt/buffalo/etc#グループは lp で良さそう。
sil:/mnt/buffalo/etc# chgrp lp /dev/usb/lp0 sil:/mnt/buffalo/etc# chmod 666 /dev/usb/lp0 sil:/mnt/buffalo/etc#試しに印刷してみる
sil:/mnt/buffalo/etc# lpq Printer: lp@sil Queue: no printable jobs in queue Server: no server active Status: job 'root@sil+991' saved at 01:10:27.019 Rank Owner/ID Pr/Class Job Files Size Time error root@sil+991 A 991 ERROR: too many errors sil:/mnt/buffalo/etc# lprm 991 Printer lp@sil: checking perms 'root@sil+991' dequeued 'root@sil+991' sil:/mnt/buffalo/etc# lpq Printer: lp@sil Queue: no printable jobs in queue Status: job 'root@sil+991' saved at 01:10:27.019 sil:/mnt/buffalo/etc# ls | lp request id is root@sil+15 sil:/mnt/buffalo/etc# lpq Printer: lp@sil Queue: no printable jobs in queue Server: no server active Status: job 'root@sil+15' saved at 01:13:18.952 Rank Owner/ID Pr/Class Job Files Size Time done root@sil+15 A 15 (STDIN) 741 01:13:18 sil:/mnt/buffalo/etc#何も出てこない。
sil:/etc/samba# vi smb.conf
:
:
sil:/etc/samba# diff -c smb.conf_notprint smb.conf
*** smb.conf_notprint Sun Jul 1 22:16:17 2007
--- smb.conf Sun Jul 15 01:59:45 2007
***************
*** 165,172 ****
# 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.
--- 165,172 ----
# 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.
***************
*** 271,276 ****
--- 271,277 ----
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
sil:/etc/samba#
sil:/etc/samba# /etc/init.d/samba reload
Reloading /etc/samba/smb.conf: smbd only.
sil:/etc/samba#
テスト印刷ができて、特に問題なし。
|
楽天市場
アット・ニフティストア Joshin web |
|
← OSC2007 Kyoto(1日目) |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ Re: HS-DHGL でハック de 録!!(9)iCommand |