Welcome! Log In Create A New Profile

Advanced

LG N1T1 NAS

Posted by ron 
Re: LG N1T1 NAS
October 13, 2020 03:22AM
Hi bodhi.

Would the latest u-boot allow booting from a pure gpt system ? I would actually feel better without the hybrid mbr/gpt. Could it allow booting from 2 different gpt partitions whether a usb stick is connected or not (might even be empty, just present) ?
If it is the case, I do have jtag + serial adapter and could do the testing being one month retired with time to spare.

Regards.



Edited 2 time(s). Last edit at 10/13/2020 03:29AM by Jmax.
Re: LG N1T1 NAS
October 13, 2020 06:33PM
Jmax,

> Would the latest u-boot allow booting from a pure
> gpt system ?

> Could it allow booting from 2
> different gpt partitions whether a usb stick is
> connected or not (might even be empty, just
> present) ?

Yes, my released Kirkwood u-boots have all those capabilities.

> If it is the case, I do have jtag + serial adapter
> and could do the testing being one month retired
> with time to spare.
>

I can't promise that I will build new u-boot for this box. At the moment I'm too busy and don't know when I will have a few-days block of free time.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: LG N1T1 NAS
October 15, 2020 02:15AM
bodhi Wrote:
-------------------------------------------------------
> Yes,
> my
> released Kirkwood u-boots
have all those
> capabilities.
>
> > If it is the case, I do have jtag + serial
> adapter
> > and could do the testing being one month
> retired
> > with time to spare.
> >
>
> I can't promise that I will build new u-boot for
> this box. At the moment I'm too busy and don't
> know when I will have a few-days block of free
> time.

Please do not worry about that.
I just mentioned being free to build and test it myself if possible, it is more an academic question than anything else.
Do not take the trouble.
Re: LG N1T1 NAS
October 15, 2020 04:11PM
OK Jmax.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: LG N1T1 NAS
October 16, 2020 01:50AM
Hi bodhi.

I did some more testing after determining that bootrom was version 1.21. kwboot works fine with the first image uboot.2017.07-tld-1.goflexhome.bodhi.tar that mentioned using the same processor, booting proceeds and give me a totally functional debian system.

I am not even sure I need to go any further, the stock N1T1 uboot supports hybrid mbr/gpt, it could as well support plain gpt. I have a spare disk that I shall format gpt, and un'tar the debian, then the stock system. I will update in case somebody comes around.

If I go farther, what should I look for beyond proper disk/net/serial already working ?

I suppose it is a good idea to get the stock uboot backed up and test it with kwboot ?

Regards.

EDIT: I backed up the mtd0 with "nanddump -l 0x80000 -f mtd0 /dev/mtd0" the -n option gives an error. From main PC, I used scp to get the image and tested it with kwboot, works perfectly.



Edited 2 time(s). Last edit at 10/16/2020 02:23AM by Jmax.
Re: LG N1T1 NAS
October 16, 2020 04:06PM
Jmax,

> I did some more testing after determining that
> bootrom was version 1.21. kwboot works fine with
> the first image
> uboot.2017.07-tld-1.goflexhome.bodhi.tar that
> mentioned using the same processor, booting
> proceeds and give me a totally functional debian
> system.

Well done!

>
> I am not even sure I need to go any further,

No need to if you found that stock u-boot works booting the Debian rootfs.

>
> If I go farther, what should I look for beyond
> proper disk/net/serial already working ?

The GoFlex Home and this N1T1 have the same SoC and memory. But different in other aspect such as flash type, LED GPIOs. Might be the same network chip (I have not looked to confirm but it should be).

So while it is OK to kwboot as a rescue tool, it should not be used as is.

> EDIT: I backed up the mtd0 with "nanddump
> -l 0x80000 -f mtd0 /dev/mtd0" the -n option gives
> an error. From main PC, I used scp to get the
> image and tested it with kwboot, works perfectly.

Now you know there is a rescue mechanism working with stock mtd0.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: LG N1T1 NAS
October 21, 2020 12:47AM
Well, I shouted "victory" too soon.

While installing Linux, I did not understand why the partitions were shown as "linux-raid" and lost any possibility of reverting to the original software. The updated u-boot, which support pure gpt prevents from reinstalling the base software. It is fine with Debian though.
I do not know if anybody still has the original 1Tb box and would be capable of extracting the information I missed at the beginning, some much for my eagerness to get the disk upgraded and not keeping the old one as it was :/

If anybody has the original non-upgraded firmware, I would like to get in touch.



Edited 2 time(s). Last edit at 10/24/2020 12:05PM by Jmax.
S
Re: LG N1T1 NAS
October 28, 2020 01:21PM
The original firmware can be downloaded from LG's website. As long, the updated u-boot contains LG's rescue mode, it shouldn't be any problem to use it to restore the raid configuration.
Re: LG N1T1 NAS
October 29, 2020 07:24AM
S Wrote:
-------------------------------------------------------
> The original firmware can be downloaded from LG's
> website. As long, the updated u-boot contains LG's
> rescue mode, it shouldn't be any problem to use it
> to restore the raid configuration.

Hi S.

I did that already, but it fails. Unfortunately, once updated for the new new U-boot, there is no way back, the original software can no longer be installed, I suppose it relies on the old U-boot. The only solution seems to be reverting to the original U-boot.
S
Re: LG N1T1 NAS
November 01, 2020 01:23PM
Jmax Wrote:
-------------------------------------------------------
> S Wrote:
> -------------------------------------------------------
> > The original firmware can be downloaded from
> LG's
> > website. As long, the updated u-boot contains
> LG's
> > rescue mode, it shouldn't be any problem to use
> it
> > to restore the raid configuration.
>
> Hi S.
>
> I did that already, but it fails. Unfortunately,
> once updated for the new new U-boot, there is no
> way back, the original software can no longer be
> installed, I suppose it relies on the old U-boot.
> The only solution seems to be reverting to the
> original U-boot.

The rescue mode will create a raid partition which will require the u-boot to boot the /dev/md0 partition (and not /dev/sda1). So, it might just be wrong configuration. Post your envs and I can compare it with my envs. Otherwise, there exist a uboot file in LG site which can be used to get the old uboot.
Re: LG N1T1 NAS
November 02, 2020 01:24AM
S Wrote:

> The rescue mode will create a raid partition which
> will require the u-boot to boot the /dev/md0
> partition (and not /dev/sda1). So, it might just
> be wrong configuration. Post your envs and I can
> compare it with my envs. Otherwise, there exist a
> uboot file in LG site which can be used to get the
> old uboot.

Yes, the env variable specify /dev/md0 as the root as root_path.

My environment, as it is now after the changes made to boot linux
from hard disk is :

baudrate=115200
loads_echo=0
rootpath=/opt/Orion-SDK/armel-2.0/rootfs
run_diag=yes
console=console=ttyS0,115200 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_nfs=root=/dev/nfs rw
image_name=uImage
boot_name=u-boot.bin
up-boot=tftp 2000000 nt/$(boot_name); sflash protect off; sflash erase all; sflash write 2000000 0 $(filesize)
root_path=root=/dev/md0 rw
read-kern=ide reset; ext2load ide 0 2000000 /boot/$(image_name);
mem-clear=mw.l 1000000 0x00000000 1000000
bootcmd_nfs=tftpboot 0x2000000 $(image_name); setenv bootargs $(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvNetConfig) $(mvPhoneConfig);  bootm 0x2000000; 
bootargs_usb=root=/dev/sdc2 rw rootdelay=10
bootcmd_enc=run mem-clear; set bootargs $(console) $(bootargs_ram) enclosure; ide res; ide load; bootm 1000000 2000000
bootargs_ram=root=/dev/ram0 rw
tftp-ram=tftp 1000000 nt/$(uImage-ram); tftp 2000000 nt/ramdisk_image; set bootargs $(console) $(bootargs_ram); bootm 1000000 2000000
uImage-ram=uImage-2.6.30-nt1_11_ramdisk
bootcmd=run bootcmd_hdd
bootcmd_tftp=tftp 0x2000000 $(image_name); setenv bootargs $(console) $(root_path) lpj=4964352; bootm 0x2000000; 
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
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
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
ethact=egiga0
ethaddr=00:E0:91:81:15:DC
nas_type=0x00000110
firmware=firmware.tar.gz
bootcmd_netenc=set bootargs $(console) $(bootargs_ram) netenc nas_type=$(nas_type) IP=$(ipaddr) SIP=$(serverip) FW=$(firmware); bootm 1000000 2000000
bootcmd_usbenc=set bootargs $(console) $(bootargs_ram) usbenc nas_type=$(nas_type) IP=$(ipaddr) SIP=$(serverip) FW=$(firmware); bootm 1000000 2000000
hdd_off_delay=4000000
arcNumber=1681
bootcmd_hdd=run read-kern; setenv bootargs $(console) $(root_path) lpj=4964352; bootm 0x2000000;
bootargs_deb=console=ttyS0,115200 root=LABEL=debfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial
autoload=no
ipaddr=10.177.190.59
netmask=netmask=255.255.254.0
bootargs_end=:::DB88FXX81:eth0:none
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=1
disaMvPnp=no
hddPowerCtrl=no
enaAutoRecovery=no
pcieTune=no
serverip=10.177.191.39

Some changes were made for Debian, which I tried to revert as
well as possible but, I guess, screwed up something in the process.
I should mention that I tried the rescue process for the new U-boot
system (new UI) but this fails as well. Probably environment being
wrong as you indicate.
In the meantime, I shall search again the LG site to find the u-boot
mentioned.

Regards.

EDIT :
You were right. One single option I overlooked was a "gateway" which
prevented the system from booting. It was straightforward after that, I
was able to restore a full standard system. I just have to figure out how
to fit it with a usb boot for Debian and I will be very happy. Many thanks.



Edited 1 time(s). Last edit at 11/02/2020 04:14AM by Jmax.
S
Re: LG N1T1 NAS
November 08, 2020 03:47PM
Jmax Wrote:
-------------------------------------------------------
> Some changes were made for Debian, which I tried
> to revert as
> well as possible but, I guess, screwed up
> something in the process.
> I should mention that I tried the rescue process
> for the new U-boot
> system (new UI) but this fails as well. Probably
> environment being
> wrong as you indicate.
> In the meantime, I shall search again the LG site
> to find the u-boot
> mentioned.
>
> Regards.
>
> EDIT :
> You were right. One single option I overlooked was
> a "gateway" which
> prevented the system from booting. It was
> straightforward after that, I
> was able to restore a full standard system. I just
> have to figure out how
> to fit it with a usb boot for Debian and I will be
> very happy. Many thanks.

I'm glad it worked out. I have been busy with other things and have almost forgot about the post.
Usb boot should probably be similar steps as described in other posts, haven't tested but it should likely work. Hopefully you will find a solution for it.
gf
Re: LG N1T1 NAS
January 11, 2021 03:04PM
Hello N1T1 owners,

I now run my device with Bodhi's Kernel 5.9.12. Finally an open system, thanks for that.

I need help putting this device on standby.
My first attempt with hdparm spoke to the HDD successfully. Unfortunately, it is reactivated after 3 minutes of running processes.
Is it possible to put the device into energy saving mode with this kernel?

Thanks in advance.
Re: LG N1T1 NAS
January 11, 2021 04:57PM
gf ,

> I need help putting this device on standby.
> My first attempt with hdparm spoke to the HDD
> successfully. Unfortunately, it is reactivated
> after 3 minutes of running processes.

If the rootfs is on the HDD, then don't try to put it to sleep. It is not feasible. Only way to ensure the HDD is sleeping all the time is to have the rootfs on USB.

> Is it possible to put the device into energy
> saving mode with this kernel?

The energy saving mode is possible with this kernel CPU Frequency governor. Install cpufrequtils, and use the cpufreq-set to set the governor to what you like to. There are many modes: userspace, conservative, ondemand, powersave, and performance.

For example, my NSA325 box is set to ondemand. THe CUP is 1.6Ghz, but most of the time it is running at 533 MHz.

uname -a
Linux HomeBackup 5.9.12-kirkwood-tld-1 #1.0 PREEMPT Sat Dec 5 14:05:39 PST 2020 armv5tel GNU/Linux


cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: kirkwood-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 5.0 us.
  hardware limits: 533 MHz - 1.60 GHz
  available frequency steps: 1.60 GHz, 533 MHz
  available cpufreq governors: ondemand, conservative, userspace, powersave, performance
  current policy: frequency should be within 533 MHz and 1.60 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 533 MHz (asserted by call to hardware).

-bodhi
===========================
Forum Wiki
bodhi's corner
gf
Re: LG N1T1 NAS
January 16, 2021 08:11AM
Hello Bodhi,

#1
I wanted to undo my last change. Unfortunately I can no longer save "setenv".
See below:

´┐ŻNormal mode boot start!

 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|  ** LOADER **
 ** LGE-NAS BOARD: NT1 LE

U-Boot 1.1.4 (May 21 2011 - 03:56:55)NT1

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CDEE0

Soc: 88F6281 A1 (DDR2)
CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 333Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 15 tRCD=5
DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB  16bit width
[512kB@f8000000] Flash: 512 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
 Normal mode : lg_bootmode = 0
Hit any key to stop autoboot:  0
LGE-NAS>> printenv                                                              baudrate=115200
loads_echo=0
ipaddr=10.177.190.59
serverip=10.177.191.39
rootpath=/opt/Orion-SDK/armel-2.0/rootfs
netmask=255.255.254.0
run_diag=yes
console=console=ttyS0,115200 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_nfs=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
boot_name=u-boot.bin
up-boot=tftp 2000000 nt/$(boot_name); sflash protect off; sflash erase all; sflash write 2000000 0 $(filesize)
root_path=root=/dev/md0 rw
read-kern=ide reset; ext2load ide 0 2000000 /boot/$(image_name);
mem-clear=mw.l 1000000 0x00000000 1000000
bootcmd_nfs=tftpboot 0x2000000 $(image_name); setenv bootargs $(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvNetConfig) $(mvPhoneConfig);  bootm 0x2000000;
bootcmd_hdd=run read-kern; setenv bootargs $(console) $(root_path) lpj=4964352; bootm 0x2000000;
bootcmd_enc=run mem-clear; set bootargs $(console) $(bootargs_ram) enclosure; ide res; ide load; bootm 1000000 2000000
bootargs_ram=root=/dev/ram0 rw
tftp-ram=tftp 1000000 nt/$(uImage-ram); tftp 2000000 nt/ramdisk_image; set bootargs $(console) $(bootargs_ram); bootm 1000000 2000000
uImage-ram=uImage-2.6.30-nt1_11_ramdisk
bootcmd_tftp=tftp 0x2000000 $(image_name); setenv bootargs $(console) $(root_path) lpj=4964352; bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
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
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
ethaddr=00:E0:91:80:FF:E6
nas_type=0x00000110
firmware=firmware.tar.gz
bootcmd_netenc=set bootargs $(console) $(bootargs_ram) netenc nas_type=$(nas_type) IP=$(ipaddr) SIP=$(serverip) FW=$(firmware); bootm 1000000 2000000
bootcmd_usbenc=set bootargs $(console) $(bootargs_ram) usbenc nas_type=$(nas_type) IP=$(ipaddr) SIP=$(serverip) FW=$(firmware); bootm 1000000 2000000
arcNumber=1681
set_mw=mw 0x800000 0 1
load_bootm=bootm 0x800000 0x2100000
load_usbuimage=ext2load usb 0:1 0x800000 /boot/uImage
load_usbuinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs_usb rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial
bootcmd_usb=run bootargs_usb; usb start; run set_mw; run load_usbuimage; run load_usbuinitrd; run load_bootm
load_myhdduimage=ext2load ide 0:1 0x800000 /boot/uImage
load_myhdduinitrd=ext2load ide 0:1 0x2100000 /boot/uInitrd
bootcmd_myhdd=ide reset; run set_mw; run load_myhdduimage; run load_myhdduinitrd; run load_bootm
bootcmd=run bootcmd_usb; run bootcmd_myhdd; reset
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
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=1
disaMvPnp=no
hddPowerCtrl=no
enaAutoRecovery=no
pcieTune=no

Environment size: 2999/4092 bytes
LGE-NAS>> setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial'
LGE-NAS>> saveenv
Saving Environment to Flash...
Error: start and/or end address not on sector boundary
LGE-NAS>>

# 2
In comparison with raffe's settings from 11/22/2017 05:37, it is noticeable that the following values are missing:

setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial'
setenv run_mw 'mw 0x800000 0 1'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_initrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv bootargs_usb 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial'

# 3
Can the u-boot be saved on a hard drive or USB?
The u-boot settings are based on the latest version from LG. I did not make a backup out of ignorance, so I cannot say whether the settings were missing or whether I accidentally removed them.

# 4
The status today:
~USB only: runs
~HDD only: runs
~USB / HDD both with debian and labeled "rootfs": Boot from USB, then the system is seen on the HDD and continues to load from the HDD. Since I can drive with only HDD.
~USB / empty HDD: Boot from USB, then error due to empty HDD.

Lots of construction sites. Maybe there is a solution for # 1 first.

Thanks in advance.
Re: LG N1T1 NAS
January 16, 2021 03:57PM
gf ,

> I wanted to undo my last change. Unfortunately I
> can no longer save "setenv".

> LGE-NAS>> saveenv
> Saving Environment to Flash...
> Error: start and/or end address not on sector
> boundary

This error was due to a bug in this stock u-boot. So try to set the envs inside Debian after you have booted, and at Linux shell. I recall somewhere in this thread I showed how to do that. Look for the /etc/fw_env.config setup info.


> # 2
> In comparison with raffe's settings from
> 11/22/2017 05:37, it is noticeable that the
> following values are missing

You do have them set for USB booting as shown in your post above

load_bootm=bootm 0x800000 0x2100000
load_usbuimage=ext2load usb 0:1 0x800000 /boot/uImage
load_usbuinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs_usb rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial
bootcmd_usb=run bootargs_usb; usb start; run set_mw; run load_usbuimage; run load_usbuinitrd; run load_bootm
load_myhdduimage=ext2load ide 0:1 0x800000 /boot/uImage
load_myhdduinitrd=ext2load ide 0:1 0x2100000 /boot/uInitrd
bootcmd_myhdd=ide reset; run set_mw; run load_myhdduimage; run load_myhdduinitrd; run load_bootm
bootcmd=run bootcmd_usb; run bootcmd_myhdd; reset


> # 3
> Can the u-boot be saved on a hard drive or USB?
> The u-boot settings are based on the latest
> version from LG. I did not make a backup out of
> ignorance, so I cannot say whether the settings
> were missing or whether I accidentally removed
> them.

Not sure exactly what you are asking. But the envs listing can be copy/pasted to a notepad. u-boot image on flash can be dump to a file while you are inside Debian.

-bodhi
===========================
Forum Wiki
bodhi's corner
gf
Re: LG N1T1 NAS
January 17, 2021 11:51PM
Thank you Bodhi!

I found this post on Sep 27, 2016 04:24 AM.
> In the uboot installation thread: http://forum.doozan.com/read.php?3,12381

And here are my settings. I hope this helps.
root@debian:~# fw_printenv
Warning: Bad CRC, using default environment
bootcmd=run distro_bootcmd
bootdelay=2
baudrate=115200
stdin=serial,cros-ec-keyb,usbkbd
stdout=serial,vidconsole
stderr=serial,vidconsole
ethaddr=00:00:11:22:33:44
eth1addr=00:00:11:22:33:45
eth3addr=00:00:11:22:33:46
eth5addr=00:00:11:22:33:47
ipaddr=1.2.3.4
host_boot=if host dev ${devnum}; then setenv devtype host; run scan_dev_for_boot_part; fi
sata_boot=if sata dev ${devnum}; then setenv devtype sata; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi
scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot_part; fi
virtio_boot=if virtio dev ${devnum}; then setenv devtype virtio; run scan_dev_for_boot_part; fi
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=host1 host0
boot_syslinux_conf=extlinux/extlinux.conf
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
bootcmd_host1=setenv devnum 1; run host_boot
bootcmd_host0=setenv devnum 0; run host_boot
distro_bootcmd=setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
bootm_size=0x10000000
kernel_addr_r=0x1000000
fdt_addr_r=0xc00000
ramdisk_addr_r=0x2000000
scriptaddr=0x1000
pxefile_addr_r=0x2000
root@debian:~#

 GNU nano 3.2                   /etc/fw_env.config                             
# MTD device name       Device offset   Env. size       Flash sector size      $
/dev/mtd0 0xc0000 0x20000 0x20000

root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00001000 "u-boot"
root@debian:~#

My idea for the setup:
Start and operation from USB, the HDD (with rootfs for operation without USB) then as personal data storage. Then "hdparm" should also work for the HDD.

The device starts well with two options:
1. Boot from HDD (without connected USB stick)
2. Boot from USB stick (without connected HDD)

If I operate the device with a USB stick and HDD at the same time, "Linux-5.2.9-kirkwood-tld-1" and "initramfs-5.2.9-kirkwood-tld-1" are loaded from the USB.
The operating system is then reloaded from the HDD and Debian works from the HDD. But I want to stay on the USB to put the HDD to sleep.


Can you help?


Thanks in advance.



Edited 2 time(s). Last edit at 01/18/2021 01:41PM by gf.
Re: LG N1T1 NAS
January 18, 2021 05:27PM
gf,

Quote

If I operate the device with a USB stick and HDD at the same time, "Linux-5.2.9-kirkwood-tld-1" and "initramfs-5.2.9-kirkwood-tld-1" are loaded from the USB.
The operating system is then reloaded from the HDD and Debian works from the HDD. But I want to stay on the USB to put the HDD to sleep.

This is why I have the bootargs with root device identifed by label rootfs

bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs_usb rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial

To make sure the HDD is not scanned by Debian when it tries to find the rootfs, check the HDD partitions label. If any of the partitions is labeled rootfs then change the partition label to something else such as Data, Music, Pictures... whatever is appropriate.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: