LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-06-2019, 05:24 PM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
Installation, booting and kernel upgrades: let's share scripts and plans with friends


Hello,

This post is a retweet(sic) of this one.

I want to share some scripts and plans for Slint with friend distributions, namely Salix and Slackel. Maybe some Slackware users could be interested too.

The scripts are here. They are shipped either in the installer's initrd or in packages available in http://slackware.uk/slint/x86_64/slint-testing/ that you can add to your slapt-getrc to try them.

I won't mention here the changes specifically intended to make the installer accessible to blind users, but am ready to answer questions about them.

At the beginning of installation, the script auto is optionally used before running setup. It looks for not mounted devices with a size > 30G, and writes a GPT on the one chosen by the user, including a Bios Boot partition (4M, for GRUB in Legacy mode), an ESP (100M) and a Linux partition (30G). The user can tune this partition table before running setup. This could help users not acquainted with manual partitioning.

The DOS partitions detection is based on their file system type (i.e., vfat but the ESP, msdos or ntfs), instead of the partition type. Rationale: only populate /etc/fstab with partitions of which mount can handle the file system.

In /etc/fstab, the lines for Linux, DOS, swap and EFI partitions are labeled by UUID instead of name, to allow finding them even if the device is renamed.

GRUB is used as boot loader and manager for both Legacy and UEFI booting. This is done running the grubconfig script just installed, shipped in grub-extra, modified from Salix/Slackel to install GRUB in both Legacy and EFI modes if possible, and to make writing a boot entry in the EFI firmware optional.

A portable installation mode is provided using the script install-portable shipped in slint-misc.

As it is not yet shipped in the ISO for Slint64-14.2.1.2, there is a specific procedure to use it. The idea is to allow installing Slint in a removable device in such a way that it can boot on many if not any machines, using a generic kernel and an initrd with modules able to handle various hardware and writing a custom grub.conf. This script is also needed to install on an USB attached drive even if used on only one machine. Limitation: the f2fs file system is not yet supported, which practically precludes installing on a flash drive.

Also in the slint-misc package the script update-portable allows to redo an initrd and rewrite grub.conf after a change in the generic kernel(s) installed. This script also allows to bring portability to a Slint that was not portable initially. This can be reverted just running update-grub.

The script upgrade-kernel, also in slint-misc, automatizes the installation of upgraded kernels provided by Slint: it downloads the new kernels, remove the old ones and install the new ones, then rebuild an initrd supporting all installed generic kernels, and update grub. A portable system will stay so.

To make the initrd we use the scripts shipped in the mkinitrd package for Slackware-current, with a modification of the script setup.01.mkinitrd to ship in the initrd modules for all installed generic kernels, including custom ones.

Enhancements planned, or at least considered

Make the script 'auto' more versatile: Instead of providing just one layout for a dedicated device, allow various layouts depending on the answers to questions asked to the user, in a similar fashion as what does the Debian text installer, as suggested by several users, cf. this thread. Also, if the installation occurs in Legacy mode, prefer to set up a DOS partition table as some machines are unhappy with a GPT one if booted in Legacy mode, or ask the user which one to set up.

Allow to choose between a fixed or portable system during installation

Allow to install a f2fs file system, to benefit flash drives. This will wait until grub 2.04 be released or close, as it supports this file system and brings other enhancements.

Provide only generic kernels, but keep the previous one in case of upgrade, as do other distributions. Then, dedicate an initrd to each one instead of an unique initrd "catch all".

Include in the boot menus a boot entry allowing to boot almost any installed system. Also linked to the release of grub 2.04, as will use scripts shipped in SuperGrub2 from Adrián Gibanel Lopez (currently version 2.04rc1s1-beta4).

Include an i386EFI image in the ESP, that could help users using some machines that have an x86_64 architecture but a 32-bit only EFI firmware

So, what?

Comments, questions, suggestions are welcome.

Best regards,

Last edited by Didier Spaier; 05-07-2019 at 11:07 AM. Reason: Comletely rewritten so that reeders won't have to register to another forum to comment.
 
Old 05-07-2019, 09:10 AM   #2
Cristiano Urban
Member
 
Registered: Jul 2013
Location: Gonars (UD), Italy
Distribution: Slackware 14.2 x86_64
Posts: 76

Rep: Reputation: 10
I tried to write a Bash script for kernel patches upgrade more then one year ago. I tested it only on Slackware stable. I think it has to be changed in some parts because, for example, it doesn't remove the old packages. There are also other things that may be improved. Here you can find the code.

Another script I wrote is the one to install Oracle VirtualBox. This essentially due to my laziness
Here is the latest code on master branch and here are the latest changes on testing branch.
Unfortunately this script stopped to work when the VirtualBox binary started to fail and needed some patches on Slackware 14.2
EDIT: Just tested with the latest version of VirtualBox (6.0.6) and it works fine. It seems they have solved the issues.

I'm not so experienced in Bash scripting, therefore I appreciate suggestions if someone notices there is something to be changed.

Last edited by Cristiano Urban; 05-08-2019 at 01:51 PM.
 
Old 05-07-2019, 10:09 AM   #3
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
I really have no need to join Salix forum. love what they do. here is my github. remember some need tweaking. https://github.com/Drakeo?tab=repositories
 
1 members found this post helpful.
Old 05-07-2019, 11:08 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Drakeo View Post
I really have no need to join Salix forum.
Objection received, Your Honor. I have rewritten the initial post accordingly.
 
Old 05-07-2019, 11:44 AM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Hey Didier, great idea, I like your project! Anytime you help someone it's a good thing and hopefully you are blessed for your efforts!

Is your iso a live or install iso?
 
Old 05-07-2019, 02:27 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
It is an install ISO. Maybe later I will provide a live ISO, but there are other items above this one in my TODO list, like finding a way to provide more packages while not increasing too much the associated world load.

I am going to see how I could use David's slackrepo for that, with adaptations if need be.

Last edited by Didier Spaier; 05-07-2019 at 02:40 PM.
 
1 members found this post helpful.
Old 05-07-2019, 03:25 PM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Didier could I have your permission to make a Live DVD/USB of your iso and host it on my sourceforge site which will be devoted to slackware after this week?
The link in my signature below.
 
Old 05-07-2019, 04:52 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linus72 View Post
Didier could I have your permission to make a Live DVD/USB of your iso and host it on my sourceforge site which will be devoted to slackware after this week?
Of course! and I am eager to try it. Just make clear that the mastering is your work, so support requests for it should be addressed to you. However if that uncovers issues in Slint, please let me know.
 
1 members found this post helpful.
Old 05-07-2019, 05:50 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Fascinating project Didier!

Regarding the upgrade-kernel script, I prefer installing new kernels rather than replacing. Users then have a way to boot a system should a new kernel cause havoc. I keep two kernels in my Slackware system for several days after installing a new kernel. Retaining at least two kernels installed is standard across almost all distros.

I did not notice support for LUKS in grubconfig, but perhaps encryption is supported elsewhere.

One nit-pick -- my over inflated opinion -- I dislike 8 space indents. I prefer 2 spaces, but for me even 4 spaces is more readable than 8.

Pretty obvious that you are having way too much fun.
 
1 members found this post helpful.
Old 05-07-2019, 05:58 PM   #10
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK Didier I'll install it on my hdd tonight and will make it Live. Note I will not change anything else in your iso except the kernel/modules required for live booting.
It'll be hosted here, a work in progress, thanks
https://sourceforge.net/projects/slacker-live/

The caveat is I know nothing about efi booting etc I make all this stuff on a windowless dell 1545 lol
But I can add efi support if need be?

Last edited by linus72; 05-07-2019 at 06:09 PM.
 
Old 05-07-2019, 06:09 PM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by upnort View Post
Regarding the upgrade-kernel script, I prefer installing new kernels rather than replacing. Users then have a way to boot a system should a new kernel cause havoc. I keep two kernels in my Slackware system for several days after installing a new kernel. Retaining at least two kernels installed is standard across almost all distros.
I agree. I plan to keep K-1 and remove K-2 but need to find a way to do that properly.

Also, I plan to propose upgraded kernels stolen to Slackware-current not that often and only some time after they have been released, to mitigate the risks

Quote:
I did not notice support for LUKS in grubconfig, but perhaps encryption is supported elsewhere.
Not yet provided.

Quote:
One nit-pick -- my over inflated opinion -- I dislike 8 space indents. I prefer 2 spaces, but for me even 4 spaces is more readable than 8.
Actually this is one tab not spaces

Quote:
Pretty obvious that you are having way too much fun.
Yes.
 
1 members found this post helpful.
Old 05-07-2019, 11:49 PM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linus72 View Post
OK Didier I'll install it on my hdd tonight and will make it Live. Note I will not change anything else in your iso except the kernel/modules required for live booting.
Bear in mind then that in the initrd we ship all kernel modules compressed, cf. lines #144-159 in http://slackware.uk/slint/x86_64/sli...4.2.1.2.iso.sh
 
Old 05-08-2019, 01:28 PM   #13
Candelabrus
Member
 
Registered: Apr 2015
Location: Ponta Grossa - PR
Distribution: Slackware64
Posts: 173

Rep: Reputation: 26
As I always update to the last kernel, then I've created these scripts to make my life easier.

The first one is for when you will install your particular kernel having installed the native slackware kernel
Code:
#!/bin/sh

OLD=4.19.32
NEW=5.1

# Compilando o novo kernel / compiling new kernel
cd /home/backup/kernel
cp linux-$NEW.tar.xz /usr/src
cd /usr/src
tar xvf linux-$NEW.tar.xz
rm linux-$NEW.tar.xz
cp /home/backup/kernel/configs/grinder-slackware /usr/src/linux-$NEW/.config
cd /usr/src/linux-$NEW
make -j5 bzImage && make -j5 modules && make modules_install

