Kernel patches: added support for HTTP mirrors 2

kernel-patches (a screenshot)

In the previous post I talked about my attempt to create a script to automate the kernel patches installation procedure on Slackware (stable) and I reported the quick ‘n’ dirty instructions to run it, with also a video demonstration.

A few time after, a dear friend tried the script and he pointed out to me it failed with errors.

After asking him to provide me some details, I understood almost immediately what was the problem: the script didn’t work with http mirrors. This because I tested my code only with ftp mirrors.

Then I started to make some changes to the code in order to support both the mirror types.

The changes

Basically, the most important changes I’ve introduced are the following:

  • MIRROR_TYPE, a variable used to store the protocol type extracted from the mirror URL (retrieved from /etc/slackpkg/mirrors and stored in MIRROR)
  • An if statement which populates the KERN_DIR variable according to the content of MIRROR_TYPE
  • PKGS, a variable which stores the list of the packages to be downloaded
  • Another if statement which fills PKGS according to MIRROR_TYPE
  • The old download section has been replaced by a unique wget command inside a for loop iterating onto the content of PKGS
  • The way to detect the root partition has been changed by using the mount command in place of df.

There are also some minor improvements to the code and to the interface (based on dialog) which I don’t mention here since they are not so important. Anyway you can check the commits history on GitHub.

What’s next?

I’ve not a detailed plan for now, but I know that some small improvements are needed.

One of these could be to change the pattern variable used to find the root partition in order to better match the linux partition naming: this is intuitive if you think about the typical name of the partitions on a SDHC card (for example /dev/mmcblk0p1).

I’m waiting for the next Slackware stable release to try to install the ARM version (hard float) onto a Raspberry Pi. If possible, I would like to adapt the script in order to support also the ARM version of the distribution.

 

 

Did you like this post? Share it!
Share on email
Email
Share on twitter
Twitter
Share on facebook
Facebook
Share on linkedin
Linkedin
Share on print
Print

2 thoughts on “Kernel patches: added support for HTTP mirrors

  1. Reply luvr Sep 11,2019 17:15

    To find the root partition, may I suggest using the findmnt command?
    The following command will output just the device name on which the root partition is mounted:
    findmnt --noheadings --output SOURCE /
    No more pattern needed!

Leave a Reply