User Tools

Site Tools


doc:appunti:hardware:lacie_d2_network_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:lacie_d2_network_2 [2010/12/15 17:36] – [Cross compile a Debian kernel] niccolodoc:appunti:hardware:lacie_d2_network_2 [2014/01/28 10:22] (current) – [Hacking the LaCie d2 Network 2] niccolo
Line 1: Line 1:
 ====== Hacking the LaCie d2 Network 2 ====== ====== Hacking the LaCie d2 Network 2 ======
  
-The **LaCie d2 Network 2** is very similar to the **[[lacie_d2_network|LaCie d2 Network]]**, luckily enough the hardware is better and gives better performances. Just one thing is worst than before: the Wake-On-LAN is not longer handled by the U-Boot code, it is handled by the init scripts. This means that if you install a plain GNU/Linux system, you must install special software to get the Wake-On-LAN function (if it is possible at all).+{{.:lacie:lacie_d2_network.jpg?160  |LaCie d2 Network}} 
 + 
 +The **LaCie d2 Network 2** is very similar to the **[[lacie_d2_network|LaCie d2 Network]]**, luckily enough the hardware is better and gives better performances. Just one thing is worst than before: the Wake-On-LAN is not longer handled by the U-Boot code, it is handled by the init scripts. This means that if you install a plain GNU/Linux system, you must install special software to get the Wake-On-LAN function.
  
 The LaCie software is changed a lot. May be it is possible get root access without disassembling it, have a look at the [[#the_auto-update_function|Auto-Update function]]. The LaCie software is changed a lot. May be it is possible get root access without disassembling it, have a look at the [[#the_auto-update_function|Auto-Update function]].
Line 211: Line 213:
  
 The Wake-On-LAN is **not handled by the U-Boot code** (like in the LaCie d2 Network). When the power switch is onto the ON position, the U-Boot always begins the boot process spinning-on the disk, during the boot process a script checks if the Deep Sleep Mode is active, in that case it halts the disk and wait for the Magic Packet. The Wake-On-LAN is **not handled by the U-Boot code** (like in the LaCie d2 Network). When the power switch is onto the ON position, the U-Boot always begins the boot process spinning-on the disk, during the boot process a script checks if the Deep Sleep Mode is active, in that case it halts the disk and wait for the Magic Packet.
 +
 +If you install a plain Debian operating system, you can use the **[[#fake_wake-on-lan|Fake Wake-On-LAN]]** software to simulate a Wake-On-LAN.
 ===== Installing Debian ===== ===== Installing Debian =====
  
Line 312: Line 316:
 </code> </code>
  
-FIXME How to extract the initramfs from the vmlinux image? The recipe below (//Dismantling the Kernel//) does not applybecause the bzip2 signature **''BZh''** does not exists.+**How to extract the initramfs from the vmlinux image.** 
 + 
 +First of all search for a gzip signature (**''1F 8B 08''**) into the vmlinux file: 
 + 
 +<code> 
 +</code> 
 + 
 +Say the gzip signature offset is 12504extract the gzip data and expand it: 
 + 
 +<code> 
 +dd if=vmlinux of=vmlinux_data1.gz bs=1 skip=12504 
 +gunzip vmlinux_data1.gz 
 +</code> 
 + 
 +Search again for a gzip signature, extract the gzip data and expand it. The resulting file is the **{{.:lacie:d2net2_initramfs.cpio.gz|initramfs cpio}}** archive: 
 + 
 +<code> 
 +dd if=vmlinux_data1 of=vmlinux_data2.gz bs=1 skip=88928 
 +gunzip vmlinux_data2.gz 
 +mv vmlinux_data2 initramfs.cpio 
 +mkdir initramfs 
 +cd initramfs 
 +cat ../initramfs.cpio | cpio --extract --make-directories  --no-absolute-filenames 
 +</code>
  
 === Useful links === === Useful links ===
  
   * [[http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt|ramfs, rootfs and initramfs]]   * [[http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt|ramfs, rootfs and initramfs]]
 +  * [[http://www.gossamer-threads.com/lists/linux/kernel/1015140|Initramfs from existing vmlinuz]]
   * [[http://en.gentoo-wiki.com/wiki/Initramfs|Dismantling the Kernel]]   * [[http://en.gentoo-wiki.com/wiki/Initramfs|Dismantling the Kernel]]
   * [[http://blog.harrylau.com/2009/08/generate-uboot-uimage.html|Generate uboot image]]   * [[http://blog.harrylau.com/2009/08/generate-uboot-uimage.html|Generate uboot image]]
Line 375: Line 403:
 Install the **[[http://packages.debian.org/experimental/linux-source-2.6.37|linux-source-2.6.37]]** package from Debian experimental. We need 2.6.37 because previous versions does not have support for LaCie d2 Network 2 hardware. Install the **[[http://packages.debian.org/experimental/linux-source-2.6.37|linux-source-2.6.37]]** package from Debian experimental. We need 2.6.37 because previous versions does not have support for LaCie d2 Network 2 hardware.
  
-Using the kernel config file provied by Debian for the kirkwood architecture as a starting point, we made some changes to add support for our LaCie machine (**''MACH_D2NET_V2''**), the RTC clock (**''RTC_DRV_MV''**), etc. This is the final **{{.:lacie:config-2.6.37-rc5_lacie2dn2.0.15.txt|config}}** file.+Using the kernel config file provied by Debian for the kirkwood architecture as a starting point, we made some changes to add support for our LaCie machine (**''MACH_D2NET_V2''**), the RTC clock (**''RTC_DRV_MV''**), etc. This is the final **{{.:lacie:config-2.6.37-rc5_lacie2dn2.0.15.txt|config}}** file and **[[http://www.rigacci.org/pub/Linux/kernel-lacie/linux-image-2.6.37-rc5_lacie2dn2.0.15_armel.deb|linux-image]]** package.
  
 Prepare the source tree: Prepare the source tree:
Line 407: Line 435:
 dd if=uImage of=/dev/sda6 dd if=uImage of=/dev/sda6
 </code> </code>
 +
 +===== Fake Wake-on-LAN =====
 +
 +The Ethernet chip does not have WoL capabilities (whereas the old d2 Network does), so we can only simulate it. This is my first attempt to make a software Wake-on-LAN.
 +
 +At an early stage of the boot process the **''fake-on-lan''** program suspends the USB power, turn off the blue LED and suspend the disk. Then the program waits for a Wake-on-LAN Magic Packet or for a Power Button press/release before to proceed. The device is effectively powered-on and running the Linux kernel, just the USB, the LED and the disk are turned off. I'm running the program with a **Debian Squeeze** installation.
 +
 +You can download the program here: **{{.:lacie:fake-on-lan-20110324.tar.gz|fake-on-lan-20110324.tar.gz}}**.
 +
 +===== The EEPROM =====
 +
 +The content of the EEPROM is exposed for read and write via the pseudo file **''/sys/bus/i2c/devices/0-0050/eeprom''**, like with the previous d2 Network model, but the meaning is changed. This is what I know:
 +
 +^ Offset  ^ Length  ^ Content  ^
 +|       0 |       2 | 0x00 0x02              |
 +|       2 |       6 | Ethernet MAC address.  |
 +
doc/appunti/hardware/lacie_d2_network_2.1292430969.txt.gz · Last modified: 2010/12/15 17:36 by niccolo