root Access to GoFlex Home without Registering Device

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

root Access to GoFlex Home without Registering Device

Postby mlitke » Sun Nov 18, 2012 8:18 am

I have a number of different ARMv5 devices, but my preference is for the GoFlex Home. It is very small, accepts a 3.5 inch SATA drive, and when I got mine they were available on eBay for less than $20. I established a serial connection with the device before the first time booting one so I could watch the boot sequence, and I assumed (incorrectly) once it had booted, I would be able to access the device as root. To my surprise I could not access the device as root through the serial connection. I checked out the install instructions for Arch Linux ARM and saw that in order to gain root access to the device I first had to register it. Reluctantly, I registered the device and proceeded to install Arch Linux ARM. Since then, I have found a few ways to gain root access to the device without having to register it. In case anyone else is interested, I have outlined the steps below, all but one of the procedures requires a serial connection. I have tried them all (some several times) and they work for me, but I take no responsibility for them working for you, so USE AT YOUR OWN RISK. If you do not have a fairly decent understanding of Linux, some understanding of U-Boot and/or you do not have a way to access the device through a serial connection, I recommend you DO NOT run the procedures.

Happy root access!

Method 1
Through ssh using Seagate's recovery images with a modified initrd file (requires modifying an initrd file):
1. Download the Seagate recovery image at: http://s3.amazonaws.com/downloads-axent ... rmware.zip
2. Decompress the files in goflex_2_7_1_firmware.zip to a USB drive
3. Modify the initrd file to update /etc/passwd to allow root access:
3a. Strip the 64 byte U-Boot header off the file:
Code: Select all
> dd if=initrd of=initrd-noheader.gz skip=64 bs=1

3b. Decompress the header-less file:
Code: Select all
> gunzip initrd-noheader.gz

3c. Mount the file system:
Code: Select all
> mount -o loop initrd-noheader <mount point>

3d. Update the last two lines in the file: <mount point>/etc/init.d/rcS
From:
Code: Select all
umount /mnt/usb
reboot

To:
Code: Select all
umount /mnt/usb

# Attach the root file system and update /etc/passwd
echo "**** Attaching UBI file system"
ubiattach /dev/ubi_ctrl -m 2 -O 2048
if [ $? != 0 ]; then
        echo "**** ERROR - Could not attach UBIFS"
fi
mdev -s
mkdir -p /mnt/ubifs

# sleep a while to allow devices to settle
sleep 5

echo "**** Mounting root file system"
mount -t ubifs ubi0 /mnt/ubifs

echo "**** Updating system password file"
sed -i 's/root:\*:/root:\$1\$3h5WisJ4\$JbJ\/AJORbUw8Mf.LtNVtp\/:/' /mnt/ubifs/etc/shadow
reboot

3e. Unmount the file system:
Code: Select all
> umount <mount point>

3f. Compress the updated file system:
Code: Select all
> gzip initrd-noheader

3g. Make the file system into a U-Boot image:
Code: Select all
>mkimage -A arm -O linux -C gzip -T ramdisk -n initramfs -d initrd-noheader.gz initrd

NOTE: mkimage is from the uboot-mkimage pkg and is much easier to run on a target system (versus setting up a cross development tool chain)
4. Copy the modified initrd file to the USB drive (overwrite the initrd file from the Seagate image)
5. Insert the USB drive into the device
6. Hold the reset button on the device
7. Power up the device on the LAN
8. Wait for the flashing light on the front of the device to turn white
9. Release the reset button
10. Wait for the flashing light on the front of the device to turn yellow(? or green?) again (it will take about 2 minutes)
11. Wait for the light on the front to stop flashing (it will take about 2 minutes)
12. The device should have an IP address on the LAN and be accessible as root via ssh, root's password is root

Method 2
Through a serial connection using the Arch Linux ARM image:
1. Unpack the latest Arch Linux ARM armv5te files (from ArchLinuxARM-armv5te-latest.tar.gz) to a USB drive
2. Insert the USB drive into the device
3. Establish a serial connection with the device
4. Enter the UBoot environment by hitting a key when prompted with:
Code: Select all
Hit any key to stop autoboot:

5. Set the architect number and mainlineLinux environment variables (if they are not already set):
Code: Select all
  NAS>> setenv arcNumber 3089
  NAS>> setenv mainlineLinux yes
  NAS>> saveenv
  NAS>> reset

NOTE: The mainlineLinux ?and arcNumber? settings are only checked when U-Boot first starts, so if you change their values you must reset the device.
6. After the reset, enter the UBoot environment and boot the Arch Linux ARM image by running the following commands:
Code: Select all
  NAS>> usb start
  NAS>> setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 usb_rootfstype=ext2 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
  NAS>> ext2load usb 0:1 0x800000 /boot/uImage
  NAS>> bootm 0x800000


Method 3
Through a serial connection using Seagate's recovery images:
1. Download the Seagate recovery image at: http://s3.amazonaws.com/downloads-axent ... rmware.zip
2. Decompress the files in goflex_2_7_1_firmware.zip to a USB drive
3. Insert the USB drive into the device
4. Establish a serial connection with the device
5. Hold the reset button on the device
6. Power up the device
7. Wait for the flashing light on the front of the device to turn white, the serial connection will display the message:
Code: Select all
    <Explorer> Enter USB firmware instllation by RESET IO.

8. Release the reset button
9. Watch the text displayed by the serial connection
10. Wait for the following message:
Code: Select all
  **** PRESS ENTER TO STOP THE COUNT DOWN
  **** Will flash tarball from USB disk to internal NAND /dev/mtdblock1
  **** This will wipe out EVERYTHING on the internal NAND flash
  **** Will wait 10 seconds before the flash.

11. Press enter to stop flashing from the USB drive
12. Press enter again to gain access to the console (the console allows root access to the system)
13. Remove the USB drive from the device
NOTE: If the device hangs after decompressing the kernel, make sure the UBoot mainlineLinux environment variable is set to no.
mlitke
 
Posts: 54
Joined: Sat Apr 30, 2011 5:27 am

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 1 guest