Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Friday, 17 February 2023

Upgrading Debian 6 kernel

Attempts to do this through apt-get involved upgrading too many packages and in my opinion, was too risky. Therefor, an upgrade from Squeeze to Wheezy was done this way and from there, a kernel [5.15.94] was built on another box, in my case a Debian 11 VM running kernel [5.10.0-21]

UPDATE: Apr 2024 - See comments and additions below.

1 Upgrading from Squeeze to Wheezy using Apt-get

Run uname -a to find current kernel version.

Modify /etc/apt/sources.list to include next Debian version information.

Run apt-get update

Run apt-get install linux-image-amd64 (assuming that is what is shown after running uname -a)

Rebooting should now show updated GRUB menu with new kernel, continue booting and test functionality of existing system.

2 Updating Kernel Manually

2.1 Build Kernel on another box

2.1.1 Get kernel from kernel.org and uncompress it, preferably in the home directory.

2.1.2 The following additional packages may be required, so as well to get them before we go any further;

apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison dwarves

2.1.3 Copy the previous config file cp /boot/config* .config and run make menuconfig

Make any changes, in my case, I chose to build support for HP smart raid into the kernel.

2.1.4 run make bzImage

I ran into an issue, relating to a certificate error, see here I used the solution here essentially opening .config with an editor and searching for the 3 lines as below;

# CONFIG_TRUSTED_KEY
 CONFIG_SYSTEM_TRUSTED_KEYRING = y
 CONFIG_SYSTEM_TRUSTED_KEYS=""

The KEYRING value was left at y and the KEYS changed to "" (this previously had the location displayed in the error).

2.1.5 Once the kernel is built without errors, we can build the modules with make modules 

2.1.6 then make modules_install which will copy them to /lib/modules/5.15.94

NOTE: make modules_install will probably do both things at once, I recall back in the day doing things like make dep && make clean && make bzImage && make modules && make modules_install etc...

2.1.7 We would then copy the bzImage (in arch/x86/boot/bzImage) to /boot/vmlinuz-5.15.94

NOTE: I'm sure back in the day, I could do make install which essentially done this, but for some reason, I always preferred to do it manually.

2.1.8 Same with the System.map to /boot/System.map-5.15.94

2.1.9 We would then update the initrd image in /boot with update-initramfs -u -k 5.15.94

NOTE: If there was no initrd image already in /boot for this version, we would create one with update-initramfs -c -k 5.15.94

2.1.10 Finally, update grub with update-grub

PLACEHOLDER

TODO add cciss [see below from Apr 24 as it is actually the hpsa module that is in here with the cciss one commented out] into /etc/initramfs-tools/modules and update-initramfs -u -k (version number as per boot) and attempt to boot. [didn't work]

PLACEHOLDER

PLACEHOLDER

PLACEHOLDER

PLACEHOLDER

PLACEHOLDER

UPDATE: Apr 2024

Rereading the above, I am not entirely sure as to why I was upgrading to 5.15.94 (this may have been for the purposes of attempting to get FEC-A to connect to the updated Oracle database for Broner)

My notes for section 1 would seem to indicate upgrading the kernel from 2.6.32-5 to 3.2.0-4 (both of which appear on Process Control server FEC-A, with 3.2.0-4 running and matching that of MCC-A) but interestingly 5.15.94 also appears in /boot and lib/modules so I know that I have at least attempted to install that on there. (unsure at this time whether it appears in the grub menu or not [It doesn't]). It is also worth noting that the grub version on both FEC-A and MCC-A is 1.99 (both running 3.2.0-4), while FEC-B is running 1.98 and 2.6.62-5

I'm also confused by the "didn't work" from above, especially given there is no follow up and FEC-A has been running since Feb 2023. I can only assume that following this note, I added the hpsa into /etc/initramfs-tools/modules as FEC-A is and has been working since Feb 23, although interestingly, MCC-A on the same kernel will not boot with the same in place.

UPDATE: May 2024

To get the restored MCC-A to boot;

At this stage I had assumed that grub was working and that the initrd contained the drivers required (hpsa). So I set about adding a boot parameter as follows;

When booting, interrupt grub by using pressing e and add the line hpsa.hpsa_allow_any=1 to grub to the boot command, after the ro and quiet (actually, remove quiet for the time being) and boot the system using ctrl-x

This booted successfully, so to make this change permanent, we need to modify /etc/default/grub specifically the line GRUB_CMDLINE_LINUX_DEFAULT=“quiet" adding  hpsa.hpsa_allow_any=1 to it essentially becomes GRUB_CMDLINE_LINUX_DEFAULT=“quiet hpsa.hpsa_allow_any=1”

We then simply run update-grub

Note: This was not required in order to get FEC-A to overcome the same issue, perhaps the 3.2.0-4 kernel on both FEC-A and MCC-A is not configured the same.

Sources list:

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

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

Some commands by passing gpg errors;

apt-get --allow-unauthenticated update

apt-get --allow-unauthenticated install --only-upgrade vim

apt-get --allow-unauthenticated install linux-image-amd64

apt-get --allow-unauthenticated install linux-source-3.2

https://wiki.debian.org/HP/ProLiant 

https://www.suse.com/support/kb/doc/?id=000018202

https://unix.stackexchange.com/questions/474979/hpsa-allow-any-1-and-centos7-5

https://man7.org/linux/man-pages/man4/hpsa.4.html

See also here



Sources

 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.