Re: LG N1T1 NAS
March 12, 2018 03:41AM
Back again :) I tried to do an upgrade of my 4.12.1-kirkwood to 4.15.2-kirkwood. But it does not boot up. I think it get stuck at U-boot, and I just realized that my USB-serial adapter is probably at home as can't find it anywhere here. So I can't see what it is doing until tomorrow. But what would you guess I did wrong?

I did it like this:

ROOTFS
1. I find the latest kernel at https://forum.doozan.com/read.php?2,12096,12096#msg-12096

2. Download the file
cd /boot
wget https://bitly.com/2EksnWU
mv 2EksnWU linux-4.15.2-kirkwood-tld-1-bodhi.tar.bz2

3. Backup files
cd /boot
mkdir backup/2018-03-12
cp uInitrd backup/2018-03-12
cp uImage backup/2018-03-12
cp initrd.img-4.12.1-kirkwood-tld-1 backup/2018-03-12
cp System.map-4.12.1-kirkwood-tld-1 backup/2018-03-12
cp vmlinuz-4.12.1-kirkwood-tld-1 backup/2018-03-12
cp config-4.12.1-kirkwood-tld-1 backup/2018-03-12
cp dts/ backup/2018-03-12/dts -r

4. Extract the kernel and the DTB files in the archive
cd /boot
tar -xjf linux-4.15.2-kirkwood-tld-1-bodhi.tar.bz2
tar -xf  linux-dtb-4.15.2-kirkwood-tld-1.tar

5. And install it with dpkg
cd /boot
apt-get remove flash-kernel 
dpkg -i linux-image-4.15.2-kirkwood-tld-1_1.0_armel.deb

It say:
Selecting previously unselected package linux-image-4.15.2-kirkwood-tld-1.
(Reading database ... 20395 files and directories currently installed.)
Preparing to unpack linux-image-4.15.2-kirkwood-tld-1_1.0_armel.deb ...
Examining /etc/kernel/preinst.d/
Done.
Unpacking linux-image-4.15.2-kirkwood-tld-1 (1.0) ...
Setting up linux-image-4.15.2-kirkwood-tld-1 (1.0) ...

 Hmm. There is a symbolic link /lib/modules/4.15.2-kirkwood-tld-1/build
 However, I can not read it: No such file or directory
 Therefore, I am deleting /lib/modules/4.15.2-kirkwood-tld-1/build


 Hmm. The package shipped with a symbolic link /lib/modules/4.15.2-kirkwood-tld-1/source
 However, I can not read the target: No such file or directory
 Therefore, I am deleting /lib/modules/4.15.2-kirkwood-tld-1/source

Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.15.2-kirkwood-tld-1 /boot/vmlinuz-4.15.2-kirkwood-tld-1
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.15.2-kirkwood-tld-1 /boot/vmlinuz-4.15.2-kirkwood-tld-1
update-initramfs: Generating /boot/initrd.img-4.15.2-kirkwood-tld-1
I: The initramfs will attempt to resume from /dev/sda2
I: (UUID=b6c69d1f-25f0-4963-91fb-d7b2c85455cc)
I: Set the RESUME variable to override this.
run-parts: executing /etc/kernel/postinst.d/zz-flash-kernel 4.15.2-kirkwood-tld-1 /boot/vmlinuz-4.15.2-kirkwood-tld-1

6. Boot with DTB file embedded in the kernel image
cd /boot
mv uImage uImage.orig
cp -a zImage-4.15.2-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.15.2-kirkwood-tld-1 -d zImage.fdt uImage

It say
Image Name:   Linux-4.15.2-kirkwood-tld-1
Created:      Mon Mar 12 08:59:09 2018
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3937421 Bytes = 3845.14 kB = 3.76 MB
Load Address: 00008000
Entry Point:  00008000

I run
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.15.2-kirkwood-tld-1 -d initrd.img-4.15.2-kirkwood-tld-1 uInitrd

It say:
Image Name:   initramfs-4.15.2-kirkwood-tld-1
Created:      Mon Mar 12 09:00:09 2018
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    7872767 Bytes = 7688.25 kB = 7.51 MB
Load Address: 00000000
Entry Point:  00000000

7. The new uImage and uInitrd files should be created in /boot directory now. You're ready to reboot the system:
sync 
sync
sync
shutdown -r now



Edited 1 time(s). Last edit at 03/12/2018 03:44AM by raffe.
Re: LG N1T1 NAS
March 12, 2018 02:58PM
raffe,

> 6. Boot with DTB file embedded in the kernel
> image
>
> cd /boot
> mv uImage uImage.orig
> cp -a zImage-4.15.2-kirkwood-tld-1 zImage.fdt
> cat dts/kirkwood-goflexnet.dtb >> zImage.fdt

The DTB file name is wrong. Should be n1t1.

The rest looks OK.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/13/2018 12:41AM by bodhi.
Re: LG N1T1 NAS
March 13, 2018 03:52AM
Wow, you have good eyes! It would have taken me a long time before I had seen that. THANKS!

1. Booted up with USB

2. Login with root root and did this just in case
su -

3. Connect to hdd / and Go to hdd boot
mount /dev/sda1 /mnt/start
cd /mnt/start/boot

4. Try to fix my mistake
cat dts/kirkwood-n1t1.dtb >> zImage.fdt

5. Reboot
shutdown -r now

6. It still don't boot up. See attached file

7. So I try to boot with USB again and restore backup
su -
mount /dev/sda1 /mnt/start
cd /mnt/start/boot
cp backup/2018-03-12/uInitrd .
cp backup/2018-03-12/uImage .
cp backup/2018-03-12/initrd.img-4.12.1-kirkwood-tld-1 .
cp backup/2018-03-12/System.map-4.12.1-kirkwood-tld-1 .
cp backup/2018-03-12/vmlinuz-4.12.1-kirkwood-tld-1 .
cp backup/2018-03-12/config-4.12.1-kirkwood-tld-1 .
cp backup/2018-03-12/dts dts/ -r
sync

Now it boot up again with the hdd :-)
Attachments:
open | download - boot.txt (11.6 KB)
Re: LG N1T1 NAS
March 13, 2018 04:43PM
raffe,

> 7. So I try to boot with USB again and restore
> backup
>
> Now it boot up again with the hdd :-)

Cool!

But too bad you've replaced the 2 new kernel files. We need to look at those files and the boot log at the same time to see clues why it did not boot. Please recreate them,

cd /boot
cp -a uImage uInitrd ./backup/2018-03-12/
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.15.2-kirkwood-tld-1 -d vmlinuz-4.15.2-kirkwood-tld-1 uImage 
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.15.2-kirkwood-tld-1 -d initrd.img-4.15.2-kirkwood-tld-1 uInitrd

Boot again, see if it boots. If not, before going back to old kernel, you should get the listing before replacing.

mount /dev/sda1 /mnt/start
cd /mnt/start/boot
ls -lart *
ls -larth *

BTW, always use the cp option -a to copy files, so you can preserve the time stamps and all other attributes.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
March 14, 2018 03:26AM
Thanks for the cp option -a info! OK, here is my test log.

I start with
cd /boot
cp -a uImage uInitrd ./backup/2018-03-12/

I try "Boot with DTB file" as you suggest in the post
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.15.2-kirkwood-tld-1 -d vmlinuz-4.15.2-kirkwood-tld-1 uImage

I get
Image Name:   Linux-4.15.2-kirkwood-tld-1
Created:      Wed Mar 14 08:25:23 2018
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3925976 Bytes = 3833.96 kB = 3.74 MB
Load Address: 00008000
Entry Point:  00008000

Then (same as before)
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.15.2-kirkwood-tld-1 -d initrd.img-4.15.2-kirkwood-tld-1 uInitrd

I get
Image Name:   initramfs-4.15.2-kirkwood-tld-1
Created:      Wed Mar 14 08:26:03 2018
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    7872767 Bytes = 7688.25 kB = 7.51 MB
Load Address: 00000000
Entry Point:  00000000

I reboot
sync 
sync
sync
shutdown -r now

Boot fails with
Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00000691, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.

See more in BootWithDifferentDTBfiles.txt (above PART TWO)

I boot up WITH USB and
mount /dev/sda1 /mnt/start
cd /mnt/start/boot
ls -lart *

I get ls-lart.txt (above PART TWO)

And
ls -larth *

Gives ls-larth.txt (above PART TWO)


I restore the old kernel files and reboot
mkdir backup/2018-03-14
mv uImage ./backup/2018-03-14/uImage.4.15.2-DTB-file-embedded
mv uInitrd ./backup/2018-03-14/uInitrd.4.15.2
cp -a ./backup/2018-03-12/uImage .
cp -a ./backup/2018-03-12/uInitrd .
sync 
sync
sync
shutdown -r now

It boots with the harddrive
Now I try "Boot with DTB file embedded in the kernel image"
su -
cd /boot
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.15.2-kirkwood-tld-1 -d zImage.fdt uImage

I get
Image Name:   Linux-4.15.2-kirkwood-tld-1
Created:      Wed Mar 14 09:01:55 2018
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3949301 Bytes = 3856.74 kB = 3.77 MB
Load Address: 00008000
Entry Point:  00008000

Then (same as before)
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.15.2-kirkwood-tld-1 -d initrd.img-4.15.2-kirkwood-tld-1 uInitrd

I get
Image Name:   initramfs-4.15.2-kirkwood-tld-1
Created:      Wed Mar 14 09:02:56 2018
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    7872767 Bytes = 7688.25 kB = 7.51 MB
Load Address: 00000000
Entry Point:  00000000

I reboot
sync 
sync
sync
shutdown -r now

The boot fails, see BootWithDifferentDTBfiles.txt. SCROLL DOWN TO PART TWO!

I boot up WITH USB and
su -
mount /dev/sda1 /mnt/start
cd /mnt/start/boot
ls -lart *

I get ls-lart.txt. SCROLL DOWN TO PART TWO!

And
ls -larth *

Gives ls-larth.txt. SCROLL DOWN TO PART TWO!

I restore the old kernel files and reboot
mv uImage ./backup/2018-03-14/uImage.4.15.2-DTB-file
mv uInitrd ./backup/2018-03-14/uInitrd.4.15.2.OneMore
cp -a ./backup/2018-03-12/uImage .
cp -a ./backup/2018-03-12/uInitrd .
sync 
sync
sync
shutdown -r now

Boots up with the hdd.
Attachments:
open | download - BootWithDifferentDTBfiles.txt (15.2 KB)
open | download - ls-lart.txt (16.3 KB)
open | download - ls-larth.txt (16 KB)
Re: LG N1T1 NAS
March 14, 2018 07:12AM
raffe,

You misread the instruction. Booting with separate DTB is recommended only when you are running the new uboot that I released (there is no new LG N1T1 uboot yet).

Quote

I try "Boot with DTB file" as you suggest in the post

With stock uboot, you must boot with embedded DTB.


And you dont really know how to post the log for trouble shooting purpose :) You have posted info in a really nice and organized way. But that has made the “debugging” harder.

What I’d like to see is one log in code tags, with no need for commentary, commands you actually typed and all of the outputs from that. From installing kernel to the power up, to boot failure. Usually, you just copy and paste the whole terminal session.

But it is ok this time. I will take a look.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 14, 2018 08:55AM
Hey,

Just wanted to say thankyou! I now have Debian 9.5 on my n1t1


          _sudZUZ#Z#XZo=_         Hostname: debian
       _jmZZ2!!~---~!!X##wx       OS: Debian 9.5 armv5tel
    .<wdP~~            -!YZL,     Kernel: 4.17.2-kirkwood-tld-1
   .mX2'       _xaaa__     XZ[.   Uptime: 1:06
   oZ[      _jdXY!~?S#wa   ]Xb;   Shell: Bash
  _#e'     .]X2(     ~Xw|  )XXc   Terminal: Xterm-256color
 .2Z`      ]X[.       xY|  ]oZ(   Packages: 309
 .2#;      )3k;     _s!~   jXf`   CPU: CPU implementer	: 0x56
  1Z>      -]Xb/    ~    __#2(    RAM: -148 MB / 114 MB
  -Zo;       +!4ZwerfgnZZXY'      Disk: 944M / 7.4G
   *#[,        ~-?!!!!!!-~        
    XUb;.                         
     )YXL,,                       
       +3#bc,                     
         -)SSL,,                  
            ~~~~~


Currently i am booting via serial each time the device starts, im a little confused about what i need to change to be able to dual boot both USB and HDD stock os?
Re: LG N1T1 NAS
August 14, 2018 12:49PM
trx30,

> Just wanted to say thankyou! I now have Debian 9.5
> on my n1t1

Cool!

> Currently i am booting via serial each time the
> device starts, im a little confused about what i
> need to change to be able to dual boot both USB
> and HDD stock os?

You need to adjust u-boot envs to do that.

In Debian, get the output of

cat /etc/fw_env.config
fw_printenv

and post here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 14, 2018 06:50PM
root@debian:~# cat /etc/fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000



root@debian:~# fw_printenv
Warning: Bad CRC, using default environment
bootargs=
bootcmd=
bootdelay=2
baudrate=115200
arch=sandbox
cpu=sandbox
board=sandbox
board_name=sandbox
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
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; 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_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.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=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


Re: LG N1T1 NAS
August 15, 2018 12:34AM
trx30,

Power up, interrupt serial console at count down, then,

printenv
boot

Please post the entire serial console log here (from u-boot banner).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 15, 2018 05:21AM
> Please post the entire serial console log here
> (from u-boot banner).


added as attachment to avoid wall of text
Attachments:
open | download - bodhi-env (25.6 KB)
Re: LG N1T1 NAS
August 15, 2018 07:02AM
trx30,


Quote

Just wanted to say thankyou! I now have Debian 9.5 on my n1t1

Quote

Currently i am booting via serial each time the device starts

Please post the serial boot log that shows how you run u-boot envs to boot the new kernel on USB. I only need to see from the beggining of u-boot until the first part of kernel booting that inlcude the kernel command line.

And you can post the log here in code tags (It is easier to read/search than log on another text file).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 15, 2018 09:05AM
þ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:  1  0
LGE-NAS>> setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial'

LGE-NAS>> setenv mainlineLinux yes

LGE-NAS>> usb start

(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
LGE-NAS>> mw 0x800000 0 1 

LGE-NAS>> ext2load usb 0:1 0x800000 /boot/uImage

.
.
....
.
......
............
.........................
...................................................
......................................................................................................
......................................................................................................................................................................................................

4127376 bytes read
LGE-NAS>> ext2load usb 0:1 0x2100000 /boot/uInitrd

.
.
....
.
......
............
.........................
...................................................
......................................................................................................
............................................................................................................................................................................................................
....
......................................................................................................................................................................................................................................................................................................................................................................................

8082006 bytes read
LGE-NAS>> bootm 0x800000 0x2100000

## Booting image at 00800000 ..., header_size = 00000040, header_addr = 0068dcdc
image_header_t hdr contents
hdr->ih_magic = 56190527, hdr->ih_hcrc = e20888ee
hdr->ih_time = 2c61705b, hdr->ih_size = 003efa50
hdr->ih_load = 00800000, hdr->ih_ep = 00800000
hdr->ih_dcrc = 0ff3df8b
hdr->ih_os = 05, hdr->ih_arch = 02
hdr->ih_type = 02, hdr->ih_comp = 00
hdr->ih_name = Linux-4.17.2-kirkwood-tld-1

   Image Name:   Linux-4.17.2-kirkwood-tld-1
   Created:      2018-08-12  16:32:44 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4127312 Bytes =  3.9 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000, header_addr = 0068dcdc, header_size = 00000040 ...
RAMdisk image_header_t hdr contents
hdr->ih_magic = 56190527, hdr->ih_hcrc = df423592
hdr->ih_time = 3961705b, hdr->ih_size = 007b5216
hdr->ih_load = 00000000, hdr->ih_ep = 00000000
hdr->ih_dcrc = 4652fea5
hdr->ih_os = 05, hdr->ih_arch = 02
hdr->ih_type = 03, hdr->ih_comp = 01
hdr->ih_name = initramfs-4.17.2-kirkwood-tld-1

   Image Name:   initramfs-4.17.2-kirkwood-tld-1
   Created:      2018-08-12  16:32:57 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8081942 Bytes =  7.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.17.2-kirkwood-tld-1 (root@tldDebian) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 PREEMPT Sun Jun 17 23:16:03 PDT 2018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: LG N1T1
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x78/0x4ec with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env) earlyprintk=serial
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 108556K/131072K available (8192K kernel code, 803K rwdata, 2124K rodata, 1024K init, 278K bss, 22516K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (9184 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 804 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 279 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
Re: LG N1T1 NAS
August 15, 2018 11:41PM
trx30,

Nice! I will be back with instruction.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 16, 2018 12:12AM
Do this with USB rootfs attached. It should boot to Debian.

Power up, interrupt seriall console and

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

setenv bootcmd_usb 'setenv mainlineLinux yes; usb start; mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x2100000 /boot/uInitrd; bootm 0x800000 0x2100000'

setenv bootcmd 'run bootargs_usb; run bootcmd_usb; run bootcmd_hdd'

And then repeat without USB rootfs. It should boot to stock HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 16, 2018 03:14PM
bodhi Wrote:
-------------------------------------------------------
> Do this with USB rootfs attached. It should boot
> to Debian.
>
> Power up, interrupt seriall console and
>
>
> setenv bootargs_usb 'console=ttyS0,115200
> root=LABEL=rootfs rootdelay=10
> mtdparts=spi_flash:0x78000@0(uboot),0x1000@0x78000(env)
> earlyprintk=serial'
> 
> setenv bootcmd_usb 'setenv mainlineLinux yes; usb
> start; mw 0x800000 0 1; ext2load usb 0:1 0x800000
> /boot/uImage; ext2load usb 0:1 0x2100000
> /boot/uInitrd; bootm 0x800000 0x2100000'
> 
> setenv bootcmd 'run bootargs_usb; run bootcmd_usb;
> run bootcmd_hdd'
>
>
> And then repeat without USB rootfs. It should boot
> to stock HDD.


i get ** Too many args (max. 16) ** with the second command
Re: LG N1T1 NAS
August 17, 2018 12:31AM
Try

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

setenv load_image_usb 'ext2load usb 0:1 0x800000 /boot/uImage'

setenv load_initrd_usb 'ext2load usb 0:1 0x2100000 /boot/uInitrd'

setenv bootcmd_usb 'setenv mainlineLinux yes; usb start; mw 0x800000 0 1; run load_image_usb; run load_initrd_usb; bootm 0x800000 0x2100000'

setenv bootcmd 'run bootargs_usb; run bootcmd_usb; run bootcmd_hdd'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
August 17, 2018 12:09PM
This time i get

Hit any key to stop autoboot:  0 
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>> 
LGE-NAS>> setenv load_ima0/boot/uImage'
LGE-NAS>> 
LGE-NAS>> setenv load_ini0rd'
LGE-NAS>> 
LGE-NAS>> setenv bootcmd_s00000 0 1; run load_image_usb; run load_initrd_usb; bootm 0x800000 0x2100000'
## Error: "load_image_usb" not defined
## Error: "load_initrd_usb" not defined
## Booting image at 00800000 ..., header_size = 00000040, header_addr = 0068dcdc
Bad Magic Number
LGE-NAS>> 
LGE-NAS>> setenv bootcmd 
LGE-NAS>>


I am a noob when it comes to linux so just to clarify, I enter it all at once as one command?
Re: LG N1T1 NAS
August 18, 2018 02:48AM
Only your first line is correct, every line after that is corrupted and does not match what you were asked to enter. How did you enter the commands?

You should enter each line from bodhi's post 1 line at a time.
Re: LG N1T1 NAS
August 18, 2018 06:56AM
> You should enter each line from bodhi's post 1
> line at a time.

Right!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Roca
Help!!! LG N1A1 NAS
May 10, 2019 10:59PM
Hello, I do not know if this topic has any kind of comment from all those who have commented here but I really hope you can help me.

it happens that I have a nas lg N1A1 DD1 that a while ago stopped working because this had the HDD with problems, one day it just started to make a few noises and it did not work but I extracted the HDD since it was already out of warranty and try to replace it with another one but it did not work as I have been reading, I need to install a kind of operating system on the new HDD and I have no idea how to do it.

I do not have much experience in Linux or anything like that, I just need to know how to install the software I had in the simplest way possible and I saw that according to another forum it could be done from a USB with the original files of LG but the latter in its platform do not say what steps to follow in case the HDD is broken so it seems that they believed they would be eternal.

I hope you can help me with this issue I am sorry to ask now but it is that my NAS worked without problems until couple of months ago that at the moment I stop working without giving me time to do backup or anything.
Re: Help!!! LG N1A1 NAS
May 10, 2019 11:30PM
Roca,

Ron did get this box working, so it will not be too difficult.

Do you have serial console connected? if not, can you do that (open the box), buy parts and wire?

Look at how people do this in the Wiki thread. In particular the post I highlighted below.

Quote

Serial Console & JTAG console

Repair Pogo E02 with Raspberry PI (JTAG) and OpenOCD
Serial Port connector - what are people using to make it work
Serial Console hookup - GoFlex Net (external link)
Serial Console hookup - Pogoplug E02 and Pogoplug Pro V3 (external link)
OSX Serial/Net Console
Use Phone Jack - Phone Jack Serial Console Pics
Adding serial connector to Pogoplug Mobile (external link)
WD Mycloud EX2100/4100 Serial Console pic1, also pic2, pic3
Dreamplug Serial Console
How to unbrick your box using serial console with kwboot
kwboot on Mac OSX 10
Unbrick a Pogoplug Pro v3 OXNAS by flashing u-boot in serial console

Since we don't have new u-boot for this box, installation is so that you can run the latest Debian rootfs from this release thread: Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 .

So to sum up the general steps:

1. Create the new rootfs on USB using the tarball Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2, following the instruction in that release thread.
2. Connect serial console.
3. And set some envs in u-boot to boot with the new USB rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Roca
Re: Help!!! LG N1A1 NAS
May 11, 2019 02:00AM
hello bodhi thank you for your prompt response if I tell you that I understood everything you said I would be lying really this complicated thing as I mentioned I have no experience in this kind of technical stuff ... my question is: it is not possible from a USB mount the image of the original operating system of the NAS as if it were a windows installation without much complication?
Re: Help!!! LG N1A1 NAS
May 11, 2019 03:08AM
Roca,

> hello bodhi thank you for your prompt response if
> I tell you that I understood everything you said I
> would be lying really this complicated thing as I
> mentioned I have no experience in this kind of
> technical stuff ...

> my question is: it is not
> possible from a USB mount the image of the
> original operating system of the NAS as if it were
> a windows installation without much complication?

That would be more complicate than installing a new system.

Unless you could find a rescue USB image from the manufacterer.

A lot of NAS have some kind of restore mechanism with USB, where you would prepare a USB drive using their rescue image. And using a procedure provided by them to reinstall the stock FW on your NAS.

Perhaps you could browse their website to see if you can find that USB image for reinstallation.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
October 07, 2020 12:50PM
Hi.

I do not expect more people to come for information on this old thread, but it seems the best to tell about my experience and give feedback.
First, let me thank you for all that astounding work. I could not believe that one could run a recent Debian on such a machine, very limited in resources.

I got a used N1T1DD1 some years ago but did not find too much use to it, the 1 Gb disk being a bit tight for my needs. I had a 3 Gb disk just ordered and replaced the original one. It got formatted as MBR by the stock software, version 2452.340 as I noted. The disk was seen only as 2 Gb because of MBR limit, I did not go further at that time.
I needed a storage device recently and dug it out, managed to upgrade Uboot, the drive was formatted as 3 Gb to my pleasure. I managed with the help of raffe's detailed explanations (what I sorely needed) to boot once to Debian connected through usb serial adapter. All further attempts failed after "usb start".

History (i'll cut the failed attempts) :
- initialized the box, version 2452.340
- upgraded Uboot with new_ui_uboot_update_111223
- installed latest firmware-N1T1_10124rfke modified to get root access (modifying postinst.sh). The disk
was reformatted but this time as hybrid MBR/GPT.
- root access failed but user lgroot was created, but following a post on www.geeek.org about gaining root
access through a hidden page allowed me get in through telnet
- I had to modify the apt sources, the address on the US site no longer responded, installed dropbear and
was able to ssh into the nas.
- after the failed attempts at booting debian, I had the idea of formatting the usb stick with the nas, and
then doing all the stuff through my Mint box. It works better but still many reset to do.

I am in the process of installing a dual boot, now, and wish to thank you all. My goal is to install a nextcloud server on it, for shared work at home, and I may possibly be happy with a permanent installation of Debian on the main disk. If you have suggestions, warnings, please tell me.



Edited 3 time(s). Last edit at 10/07/2020 02:13PM by Jmax.
Re: LG N1T1 NAS
October 07, 2020 09:16PM
Jmax,

> My goal is to
> install a nextcloud server on it, for shared work
> at home, and I may possibly be happy with a
> permanent installation of Debian on the main disk.

If you are going to run nextcould then the Debian rootfs should be on the HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
October 08, 2020 02:35AM
bodhi Wrote:
-------------------------------------------------------
> Jmax,

> If you are going to run nextcould then the Debian
> rootfs should be on the HDD.

Thanks for the answer, I would never think about keeping the root directory on external usb stick, except maybe for testing. I still have to understand how to install and run from the partition which contains the "main" OS, meaning deleting it. Hybrid MBR/GPT is still beyond my knowledge and , if I understand properly, there is no way grub can work like on standard PC. Can the rootfs just be copied to the first partition of the disk ? I noticed that without information about the usb rootfs, booting takes that partition as root.
Last question, if it is the case, would it work "as is" without modifying the environment variables (which I doubt) ?

Regards.



Edited 2 time(s). Last edit at 10/08/2020 01:42PM by Jmax.
Re: LG N1T1 NAS
October 08, 2020 05:26PM
Jmax,

> Thanks for the answer, I would never think about
> keeping the root directory on external usb stick,
> except maybe for testing. I still have to
> understand how to install and run from the
> partition which contains the "main" OS, meaning
> deleting it.

> Hybrid MBR/GPT is still beyond my
> knowledge and , if I understand properly, there is
> no way grub can work like on standard PC.

Correct. All ARM boxes like this one use u-boot, not Grub. And I would avoid Hybrid MBR/GPT if you can live with multiple 2-TB-or-less partitions. OTOH, a lot of people found that they are using Hybrid successfully, so it's your choice.


> Can the
> rootfs just be copied to the first partition of
> the disk ? I noticed that without information
> about the usb rootfs, booting takes that partition
> as root.

Yes. What you can do is a simple procedure to tar the USB rootfs to a tarball, and then restore it on the HDD with an empty Ext3 parttion.

As described in the Wiki thread:

Quote

Backup and Cloning rootfs

CrashPlan 4.3.0
Backup/Restore rootfs using tar command
Adjust udev rules after cloning rootfs
Stock Pogoplug rootfs
How to clone a rootfs from one Kirkwood box to another: Step 1 and Step 2
How to clone SATA rootfs to USB rootfs

> Last question, if it is the case, would it work
> "as is" without modifying the environment
> variables (which I doubt) ?
>

You need to modify u-boot envs to boot with SATA. When you are ready, I will help with that. Connect serial console and we'll change a few envs to boot to HDD rootfs. After it works for a few reboot, then we'll save the envs permanently.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LG N1T1 NAS
October 09, 2020 05:58AM
Hi bodhi.

It turned out to quite easy. printenv gave me all the pointers to solve this little problem.
I did it so :

- tar'ed the original file system and saved it on my PC

- deleted all the files/directories and untar'ed the Debian file system at the same place.

- saved the original environment on my PC

- modified bootcmd_hdd from
bootcmd_hdd=run read-kern; setenv bootargs $(console) $(root_path) lpj=4964352; bootm 0x2000000;
to
bootcmd_hdd=run ide reset;ext2load ide 0 0x800000 /boot/uImage;ext2load ide 0 0x2100000 /boot/uInitrd;bootm 0x800000 0x2100000
by doing :
setenv bootcmd_hdd 'ide reset;ext2load ide 0 0x800000 /boot/uImage;ext2load ide 0 0x2100000 /boot/uInitrd;bootm 0x800000 0x2100000'

- typed "run bootcmd_hdd", enter, and booted from hard disk. That file is the one run at boot I think.

ide reset is necessary; if not run the disk is not detected.
setting mainlineLinux to yes is unnecessary.
I will make the changes permanent, as I backed up the environment, it will be easy to go back.
I will keep all updated. Thanks

EDIT :
It worked perfectly. If one needs to go back to the previous configuration, it is quite easy to unset a variable (setenv xyz without argument) ou just overwrtite it.
Second point, the trouble with usb stick went away (for most of them, except the weirdest ones) but running
usb reset
instead of
usb start
It gave me a consistent behavior, it seems to be very reliable.

Third point, I checked for the latest Uboot files, but the n1t1 is not listed, too old or too few requests ?



Edited 3 time(s). Last edit at 10/09/2020 06:12AM by Jmax.
Re: LG N1T1 NAS
October 09, 2020 01:14PM
Jmax,


> Third point, I checked for the latest Uboot files,
> but the n1t1 is not listed, too old or too few
> requests ?

Yes. Not a lot of users have this box, so I did not build new u-boot for it. Testing is time consuming so unless I have a lot free time, I don't try to start the project.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


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: