Welcome! Log In Create A New Profile

Advanced

Kernel upgrade question

Posted by cdlenfert 
Kernel upgrade question
September 07, 2024 02:41PM
Long time since I've been tinkering with Pogo boxes, but I'm working through the steps to upgrade the the latest kernel on my pogoplug v4 (mobile). I want to update the kernel so that I can boot my SD card from the SD card slot. I'm currently booting from a USB > SD card adapter.

I've downloaded the tarball from dropbox, confirmed the hash.

I have created a backup of my current boot directory.

I am stuck at not understanding if I should clear anything out of the /boot directory before I extract the tarball. I assume it should be downloaded to, and extracted within /boot, but that will leave all of the old 6.5.7 files in /boot if I don't manually remove them (which was not mentioned in the steps).

It feels like a real noob questions to ask, but should I leave the old 6.5.7 files behind, remove them in advance, or remove them after I complete the steps in the guide?

Thanks for any clarification for my foggy brain!
Re: Kernel upgrade question
September 07, 2024 11:54PM
cdlenfert,

> I am stuck at not understanding if I should clear
> anything out of the /boot directory before I
> extract the tarball. I assume it should be
> downloaded to, and extracted within /boot, but
> that will leave all of the old 6.5.7 files in
> /boot if I don't manually remove them (which was
> not mentioned in the steps).
>
> It feels like a real noob questions to ask, but
> should I leave the old 6.5.7 files behind, remove
> them in advance, or remove them after I complete
> the steps in the guide?
>

You could leave the old files in /boot directory, it won't be a problem, since the files have unique names. And you could also remove the files extracted from the tarball after the installation.

However, to tidy up /boot, you could create a kernel directory like /boot/kernel/ and extract the tarball there, And then when you run the installation commands, make sure the path is specified. Like this,

Quote

2. Extract the kernel and the DTB files in the archive:

cd /boot/kernel
tar xjf linux-6.9.6-kirkwood-tld-1-bodhi.tar.bz2

cd /boot
tar xf ./kernel/linux-dtb-6.9.6-kirkwood-tld-1.tar

3. And install it with dpkg. Remove flash-kernel first to avoid potential problem (if flash-kernel was not installed then you'll see some error output):

cd /boot
apt-get remove flash-kernel
dpkg -i ./kernel/linux-image-6.9.6-kirkwood-tld-1_1_armel.deb

One good trick to see all kernel and its associated files: list the files in reversed chronological order.
ls -larth /boot
You will see the date time of the kernel files and the most recent files are listed at the bottom.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kernel upgrade question
September 10, 2024 08:32PM
Thank you for the clarifications!

I was able to complete the kernel upgrade and have left all of the files intact in the /boot directory.

When I list them out in reverse chronological order, I'm still confused by some of the dates of the generated files (i.e. files that were not in the new kernel tarball such as vmlinuz-6.9.6-kirkwood-tld-1) having a date of June 21st, when other generated files have a date of Sept 7.

root@pogoplugmobile:~# ls -larth /boot
total 137M
-rwxr-xr-x  1 root root 6.0M Oct 18  2023 vmlinuz-6.5.7-kirkwood-tld-1
-rw-r--r--  1 root root 194K Oct 18  2023 config-6.5.7-kirkwood-tld-1
-rw-r--r--  1 root root 4.4M Oct 18  2023 System.map-6.5.7-kirkwood-tld-1
-rwxr-xr-x  1 root root 6.0M Oct 18  2023 zImage-6.5.7-kirkwood-tld-1
-rw-r--r--  1 root root 8.2M Oct 18  2023 linux-headers-6.5.7-kirkwood-tld-1_1_armel.deb
drwxr-xr-x  2 root root 4.0K Jun  2 17:34 dts
-rwxr-xr-x  1 root root 6.0M Jun 21 15:33 vmlinuz-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 197K Jun 21 15:33 config-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 4.4M Jun 21 15:33 System.map-6.9.6-kirkwood-tld-1
-rwxr-xr-x  1 root root 6.0M Jun 21 17:48 zImage-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 8.4M Jun 21 18:00 linux-headers-6.9.6-kirkwood-tld-1_1_armel.deb
-rw-r--r--  1 root root  25M Jun 21 18:01 linux-image-6.9.6-kirkwood-tld-1_1_armel.deb
-rw-r--r--  1 root root 1.4M Jun 21 18:13 linux-dtb-6.9.6-kirkwood-tld-1.tar
-rw-r--r--  1 root root 164K Jun 25 16:00 linux-6.9.6-kirkwood-tld-1.patch
-rw-r--r--  1 root root 5.7M Sep  7 11:38 initrd.img-6.5.7-kirkwood-tld-1
-rw-r--r--  1 root root   55 Sep  7 12:00 uEnv.txt
-rw-r--r--  1 root root  39M Sep  7 12:46 linux-6.9.6-kirkwood-tld-1-bodhi.tar.bz2
drwxr-xr-x 20 root root 4.0K Sep  7 20:22 ..
-rw-r--r--  1 root root 5.6M Sep  7 20:28 initrd.img-6.9.6-kirkwood-tld-1
drwxr-xr-x  3 root root 4.0K Sep  7 20:28 .
-rw-r--r--  1 root root 6.0M Sep  7 20:28 uImage
-rw-r--r--  1 root root 5.6M Sep  7 20:29 uInitrd
Re: Kernel upgrade question
September 11, 2024 12:42AM
These are the kernel files, so they have the build date, except for initrd file. They were generated by

dpkg -i linux-image-6.9.6-kirkwood-tld-1_1_armel.deb

-rwxr-xr-x  1 root root 6.0M Jun 21 15:33 vmlinuz-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 197K Jun 21 15:33 config-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 4.4M Jun 21 15:33 System.map-6.9.6-kirkwood-tld-1
-rw-r--r--  1 root root 5.6M Sep  7 20:28 initrd.img-6.9.6-kirkwood-tld-1

The initrd.img-6.9.6-kirkwood-tld-1 file has the installation date because it was updated using what's currently in your rootfs.

Also, the DTB files in /boot/dts should have the kernel creation date. But they could have different date if I had recreated them during kernel building and found errors in some DTS files.

When you run the command uname -a, you should see the kernel build date

Quote
uname -a
Linux version 6.9.6-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 PREEMPT Fri Jun 21 16:45:39 PDT 2024
The kernel build time is usually a bit later than kernel files.

=======

The patch was created on Jun 25th. It means I created the patch a few days after I have installed this kernel and ran it a few days to make sure it is OK.
-rw-r--r--  1 root root 164K Jun 25 16:00 linux-6.9.6-kirkwood-tld-1.patch

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



Edited 1 time(s). Last edit at 09/11/2024 12:47AM by bodhi.
Re: Kernel upgrade question
September 11, 2024 08:56AM
I'm hoping this post helps as i will share my tried and true method of upgrading the kernel on my Pogo's.

1. Log in as su -
2. cd /boot
3. ls -larth - to see what's in the directory
4. wget https://xxxxxx.xxx - to download the new kernel file
5. echo "1234567890!@#$%^&* xxxxxx.xxx" | sha256sum --check - to verify the hash
6. Run through the upgrade process
7. Reboot
8. Log in as su -
9. uname -a - to ensure the upgrade was successful
10. cd /boot
11. ls -larth - to see what's in the directory
12. apt purge linux-image-x.x.x-kirkwood-tld-1 to remove the previous one
13. rm *x.x.x* *tar* xxxxxx.xxx - this clears out the previous files that are no longer needed
14. ls -larth - to see what's in the directory
Re: Kernel upgrade question
September 11, 2024 09:06AM
Thank you both for the additional details. Very helpful in understanding what's happening and how to manage the files after the upgrade. I'm running on a 2GB SD card (this box has a very specific purpose) and every bit counts.
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: