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)
Re: Upgrading Debian Distribution
October 20, 2023 11:05PM
I found my old Dockstar, which was in use few years ago as an 3G/HSDPA modem using Debian. I updated the Uboot for it and tested Bodhi's Debian Bullseye rootfs and it boots fine.

I was wondering that what is the status of providing Bookworm rootfs with systemd as default? Will it happen or should I just try to upgrade to it myself?
Re: Upgrading Debian Distribution
October 20, 2023 11:22PM
Upgrading to Debian Bookworm with systemd can be a long process with this 128MB device! I personally would avoid systemd on systems with such low memory.

Ray
Re: Upgrading Debian Distribution
October 20, 2023 11:55PM
timbba,

> I was wondering that what is the status of
> providing Bookworm rootfs with systemd as default?
> Will it happen or should I just try to upgrade to
> it myself?

When I have some free time, I will release a Debian bookworm rootfs, since it is more mature now at a point release. I always postpone the upgrade at initial Debian release.

And I agree with Ray. If you're going to upgrade your Dockstar rootfs to bookworm, stay with sysvinit for now until you have done the upgrade. And then switch to systemd, if you so choose. I would not do that for my Dockstar or Pogoplugs.

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



Edited 1 time(s). Last edit at 10/20/2023 11:56PM by bodhi.
Re: Upgrading Debian Distribution
October 21, 2023 05:27AM
Thanks Ray and Bodhi!
If systemd is so resource-hog, maybe it is then better to stay on sysv :)
Re: Upgrading Debian Distribution
October 25, 2023 04:04AM
I am still using Debian 11 bullseye & bullseye-backports.

Quote

cat /etc/debian_version
11.8


/ file structure is not as it is here https://forum.doozan.com/read.php?2,35581,135116#msg-135116 , no symlinks to /usr
Quote

/bin
/lin
/sbin


rootfs was created long time ago, 01/2014 (debian jessie) and upgraded with time to 11.8.
hw: pogoplug e02

cat /etc/apt/sources.list
Quote

deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

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

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

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free




Question regarding step 5

Quote

5. In Debian bookworm, the switch over to /usr is in effect. The following old sytsem folders are now symlinks to the real location in /usr.

# ls -l /{bin,lib,sbin}
lrwxrwxrwx 1 root root 7 Apr 26 14:04 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 Apr 26 14:04 /lib -> usr/lib
lrwxrwxrwx 1 root root 8 Apr 26 14:04 /sbin -> usr/sbin

So if for whatever reason, your file system does not show these 3 folders as symlinks, then you'll need to adjust them.

And also make sure that your rootfs backup conform to this structure, too.


How to make proper adjustment ?


not very usefull:
https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#a-merged-usr-is-now-required



Edited 16 time(s). Last edit at 10/25/2023 04:34AM by jst818.
Re: Upgrading Debian Distribution
October 25, 2023 12:22PM
jst818,

> How to make proper adjustment ?

There is no need to do any adjustment before upgrading to bookworm. It should be converted automatically.

However, it should be checked to see that everything got moved over, and the old locations became symlinks.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
October 28, 2023 03:16PM
Otherwise it is enough "ln -s" for all three folders (as root) ?
ln -s /bin /usr/bin
ln -s /lib /usr/lib
ln -s /sbin /usr/sbin



Or it should be hard link (ln without -s) ?



Edited 3 time(s). Last edit at 10/28/2023 03:17PM by jst818.
Re: Upgrading Debian Distribution
October 28, 2023 04:13PM
> Otherwise it is enough "ln -s" for all three
> folders (as root) ?
>
> ln -s /bin /usr/bin
> ln -s /lib /usr/lib
> ln -s /sbin /usr/sbin
>
>
>
>
> Or it should be hard link (ln without -s) ?

Symlink is correct, not hard link.

After you dist-upgraded to Debian 12, the 3 old directories should have been removed during dist-upgrade. If for whatever reason, the old directories are still there, then something went wrong.

Before removing the old directories and create symlinks for them, it's best to compare the new locations and old to see what binaries are missing in the new directories. What's in the new locations should be the one to keep.

The hard thing to figure out is if an older binary should not exist in Debian 12.

So the bottom line is you should let the dist-upgrade process do the work. Don't try to do it yourself.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
December 26, 2023 04:10PM
I've updated the 1st post to add more info about upgrading to Debian 12.4

Quote

Updated 26 Dec 2023

Upgrade to bookworm Debian 12.4

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Upgrading Debian Distribution
December 27, 2023 02:58PM
Hello all,
my 325 is running Debian as below

debian
192.168.1.5
ZyXEL NSA325
Linux version 6.6.3-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2                                                                                                             .0, GNU ld (GNU Binutils for Debian) 2.40) #1 PREEMPT Tue Nov 28 23:25:58 PST 20                                                                                                             23
Debian 11.8
Wed Dec 27 21:38:21 CET 2023 up 18 minutes
root@debian:
Shall I upgrade directly to the last or shall I make any intermediate upgrade ?
Re: Upgrading Debian Distribution
December 27, 2023 04:13PM
miazza,

> Debian 11.8
> Shall I upgrade directly to the last or shall I
> make any intermediate upgrade ?

Yes, you can do dist-upgrade to bookworm 12.4 from bullseye 11.8. The Debian official position is dist-upgrade from one version to the next is supported, but skipping version is not.

But do make a backup of your current rootfs. It will be a massive change, something can go wrong and it will be quite hard to fix when that happens.

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

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: