Installation:Linux

Aus TuxBoxWIKI
Wechseln zu: Navigation, Suche


Allgemeines

Die Installation kann auch unter Linux erfolgen. Wer sich mit Linux nicht auskennt, sollte davon bitte die Finger lassen: die gesamte Funktionalität deckt auch der Bootmanager ab. Diese Anleitung ist primär für Leute gedacht, die kein Windows zuhause haben oder es nicht benutzen möchten.


Achtung:

Bitte sichert eure UCodes vor dem Einspielen eines neuen Images !!!

Dieser Vorgang ist sehr wichtig, da ihr die Originalsoftware benötigt, um eine funktionierende Linux DBox2 zu erhalten!


Die DBox2 benutzt BootP als Boot-Protokoll. Sie bedient sich des gleichen Mechanismus wie alte Sun-Maschinen:

  • zuerst sendet sie einen RARP-Request, um ihre IP-Adresse zu erfahren
  • hat sie diese, sendet sie einen BootP-Request, um ihren Boot-Server zu ermitteln.
  • hat sie diesen, erhält sie von ihm erneut die Netzwerkkonfiguration (IP-Adresse, Netzwerk, Broadcast-Adresse, Default-Gateway), sowie die Adresse des Servers, von dem sie das Boot-File laden soll .
  • dann lädt sie per tftp dieses Boot-File und führt es aus.


Daraus folgt, dass auf dem Linux-Server die folgenden Dienste laufen müssen:

  • rarpd
  • bootpd/dhcpd
  • tftpd

Die Konfigurationsdateien sind wie folgt: /etc/ethers

00:50:9c:aa:bb:cc dbox2

/etc/hosts (oder im nameserver halt)

192.168.0.7 dbox2

/etc/dhcpd.conf

host D-Box {
   hardware ethernet 00:50:9c:AA.BB.CC;
   fixed-address DBox;
   allow bootp;
   server-name "192.168.0.1";
   filename "ppcboot";
}

Das File ppcboot ist ein Bootloader, der das eigentliche Image nachlädt und in die DBox2 flasht. Die Datei wird mit dem Windows DBox II Bootmanager mitgeliefert. Das ist sehr handlich, wenn die DBox2 nicht mehr bootet :-) Beim Einschalten wird die

debug: DDF: Calibrating delay loop... debug: DDF: 67.79 BogoMIPS
debug: BMon V1.0  mID 01
debug: feID 7a    gtxID 0b
debug: fpID 5a     dsID 01-7d.f9.7f.07.00.00-f2
debug: HWrev X5  SWrev 0.81
debug: B/Ex/Fl(MB) 32/00/08 
WATCHDOG reset enabled
dbox2:root> debug: 
BOOTP/TFTP bootstrap loader (v0.3)
debug: 
debug: Transmitting BOOTP request via broadcast
debug: Unknown RFC1048-tag debug: 3 debug: 4 debug: c0 debug: a8 debug: 4 debug: fe debug: 
debug: Unknown RFC1048-tag debug: 6 debug: 4 debug: c0 debug: a8 debug: 4 debug: 1 debug: 
debug: Unknown RFC1048-tag debug: f debug: 9 debug: 42 debug: 61 debug: 6c debug: 72 debug: 6f debug: 67 
       debug: 2e debug: 44 debug: 45 debug: 
debug: Unknown RFC1048-tag debug: 1c debug: 4 debug: c0 debug: a8 debug: 4 debug: ff debug: 
debug: Got BOOTP reply from Server IP 192.168.0.1, My IP 192.168.0.7
debug: Sending TFTP-request for file /tftpboot/ppcboot
debug: TFTP error 0x1 (File not found)
debug: 
TFTP failed, giving up...
boot net failed

Flash-FS bootstrap loader (v1.5)

Found Flash-FS superblock version 3.1
Found file /root/platform/nokia-dbox2/kernel/os in Flash-FS
debug: Got Block #0032

will verify ELF image, start= 0x800000, size= 153208
verify sig: 263
Branching to 0x40000
 

U-Boot 1.1.1 (TuxBox) (Sep  7 2004 - 22:00:05)
 
CPU:   PPC823ZTnnB2 at 67.200 MHz: 2 kB I-Cache 1 kB D-Cache
Board: DBOX2, Nokia, BMon V1.0
      Watchdog enabled
I2C:   ready
DRAM:  32 MB
FLASH:  8 MB
Scanning JFFS2 FS: . done.
FB:    ready
LCD:   ready
In:    serial 
Out:   serial
Err:   serial 
Net:   SCC ETHERNET

Options:
  1: Console on null
  2: Console on ttyS0
  3: Console on framebuffer
Select option (1-3), other keys to stop autoboot:  0 

Hier müsst Ihr eine Taste drücken, damit der automatische Boot aus dem Flash unterbrochen wird.


Der tftp-Request geht schief, weil der tftp-Server auf der Linux-Maschine im Verzeichnis /tftpboot nach der Datei /tftpboot/ppcboot sucht. ln -s . tftpboot fixt das.


Habt Ihr den Bootprozess unterbrochen, seid ihr jetzt in der Lage, ein neues Image zu flashen.

Der Bootloader bietet die folgenden Befehle an:

=> ?
?       - alias for 'help'
autoscr - run script from memory
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
cmp     - memory compare
coninfo - print console devices and informations
cp      - memory copy
crc32   - checksum calculation
dhcp    - invoke DHCP client to obtain IP/boot params
echo    - echo args to console
erase   - erase FLASH memory
flinfo  - print FLASH memory information
fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
imls    - list all images found in flash
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loop    - infinite loop on address range
ls      - list files in a directory (default /)
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill) 
nfs     - boot image via network using NFS protocol
nm      - memory modify (c onstant address)
printenv- print environme nt variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
setenv  - set environment variables
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor version

Uns interessiert der Befehl bootp: ruft ihn mit dem Namen des Images als Argument auf. ppcboot lädt das Image und kann es dann flashen.


ppcboot 0.6.4 (Jul 12 2001 - 02:51:28)

Initializing...
  CPU:   PPC823ZTnnB2 at 67 MHz: 2 kB I-Cache 1 kB D-Cache
  Board: ### No HW ID - assuming TQM8xxL
  DRAM:  (faked) 32 MB
  Ethernet: 00-50-9c-42-ba-09
  FLASH:  8 MB
  FB logo at: none
  Input:  serial
  Output: serial

Any key druecken um das Flashing abzubrechen.. :  0
  LCD driver (KS0713) initialized
Logo FlashingBOOTP broadcast 1
TFTP from server 192.168.2.1; our IP address is 192.168.2.23
Filename '/tftpboot/13.img'.
Load address: 0x100000
Loading:   ###############################################################################
done
lo: 0x100000unprotecting 4
[10001]-> [0] [S800080] unprotecting 5
[0]-> [0] [S800080] unprotecting 6
[0]-> [0] [S800080] unprotecting 7
[0]-> [0] [S800080] unprotecting 8
[0]-> [0] [S800080] unprotecting 9
[0]-> [0] [S800080] unprotecting a
[0]-> [0] [S800080] unprotecting b
[0]-> [0] [S800080] unprotecting c
[0]-> [0] [S800080] unprotecting d
[0]-> [0] [S800080] unprotecting e

[...]

[0]-> [0] [S800080] unprotecting 3a
[0]-> [0] [S800080] unprotecting 3b
[0]-> [0] [S800080] unprotecting 3c
[0]-> [0] [S800080] unprotecting 3d
[0]-> [0] [S800080] unprotecting 3e
[0]-> [0] [S800080] unprotecting 3f
[0]-> [0] [S800080] unprotecting 40
[0]-> [0] [S800080] unprotecting 41
[0]-> [0] [S800080] unprotecting 42
[0]-> [0] [S800080] Un-Protected 63 sectors
Erase Flash from 0x10020000 to 0x107fffff
 sector 66 .... done
Erased 63 sectors
Copy to Flash... done
  LCD driver (KS0713) initialized
Logo Flashing done !


Mit Gentoo installieren

Nachdem ich die DBox2 zum zweiten mal über Bootp flashen musste, habe mich entschlossen ein Backup von meiner Konfiguration hier zu hinterlegen :) Die hier beschriebene Konfiguration basiert auf Gentoo Linux. Als IP-Adresse für die DBox2 wird 192.168.1.39 und für den Gentoo-Rechner 192.168.1.34 verwendet.

Ein paar Links, die mir weitergeholfen haben:


Installieren

Die notwendigen Programme emergen:

emerge rarpd
emerge tftp-hpa
emerge dhcp

NFS über den Kernel konfigurieren (File systems - Network File Systems)

Das Verzeichnis /tftpboot/tftpboot anlegen und in dieses die ppcboot und 13.img Datei kopieren. Bei der 13.img Datei kann es sich entweder um ein Release-Image (z.B. 200503162121_neutrino_yadi_squashfs_head_1x.img) oder ein gesichertes Image (mit einer Größe von 8257536 Byte) handeln.


Konfiguration

/etc/ethers

00:50:9c:xx:xx:xx 192.168.1.39

/etc/hosts

 192.168.1.39 dbox

/etc/conf.d/in.tftpd

 # Path to server files from
 INTFTPD_PATH="/tftpboot"

 # For more options, see tftpd(8)
 INTFTPD_OPTS="-l -v -s ${INTFTPD_PATH}"

/etc/dhcp/dhcpd.conf

option domain-name "domain";
default-lease-time 600;
max-lease-time 7200;
ddns-update-style ad-hoc;

subnet 192.168.1.0 netmask 255.255.255.0 {
} 

host dbox  { 
  hardware ethernet 00:50:9c:xx:xx:xx
  fixed-address 192.168.1.39;
  allow bootp;
  server-name "192.168.1.34";
  filename "/tftpboot/ppcboot";
}

Die IP-Adresse beim server-name Eintrag ist der Rechner, auf den Gentoo läuft.

/etc/exports

/tftpboot dbox(rw,no_root_squash)


Service starten

/etc/init.d/dhcp start
/etc/init.d/in.tftpd start
/etc/init.d/nfs start


DBox2 starten

Meistens hat es funktioniert, wenn man den Netzstecker rauszieht, kurz wartet und dann den Netzstecker wieder einsteckt. Darauf hin sollte nach kurzer Zeit ein "Flashing..." zu sehen sein.

Dieses "Flashing..." verschwindet nach ca. [BITTE EDITIEREN] Minuten.

Nach dem Flashen

Nach dem Flashen müssen die Dienste gestoppt werden, da sonst die DBox2 bei einem Neustart wieder nach der ppcboot Datei im Netz sucht.

/etc/init.d/dhcp stop
/etc/init.d/in.tftpd stop

NFS kann weiterlauf (für das Streaming). Jedoch habe ich den tftpboot Eintrag in der /etc/exports Datei auskommentiert und auch das /tftpboot/tftpboot Verzeichnis umbenannt.

Daraufhin die DBox2 neu booten, dann die uCodes und das (gesicherte) Image hochladen und flashen.


Technische Anleitung zum Flashen

Der Bmon soll zunächst das ppcboot Image laden. Dies wird dadurch erreicht, dass man einen bootp-Server sowie einen tftp-Server installiert und konfiguriert. Der bootp-Server sagt dem Bmon, wo das Image ist, das er laden soll. Das ppcboot Image sucht nun im Verzeichnis tftpboot auf dem tftp-Server nach einer Datei namens 13.img. Dies ist das Image, das es zu flashen versucht. Die Vorgänge können gut über die serielle Schnittstelle beobachtet werden.

Somit ergibt sich folgender Ablauf:
1. dBox-Reset
2. dBox startet Bmon
3. Bmon sucht per bootp nach den Netzwerkeinstellungen
4. bootp-Server sagt Bmon welche IP-Adresse, sowie welches Image er laden soll. Dieses Image ist kein Flash-Image, sondern nur ein kleines ppcboot Image.
5. Bmon lädt das Image (ppcboot) vom angegebenen tftp-server und startet es.
6. ppcboot startet und versucht vom selben tftp-server die Datei 13.img zu holen. Dies ist das eigentliche Image, das geflasht werden soll. (ca. 8Mb)