Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

Debian on LaCie 2Big v2 (1 reply)

$
0
0
Hello there we meet again after playing with 2 Netgear Stora one My cloud Home now I`ve got my hands on this LaCie 2Big

Steps i`ve done so far.

Got a USB and created the rootfs

sudo parted -s /dev/sdX mklabel msdos
sudo parted -s /dev/sdX mkpart primary 1 100%
sudo mkfs.ext3 -L rootfs /dev/sdX1

Now that the partition is ready and the Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is Downloaded let`s write it on the new created partition
We Follow the Guide from just under the Downloaded rootfs ,so we Don`t get in trouble :))
# uncompressing file

sudo tar -xjf ~/Downloads/Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2 -C /media/USERNAME/rootfs/

# cd into boot folder so we may follow the instructions

cd boot/

# i`ll run " sudo su " so i don`t have to run sudo command and just copy, paste, enter
sudo su
cp -a zImage-6.5.7-kirkwood-tld-1  zImage.fdt
cat dts/kirkwood-net2big.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-6.5.7-kirkwood-tld-1 -d zImage.fdt  uImage

# Run sync so we make sure that everything finished

sync

# now let`s unmount and remove created USB

umount /media/USERNAME/rootfs

Because i am a little crazy i will not use CLUNC or tftp but serial connection so i have opened the box and attached a serial cable got from amazon
You can see in the Attached image RX TX GND location

VIEW IMAGE!

let`s connect to the serial plugged in usb serial cable opened terminal and

sudo apt update
sudo apt install picocom -y
sudo picocom -b 115200 /dev/ttyUSB0

Usb inserted in the back of LaCie network cable and power cord ON so let`s press the black power on button

PS: Because LaCie has no drives will probably get me to a sort of rescue that has no point so i stopped at U-Boot by pressing CTRL + C when i saw LACIE LOGO

          _            ____ _                                                                                     
         | |     __ _ / ___(_) ___                                                                                
         | |    / _V | |   | |/ _ \                                                                               
         | |__ | (_| | |___| |  __/                                                                               
         |____| \__,_|\____|_|\___|                                                                               
 _   _     ____              _                                                                                    
| | | |   | __ )  ___   ___ | |_                                                                                  
| | | |___|  _ \ / _ \ / _ \| __|                                                                                 
| |_| |___| |_) | (_) | (_) | |_                                                                                  
 \___/    |____/ \___/ \___/ \__|                                                                                 
 ** MARVELL BOARD: L2BIG_DDR3 REV: 1 LE                                                                           
Hold front button - long :  FAIL                                                                                  


U-Boot 1.1.4 (Mar 21 2012 - 11:02:55) Marvell version: 3.5.9 LaCie 2.0.6                                          

U-Boot code: 06000000 -> 0607FFF0  BSS: -> 060D14C0

Soc: 88F6282 A1CPU running @ 2000Mhz L2 running @ 500Mhz
SysClock = 500Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 7 tRP = 8 tRAS = 20 tRCD=8
DRAM CS[0] base 0x00000000   size 256MB 
DRAM Total size 256MB  16bit width
Addresses 98M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (98M - 97M): Done
NAND:256 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
PEX 1: interface detected no Link.
SCSI:  AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: 64bit ncq pm led clo pmp pio slum part 
scanning bus for devices...
Invaild port number 2
Invaild port number 3
Net:   egiga0 [PRIME]
Waiting for LUMP (3)

Abort
no lump receive; continuing
Waiting for LUMP (0)
no lump receive; continuing
Marvell>>

Now i can see that is a stock Uboot runnig help command will show you that " boot " command is not available , so is a custom uboot
Due to no " boot " command available i cannot test if the setenv will work !
Not scared of Bricking the box so i run

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'

# i will save the envs
saveenv
printenv

Marvell>> printenv
bootargs=console=ttyS0,115200
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
uboot_capabilities=gpt,lba64
start_lump=lump 3
pre_lump=lump 1
resetdisk=ide reset
boot_fail=lump
loadaddr=0x800000
console=console=ttyS0,115200
kernel_addr=${loadaddr}
mtdids=nand0=nand_mtd
mtdparts=mtdparts=nand_mtd:1m(u-boot),16m(uImage),-(root)
disk_list=0 1
legacy_set_rootfs=if test $boot_disk -eq 0; then rootfs=/dev/sda7; elif test $boot_disk -eq 1; then rootfs=/dev/sdb7; fi
legacy_nand_bootargs=setenv bootargs ${console} reset=${resetFlag_env} root=/dev/mtdblock2;
legacy_nand_boot=echo Booting legacy NAND installer...; if nboot ${loadaddr} uImage; then run legacy_nand_bootargs; bootm; fi
legacy_disk_bootargs=setenv bootargs ${console} reset=${resetFlag_env} root=${rootfs};
legacy_disk_boot=echo Booting legacy layout...; if test ${resetFlag_env} -ne 0; then part_list=6; else part_list="A 6"; fi;for p in ${part_list}; do for boot_disk in ${disk_list}; do if disk ${loadaddr} ${boot_disk}:$p; then run legacy_set_rootfs; run legacy_disk_bootargs; bootm; fi; done; done
legacy_boot=run legacy_disk_boot || run legacy_nand_boot
nexus_max_count=3
nexus_nv_part=3
nexus_inc_count=if test ${boot_count} -eq 0; then setenv boot_count 1; elif test ${boot_count} -eq 1; then setenv boot_count 2; else setenv boot_count ${nexus_max_count}; fi
nexus_set_root=if test $saved_entry -eq 1; then root_part=5; else root_part=4; fi
nexus_load_flags=ext2get ide ${boot_disk}:${nexus_nv_part} /ubootenv boot_count saved_entry
nexus_save_flags=ext2set ide ${boot_disk}:${nexus_nv_part} /ubootenv boot_count ${boot_count}
nexus_load_image=ext2load ide ${boot_disk}:${root_part} ${loadaddr} ${image} && iminfo ${loadaddr}
nexus_uuid=ext2uuid ide ${boot_disk}:${nexus_nv_part}; boot_uuid=${uuid}; ext2uuid ide ${boot_disk}:${root_part}; root_uuid=${uuid}
nexus_bootargs=run nexus_uuid; setenv bootargs ${console} boot=UUID=${boot_uuid} root=UUID=${root_uuid}
nexus_can_boot=test ${bootfail} -eq 0 -a ${countfail} -eq 0 -a ${button} -eq 0 -a ${user} -eq 0
nexus_rescue_countfail=test ${boot_count} -ge ${nexus_max_count}
nexus_rescue_user=ext2get ide ${boot_disk}:3 /ubootenv rescue && test ${rescue} -eq 1
nexus_rescue_bootargs=test -n ${bootfail} && setenv bootargs bootfail=${bootfail} ${bootargs}; test -n ${countfail} && setenv bootargs countfail=${countfail} ${bootargs}; test -n ${user} && setenv bootargs user=${user} ${bootargs}; test -n ${button} && setenv bootargs button=${button} ${bootargs}
nexus_nand_bootargs=setenv bootargs ${console} root=/dev/mtdblock2; if test -n ${boot_disk}; then run nexus_uuid; setenv bootargs ${bootargs} boot=UUID=${boot_uuid}; fi
nexus_boot_rescue=echo Booting Nexus rescue from NAND...; if nboot ${loadaddr} uImage; then run nexus_nand_bootargs; run nexus_rescue_bootargs; bootm; fi
nexus_panic=boot_disk=; run nexus_boot_rescue
nexus_boot=test -n ${resetFlag_env} && button=${resetFlag_env}; for boot_disk in ${disk_list}; do echo Booting Nexus layout from disk ${boot_disk}...; countfail=0; bootfail=0; user=0; if run nexus_load_flags; then run nexus_rescue_countfail && countfail=1; run nexus_set_root; image=/boot/uImage; run nexus_load_image || bootfail=1; run nexus_rescue_user && user=1; if run nexus_can_boot; then run nexus_inc_count; run nexus_save_flags; run nexus_bootargs; bootm; bootfail=1; fi; run nexus_boot_rescue; fi; done; bootfail=1; countfail=; user=;run nexus_panic
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethmtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
ethact=egiga0
usb_set_bootargs=setenv bootargs ip=dhcp console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
load_uinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
usb_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
bootcmd=usb start; run usb_bootcmd; usb stop; reset
bootdev=ide
devices=ide usb
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
disaMvPnp=no
ethaddr=00:D0:4B:96:1D:F0
resetFlag_env=0
bootdelay=0
pcieTune=no

Environment size: 4671/131068 bytes
Marvell>> 
reset

Now everything Boots perfectly untill

Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "eth0"
Failed to get interface index: No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.
ifup: failed to bring up eth0
failed.
Starting RPC port mapper daemon: rpcbind.
Starting NFS common utilities: statd idmapd.
Cleaning up temporary files....
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Not starting NFS kernel daemon: no exports ... (warning).
Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
986 (syslogd)
.
Starting NTP server: ntpd2003-07-29T01:18:18 ntpd[1007]: INIT: ntpd ntpsec-1.2.2: Starting
2003-07-29T01:18:18 ntpd[1007]: INIT: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 104:106
.
Starting system message bus: dbus.
Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Starting NTP server: ntpd.
Starting OpenBSD Secure Shell server: sshdsshd: no hostkeys available -- exiting.
 failed!
Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1010 (klogd)
.
Running local boot scripts (/etc/rc.local)
ssh-keygen: generating new host keys: RSA 
ECDSA 
ED25519 

Starting OpenBSD Secure Shell server: sshd
.
.

Debian GNU/Linux 12 debian ttyS0

debian login:

So i can see that eth0 has failed and logic the ssh failing is due to eth0 not being up

logged in as root with password root as default and runned " ifconfig -a " to check if it is a problem of renaming

Linux debian 6.5.7-kirkwood-tld-1 #2 PREEMPT Wed Oct 18 21:14:11 PDT 2023 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 31 18:33:32 PDT 2023 from fe80::4f8:63a5:4900:ad47%eth0 on pts/0
debian
LaCie 2Big Network v2
Linux version 6.5.7-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #2 PREEMPT Wed Oct 18 21:14:11 PDT 2023
Debian 12.2
Tue Jul 29 01:22:25 PDT 2003 up 4 minutes
root@debian:~# ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12  bytes 1710 (1.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1710 (1.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@debian:~#

but there is no lan so i`ve tried to bring it up with
ifup eth0

Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "eth0"
Failed to get interface index: No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.
ifup: failed to bring up eth0

in dmesg i get only 2 issues



[    3.772938] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff
[    3.781056] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    3.789655] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    3.803203] mdio_bus f1072004.mdio-bus-mii: MDIO device at address 8 is missing.

PS: why is there wireguard ?

Anyways , my issue is probably related to uboot so give me some ideas to go on from this point .

Thank you !

Viewing all articles
Browse latest Browse all 3247

Trending Articles