Repair Lacie Cloudbox after failed install of latest firmwar

Post Reply
fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Sat Aug 01, 2015 5:51 pm

instead of trying to modify it via u-boot we can also use the standalone kernel to get the file from the partition 3 at seems to be a ext2 formatted partition.

To get fire up the standalone kernel en mount sda3

Code: Select all

mkdir /sda3
mount /dev/sda3 /sda3
copy the file using tftp server to your windows PC

Code: Select all

tftp -l /sda3/bootenv -r ubootenv -p ip-c
In this command replace ip-pc by actual ip address of your pc running the fvdw-sl console.
Now you will find the file in the tftp folder of the fvdw-sl console.
Put in a zip archive and upload on plugout forum or edit it yourself using a hex editor. A editor like notepad will probably not work if this file is not a normal text file.

Getting the the modified file on partion 3 goes in a similar way only use the option "-g" instead of "-p" before ip-pc in the tftp command shown

dmiyabara
Posts: 61
Joined: Thu Jul 09, 2015 9:33 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by dmiyabara » Sun Aug 02, 2015 12:20 pm

I guess there is something more to do. Tried all the 3 files and keeps with the red light.

Is there another command to see what is happening?

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by Mijzelf » Sun Aug 02, 2015 1:02 pm

Depends where it fails. If you go to the u-boot prompt, and execute 'bootm', you can see the boot until the kernel loads. At least that will tell you where the kernel comes from, and which rootfs is used.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Sun Aug 02, 2015 1:30 pm

I suspose myself proposes to do this again in u-boot console

Code: Select all

setenv root_part 5
ide reset
setenv image /boot/uImage
run nexus_load_image
run nexus_bootargs
bootm
(and of course for root_part 4)

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by Mijzelf » Sun Aug 02, 2015 2:12 pm

Hm, no, that is not what I meant. I wanted to let it boot unattended, to see which settings are used which lead to the read led. But bootm is not the right command indeed. Is it 'go'? I guess 'run ${bootcmd}' should also work.

dmiyabara
Posts: 61
Joined: Thu Jul 09, 2015 9:33 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by dmiyabara » Thu Aug 06, 2015 3:20 am

I used this code:

Code: Select all

setenv root_part 5
ide reset
setenv image /boot/uImage
run nexus_load_image
run nexus_bootargs
bootm
and everything started to work again, without the need to move folders or anything else. But I haven't tried to turn off the NAS. I will keep using in this way, because I need those files to my work, and after I finish it, I will try to turn off.

And this command

Code: Select all

run ${bootcmd}
I use it alone?

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by Mijzelf » Thu Aug 06, 2015 8:47 am

dmiyabara wrote:And this command

Code: Select all

run ${bootcmd}
I use it alone?
Yes. ${bootcmd} is the command which is executed when you don't interrupt the bootloader.
Ultimately this will fail. But it was clear that the goal is to get the bootlog, to see what it's actually doing?

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Thu Aug 06, 2015 9:10 am

setenv root_part 5
ide reset
setenv image /boot/uImage
run nexus_load_image
run nexus_bootargs
bootm
If this works then to my opinion the only reason why the normal boot doesn't work must be that it tries to use partition 4. As these commands are the same as in the bootscript of uboot for normal boot. There is also a command that detects to what value the environment variable root_part must be set. There it seems to go wrong. I have no time right now to look in detail, later today I can have a look.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Thu Aug 06, 2015 9:08 pm

this what myself posted on nexus_boot command.

Code: Select all

nexus_boot=
test -n ${resetFlag_env} && forced=${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
What you can see here is that boot will be aborted if nexus_load_flags returns the value false
This is probably what happens . If it returns true then boot continues and uses same commands as you use manually.
So we need to find out why nexus_load_flags returns false
nexus_load_flags=ext2get ide ${boot_disk}:${nexus_nv_part} /ubootenv boot_count saved_entry
So nexus_load_flags is equal to the return value of ext2get function call
Diving nto the u-boot source for the cloudbox I found this about ext2get function

Code: Select all

U_BOOT_CMD(
	ext2get,	CFG_MAXARGS,	0,	do_ext2_getenv,
	"ext2get - get variable(s) from an environment file\n",
	"<interface> <dev[:part]> <filename> [variables ...]\n"
	"    - parse environment file 'filename' on 'dev' on 'interface'\n"
	"      and for each available 'variable', get the corresponding\n"
	"      value. The 'variable=value' tuples are both displayed and\n"
	"      appended to the U-Boot environment.\n" 
Indeed the nexus_load_flags command reads the file /ubootenv and tries to assign to the environment variables boot_count and saved_entry the values found in this file for these parameters.

The code of this function is rather big and can abort for many reasons.
I suggest you give the command (in u-boot console)

Code: Select all

ide reset
ext2get ide 0:${nexus_nv_part} /ubootenv boot_count saved_entry
If it fails it should also spit out a error message. Hopefully that will give us a hint.

dmiyabara
Posts: 61
Joined: Thu Jul 09, 2015 9:33 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by dmiyabara » Thu Aug 06, 2015 9:23 pm

My mistake, now the right code...

Code: Select all

Marvell>> ide reset
ide reset

Reset IDE:
Marvell Serial ATA Adapter

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: ST2000DM001-1CH164                       Firm: CC44     Ser#:             Z2F0VEJ3
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
PCIe SATA:ffffffff

Marvell>> ext2get ide 0:${nexus_nv_part} /ubootenv boot_count saved_entry
ext2get ide 0:${nexus_nv_part} /ubootenv boot_count saved_entry
boot_count=0
saved_entry=0
Marvell>>
I gave it, but forgot to post, lol
Last edited by dmiyabara on Thu Aug 06, 2015 9:42 pm, edited 1 time in total.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Thu Aug 06, 2015 9:37 pm

you forgot to give command

Code: Select all

ide reset
before ext2get..

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Thu Aug 06, 2015 9:48 pm

ok so when it runs the nexus_boot command the parameter "saved_entry" will get the value 0 and as result root_part will be set to partition 4

Code: Select all

nexus_set_root=if test $saved_entry -eq 1; then root_part=5; else root_part=4; fi
Your partition 4 has a problem, we know. But it doesns't fail so it will pass that if statement

You could solve that by putting the ubootenv file with saved_entry=1 and boot_count=0
Then it should set root_part to partiton 5 what we want.
But as you already tried that and still got the red light something else must be wrong
So what happens if you give these commands

Code: Select all

 setenv root_part 5
ide reset
run nexus_boot
Last edited by fvdw on Thu Aug 06, 2015 9:52 pm, edited 2 times in total.

dmiyabara
Posts: 61
Joined: Thu Jul 09, 2015 9:33 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by dmiyabara » Thu Aug 06, 2015 9:50 pm

Trying this code

Code: Select all

Marvell>> setenv root_part 5
setenv root_part 5
Marvell>> ide reset
ide reset

Reset IDE:
Marvell Serial ATA Adapter

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: ST2000DM001-1CH164                       Firm: CC44     Ser#:             Z2F0VEJ3
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
PCIe SATA:ffffffff

Marvell>> run nexus_boot
run nexus_boot
Booting Nexus layout from disk 0...
boot_count=0
saved_entry=0
ERROR: There is a global environment variable with the same name.
Loading file "/boot/uImage" from ide device 0:5 (gpt5
)
7183376 bytes read

## Checking Image at 00800000 ...
   Image Name:   Linux-2.6.31.14-svn7493
   Created:      2013-04-16  10:04:39 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7183312 Bytes =  6.9 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Error: "rescue" not defined
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.31.14-svn7493
   Created:      2013-04-16  10:04:39 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7183312 Bytes =  6.9 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
bootargs from environment variables : console=ttyS0,115200 boot=UUID=e497e3bb-b958-48c5-a972-f16ec25cbbd4 root=UUID=3c68dbc7-fe37-4c60-9f1c-52794c93d802 cap=gpt,lba64

Starting kernel ...

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by fvdw » Thu Aug 06, 2015 9:53 pm

and...no red light normal function ?

dmiyabara
Posts: 61
Joined: Thu Jul 09, 2015 9:33 pm

Re: Repair Lacie Cloudbox after failed install of latest fir

Post by dmiyabara » Thu Aug 06, 2015 9:53 pm

Still waiting, I can access the dashboard...

Post Reply