Welcome! Log In Create A New Profile

Advanced

LG N1T1 NAS

Posted by ron 
Re: LG N1T1 NAS
March 12, 2018 02: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 02:44AM by raffe.
Re: LG N1T1 NAS
March 12, 2018 01: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



Edited 1 time(s). Last edit at 03/12/2018 11:41PM by bodhi.
Re: LG N1T1 NAS
March 13, 2018 02: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 03: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
Re: LG N1T1 NAS
March 14, 2018 02: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 06: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
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: