WARNING!! -- Before modifying any system files, you should make sure you have backups. I usually make two copies of every file, one in the same directory with .bak extension, i.e. file1 will become file1.bak. Then I'll make a copy of file1.bak in a hidden folder under my home directory. I have a folder ~/.backups that I keep redundant copies in, just in case. Ok, before we get into the scripts I use, we have to make some changes to a few files. These files are critical files, something as insignificant as a missing colon or semi-colon, a stay character you didn't realize you typed, can cause your machine to be in an unbootable state. I highly recommend you have a recovery USB of some sort that will allow you to access your Linux partitions to fix things. I personally keep a SlackwareLive USB on me at all times, courtesy of AlienBob. You can find download the iso file and find instructions on setting one up here.
DISCLAIMER! -- If you decide to follow the steps that follow, you do so at your own risk. No guarantees are made or implied by myself or anyone associated with me. I am in no way affiliated in any official capacity with Slackware Linux or its development team. You are responsible for your own outcomes, and I assume no liablility if your system ends up in an unusable state. The information presented is for only that, information. Okay, I learned that the boot messages that appear on the screen don't all originate from the same source. It took a little while to figure out how to keep text from writing to the console. First, let's get rid of the lion's share of the boot messages. To do this we have to make a minor change to the grub.cfg located in /boot/grub/. If you open your grub.cfg you should see something similar to this:
menuentry 'Slackware-15.0 GNU/Linux' --class slackware_15.0 {
load_video
set gfxpayload=keep
insmod part_gpt
insmod xfs
insmod gzio
set root='hd0,gpt6'
echo 'Loading Linux kernel 5.15.19...'
linux /vmlinuz-5.15.19 root=/dev/nvme0n1p7 video=eDP:1920x1080-32@60
echo 'Loading initrd...'
initrd /initrd-5.15.19.gz
}
At the end of the kernel command line, the line that starts with 'linux', we're going to add two things:'
loglevel=0 console=tty12
Now your boot entry should look like this:
menuentry 'Slackware-15.0 GNU/Linux' --class slackware_15.0 {
load_video
set gfxpayload=keep
insmod part_gpt
insmod xfs
insmod gzio
set root='hd0,gpt6'
echo 'Loading Linux kernel 5.15.19...'
linux /vmlinuz-5.15.19 root=/dev/nvme0n1p7 video=eDP:1920x1080-32@60
echo 'Loading initrd...'
initrd /initrd-5.15.19.gz
}
What this does is turn kernel logging to stdout off, and it will also write stdout and stderr from other processes to console 12. You can verify that by pressig ctrl + alt + F12 during bootup. If you don't add loglevel=0 you will see most of the boot messages there.
Next we have to modify /etc/inittab. These are the lines you are looking for:
# Default runlevel. (Do not set to 0 or 6)
id:3:initdefault:
# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S
# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M
Now here we are going to change the default runlevel from 3 , which boots to a text console, to 4, which boots to the GUI. We're also going to add a tag to rc.S and rc.M. I use -gb, for graphical boot. We are going to create wrappers named rc.S-gb and rc.M-gb and call rc.S and rc.M from those. This is how they should look now:
# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:
# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S-gb
# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M-gb
That was pretty painless, now wasn't it? I say that now but when I was trying get it all working it didn't feel so painless. The hardest part is right around the corner. It's not really that hard though, I mean the title is 'Simple Graphical Boot'.