Welcome! Log In Create A New Profile

Advanced

Need a help with upgrading nsa 325 v2 kernel

Posted by Carlo 
Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 09:26AM
Hi
I've just started following the instructions to upgrade my box kernel to 6.13,,but I. Can't seem to shrink initrd to a reasonable size: it always stands at 13 Mb: am I missing something?

And if I make the uenv.Txt file, somehow the HD I use as storage has raid partitions (so my disk is full of /dev/mtdblock4 etc) shoulf I mention those partitions together with ide USB etc? And how?
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 12:38PM
Carlo,

> I've just started following the instructions to
> upgrade my box kernel to 6.13,,but I. Can't seem
> to shrink initrd to a reasonable size: it always
> stands at 13 Mb: am I missing something?

Make sure you run update-initramfs -u

Quote
https://forum.doozan.com/read.php?2,135322

1. Change the default modules loading to dep.

Edit the file /etc/initramfs-tools/initramfs.conf

# MODULES: [ most | netboot | dep | list ]
# dep - Try and guess which modules to load.
MODULES=dep

2. Update initramfs

I'm using the kernel 6.3.5-kirkwood-tld-1 as an example here. Adjust this to the appropriate version number to the running kernel in your system (run uname -a to display current kernel version).
cd /boot
ls -lh initrd.img-6.3.5-kirkwood-tld-1
update-initramfs -u

And then list the /boot directory to see the last file on this list
ls -larth /boot

If the new initrd corresponding to the currently running kernel is not created, then you might have a newer and different kernel version that you've installed but not used.

>
> And if I make the uenv.Txt file, somehow the HD I
> use as storage has raid partitions (so my disk is
> full of /dev/mtdblock4 etc) shoulf I mention
> those partitions together with ide USB etc? And
> how?

mtdblock or RAID is not relevant for booting. So keep the devices env in uEnv.txt file to the order of the disk type that migth contain a rootfs.
devices=usb ide

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 01:52PM
Can I safely reboot without the uenv file and if the initrd is too big?
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:31PM
i've changed a bit the /etc/initramfs-tools/initramfs.conf
i've set dep, and i've used gzip, compress level 5 as compression, cause update initram tells me it's using gzip since it can't find zstd to compress things

however the outcome is always the same:

➜  /boot nano  /etc/initramfs-tools/initramfs.conf
➜  /boot update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.13.8-kirkwood-tld-1
➜  /boot ls -lh /boot/uInitrd
-rw-r--r-- 1 root root 13M Mar 26 15:02 /boot/uInitrd
➜  /boot ls -larth /boot 
total 158M
-rwxr-xr-x  1 root root 4.8M Aug 18  2019 zImage-5.2.9-kirkwood-tld-1
-rw-r--r--  1 root root 162K Aug 18  2019 config-5.2.9-kirkwood-tld-1
-rw-------  1 root root 4.8M Aug 18  2019 vmlinuz-5.2.9-kirkwood-tld-1
-rw-------  1 root root 3.0M Aug 18  2019 System.map-5.2.9-kirkwood-tld-1
-rw-r--r--  1 root root 9.3M Aug 18  2019 linux-headers-5.2.9-kirkwood-tld-1_1.0_armel.deb
-rw-r--r--  1 root root  12M Mar 17 10:26 initrd.img-5.2.9-kirkwood-tld-1
-rwxr-xr-x  1 root root 5.8M Mar 24 20:59 vmlinuz-6.13.8-kirkwood-tld-1
-rw-r--r--  1 root root 194K Mar 24 20:59 config-6.13.8-kirkwood-tld-1
-rw-r--r--  1 root root 4.2M Mar 24 20:59 System.map-6.13.8-kirkwood-tld-1
-rwxr-xr-x  1 root root 5.8M Mar 24 22:34 zImage-6.13.8-kirkwood-tld-1
-rw-r--r--  1 root root 8.2M Mar 24 22:43 linux-headers-6.13.8-kirkwood-tld-1_1_armel.deb
-rw-r--r--  1 root root  31M Mar 24 22:43 linux-image-6.13.8-kirkwood-tld-1_1_armel.deb
drwxr-xr-x  2 root root 4.0K Mar 24 22:53 dts
-rw-r--r--  1 root root 1.5M Mar 24 22:54 linux-dtb-6.13.8-kirkwood-tld-1.tar
-rw-r--r--  1 root root 176K Mar 25 04:57 linux-6.13.8-kirkwood-tld-1.patch
drwxr-xr-x 20 root root 4.0K Mar 26 14:46 ..
-rw-r--r--  1 root root  45M Mar 26 14:48 linux-6.13.8-kirkwood-tld-1-bodhi.tar.bz2
-rw-r--r--  1 root root 5.8M Mar 26 15:00 uImage
-rw-r--r--  1 root root  13M Mar 26 15:02 uInitrd
-rw-r--r--  1 root root  105 Mar 26 15:15 uEnv.txt
-rw-r--r--  1 root root 6.4M Mar 26 20:26 initrd.img-6.13.8-kirkwood-tld-1
drwxr-xr-x  3 root root 4.0K Mar 26 20:26 .
uInitrd is 13 MB
before anything bad happens i'm going to edit the uEnv.txt this ways:

dtb_file=/boot/dts/kirkwood-nsa325.dtb
devices= usb ide
disks=0 1 2 3 4 5 6 7
load_dtb_addr=0x2c00000



Edited 1 time(s). Last edit at 03/26/2025 02:32PM by Carlo.
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:32PM
Carlo,

> Can I safely reboot without the uenv file and if
> the initrd is too big?

It's depending on what version of u-boot you are running (2017.07 or newer)? and what your u-boot envs are.

Do you have serial console? if you do, then you can boot and interrupt count down, and
printenv
Post the serial console log here. Don't boot until I can take a look.

And if you don't have serial console, then while in Debian,

fw_printenv
cat /boot/uEnv.txt
ls -larth /boot
And post the log of the above commands here. Don't reboot until I can take a look.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:36PM
Carlo,

Hold on. Disregard my post above.

You've missed a step:

Quote

3. Recreate the boot file uInitrd

So now we have a new initrd.img-6.3.5-kirkwood-tld-1 file, we need to recreate uInitrd.

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

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



Edited 1 time(s). Last edit at 03/26/2025 02:36PM by bodhi.
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:42PM
my bad.. i thought i'd had followed each and every step... but i was from mobile.. on a bus....


let's see again:


➜  /boot dpkg -i linux-image-6.13.8-kirkwood-tld-1_1_armel.deb
(Reading database ... 43407 files and directories currently installed.)
Preparing to unpack linux-image-6.13.8-kirkwood-tld-1_1_armel.deb ...
Unpacking linux-image-6.13.8-kirkwood-tld-1 (1) over (1) ...
Setting up linux-image-6.13.8-kirkwood-tld-1 (1) ...
update-initramfs: Generating /boot/initrd.img-6.13.8-kirkwood-tld-1
➜  /boot mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-6.13.8-kirkwood-tld-1 -d initrd.img-6.13.8-kirkwood-tld-1 uInitrd

Image Name:   initramfs-6.13.8-kirkwood-tld-1
Created:      Wed Mar 26 20:40:22 2025
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    6614977 Bytes = 6459.94 KiB = 6.31 MiB
Load Address: 00000000
Entry Point:  00000000
➜  /boot sync
➜  /boot ls -lh /boot/uInitrd
-rw-r--r-- 1 root root 6.4M Mar 26 20:40 /boot/uInitrd

seems like it's not going to brick, is it?
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:46PM
> ➜ /boot ls -lh /boot/uInitrd
> -rw-r--r-- 1 root root 6.4M Mar 26 20:40

> seems like it's not going to brick, is it?

Looks good! no fear.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 02:49PM
One more question: you tell to keep note of the kirkwood tds model, say kirkwood-nsa325, but I haven't used it anywhere: do I miss something else?
Re: Need a help with upgrading nsa 325 v2 kernel
March 26, 2025 03:38PM
> One more question: you tell to keep note of the
> kirkwood tds model, say kirkwood-nsa325, but I
> haven't used it anywhere: do I miss something
> else?

When you installed the u-boot 2017.07, you have defined the u-boot env dtb_file. It looks like this
dtb_file=/boot/dts/kirkwood-nsa325.dtb
You can do
fw_printenv
and it will list all u-boot envs, including that model name.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Need a help with upgrading nsa 325 v2 kernel
March 27, 2025 06:06AM
Thank you very much
Somehow fw_pribt env wasn't installed so I had to follow some guide here on the forum
I'm. No expert but I see this line:

dtb_file=/boot/dts/kirkwood-nsa325.dtb

So I guess I'm done
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: