次は LS-GL/HS-DHGL ハックキットの Windows 向けプリンタサーバ(HS-DHGL のみ)に準じて LS-HGL に Windows 向けプリンタサーバを構築する。
hackkit:~# cat /etc/init.d/usb
#!/bin/sh
case "$1" in
start)
echo on > /proc/buffalo/usb_control
chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/core/usbcore.ko
chroot /usr/local/buffalo insmod /lib/modules/usblp.ko
:
:
;;
stop)
:
:
chroot /usr/local/buffalo rmmod usblp.ko
chroot /usr/local/buffalo rmmod usbcore.ko
echo off > /proc/buffalo/usb_control
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
hackkit:~#
認識の確認のみ。
hackkit:~# tail -f /var/log/messages : : Aug 16 11:42:59 hackkit kernel: usb 1-1: new full speed USB device using ehci_platform and address 2 Aug 16 11:42:59 hackkit kernel: usb 1-1: configuration #1 chosen from 1 choice Aug 16 11:42:59 hackkit kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005
hackkit:~# 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 3s (579kB/s) Preconfiguring packages ... Package configuration lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring lprng tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x x Some people for various reasons do not want to start lpd. Refusing this option means lpd will x x not start. Unless you know why you want lpd not to start, just accept the default. x x x x Start lpd (Printer Daemon) at boot? x x x xx x x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj Selecting previously deselected package lprng. (Reading database ... 11864 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) ... hackkit:~#
hackkit:~# cat /etc/printcap
cat: /etc/printcap: No such file or directory
hackkit:~# cat > !$
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:
hackkit:~# 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:
hackkit:~#
hackkit:~# ls -ld /dev/usb/lp0 crw-rw---- 1 root root 180, 0 Mar 2 2005 /dev/usb/lp0 hackkit:~# chgrp lp /dev/usb/lp0 hackkit:~# chmod 666 /dev/usb/lp0 hackkit:~# ls -ld /dev/usb/lp0 crw-rw-rw- 1 root lp 180, 0 Mar 2 2005 /dev/usb/lp0 hackkit:~#
hackkit:~# cd /etc/samba/
hackkit:/etc/samba# mv smb.conf smb.conf_notprint
hackkit:/etc/samba# cp smb.conf_notprint smb.conf
hackkit:/etc/samba# ls -l smb.conf smb.conf_notprint
-rw-r--r-- 1 root root 10642 Aug 16 11:55 smb.conf
-rw-r--r-- 1 root root 10642 Aug 16 11:23 smb.conf_notprint
hackkit:/etc/samba# vi smb.conf
:
:
hackkit:/etc/samba# diff -c smb.conf_notprint smb.conf
*** smb.conf_notprint Sat Aug 16 11:23:42 2008
--- smb.conf Sat Aug 16 11:57:10 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
hackkit:/etc/samba#
hackkit:/etc/samba# /etc/init.d/samba reload Reloading /etc/samba/smb.conf: smbd only. hackkit:/etc/samba#
hackkit:/etc/samba# lpq Printer 'lp@localhost' - cannot open connection - No such file or directory Make sure the remote host supports the LPD protocol hackkit:/etc/samba#ん?lpd が動いていない?
hackkit:/etc/samba# /etc/init.d/lprng start Starting LPRNG printer spooler: lpd. hackkit:/etc/samba# lpq Printer: lp@hackkit Queue: 1 printable job Server: no server active Rank Owner/ID Pr/Class Job Files Size Time 1 yasunari@hackkit+220 A 220 smbprn.00000001.h3f 499185 12:01:02 hackkit:/etc/samba#プリンタがかちゃかちゃ言って、テスト印字された。
|
|
← 標準ファーム Ver.1.04 でハックキット(5)Windows 向けファイルサーバ |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ Software Design 2008/9月号 |