5 Installation eines Druckers
5.4 Installation des Scanners des Multi-Funktions-Druckers
5.4.4 Scanner-Treiber unter chroot mit qemu-i386-static installieren
Es wurden hier folgende Schritte durchgeführt:
-
Voraussetzung ist eine durchgelaufene Installation des Brother-Installationsvorgangs, wie beschrieben mit qemu i386 von Drucker und Scanner (auch wenn der Scanner nicht funktioniert).
-
Ein lubuntu 10.04 (long term support, CD-Version) wurde heruntergeladen. In dem Falle wurde eine USB-Installation ausgenutzt und dessen squashfs ausgelesen und in ein Verzeichnis kopiert.
-
Es wurden die benötigten Dateien von qemu unter /usr/bin, die auf dem Gastgebersystem bereits installiert waren in das gleiche Verzeichnis /usr/bin der chroot-Umgebnung kopiert.
-
Es wurde die Pfade proc, sys, pts mit der Option bind gemounted.
-
Es wurden Teile mit apt-get install beim Gastgeber nachinstalliert.
-
Es wurde die chroot-Umgebung gestartet und Teile mit apt-get install innerhalb der chroot-Umgebung nachinstalliert.
-
Es wurden die Komponenten mit allen Dateien zu dem Brother Drucker in ein Verzeichnis in der chroot-Umgebung heruntergeladen bzw. kopiert.
-
Der Installer von Brother wurde gestartet, lief erfolgreich durch und das Scannen funktioniert nun.
Achtung: Auf dem System Lubuntu 10.04 unter chroot darf kein wine installiert werden, da dabei lpr auf Grund von Abhängigkeitskonflikten deinstalliert wird und somit das System für Drucken zerschossen würde.
Zu Schritt 1:
Bei folgender Fehlerausgabe unter setzen eines Debug-Levels, wie im Beispiel angegeben, sollte es ebenfalls mit der Installation des Treibers funktionieren.
$ SANE_DEBUG_DLL=3 scanimage -L
[sanei_debug] Setting debug level of dll to 3.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.24
[dll] sane_init/read_dlld: using config directory `/etc/sane.d/dll.d'
[dll] add_backend: adding backend `hpaio'
…..
[dll] add_backend: adding backend `brother3'
[dll] load: searching backend `brother3' in `/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane'
[dll] load: dlopen()ing `/usr/lib/sane/libsane-brother3.so.1'
[dll] load: dlopen() failed (/usr/lib/sane/libsane-brother3.so.1: cannot open shared object file: No such file or directory)
[dll] load: searching backend `hpaio' in `/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane'
[dll] load: dlopen()ing `/usr/lib/sane/libsane-hpaio.so.1'
[dll] init: initializing backend `hpaio'
….
[dll] sane_get_devices: found 0 devices
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
[dll] sane_exit: calling backend `hpaio's exit function
…
Zu Schritt 2:
Erst nachsehen, wo der Stick für das Einbinden (mount) zu finden wäre.
$ lsblk
# sda1 (output on cubietruck)
Den Stick Einbinden ist auf folgende zwei Methoden möglich.
# In case there is no automount running, you do it manually.
$ pmount /dev/sda1
# USB-stick path is now /media/sda
$ sudo mount /dev/sda1 /home/username/mypath
# USB-stick path is now /home/username/mypath
# Don't forget to create path with mkdir in advance
Auf dem Stick wird die Datei lubuntu-10.04.iso (500-600MB) für das weitere vorgehen benötigt. Diese Datei (Image) wird Eingebunden. In dieser eingebundenen Datei (Image) wird die darin enthaltene Datei dateiname.squashfs (500-600MB) eingebunden oder deren Dateien in ein Verzeichnis entpackt.
$ ls * | grep lubuntu
# lubuntu-10.04.iso
$ find . | grep lubuntu
# ./lubuntu-10.04.iso
$ sudo mount -o loop lubuntu-10.04.iso /home/username/mypath_iso
# mount: /dev/loop0 is write-protected, mounting read-only
# There you need the file squashfs
$ find . | grep squash
# ./casper/filesystem.squashfs
$ sudo mount -t squashfs -o loop filesystem.squashfs /home/username/mypath_squash
# Use -t squashfs. Then error message will tell you missing squashfs support.
# Now with sudo (or as root) you can now copy all files to an folder
# Look first how much GB you need on your drive!
$ sudo du --max-depth=1 /home/username/mypath_squash
# 1392292 /home/username/mypath_squash
# That will also need 1.4GB.
# With some additional installations it increased to nearly 1.9GB.
# It is recommended that on media is 4GB reserved for this project.
$ sudo cp –recursive /home/username/mypath_squash /home/mychroots/lubuntu10p04
Zu Schritt 3:
# Look for your qemu-files on your host system.
$ find /usr/bin | grep qemu | grep i386
# /usr/bin/qemu-system-i386
# /usr/bin/qemu-i386
# /usr/bin/qemu-i386-static
# Copy these files to your chroot /usr/sys
$ sudo cp /usr/bin/qemu-i386-static /home/mychroots/lubuntu10p04/usr/bin
Als weitere Option war auch daran gedacht worden unter qemu ein ganzes i386er Linux in einer virtuellen Umgebung zu betreiben. Bei unterschiedlichen Prozessor-Architekturen ist dies aber sehr langsam. Der Versuch ein Knoppix 7.2 zu booten dauerte zwischen zwei bis drei Stunden. Es war so langsam, dass es überhaupt nicht verwendet werden konnte.
https://fedoraproject.org/wiki/Using_UEFI_with_QEMU
http://www.gtkdb.de/index_7_2213.html
wget http://wiki.qemu.org/download/efi-bios.tar.bz2
tar xjf efi-bios.tar.bz2
qemu -bios bios.bin -L . -hda /media/sda1/home/Qemu/debian_wheezy_i386_standard.qcow2
Funktioniert nicht, schwarzes Fenster.
https://wiki.ubuntu.com/UEFI/OVMF
http://www.linux-kvm.org/downloads/lersek/ovmf-whitepaper-c770f8c.txt
Etwas später wurde folgendes gefunden:
https://wiki.debian.org/QemuUserEmulation
Installing the target C libraries with dpkg-cross
The target Debian package cannot be installed directly on the host, so we need to use dpkg-cross to "cross-install" the package.
For example purposes, let's assume the target system is "armel".
Install the dpkg-cross package:
# apt-get install dpkg-cross
Now download the target libc6 package from one of the Debian mirrors and install it using dpkg-cross:
# dpkg-cross -i -a arm libc6_<version>_armel.deb
Alternatively, you can install the libc6-dev-armhf-cross package from EmDebian:
# wget http://www.emdebian.org/debian/pool/main/g/glibc/libc6-armel-cross_2.7-18lenny6_all.deb
# dpkg -i libc6-armel-cross_2.7-18lenny6_all.deb
sudo service binfmt-support start
https://wiki.gentoo.org/wiki/Crossdev_qemu-static-user-chroot
https://www.plop.at/de/ploplinux/arm/crossbuildchroot.html
Hier arm unter x86 Architektur. Benötigt wird genau die umgekehrte Richtung.
https://wiki.archlinux.org/index.php/Raspberry_Pi#QEMU_chroot
https://github.com/AlbrechtL/RPi-QEMU-x86-wine
Nicht uninteressant. Raspi mit qemu+wine-Kombination.
https://help.ubuntu.com/community/BasicChroot
https://grinux.wordpress.com/2012/02/24/setting-up-a-network-inside-a-chroot/
In der chroot-Umgebung diese Datei editieren und den Wert vom Gastgebersystem übernehmen. Dann hat diese auch Internetverbindung und ins Netzwerk, z.B. den Drucker.
$ sudo mount -o bind /proc /home/i386/mnt3/qemu_chroot_i386/proc
$ sudo mount -o bind /sys /home/i386/mnt3/qemu_chroot_i386/sys
(Für Internet reicht meist nur /proc zu mounten.)
Zur Fehlermeldung „Can not write log, openpty() failed (/dev/pts not mounted?)“ spuckte die Suchmaschine im Internet aus, dass noch etwas gemountet werden muss:
$ sudo mount -o bind /dev/pts /home/i386/mnt3/qemu_chroot_i386/dev/pts
Danach funktionierte bei lxterminal auch die Tastatureingaben.
D-Bus library appears to be incorrectly set up; failed to read ... uuid: Failed to open "/var/lib/dbus/machine-id"
Somit ggf auch /var/lib/dbus ebenfalls mit der Option bin zu mounten.
$ cat /etc/resolv.conf
$ nano /etc/resolv.conf
https://wiki.ubuntuusers.de/QEMU/
Qemu Optionen und Verwendung von squashfs.
https://fedoraproject.org/wiki/How_to_use_qemu
http://wiki.qemu.org/download/qemu-doc.html
Creating squashfs:
http://elinux.org/Squash_FS_Howto
http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html
Making it writeable:
As mentioned, another interesting use for SquashFS is with Unionfs filesystem, which provides copy-on-write semantics for the read-only file systems, enahancing the possibilities.
Create the ro.fs squashed file system and the rw.fs dir.
bash# mksquashfs /home/user1 ro.fs
bash# mkdir /home/rw.fs
Mount the squashed ro.fs file system using the loopback device
bash# mount -t squashfs ro.fs /mnt -o loop
mount the unionfs file system, that makes /mnt and /home/rw.fs apparently merged under /home/user1 location.
bash# cd /home
bash# mount -t unionfs -o dirs=rw.fs=rw:/mnt=ro unionfs user1
As you can see, now you can create new files in /home/user1.
https://fedoraproject.org/wiki/Using_UEFI_with_QEMU
https://wiki.ubuntu.com/UEFI/OVMF
https://github.com/qemu/qemu/tree/master/pc-bios
https://forums.gentoo.org/viewtopic-p-7206924.html:
There's a (undocumented) -no-kvm CMDline switch.
Mit Hilfe von chroot ein defektes Linux reparieren:
For Old Releases with Ubuntu that apt-get is working again:
http://old-releases.ubuntu.com/releases/
https://wiki.ubuntuusers.de/sources.list/
Für die graphische Ausgaben unter chroot:
https://help.ubuntu.com/community/BasicChroot
Install xhost: Das war schon vorhanden (Komponente von x-server)
$ sudo apt-get install xnest
(ca. 2,5MB zum Herunterladen)
$ sudo apt-get install metacity
Fehlermeldung im chroot:
@chroot@cubietruck $ sudo apt-get install xnest
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 81597 files and directories currently installed.)
Preparing to replace xserver-common 2:1.7.6-2ubuntu7 (using .../xserver-common_2%3a1.7.6-2ubuntu7.12_all.deb) ...
Unpacking replacement xserver-common ...
Selecting previously deselected package xnest.
$ apt-cache search xnest
sabayon - system administration tool to manage GNOME desktop settings
tsclient - front-end for viewing of remote desktops in GNOME
xoo - graphical wrapper around Xnest/Xephyr
xnest - Nested X server
xserver-xephyr - nested X server
https://awesome.naquadah.org/wiki/Using_Xephyr
https://help.ubuntu.com/community/BasicChroot
$ sudo apt-get install metacity
0 upgraded, 10 newly installed, 0 to remove and 8 not upgraded.
Need to get 24.0 MB of archives.
After this operation, 52.4 MB of additional disk space will be used.
https://help.ubuntu.com/community/DebootstrapChroot
Das Paket debootstrap erzeugt eine minimale chroot-Umgebung zur weiteren Verwendung.
Nachdem nun einiges experimentiert wurde, wurden noch ein paar Pakete nachgeladen in der chroot-Umgebung.
$ sudo apt-get update
($ sudo apt-get upgrade)
$ sudo apt-get install lpr
Wegen Fehlers beim Installieren mußte noch /dev/pts gemountet werden.
$ sudo apt-get purge lpr
$ sudo apt-get install lpr
$ sudo apt-get install cups
Hier gab es einen DBUS Fehler. Als diese Meldung kopiert werden sollte, verabschiedete sich der Rechner. Die Fenster gingen zu, die Leisten verschwanden. Der DBUS war weg.
$ sudo mount /dev/mmcblk0p5 /home/i386/mnt3
$ sudo mount -o bind /sys /home/i386/mnt3/qemu_chroot_i386/sy
$ sudo mount -o bind /proc /home/i386/mnt3/qemu_chroot_i386/proc
$ sudo mount -o bind /dev/pts /home/i386/mnt3/qemu_chroot_i386/dev/pts
$ xhost +
$ sudo chroot /home/i386/mnt3/qemu_chroot_i386/ /usr/bin/qemu-i386-static /bin/bash
@cubietruck:/# export DISPLAY=:0.0
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
$ sudo apt-get install sane sane-utils sanex
Was war hier nur passiert?
Setting up sane-utils (1.0.20-13ubuntu2) ...
Adding saned group and user...
Removing any system startup links for /etc/init.d/saned ...
In dem Fenster zeigt ls nichts mehr an.
$ sudo apt-get install tcl
@cubietruck:/home/dieterd/INSTALL/Brother795# bash linux-brprinter-installer-2.0.0-1
Input model name ->mfc-795
You are going to install following packages.
mfc795cwlpr-1.1.3-1.i386.deb
mfc795cwcupswrapper-1.1.3-1.i386.deb
brscan3-0.2.13-1.i386.deb
brscan-skey-0.2.4-1.i386.deb
OK? [y/N] ->y
dpkg -x mfc795cwlpr-1.1.3-1.i386.deb /
dpkg -x mfc795cwcupswrapper-1.1.3-1.i386.deb /
dpkg-deb: building package `mfc795cwlpr' in `mfc795cwlpr-1.1.3-1a.i386.deb'.
dpkg -b ./brother_driver_packdir mfc795cwlpr-1.1.3-1a.i386.deb
dpkg-deb: building package `mfc795cwcupswrapper' in `mfc795cwcupswrapper-1.1.3-1a.i386.deb'.
dpkg -b ./brother_driver_packdir mfc795cwcupswrapper-1.1.3-1a.i386.deb
dpkg -i --force-all mfc795cwlpr-1.1.3-1a.i386.deb
Selecting previously deselected package mfc795cwlpr.
(Reading database ... 83934 files and directories currently installed.)
Unpacking mfc795cwlpr (from mfc795cwlpr-1.1.3-1a.i386.deb) ...
Setting up mfc795cwlpr (1.1.3-1) ...
dpkg -i --force-all mfc795cwcupswrapper-1.1.3-1a.i386.deb
Selecting previously deselected package mfc795cwcupswrapper.
(Reading database ... 83957 files and directories currently installed.)
Unpacking mfc795cwcupswrapper (from mfc795cwcupswrapper-1.1.3-1a.i386.deb) ...
Setting up mfc795cwcupswrapper (1.1.3-1) ...
Stopping printer spooler: lpd [not running]
* Restarting Common Unix Printing System: cupsd
...done.
#
The security level of AppArmor has been lowered. (aa-complain cups)
aa-complain cupsd
Can't find system log.
Will you specify the Device URI? [Y/n] ->y
0: ipp
1: socket
2: http
3: lpd
4: scsi
5: smb
6 (I): Specify IP address.
7 (A): Auto. (usb://dev/usblp0)
select the number of destination Device URI. ->6
enter IP address ->192.168.43.128
lpadmin -p MFC795CW -v socket://192.168.43.128 -E
Test Print? [y/N] ->n
You are going to install following packages.
brscan3-0.2.13-1.i386.deb
dpkg -i --force-all brscan3-0.2.13-1.i386.deb
Selecting previously deselected package brscan3.
(Reading database ... 83961 files and directories currently installed.)
Unpacking brscan3 (from brscan3-0.2.13-1.i386.deb) ...
Setting up brscan3 (0.2.13-1) ...
You are going to install following packages.
brscan-skey-0.2.4-1.i386.deb
dpkg -i --force-all brscan-skey-0.2.4-1.i386.deb
Selecting previously deselected package brscan-skey.
(Reading database ... 83981 files and directories currently installed.)
Unpacking brscan-skey (from brscan-skey-0.2.4-1.i386.deb) ...
Setting up brscan-skey (0.2.4-1) ...
brsaneconfig3 -a name=MFC-795CW model=MFC-795CW ip=192.168.43.128
Hit Enter/Return key.
root@cubietruck:/home/dieterd/INSTALL/Brother795# scanimage -L
qemu: Unsupported syscall: 101
qemu: Unsupported syscall: 101
device `brother3:net1;dev0' is a Brother MFC-795CW MFC-795CW
root@cubietruck:/home/dieterd/INSTALL/Brother795# scanimage -L
qemu: Unsupported syscall: 101
qemu: Unsupported syscall: 101
device `brother3:net1;dev0' is a Brother MFC-795CW MFC-795CW
root@cubietruck:/home/dieterd/INSTALL/Brother795# man scanimage
root@cubietruck:/home/dieterd/INSTALL/Brother795# scanimage -d "brother3:net1;dev0" >image.pnm
scanimage: rounded value of br-x from 215.9 to 215.88
scanimage: rounded value of br-y from 355.6 to 355.567
Und nun funktionierte auch das Scannen.
Eine Liste von funktionierenden Anwendung unter der chroot-Umgebung.
-
Abiword,
-
lxterminal,
-
gnumeric,
-
xchat,
-
midori,
-
netsurf
-
gnumeric, funktioniert trotz der Fehlermeldungen:
process 4344: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
(/usr/bin/gnumeric:4344): Gdk-WARNING **: shmat failed: error 22 (Invalid argument)
Eine Liste von nicht funktionierenden Anwendung unter der chroot-Umgebung.
-
Firefox,
-
cromium-broser,
-
x-www-browser,
-
links2.
Folgender Fehler:
# firefox
process 24229: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
Segmentation fault
sudo mount -o bind /var/lib/dbus /home/i386/mnt3/qemu_chroot_i386/var/lib/dbus
Dann bleibt nur noch der Segmentation fault übrig.
Ergänzungen in der chroot-Umgebung:
$ sudo apt-get install midori links2 netsurf