Upgrading 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.

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:

2. Have installed a mix of my released kernel images and mainline kernel images

Your system is running my released kernel linux-image-xx.xx.xx-kirkwood-tld-xx, and also you had previously installed and run some mainline kernel in this system. Usually because you started with a Debian installation (e.g. Debian netboot, Debian CD,…).

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.

b. Remove all mainline kernels that have been installed. Check for previous versions:

dpkg -l | grep -i linux-image

and purge each of these linux-image when you found them. The image name would indicate a mainline kernel when there is no -kirkwood-tld-xx postfix.

dpkg —purge linux-image-xx.xx.xx

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

apt-get update
apt-get dist-upgrade

d. 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 version (there are a lot of packages that you might never use).

apt-get update
apt-get upgrade

e. 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

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

See section 1d or 2e above, if you encounters problem mounting rootfs.

c. NFS rootfs booting problem.

Debian stretch has a behavioral change in NFS server: it will not provide NFS V2 protocol by default, and u-boot had always been using NFS V2 to load the kernel from the rootfs. The later u-boot versions in 2017 has finnally got V3 capability (It will be available when I release new u-boots for 2017).

It will work. But you will need to have the DTB appended to uImage as instructed:

Quote4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

>
> Update uboot to latest 2017.07 version. Then boot
> with old Kernel: 3.9.5 and then update Debian and
> kernel.
>

This is a good plan.

But in order to run the new u-boot with your existing rootfs, you need to check your rootfs for kernel files and Dockstar DTB file to make sure it will be bootable.

I am not famiilar with this kernel: 3.9.5-dockstar-goflex-shyd. So you will need to make sure that your rootfs /boot folder conform to the structure in my release rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (24 Jul 2017).

It is a classic problem with having multiple partitions in the system. The new u-boot will take care of that with the envs. You are runing old u-boot so you need to change a few envs to ensure the booting is correct.

Please note: At the moment I only can use a Debian 9.0 (Stretch) Linux system in virtual machine (VMWare).
The e2label command only works as superuser/root and shows no entry.
The used usb pen drive is mounted as /media/tom/7b3f7f98-dc8e-47a4-8857-3ac9976121a8 here in Debian and not as
/media/sdb1

The LED color amber indicated that the kernel has failed to run. But on the slight chance that the LED is wrong, and the problem is actually rootfs mounting, setting the correct label will enable the kernel to mount the rootfs correctly.

Since you don't have serial console, it is difficult to see exactly what has happened. We can only make educated guess. If this does not work. We'll go to plan B.

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.