1 DockStar - Installation Système
1.1 Premier démarrage
1.1.1 Tutoriel
1.1.2 Commandes
1.1.2.1 Recherche du DockStar
1.1.2.2 Blocage des mises à jour
1.2 Informations système
1.2.1 Recherche du DockStar
1.2.2 Informations système
1.3 Backup Pogoplug
1.3.1 dd
1.3.2 nandump
1.4 Paramètres Pogoplug
1.5 Désactivation du service PogoPlug
1.6 Mise à jour uBoot
1.7 Installation ArchLinux
1.8 Paramétrages système
1.8.1 Utilitaires uBoot
1.8.2 Dernières mises à jour
1.8.3 Ordre de démarrage
1.8.4 Activation de la swap
1.8.4.1 UUID
1.8.5 Hostname
1.8.6 Désactivation ipv6
1.8.7 Fuseau Horaire
1.8.8 Installation de ntp
1.8.9 Utlisateur & sudo
1.8.10 Automount / USB Mount
1.8.10.1 udev
1.8.10.2 usbmount
1.8.11 Veille des disques
1.8.11.1 sdparm
1.8.11.2 hdparm
1.8.11.3 script udev
1.9 Erreurs NAND
1.10 Compilation
1.10.1 Cross Compilation
1.10.2 Environnement de Compilation
1.10.3 AUR
DockStar - Installation Système
Premier démarrage
Tutoriel
* Connect the DockStar with a network cable directly to a computer running Linux which doesn't route or offers DHCP. Plug in the power cable of the DockStar and wait until the LED is steadily orange. Because the device won't get an IP from an DHCP server, it will use an automatic generated IP between 169.254.1.0 and 169.254.254.255 (see RFC 3927).
* To find out the IP the device uses we are scanning this range. You might have luck and this quick scan may find the IP:
Code :
- root@host ~ # ifconfig eth0 169.254.1.0
- root@host ~ # nmap -e eth0 -sP 169.254.185.0/24
|
* If this won't find the device, you have to take the long route:
Code :
- root@host ~ # ifconfig eth0 169.254.1.0
- root@host ~ # nmap -e eth0 -sP 169.254.0.0/16
|
* Someone sent me the hint, that the last two numbers in the IP are the last two bytes of the MAC. So this should be the fastest way (assuming BE and EF are the last two bytes of the MAC of your device):
Code :
- root@host ~ # ifconfig eth0 169.254.1.0
- root@host ~ # nmap -e eth0 -sP $(printf "169.254.%d.%d" 0xbe 0xef)
|
* On se connecte en ssh sur l'IP du dockstar (login: root, mot de passe: stxadmin).
* On monte le filesystem en écriture :
Code :
- mount / -rw -o remount
|
* On remplit le fichier hosts afin que les mises à jour automatique soient désactivés car apparemment, elle bloquerait l'accès ssh.
* On remplit avec :
Code :
- 127.0.0.1 service.pogoplug.com
- 127.0.0.1 pm1.pogoplug.com
- 127.0.0.1 pm2.pogoplug.com
- 127.0.0.1 service.cloudengines.com
- 127.0.0.1 upgrade.pogoplug.com
|
* On enregistre ( shift + z +z ou :w! ou ...)
* On remonte le filesystem en lecture seule
Code :
- mount / -r -o remount
|
* C'est bon, on peut remettre l'accès Internet et redémarrer le plug.
* Sources :
** Using Linux on a DockStar.
** forum.hardware.fr#1230267.
Commandes
Recherche du DockStar
* Connecté directement à l'ordinateur avec un cable (premier démarrage)
** Dans ce cas, l'adresse attribuée dépend de l'adresse MAC du DockStar
Code :
- # ifconfig eth0 169.254.1.0
- # nmap -e eth0 -sP $(printf "169.254.%d.%d" 0xd8 0x28)
- Starting Nmap 5.21 ( http://nmap.org ) at 2012-02-17 19:12 CET
- Nmap scan report for 169.254.216.40
- Host is up (0.00013s latency).
- MAC Address: 00:10:75:1A:D8:28 (Maxtor)
- Nmap done: 1 IP address (1 host up) scanned in 0.31 seconds
|
Blocage des mises à jour
Code :
- -bash-3.2# ssh root@169.254.216.40
- -bash-3.2# mount / -rw -o remount
- -bash-3.2# vi /etc/hosts
- 127.0.0.1 service.pogoplug.com
- 127.0.0.1 pm1.pogoplug.com
- 127.0.0.1 pm2.pogoplug.com
- 127.0.0.1 service.cloudengines.com
- 127.0.0.1 upgrade.pogoplug.com
- -bash-3.2# mount / -r -o remount
|
Informations système
Recherche du DockStar
* Une fois connecté au réseau local, le DockStar a une adresse attribuée par le DHCP
Code :
- # nmap -e eth0 -sP 192.168.0.0/24
- (...)
- Nmap scan report for 192.168.0.101
- Host is up (0.0059s latency).
- MAC Address: 00:10:75:1A:D7:DF (Maxtor)
- (...)
|
Informations système
Code :
- -bash-3.2# uname -a
- Linux Pogoplug 2.6.22.18 #57 Mon Aug 31 16:31:01 PDT 2009 armv5tejl unknown
|
Code :
- -bash-3.2# cat /proc/cpuinfo
- Processor : ARM926EJ-S rev 1 (v5l)
- BogoMIPS : 1192.75
- Features : swp half thumb fastmult edsp
- CPU implementer : 0x56
- CPU architecture: 5TE
- CPU variant : 0x2
- CPU part : 0x131
- CPU revision : 1
- Cache type : write-back
- Cache clean : cp15 c7 ops
- Cache lockdown : format C
- Cache format : Harvard
- I size : 16384
- I assoc : 4
- I line length : 32
- I sets : 128
- D size : 16384
- D assoc : 4
- D line length : 32
- D sets : 128
- Hardware : Feroceon-KW
- Revision : 0000
- Serial : 0000000000000000
|
Code :
- -bash-3.2# free
- total used free shared buffers
- Mem: 126064 22464 103600 0 0
- Swap: 0 0 0
- Total: 126064 22464 103600
|
Code :
- -bash-3.2# dmesg | grep "NAND"
- [ 0.870000] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
- [ 1.040000] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
|
Code :
- -bash-3.2# cat /proc/mtd
- dev: size erasesize name
- mtd0: 00100000 00020000 "u-boot"
- mtd1: 00400000 00020000 "uImage"
- mtd2: 02000000 00020000 "root"
- mtd3: 0db00000 00020000 "data"
|
Code :
- -bash-3.2# mount
- rootfs on / type rootfs (rw)
- /dev/root on / type jffs2 (ro)
- none on /proc type proc (rw)
- none on /sys type sysfs (rw)
- none on /dev/pts type devpts (rw)
- none on /tmp type tmpfs (rw)
|
Backup Pogoplug
Code :
- -bash-3.2# mount
- rootfs on / type rootfs (rw)
- /dev/root on / type jffs2 (ro)
- none on /proc type proc (rw)
- none on /sys type sysfs (rw)
- none on /dev/pts type devpts (rw)
- none on /tmp type tmpfs (rw)
- /tmp/.cemnt/sda1 on /tmp/.cemnt/mnt_sda1 type ufsd (rw,nosuid,nodev,noexec,noatime)
- -bash-3.2# cat /proc/mtd
- dev: size erasesize name
- mtd0: 00100000 00020000 "u-boot"
- mtd1: 00400000 00020000 "uImage"
- mtd2: 02000000 00020000 "root"
- mtd3: 0db00000 00020000 "data"
|
dd
Code :
- -bash-3.2# cd /tmp/.cemnt/mnt_sda1
- -bash-3.2# mkdir -p Pogoplug/Backup
- -bash-3.2# cd Pogoplug/Backup
- -bash-3.2# dd if=/dev/mtd0 of=mtd0.img
- 2048+0 records in
- 2048+0 records out
- -bash-3.2# sha1sum mtd0.img >mtd0.img.sha1
- -bash-3.2# dd if=/dev/mtd1 of=mtd1.img
- 8192+0 records in
- 8192+0 records out
- -bash-3.2# sha1sum mtd1.img >mtd1.img.sha1
- -bash-3.2# dd if=/dev/mtd2 of=mtd2.img
- 65536+0 records in
- 65536+0 records out
- -bash-3.2# sha1sum mtd2.img >mtd2.img.sha1
- -bash-3.2# dd if=/dev/mtd3 of=mtd3.img
- 448512+0 records in
- 448512+0 records out
- -bash-3.2# sha1sum mtd3.img >mtd3.img.sha1
- -bash-3.2# /sbin/halt
|
(Warning: At least the backup for mtd0 is useless because the kernel uses a different ECC algorithm than that old and modified version of U-Boot. Anyway, this guide here doesn't change the installed U-Boot, so that should be no problem.)
Wait a minute until the system has shut down (the LED will still be orange after shutdown), turn of the power of the DockStar, take the USB-storage device and make a backup of the directory Backup onto another device.
* Source :
** Using Linux on a DockStar.
nandump
Code :
- -bash-3.2# cd /tmp/.cemnt/mnt_sda1
- -bash-3.2# cd Pogoplug/Backup
- -bash-3.2# cp ../uBoot/nanddump /tmp
- -bash-3.2# chmod u+x /tmp/nanddump
- -bash-3.2# /tmp/nanddump -no -l 0x80000 -f uboot-mtd0-dump /dev/mtd0
- -bash-3.2# sha1sum uboot-mtd0-dump > uboot-mtd0-dump.sha1
|
Code :
- -bash-3.2# cd /tmp/.cemnt/mnt_sda1
- -bash-3.2# cd Pogoplug/Backup
- -bash-3.2# cp ../uBoot/blparam /tmp
- -bash-3.2# chmod u+x /tmp/blparam
- -bash-3.2# /tmp/blparam > blparam.orig
|
Paramètres Pogoplug
* Depuis Pogoplug, via blparam.
Code :
- -bash-3.2# /tmp/blparam
- baudrate=115200
- loads_echo=0
- ipaddr=169.254.254.253
- serverip=169.254.254.254
- rootpath=/mnt/ARM_FS/
- netmask=255.255.0.0
- run_diag=yes
- console=console=ttyS0,115200
- CASset=min
- MALLOC_len=1
- ethprime=egiga0
- bootargs_root=root=/dev/mtdblock2 ro
- ethmtu=1500
- usb0Mode=host
- nandEcc=1bit
- ethact=egiga0
- stdin=serial
- stdout=serial
- stderr=serial
- mainlineLinux=no
- enaMonExt=no
- enaCpuStream=no
- enaWrAllo=no
- pexMode=RC
- disL2Cache=no
- setL2CacheWT=yes
- disL2Prefetch=yes
- enaICPref=yes
- enaDCPref=yes
- sata_dma_mode=yes
- netbsd_en=no
- vxworks_en=no
- bootdelay=3
- disaMvPnp=no
- ethaddr=00:10:75:1A:D8:28
- cesvcid=KBM64VERFQNKAJHL3A5V5G78KN
- ceserialno=2GEP1JSV
- ceboardver=REDSTONE:1.0
- bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
|
* Depuis Linux, via fw_printenv.
** Commande exécutée après installation de uBoot et Arch.
Code :
- [root@DockStar ~]# fw_printenv
- ethact=egiga0
- bootdelay=3
- baudrate=115200
- mainlineLinux=yes
- console=ttyS0,115200
- led_init=green blinking
- led_exit=green off
- led_error=orange blinking
- mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
- mtdids=nand0=orion_nand
- partition=nand0,2
- stdin=serial
- stdout=serial
- stderr=serial
- rescue_installed=0
- rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
- rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
- pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
- force_rescue=0
- force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
- ubifs_mtd=3
- ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
- ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
- usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
- usb_scan_list=1 2 3 4
- usb_scan_1=usb=0:1 dev=sda1
- usb_scan_2=usb=1:1 dev=sdb1
- usb_scan_3=usb=2:1 dev=sdc1
- usb_scan_4=usb=3:1 dev=sdd1
- usb_init=run usb_scan
- usb_device=0:1
- usb_root=/dev/sda1
- usb_rootdelay=10
- usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
- usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
- usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
- bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
- ethaddr=00:10:75:1A:D8:28
- usb_rootfstype=ext3
- arcNumber=2998
|
* Source :
** install_uboot_mtd0.sh.
Désactivation du service PogoPlug
Code :
- -bash-3.2# mount / -rw -o remount
- -bash-3.2# vi /etc/init.d/rcS
- #Uncomment the line below to enable the pogoplug service
- #/etc/init.d/hbmgr.sh start
- -bash-3.2# mount / -r -o remount
|
Mise à jour uBoot
* Arrêt du processus PogoPlug (si non désactivé).
Code :
- -bash-3.2# killall hbwd
|
* Mise à jour uBoot
Code :
- -bash-3.2# cd /tmp
- -bash-3.2# wget http://jeff.doozan.com/debian/uboo [...] ot_mtd0.sh
- -bash-3.2# chmod +x install_uboot_mtd0.sh
- -bash-3.2# ./install_uboot_mtd0.sh
- !!!!!! DANGER DANGER DANGER DANGER DANGER DANGER !!!!!!
- If you lose power to your device while running this script,
- it could be left in an unusable state.
- This script will replace the bootloader on /dev/mtd0.
- This installer will only work on the following devices:
- Seagate GoFlex Net
- Seagate Dockstar
- Pogoplug v1
- Pogoplug Pink
- Do not run this installer on any other device.
- By typing ok, you agree to assume all liabilities and risks
- associated with running this installer.
- If you agree, type 'ok' and press ENTER to continue: ok
- # checking for /usr/sbin/nandwrite...
- # Installing /usr/sbin/nandwrite...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- nandwrite.md5 100% |***************************************************| 44 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- nandwrite 100% |***************************************************| 11500 --:--:-- ETA
- # Successfully installed /usr/sbin/nandwrite.
- # checking for /usr/sbin/nanddump...
- # Installing /usr/sbin/nanddump...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- nanddump.md5 100% |***************************************************| 43 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- nanddump 100% |***************************************************| 21286 00:00:00 ETA
- # Successfully installed /usr/sbin/nanddump.
- # checking for /usr/sbin/flash_erase...
- # Installing /usr/sbin/flash_erase...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- flash_erase.md5 100% |***************************************************| 46 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- flash_erase 100% |***************************************************| 12819 --:--:-- ETA
- # Successfully installed /usr/sbin/flash_erase.
- # checking for /usr/sbin/fw_printenv...
- # Installing /usr/sbin/fw_printenv...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- fw_printenv.md5 100% |***************************************************| 46 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- fw_printenv 100% |***************************************************| 652k 00:00:00 ETA
- # Successfully installed /usr/sbin/fw_printenv.
- # checking for /etc/fw_env.config...
- # Installing /etc/fw_env.config...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- fw_env.config.md5 100% |***************************************************| 48 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- fw_env.config 100% |***************************************************| 329 --:--:-- ETA
- # Successfully installed /etc/fw_env.config.
- # Validating existing uBoot...
- Block size 131072, page size 2048, OOB size 64
- Dumping data starting at 0x00000000 and ending at 0x00080000...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- valid-uboot.md5 100% |***************************************************| 756 --:--:-- ETA
- ## Valid uBoot detected: [dockstar original]
- killall: hbwd: no process killed
- DISABLE POGOPLUG SERVICES
- The pogoplug service includes an auto-update feature which could
- be used to cripple or disable your device. It is recommended
- that you disable this service.
- NOTE: The pogoplug service is proprietary software
- created by Cloud Engines. It is not available for use
- in other distributions and will not be available in
- your new linux installation even if you choose not to disable it.
- Would you like to disable the pogoplug services? [Y/n] n
- # checking for /uboot-original-mtd0.kwb...
- # Installing /uboot-original-mtd0.kwb...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot-original-mtd0. 100% |***************************************************| 67 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot-original-mtd0. 100% |***************************************************| 512k 00:00:00 ETA
- # Successfully installed /uboot-original-mtd0.kwb.
- # checking for /usr/sbin/blparam...
- # Installing /usr/sbin/blparam...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- blparam.md5 100% |***************************************************| 42 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- blparam 100% |***************************************************| 14168 --:--:-- ETA
- # Successfully installed /usr/sbin/blparam.
- # Installing uBoot
- ## Installing dockstar jeff-2010-10-23
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.mtd0.kwb.md5 100% |***************************************************| 74 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.mtd0.kwb 100% |***************************************************| 512k 00:00:00 ETA
- Erase Total 4 Units
- Performing Flash Erase of length 131072 at offset 0x60000 done
- Writing data to block 0 at offset 0x0
- Writing data to block 1 at offset 0x20000
- Writing data to block 2 at offset 0x40000
- Writing data to block 3 at offset 0x60000
- Block size 131072, page size 2048, OOB size 64
- Dumping data starting at 0x00000000 and ending at 0x00080000...
- ## Verifying new uBoot...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.mtd0.kwb.md5 100% |***************************************************| 74 --:--:-- ETA
- # Verified successfully!
- # Installing uBoot environment
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.environment.md 100% |***************************************************| 52 --:--:-- ETA
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.environment 100% |***************************************************| 128k 00:00:00 ETA
- Erase Total 1 Units
- Performing Flash Erase of length 131072 at offset 0xc0000 done
- Writing data to block 6 at offset 0xc0000
- # Verifying uBoot environment
- Block size 131072, page size 2048, OOB size 64
- Dumping data starting at 0x000c0000 and ending at 0x000e0000...
- Connecting to jeff.doozan.com (69.163.187.226:80)
- uboot.environment.md 100% |***************************************************| 52 --:--:-- ETA
- # Setting arcNumber to 2097 (SheevaPlug)
- # Note: if you have a kernel that supports your platform, you should use the proper arcNumber.
- # You can set the correct arcNumber by running the following command:
- /usr/sbin/fw_setenv arcNumber 2998
- # uBoot installation has completed successfully.
|
* Source :
** Update uBoot on your Dockstar.
The new uBoot install script thought I'd already installed a new uBoot. It gave me an option to override which worked just fine (but is a risky move):
Code :
- ./install_uboot_mtd0.sh --no-uboot-check
|
* Source :
** Turn a Pogoplug into a Full-Featured Linux Web Server.
Installation ArchLinux
* Création de la partition USB (sans swap).
Code :
- -bash-3.2# /sbin/fdisk /dev/sda
- Command (m for help): o
- Building a new DOS disklabel. Changes will remain in memory only,
- until you decide to write them. After that the previous content
- won't be recoverable.
- Command (m for help): p
- Disk /dev/sda: 4102 MB, 4102029312 bytes
- 1 heads, 32 sectors/track, 250368 cylinders
- Units = cylinders of 32 * 512 = 16384 bytes
- Device Boot Start End Blocks Id System
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 1
- First cylinder (2-250368, default 2): Using default value 2
- Last cylinder or +size or +sizeM or +sizeK (2-250368, default 250368): Using default value 250368
- Command (m for help): p
- Disk /dev/sda: 4102 MB, 4102029312 bytes
- 1 heads, 32 sectors/track, 250368 cylinders
- Units = cylinders of 32 * 512 = 16384 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 2 250368 4005872 83 Linux
- Command (m for help): w
- The partition table has been altered!
|
* Création de la partition USB (avec swap).
Code :
- -bash-3.2# /sbin/fdisk /dev/sda
- Command (m for help): o
- Building a new DOS disklabel. Changes will remain in memory only,
- until you decide to write them. After that the previous content
- won't be recoverable.
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 1
- First cylinder (2-250368, default 2): Using default value 2
- Last cylinder or +size or +sizeM or +sizeK (2-250368, default 250368): 234742
- Command (m for help): p
- Disk /dev/sda: 4102 MB, 4102029312 bytes
- 1 heads, 32 sectors/track, 250368 cylinders
- Units = cylinders of 32 * 512 = 16384 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 2 234742 3755856 83 Linux
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 2
- First cylinder (234743-250368, default 234743): Using default value 234743
- Last cylinder or +size or +sizeM or +sizeK (234743-250368, default 250368): Using default value 250368
- Command (m for help): p
- Disk /dev/sda: 4102 MB, 4102029312 bytes
- 1 heads, 32 sectors/track, 250368 cylinders
- Units = cylinders of 32 * 512 = 16384 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 2 234742 3755856 83 Linux
- /dev/sda2 234743 250368 250016 83 Linux
- Command (m for help): t
- Partition number (1-4): 2
- Hex code (type L to list codes): 82
- Changed system type of partition 2 to 82 (Linux swap)
- Command (m for help): p
- Disk /dev/sda: 4102 MB, 4102029312 bytes
- 1 heads, 32 sectors/track, 250368 cylinders
- Units = cylinders of 32 * 512 = 16384 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 2 234742 3755856 83 Linux
- /dev/sda2 234743 250368 250016 82 Linux swap
- Command (m for help): w
- The partition table has been altered!
|
* Formatage de la partition USB en ext2.
* Formatage de la partition USB en ext3.
* En cas d'installation en ext3, il faut indiquer à uBoot.
** fw_setenv est installé avec uBoot.
Code :
- -bash-3.2# /usr/sbin/fw_setenv usb_rootfstype ext3
|
* Téléchargement et installation de ArchLinux
* Redémarrage
Code :
- -bash-3.2# cd ..
- -bash-3.2# umount usb
- -bash-3.2# /sbin/reboot
|
* Suppression de l'ancienne clé SSH du fichier ~/.ssh/known_hosts
Code :
- $ ssh-keygen -R 192.168.yyy.xxx #(using your device's IP)
|
* Sources :
** Arch Linux ARM - Seagate DockStar
** Installer Debian sur le Seagate Dockstar
** Présentation FreeAgent DockStar
Paramétrages système
Utilitaires uBoot
* Permet d'avoir les commande nanddump, nandwrite, fw_printenv, fw_setenv...
Code :
- [root@alarm ~]# cd /tmp
- [root@alarm tmp]# wget http://jeff.doozan.com/debian/uboo [...] ot_mtd0.sh
- [root@alarm tmp]# chmod +x install_uboot_mtd0.sh
- [root@alarm tmp]# ./install_uboot_mtd0.sh
- !!!!!! DANGER DANGER DANGER DANGER DANGER DANGER !!!!!!
- If you lose power to your device while running this script,
- it could be left in an unusable state.
- This script will replace the bootloader on /dev/mtd0.
- This installer will only work on the following devices:
- Seagate GoFlex Net
- Seagate Dockstar
- Pogoplug v1
- Pogoplug Pink
- Do not run this installer on any other device.
- By typing ok, you agree to assume all liabilities and risks
- associated with running this installer.
- If you agree, type 'ok' and press ENTER to continue: ok
- (...)
- ## Valid uBoot detected: [dockstar jeff-2010-10-23-current ebd566de30c6521e65fb1255415c037f pogov1 jeff-2010-10-23-current]
- ## The newest uBoot is already installed on mtd0.
- You are already running the latest uBoot.
- Would you like to reset the uBoot environment? [N/y] n
- # uBoot installation has completed successfully.
|
Code :
- [root@alarm ~]# fw_setenv arcNumber 2998
- [root@alarm ~]# reboot
|
Dernières mises à jour
Code :
- [root@alarm ~]# uname -a
- Linux alarm 3.1.7-2-ARCH #1 PREEMPT Sat Jan 14 15:45:38 UTC 2012 armv5tel Feroceon 88FR131 rev 1 (v5l) Marvell SheevaPlug Reference Board GNU/Linux
|
Code :
- [root@alarm ~]# pacman -Syu
- Synchronizing package databases...
- core 37.8K 139.0K/s 00:00:00 [######################] 100%
- extra 421.0K 203.0K/s 00:00:02 [######################] 100%
- community 370.3K 202.1K/s 00:00:02 [######################] 100%
- aur 9.8K 100.1K/s 00:00:00 [######################] 100%
- The following packages should be upgraded first :
- pacman
- Do you want to cancel the current operation
- and upgrade these packages now? [Y/n]
- (...)
- >>> Run `pacman-key --init` to set up your pacman keyring.
|
Code :
- [root@alarm ~]# pacman -Syu
- Synchronizing package databases...
- core is up to date
- extra is up to date
- community is up to date
- aur is up to date
- Starting full system upgrade...
- Replace module-init-tools with core/kmod? [Y/n]
- resolving dependencies...
- looking for inter-conflicts...
- (...)
- error: failed to commit transaction (conflicting files)
- initscripts: /etc/profile.d/locale.sh exists in filesystem
- Errors occurred, no packages were upgraded.
- [root@alarm ~]# pacman -Qo /etc/profile.d/locale.sh
- error: No package owns /etc/profile.d/locale.sh
- [root@alarm ~]# mv /etc/profile.d/locale.sh /etc/profile.d/locale.sh.orig
- [root@alarm ~]# pacman -Syu
- Synchronizing package databases...
- core is up to date
- extra is up to date
- community is up to date
- aur is up to date
- Starting full system upgrade...
- Replace module-init-tools with core/kmod? [Y/n]
- resolving dependencies...
- looking for inter-conflicts...
- (...)
- ATTENTION UDEV:
- ----------
- udev-compat has been removed, and should be uninstalled.
- --
- Framebuffers are no longer blacklisted by default.
- --
- binaries moved from /sbin to /usr/bin
- ---------------
- (...)
- If using non-bash-compatible shell, please set LANG in /etc/locale.conf,
- as LOCALE in /etc/rc.conf no longer works.
- (...)
- [root@alarm ~]# reboot
|
Code :
- [root@alarm ~]# uname -a
- Linux alarm 3.1.10-3-ARCH #1 PREEMPT Sat Feb 11 03:57:49 UTC 2012 armv5tel Feroceon 88FR131 rev 1 (v5l) Marvell SheevaPlug Reference Board GNU/Linux
|
Ordre de démarrage
* Il est possible de modifier l'ordre de test des périphériques USB au démarrage.
** http://forum.doozan.com/read.php?3,12
* En se basant sur les uuid pour accéder aux partitions, ce n'est pas nécessaire.
* Cependant, si plusieurs disques sont amorçables, ça pourrait devenir indispensable.
Activation de la swap
Code :
- [root@DockStar ~]# mkswap -L Swap /dev/sda2
- Setting up swapspace version 1, size = 250012 KiB
- LABEL=Swap, UUID=1bbda5b0-31ee-4c54-9a8d-74f950e17460
- [root@alarm ~]# swapon /dev/sda2
- [root@alarm ~]# vi /etc/fstab
- /dev/sda2 none swap defaults 0 0
|
* Source :
** ArchLinux - Swap.
UUID
* L'odre sd[a-z] peut changer selon les disques branché.
En se basant sur l'identification uuid, on est sûr d'accéder toujours au même emplacement.
* Création de la swap
Code :
- [root@DockStar ~]# mkswap -L Swap /dev/sda2
- Setting up swapspace version 1, size = 250012 KiB
- LABEL=Swap, UUID=1bbda5b0-31ee-4c54-9a8d-74f950e17460
- [root@alarm ~]# swapon -U 1bbda5b0-31ee-4c54-9a8d-74f950e17460
- [root@alarm ~]# vi /etc/fstab
- UUID=1bbda5b0-31ee-4c54-9a8d-74f950e17460 none swap defaults 0 0
|
* Listage des partitions
Code :
- [root@DockStar ~]# blkid -o list -c /dev/null
- device fs_type label mount point UUID
- ------------------------------------------------------------------------------------------------------------------------
- /dev/sda1 ext3 / 6ef685a3-8e7a-4285-8f4b-9859cf240a29
- /dev/sda2 swap Swap (not mounted) 1bbda5b0-31ee-4c54-9a8d-74f950e17460
|
* Sources :
** ArchLinux - Persistent block device naming.
** ArchLinux - fstab.
Hostname
Code :
- [root@alarm ~]# vi /etc/rc.conf
- HOSTNAME="DockStar"
- [root@alarm ~]# reboot
|
Désactivation ipv6
Code :
- [root@DockStar ~]# free
- total used free shared buffers cached
- Mem: 123532 29388 94144 0 1832 15028
- -/+ buffers/cache: 12528 111004
- Swap: 250012 0 250012
- [root@DockStar ~]# vi /etc/sysctl.conf
- # Disable ipv6
- net.ipv6.conf.all.disable_ipv6 = 1
- [root@DockStar ~]# reboot
- [root@DockStar ~]# free
- total used free shared buffers cached
- Mem: 123532 27992 95540 0 1812 14832
- -/+ buffers/cache: 11348 112184
- Swap: 250012 0 250012
|
Fuseau Horaire
Code :
- [root@DockStar ~]# grep ^TIMEZONE /etc/rc.conf
- [root@DockStar ~]# ls /usr/share/zoneinfo/
- [root@DockStar ~]# vi /etc/rc.conf
- TIMEZONE="Europe/Paris"
|
* Source :
** ArchLinux - TimeZone.
Installation de ntp
* Installation
Code :
- [root@DockStar ~]# pacman -S ntp
- resolving dependencies...
- looking for inter-conflicts...
- Targets (1): ntp-4.2.6.p5-2
- Total Download Size: 0.38 MB
- Total Installed Size: 1.50 MB
- Proceed with installation? [Y/n]
- Retrieving packages from extra...
- ntp-4.2.6.p5-2-arm 392.9K 202.2K/s 00:00:02 [######################] 100%
- (1/1) checking package integrity [######################] 100%
- (1/1) checking for file conflicts [######################] 100%
- (1/1) installing ntp [######################] 100%
|
* Synchronisation
Code :
- [root@DockStar ~]# ntpd -qg
|
* Activation au démarrage
Code :
- [root@DockStar ~]# rc.d start ntpd
- Starting NTP Daemon [DONE]
- [root@DockStar ~]# vi /etc/rc.conf
- DAEMONS=(... !hwclock ntpd ...)
|
* Source :
** ArchLinux - Network Time Protocol daemon.
Utlisateur & sudo
Code :
- [root@DockStar ~]# pacman -S sudo
- resolving dependencies...
- looking for inter-conflicts...
- Targets (1): sudo-1.8.3.p2-2
- Total Download Size: 0.44 MiB
- Total Installed Size: 1.90 MiB
- Proceed with installation? [Y/n]
- Retrieving packages from core...
- sudo-1.8.3.p2-2-arm 447.1 KiB 203K/s 00:02 [######################] 100%
- (1/1) checking package integrity [######################] 100%
- (1/1) loading package files [######################] 100%
- (1/1) checking for file conflicts [######################] 100%
- (1/1) checking available disk space [######################] 100%
- (1/1) installing sudo [######################] 100%
- [root@DockStar ~]# visudo
- ##
- ## User privilege specification
- ##
- root ALL=(ALL) ALL
- xxx ALL=(ALL) ALL
- [root@DockStar ~]# useradd -m -g users xxx
- [root@DockStar ~]# passwd xxx
- Enter new UNIX password:
- Retype new UNIX password:
- passwd: password updated successfully
|
Automount / USB Mount
udev
* Sources :
** ArchLinux - Mount under /media; use partition label if present; ntfs-3g.
** forum.hardware.fr#1231779 et forum.hardware.fr#1247732
* Règle à mettre en place
** Attention au sd[a-z]* à la place du sd[b-z]* par défaut.
Code :
- #
- # /etc/udev/rules.d/10-my-media-automount.rules
- # start at sdb to ignore the system hard drive
- KERNEL!="sd[a-z]*", GOTO="my_media_automount_end"
- ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"
- # import some useful filesystem info as variables
- IMPORT{program}="/sbin/blkid -o udev -p %N"
- # get the label if present, otherwise assign one based on device/partition
- ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
- ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
- # create the dir in /media and symlink it to /mnt
- ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"
- # global mount options
- ACTION=="add", ENV{mount_options}="relatime"
- # filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat)
- ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"
- # automount ntfs filesystems using ntfs-3g driver
- ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"
- # automount all other filesystems
- ACTION=="add", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"
- # clean up after device removal
- ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"
- # exit
- LABEL="my_media_automount_end"
|
* Débuggage
Tu as quoi dans les log (messages, daemon.log) après un
Code :
- sudo udevadm control --log-priority=info
|
Un redémarrage d'udev ([i]rc.d restart udev) et le branchement de ta clef/dd ?[/i]
* Source :
** forum.hardware.fr#1233051
usbmount
* Solution non utilisée.
Je ne sais pas si c'est déjà passé mais voici un truc pour monter automatiquement les clés USB et disque dur au démarrage si vous avez installé Debian sur une clé USB :
Code :
- apt-get install usbmount
- Modifier /etc/usbmount/usbmount.conf pour rajouter ntfs dans FILESYSTEMS
- Récupérer le fichier usbmount-start à cet endroit http://bugs.debian.org/cgi-bin/bug [...] bug=508699 et copier le dans /etc/init.d
- chmod 755 usbmount-start
- update-rc.d usbmount-start start 99 S
|
Le coup du usbmount-start c'est pour qu'il monte aussi les clés USB si vous démarrez la machine avec la clé USB déjà branchée
* Source :
** forum.hardware.fr#1266885
Encore un autre truc : utiliser ext2 sur une clé USB pour l'OS c'est pas terrible en cas de coupure de courant.
Malheureusement si on utilise ext3, cela va vite fatiguer la clé avec de nombreux cycles d'écriture (à ce qu'il paraît...).
Heureusement ext4 est là pour vous sauver.
Pour cela l'astuce est de suivre la procédure normale d'installation de Debian sur votre clé USB (http://jeff.doozan.com/debian/) et de :
Code :
- rebootez sans avoir la clé branchée
- une fois sous Pogoplug : fw_setenv usb_rootfstype ext4
- puis branchez votre clé USB qui va sans doute se retrouver sur /dev/sda
- tune2fs -O extents,uninit_bg,dir_index /dev/sda1
- rebootez (avec la clé branchée) et éditez ensuite /etc/fstab et à la ligne /dev/sda1, remplacez ext2 par ext4
- rebooter une dernière fois (vous pouvez éviter la dernière manip en éditant directement le fichier de la clé USB sous Pogoplug)
|
En gros on transforme l'ext2 en ext4 !
* Source :
** forum.hardware.fr#1266886
Je ne voulais pas ext2 car je voulais que cela remarche automatiquement en cas de coupure de courant (j'ai déjà eu le cas où j'ai du faire manuellement un e2fsck après un débranchement sauvage, sinon ça ne bootait plus).
Ext3 est apparemment trop exigeant pour une pauvre clé USB, donc je me suis tourné vers ext4 qui est un peu un compromis entre les deux (allocation retardée).
C'est un peu expliqué ici :
http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/
Donc en gros, ext2 n'est pas acceptable pour moi, donc il fallait bien trouver quelque chose d'autre. Si vous avez une meilleure idée...
* Source :
** forum.hardware.fr#1266989
Veille des disques
sdparm
* Installation
Code :
- [root@DockStar ~]# pacman -S sdparm
|
* Liste des paramètres
Code :
- [root@DockStar ~]# sdparm -al -6 /dev/sda
- /dev/sda1: Seagate FreeAgent Go 102D
- Direct access device specific parameters: WP=0 DPOFUA=0
- Power condition [po] mode page:
- PM_BG 0 [cha: n, def: 0, sav: 0] Power management, background functions, precedence
- STANDBY_Y 0 [cha: n, def: 0, sav: 0] Standby_y timer enable
- IDLE_C 0 [cha: n, def: 0, sav: 0] Idle_c timer enable
- IDLE_B 0 [cha: n, def: 0, sav: 0] Idle_b timer enable
- IDLE 0 [cha: n, def: 0, sav: 0] Idle_a timer enable
- STANDBY 0 [cha: n, def: 1, sav: 0] Standby_z timer enable
- ICT 0 [cha: n, def: 0, sav: 0] Idle_a condition timer (100 ms)
- SCT 0 [cha: n, def:3000, sav: 0] Standby_z condition timer (100 ms)
- Power consumption [ps] mode page:
- ps_id 0 [cha: n, def: 0, sav: 0] Power consumption identifier
- SAT ATA Power condition [apo] mode page:
- APMP 0 [cha: n, def: 0, sav: 0] Advanced Power Management (APM) enabled/change
- APM 0 [cha: n, def: 0, sav: 0] Advanced Power Management (APM) value
|
* Désactivation (-c, --clear).
Code :
- [root@DockStar ~]# sdparm -c STANDBY -6 /dev/sda
- /dev/sda: Seagate FreeAgent Go 102D
|
* Etat (-g, --get).
Code :
- /dev/sda: Seagate FreeAgent Go 102D
- STANDBY 0 [cha: n, def: 1, sav: 0]
|
* Activation (-s, --set).
** Marche pas.
Code :
- [root@DockStar ~]# sdparm -s STANDBY=1 -6 /dev/sda
- /dev/sda: Seagate FreeAgent Go 102D
|
* Activation (-D, --defaults et -p, --page).
Code :
- [root@DockStar ~]# sdparm -D -p 0x1a -6 /dev/sda
- /dev/sda: Seagate FreeAgent Go 102D
|
* Délai de mise en veille
Code :
- [root@DockStar ~]# sdparm -s SCT=3000 --save /dev/sda
|
Me confirme que le mode standby est bien activé à 5 min, comme spécifié par l'utilitaire windows Seagate. (SCT = 3000 10ème de secondes=5min).
Par contre mon dd est jamais en standby j'ai l'impression (la led est toujours allumé) et je ne sais pas comment le savoir de façon sure(vu que hdparm foire).
Pour info en faisant un sdparm --command=stop, les led s'éteignent bien....
Il y a t-il un moyen "d'appliquer" la mise en veille programmée via le SCT?
hdparm
* Installation
Code :
- [root@DockStar ~]# pacman -S hdparm
|
-y
Force an IDE drive to immediately enter the low power consumption standby mode, usually causing it to spin down. The current power mode status can be checked using the -C option.
-Y
Force an IDE drive to immediately enter the lowest power consumption sleep mode, causing it to shut down completely. A hard or soft reset is required before the drive can be accessed again (the Linux IDE driver will automatically handle issuing a reset if/when needed). The current power mode status can be checked using the -C flag.
-C
Check the current IDE power mode status, which will always be one of unknown (drive does not support this command), active/idle (normal operation), standby (low power mode, drive has spun down), or sleeping (lowest power mode, drive is completely shut down). The -S, -y, -Y, and -Z options can be used to manipulate the IDE power modes.
* standby mode
Code :
- [root@DockStar ~]# hdparm -y /dev/sda
- /dev/sda:
- issuing standby command
|
* sleep mode
Code :
- [root@DockStar ~]# hdparm -Y /dev/sda
- /dev/sda:
- issuing sleep command
|
* check state
Code :
- [root@DockStar ~]# hdparm -C /dev/sda1
- /dev/sda1:
- drive state is: standby
|
script udev
* Source :
** forum.hardware.fr#1232508.
Erreurs NAND
* La commande dmesg affiche beaucoup d'erreurs de ce type.
Code :
- [ 42.881971] uncorrectable error :
- [ 42.885223] end_request: I/O error, dev mtdblock1, sector 0
- [ 42.891001] Buffer I/O error on device mtdblock1, logical block 0
- [ 42.897346] uncorrectable error :
- [ 42.900649] end_request: I/O error, dev mtdblock1, sector 0
- [ 42.906434] Buffer I/O error on device mtdblock1, logical block 0
- [ 42.913050] uncorrectable error :
- [ 42.916300] end_request: I/O error, dev mtdblock1, sector 0
- [ 42.922078] Buffer I/O error on device mtdblock1, logical block 0
- [ 42.928505] uncorrectable error :
- [ 42.931750] end_request: I/O error, dev mtdblock1, sector 8
- [ 42.937530] Buffer I/O error on device mtdblock1, logical block 1
- [ 42.943859] uncorrectable error :
- [ 42.947106] end_request: I/O error, dev mtdblock1, sector 8
- [ 42.952886] Buffer I/O error on device mtdblock1, logical block 1
- [ 42.959677] uncorrectable error :
- [ 42.962975] end_request: I/O error, dev mtdblock1, sector 8
- [ 42.968758] Buffer I/O error on device mtdblock1, logical block 1
|
De ce que j'ai lu, la mémoire NAND a un taux habituellement élevé de secteurs défectueux, et les constructeurs en tiennent compte en faisant de la correction d'erreur, a priori le message est purement cosmétique, derrière tout fonctionne bien.
* Sources :
** forum.doozan.com
** forum.hardware.fr#1230761.
Compilation
Cross Compilation
* Pas utilisé pour l'instant.
* Sources :
** http://plugcomputer.org/plugwiki/i [...] g_Computer
** http://www.nas-central.org/wiki/Se [...] _compiling
** http://dev.shyd.de/2011/03/docksta [...] toolchain/
** http://forum.doozan.com/read.php?2,6010,6010
** http://forum.doozan.com/read.php?2,2694,2715
Environnement de Compilation
Code :
- [root@DockStar ~]# pacman -S base-devel
- [root@DockStar ~]# pacman -S git
- [root@DockStar ~]# pacman -S mercurial
|
AUR
* Sources :
** AUR sur wiki.archlinux.org.
** Creating_Packages sur wiki.archlinux.org.
** Arch Build System sur wiki.archlinux.org.
Message édité par bmd_online le 09-03-2012 à 21:45:29