# Copiando arquivos do novo kernel / installing new kernel
cp System.map /boot/System.map-$NEW
cp .config /boot/config-$NEW
cd arch/x86_64/boot
cp bzImage /boot/vmlinuz-$NEW

# Removendo o kernel antigo / removing old kernel
removepkg kernel-generic
removepkg kernel-huge
removepkg kernel-modules
removepkg kernel-source
rm -rf /usr/src/linux

# Arrumando os symlinks / fixing symlinks
cd /usr/src
ln -s linux-$NEW linux
ln -s /boot/System.map-$NEW /boot/System.map
ln -s /boot/config-$NEW /boot/config
ln -s /boot/vmlinuz-$NEW /boot/vmlinuz

# Gerando o initramfs / generating initramfs
# mkinitrd -c -k $NEW -m ext4 -f ext4 -r /dev/sda6

# Gerando o novo GRUB / updating your grub with new entries
grub-mkconfig -o /boot/grub/grub.cfg
The second is to update the kernel when you are with your particular kernel
Code:
#!/bin/sh

OLD=5.0.7
OLD_LIB=5.0.7
NEW=5.0.8

# Compilando o novo kernel
cd /home/backup/kernel
cp linux-$NEW.tar.xz /usr/src
cd /usr/src
tar xvf linux-$NEW.tar.xz
rm -rf linux
ln -s linux-$NEW linux
rm linux-$NEW.tar.xz
cd /usr/src/linux
cp /usr/src/linux-$OLD/.config /usr/src/linux-$NEW/.config
make oldconfig
cp .config /home/backup/kernel/configs/grinder-slackware
make -j5 bzImage && make -j5 modules && make modules_install

# Arrumando os symlinks
cp System.map /boot/System.map-$NEW
rm /boot/System.map
ln -s /boot/System.map-$NEW /boot/System.map
cp .config /boot/config-$NEW
rm /boot/config
ln -s /boot/config-$NEW /boot/config
cd arch/x86_64/boot
cp bzImage /boot/vmlinuz-$NEW
rm /boot/vmlinuz
ln -s /boot/vmlinuz-$NEW /boot/vmlinuz

# Removendo o kernel antigo
rm /boot/System.map-$OLD
rm /boot/vmlinuz-$OLD
rm /boot/config-$OLD
rm -rf /lib/modules/$OLD_LIB
cd /usr/src/linux-$OLD
make mrproper
cd /usr/src
rm -rf linux-$OLD

# Gerando o initramfs
# mkinitrd -c -k $NEW -m ext4 -f ext4 -r /dev/sda5

# Gerando o novo GRUB
grub-mkconfig -o /boot/grub/grub.cfg
And the third is to recompile the kernel if you have changed anything within the same version.
Code:
#!/bin/sh

VERSION=5.1
VERSION_MODULES=5.1.0

# Removendo o kernel antigo
rm /boot/System.map
rm /boot/System.map-$VERSION
rm /boot/config
rm /boot/config-$VERSION
rm /boot/vmlinuz
rm /boot/vmlinuz-$VERSION
rm -rf /lib/modules/$VERSION_MODULES

# Compilando o novo kernel
cd /usr/src/linux-$VERSION
cp .config /home/backup/kernel/configs/grinder-slackware
make mrproper
cp /home/backup/kernel/configs/grinder-slackware /usr/src/linux/.config
make -j5 bzImage && make -j5 modules && make modules_install

# Copiando arquivos do novo kernel
cp System.map /boot/System.map-$VERSION
cp .config /boot/config-$VERSION
cd arch/x86_64/boot
cp bzImage /boot/vmlinuz-$VERSION

# Arrumando os symlinks
ln -s /boot/System.map-$VERSION /boot/System.map
ln -s /boot/config-$VERSION /boot/config
ln -s /boot/vmlinuz-$VERSION /boot/vmlinuz

# Gerando o initramfs
# mkinitrd -c -k $VERSION -m ext4 -f ext4 -r /dev/sda5

# Gerando o novo GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Last edited by Candelabrus; 05-08-2019 at 01:31 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Let's Automate Let's Encrypt LXer Syndicated Linux News 0 11-01-2016 06:51 AM
LXer: Fedora Linux Might Drop Incremental Upgrades, Let Users Skip a Release LXer Syndicated Linux News 0 01-17-2016 02:40 PM
LXer: Public warning: Windows 10 will share your Wi-Fi password with your friends' friends LXer Syndicated Linux News 0 07-01-2015 12:33 AM
"Let it Snow, Let it Snow" .. and the Google That Cried "Wolf" sundialsvcs General 7 02-11-2014 07:59 PM
LXer: Share files with friends while chatting using Qnext LXer Syndicated Linux News 0 05-23-2007 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration