Welcome! Log In Create A New Profile

Advanced

Upgrading Debian Distribution

Posted by bodhi 
Re: Upgrading Debian Distribution
May 15, 2023 10:10AM
No, that does not seem to be my problem, since
everything is correct with me.

root@pogoplug-dev:~# ls -la /
total 64
drwxr-xr-x  18 root root  4096 May  2 12:10 .
drwxr-xr-x  18 root root  4096 May  2 12:10 ..
lrwxrwxrwx   1 root root     7 May  2 12:10 bin -> usr/bin
drwxr-xr-x   3 root root  4096 May 13 23:01 boot
drwxr-xr-x  13 root root  2900 Jan  1  1970 dev
drwxr-xr-x  76 root root  4096 May 15 17:07 etc
drwxr-xr-x   2 root root  4096 Jan 22  2012 home
lrwxrwxrwx   1 root root     7 May  2 12:10 lib -> usr/lib
drwx------   2 root root 16384 Feb 24  2012 lost+found
drwxr-xr-x   2 root root  4096 Feb 24  2012 media
drwxr-xr-x   2 root root  4096 Feb 10  2015 mnt
drwxr-xr-x   2 root root  4096 Feb 24  2012 opt
dr-xr-xr-x 124 root root     0 Jan  1  1970 proc
drwx------   7 root root  4096 Apr 29 01:12 root
drwxr-xr-x  12 root root   600 May 15 17:07 run
lrwxrwxrwx   1 root root     8 May  2 12:10 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Feb 24  2012 srv
dr-xr-xr-x  12 root root     0 Jan  1  1970 sys
drwxrwxrwt   4 root root    80 May 15 17:07 tmp
drwxr-xr-x  11 root root  4096 Sep 24  2021 usr
drwxr-xr-x  11 root root  4096 Jan  1  1970 var
Re: Upgrading Debian Distribution
May 15, 2023 04:05PM
OK, that's checked out.

So now check to see if you are running the latest initramfs. If the uInitrd timestamp is older then the initramfs, then you've forgot (or was not aware you need to do that) to recreate the uInitrd after upgrading to bookworm.

cd /boot
ls -lart

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
May 15, 2023 06:49PM
Quote

Ugrading to Debian stretch

This is a brief instruction about how to upgrade to Debian stretch from jessie. It also applicable to all other Debian version upgrade, i.e wheezy to jessie, stretch to the future Debian stable version.

I assume you are currently running one of my customed kernel release linux-image-xx.xx.xx-kirkwood-tld-xx from this thread. This is the reason for this post, since upgrading to the next Debian release while running a customed kernel could potentially cause some out-of-sync in the boot files. The following are 2 sections, one of them might be applicable to your system. And also see Note (section 3) at the end for how to solve possible error during upgrade. If needed in the furture, I will add more sections to this post to cover some special cases.

1. Have installed only my released kernel images

Your system is running only my released kernel linux-image-xx.xx.xx-kirkwood-tld-xx. It has never been upgraded to mainline kernel or previously running mainline kernel. Usually because you started with my released rootfs from this thread.

Back up your rootfs before starting the following steps.

a. Update the apt source list to stretch. Your source should look like the following. Note that it is a good idea to adjust the repo to near your locale, and use ftp where available.

cat /etc/apt/sources.list

deb http://ftp.us.debian.org/debian stretch main
deb-src http://ftp.us.debian.org/debian stretch main

deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free

deb http://http.debian.net/debian stretch-updates main contrib
deb-src http://http.debian.net/debian stretch-updates main contrib


b. Run full upgrade (or you can choose to do minimal upgrade with step c).

apt-get update
apt-get dist-upgrade


c. Skip this if you've chosen step b. Run minimal upgrade if you want to do it slow, and then update to stretch for certain packages in the future when necessary. This is OK to do if you don't care much about having your system running every latest Debian package versions (there are a lot of packages that you might never use).

apt-get update
apt-get upgrade

d. Check fstab before rebooting. Debian stretch now has stricter rules, and rejects the old syntax in fstab. So if your rootfs still has the old entry like this
/dev/root / ext3 noatime,errors=remount-ro 0 1

Then edit /media/sdb1/etc/fstab entry for root device to the new syntax to use the rootfs label:
LABEL=rootfs / ext3 noatime,errors=remount-ro 0 1

e. Usually a distribution upgrade like this would result in a new initramfs. So regenerate the uInitrd boot file. See section 4 in my kernel/rootfs installation for how to recreate uInitrd. It should look like this example: 

cd /boot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.11.3-kirkwood-tld-2 -d initrd.img-4.11.3-kirkwood-tld-2 uInitrd


-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
May 16, 2023 07:41AM
bodhi Wrote:
-------------------------------------------------------
>
> cd /boot
> ls -lart
>


root@pogoplug-dev:/boot# ls -lart
total 64124
-rwxr-xr-x  1 root root  5435824 Aug  1  2021 vmlinuz-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root   183927 Aug  1  2021 config-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root  4403336 Aug  1  2021 System.map-5.13.6-kirkwood-tld-1
-rwxr-xr-x  1 root root  5435824 Aug  1  2021 zImage-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root  7762080 Aug  1  2021 linux-headers-5.13.6-kirkwood-tld-1_1.0_armel.deb
drwxr-xr-x  2 root root     4096 Aug  1  2021 dts
-rw-r--r--  1 root root  5435888 Sep 24  2021 uImage.orig
-rw-r--r--  1 root root  5435888 Sep 24  2021 uImage
-rw-r--r--  1 root root  9671091 Sep 24  2021 uInitrd
-rwxr-xr-x  1 root root  5445938 Apr 28 22:55 zImage.fdt
-rw-r--r--  1 root root  5446002 Apr 28 22:56 uImage.pogo_e02
drwxr-xr-x 18 root root     4096 May  2 12:10 ..
-rw-r--r--  1 root root 10829167 May  2 12:50 initrd.img-5.13.6-kirkwood-tld-1
drwxr-xr-x  3 root root     4096 May 13 23:01 .
Re: Upgrading Debian Distribution
May 16, 2023 07:46AM
bodhi Wrote:
-------------------------------------------------------
>
> e. Usually a distribution upgrade like this
> would result in a new initramfs. So regenerate the
> uInitrd boot file. See section 4 in my
> kernel/rootfs installation for how to recreate
> uInitrd. It should look like this example: 
> 
> cd /boot
> mkimage -A arm -O linux -T ramdisk -C gzip -a
> 0x00000000 -e 0x00000000 -n
> initramfs-4.11.3-kirkwood-tld-2 -d
> initrd.img-4.11.3-kirkwood-tld-2
> uInitrd[/quote]
> 


Hmm, I have no "initramfs-*-kirkwood-tld-2"
Re: Upgrading Debian Distribution
May 16, 2023 11:07PM
droidbox,
root@pogoplug-dev:/boot# ls -lart
total 64124
-rwxr-xr-x  1 root root  5435824 Aug  1  2021 vmlinuz-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root   183927 Aug  1  2021 config-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root  4403336 Aug  1  2021 System.map-5.13.6-kirkwood-tld-1
-rwxr-xr-x  1 root root  5435824 Aug  1  2021 zImage-5.13.6-kirkwood-tld-1
-rw-r--r--  1 root root  7762080 Aug  1  2021 linux-headers-5.13.6-kirkwood-tld-1_1.0_armel.deb
drwxr-xr-x  2 root root     4096 Aug  1  2021 dts
-rw-r--r--  1 root root  5435888 Sep 24  2021 uImage.orig
-rw-r--r--  1 root root  5435888 Sep 24  2021 uImage
-rw-r--r--  1 root root  9671091 Sep 24  2021 uInitrd
-rwxr-xr-x  1 root root  5445938 Apr 28 22:55 zImage.fdt
-rw-r--r--  1 root root  5446002 Apr 28 22:56 uImage.pogo_e02
drwxr-xr-x 18 root root     4096 May  2 12:10 ..
-rw-r--r--  1 root root 10829167 May  2 12:50 initrd.img-5.13.6-kirkwood-tld-1
drwxr-xr-x  3 root root     4096 May 13 23:01 .

That means you are running 5.13.6-kirkwood-tld-1, and the initrd.img-5.13.6-kirkwood-tld-1 was regenerated by the apt-get dist-upgrade. So

cd /boot
cp -a uInitrd uInitrd.bak

and regenerate the uInitrd for kernel 5.13.6-kirkwood-tld-1

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

And then reboot.

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



Edited 1 time(s). Last edit at 05/18/2023 03:38PM by bodhi.
Re: Upgrading Debian Distribution
May 17, 2023 08:21AM
Okay I will checked it in the evening.
Re: Upgrading Debian Distribution
May 25, 2023 10:45PM
Probably a good idea to mention that Buster-LTS and later Bullseye-LTS are a thing only because of NASA and JPL utilizing that branch at their facilities and on the International Space Station. For this reason the LTS branch came into being, specifically for the far-latter, for software stability in orbit. This is the main reason why the LTS branch exists, and why armel is specifically now deprecated from the branch. ARM cores with no hardware float are not necessary for extended support, but everything else on the list is... back in 2013 it was different.

-----

Aside from this: I did an apt full-upgrade to bookworm today on one of my two kace boxes and had no issues. However, it seems the upgrade does re-generate your SSH key (possibly for security purposes), so that's something notable for anyone who uses that for auth.
Re: Upgrading Debian Distribution
May 26, 2023 12:04AM
Response to sudos on the Dell Kace M300 thread.

https://forum.doozan.com/read.php?2,61344,135215#msg-135215

This is where the orphan sysvinit scripts can be installed:

Quote

apt-cache show orphan-sysvinit-scripts
Package: orphan-sysvinit-scripts
Version: 0.14
Installed-Size: 80
Maintainer: Debian sysvinit maintainers <debian-init-diversity@chiark.greenend.org.uk>
Architecture: all
Depends: ucf
Description: Orphaned System-V-like init scripts
Description-md5: 6e62a05dcaf39a4d5ec8fa894f07cfb8
Section: admin
Priority: optional
Filename: pool/main/o/orphan-sysvinit-scripts/orphan-sysvinit-scripts_0.14_all.deb
Size: 16088
MD5sum: 7ef507a4b51d81f88a3eb162678c6d08
SHA256: 18b1294829c7a3b8ff2962a16c00c0d51d233e2903ca4f09bd8ff3701fc9abfe


I have not got around to update the notable list in the 1st post. But you can do

apt-get install orphan-sysvinit-scripts

I hope the Devuan developers continue to maintain these sysvinit scripts. I do agree with sudos about low memory Kirkwodd plugs should be running sysviit.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
May 30, 2023 05:25AM
Yep, that's the package I was referring to, and seems to be the brianchild of Simon Tatham, aka Chiark, aka the person that made the PuTTY family of clients... Without it, certain things just will not start. If anything my suggestion would be to include it in the upcoming bookworm rootfs by default.

On the subject of PuTTY, it'd also be a good idea to include sshguard as a default package. Written in C and is way better than fail2ban from an overhead perspective... I think it uses like maybe 1.5MB overall? It shouldn't be up to the end user to choose to install that, from a security perspective, given the benefits, but I do believe it requires syslog-ng, which may be a deal breaker as that's not included in the stock rootfs anyway to cut down on writes.

As previously stated, it'd be wise to do two separate rootfs images for both sysvinit and systemd before bookworm officially releases, but I understand this isn't really doable from size vs hosting space. I'm not sure what file cruft the manual switchover to systemd adds but it might be worth looking into given the changeover seems to be different now with bullseye and bookworm than previously in past releases where it now forcefully boots systemd if available, despite sysvinit being declared at boot time, no env edits required.

I have a third Kace on the way so I may use this to look into this further as a testbed with a fresh rootfs image and a bookworm upgrade.

And a last minute addition: bookworm wants to use the zstd package to gzip the initramfs image now, and while it auto falls back to gzip if it doesn't exist, that's another package that needs to be in the next rootfs image and is recommended to be installed prior to a manual full-upgrade. The performance hit between the two from an execution point of view is negligible but I'm sure this will lead to the gzip fallback portion of the update-initramfs command being deprecated in the future. It still gzips the initramfs image but does it with gzip through zstd in a similar manner to how pigz does the sort of same thing on multiple threads.
Re: Upgrading Debian Distribution
May 30, 2023 02:58PM
> As previously stated, it'd be wise to do two
> separate rootfs images for both sysvinit and
> systemd before bookworm officially releases, but I
> understand this isn't really doable from size vs
> hosting space.

I have to disagree. IMO, Debian is not at the point where systemd is a must-have. When that time comes, I'll switch to systemd for the rootfs. In the mean time, people who want to run systemd have already done so successfully with the bootarg.

> And a last minute addition: bookworm wants to use
> the zstd package to gzip the initramfs
> image now,

Yes. That will be noted in the future bookworm rootfs release here (which will include zstd package). However, it does seem zstd is quite slow with low RAM boxes (so the reduction in size is not great to have for those Kirkwood plugs). I'll adjust the kernel instruction to show both gzip and zstd alternatives.

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



Edited 1 time(s). Last edit at 06/01/2023 01:32PM by bodhi.
Re: Upgrading Debian Distribution
June 01, 2023 01:35PM
Some more observation.

For low RAM Kirkwood boxes (128MB, 256MB), we actually need to change the initramfs compression back to gzip. Both lzma and zstd are just too slow in these boxes.

-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: