Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, September 18, 2025

Slackware Kernel Compilation for Dummies

Slackware 15 is getting a little long in the tooth, so I decided to upgrade to the latest kernel in the Slackware-current branch. This makes it easier because I can avoid many of the kernel compilation pain points. Here's what I did:

  1. Download the latest Slackware-current kernel source. I did it this way:
    lftp -c "open https://slackware.osuosl.org/slackware64-current/source ; mirror k"

  2. Go into the "k" directory it created and untar the kernel source

  3. Copy the config you need from ../kernel-configs to the kernel source directory and rename it .config

  4. Run "make olddefconfig"

  5. Run "make -j 12" Change the 12 to whatever cores you have available on your CPU. The command nproc will tell you.

  6. Go watch the baseball game while it compiles.

  7. Run "make modules_install"

  8. Copy the new kernel to the Slackware efi directory (replace the x.x.x with the kernel revision numbers):

    cp arch/x86_64/boot/bzImage /boot/efi/EFI/Slackware/vmlinuz-x.x.x

  9. Back up the existing initrd,gz in the /boot directory

  10. Make a new initrd this way (replace the /dev/nvme0n1p2 with whatever your root partition is):

    mkinitrd -c -k x.x.x -m ext4 -f ext4 -r /dev/nvme0n1p2

  11. I change the name of the new initrd,gz to initrd-x.x.x.gz to tell them apart.

  12. Copy the new initrd to the /boot/efi/EFI/Slackware directory

  13. Edit the elilo.conf file with the new kernel info

  14. Profit!

Sunday, October 29, 2023

BIOS Updates and UEFI

I finally figured out how to rebuild my EFI boot entry after a BIOS update. I boot to the Slackware USB boot drive. When it has me select a kernel I hit tab and enter the following command:

huge.s root=/dev/nvme0n1p2 rdinit=ro

Then once it finally boots to my existing Slackware installation, I issue this command:

efibootmgr -c -d /dev/nvme0n1p1 -l "\\EFI\\Slackware\\elilo.efi" -L "Slackware"

I wish that the EFI boot entry wouldn't be deleted, but since the BIOS updater automatically clears all BIOS settings, it is inevitable.

Update 3/18/2024: I finally got smart and make a shell script for the efibootmgr command and put it in /root so that it's handy whenever I have a new BIOS available.

Sunday, February 19, 2023

Even More UEFI Stuff

About five years ago I posted about getting UEFI to work with Slackware and elilo. I made it a bit more confusing than it needed to be. To make an initrd, you just need to go into the /boot directory as root and use the command geninitrd. Slackware will automagically make the proper initrd.gz so your system will boot.

Then copy the generic and huge kernels as well as initrd.gz to /boot/efi/EFI/Slackware. eliloconfig will create an elilo.conf file there but it will only create one entry. You can make your own. The syntax is very similar to lilo. Here's my current elilo.conf. I noticed there was some weirdness in the one from five years ago. This is for the latest kernel as of this writing on my fancy new WD Black NVMe drive. Zoom!

chooser=simple
delay=100
timeout=100
prompt
#
image=vmlinuz-generic-5.15.94
       label=generic
       description="Slackware 15.0"
       initrd=initrd.gz
       read-only
       append="root=/dev/nvme0n1p2 vga=normal ro"

image=vmlinuz-huge-5.15.94
       label=huge
       description="Slackware 15.0 Huge"
       read-only
       append="root=/dev/nvme0n1p2 vga=normal ro"

Friday, October 1, 2021

Wake for Cron

I recently installed an SSD in my computer and decided to upgrade to Slackware -current (the developmental branch, soon to be Slackware 15). One pleasant surprise is that for the first time my computer will sleep and wake properly. That's great, but that means the various cron jobs won't run because my computer will be asleep when they're supposed to run. I thought of using anacron since I had used that many moons ago when I was running Red Hat. My concern was that it hadn't been updated since June 2000.

So I did a little research and decided to use rtcwake. That will make the computer wake up at a time you set. I checked /usr/spool/cron/crontabs/root to see when the cron jobs run. Turns out that daily runs at 4:40 A.M., weekly at 4:30, and monthly at 4:20. I knew that when my computer woke up, KDE would automatically put it back to sleep after an hour. So I decided to wake it up at 4:10 A.M. Everything seemed to work fine. So I created another file in cron.daily called rtcwake with the following in it:

#!/bin/sh
/usr/sbin/rtcwake -m no -l -t $(date +\%s -d "tomorrow 04:10")

The -m no tells it not to immediately put the device to sleep. -l means that the clock is set to local time and not UTC. The crazy looking date command translates "tomorrow at 4:10 A.M." into the time since the Unix epoch (number of seconds since midnight on January 1, 1970) which the rtcwake command command needs. I executed the command on its own last night. It ran properly. That cron job makes sure it will run tomorrow too. Pretty handy!

Tuesday, February 13, 2018

UEFI and Slackware 14.2

I inherited my dad's computer that has Secure Boot/UEFI. Here's what I had to do to get elilo to work:
  1. Create an initrd (I'm using the generic kernel). I used this command in the /boot directory:
    mkinitrd -c -k 4.4.115 -m ext4 -f ext4 -r /dev/sda3
    This assumes that you are using ext4 and that /dev/sda3 is root
  2. Copy initrd.gz, vmlinuz-generic-4.4.115, and vmlinuz-huge to /boot/efi/EFI/Slackware
  3. Edit elilo.conf to reflect the boot parameters you want. Mine looks like this:
    default=generic
    prompt chooser=simple
    delay=100
    timeout=100
    #
    image=vmlinuz-generic-4.4.115
         initrd=initrd.gz
         root=/dev/sda3
         label=generic
         description="Slackware64 14.2"
         read-only

    image=vmlinuz
         root=/dev/sda3
         label=huge description="Slackware64 14.2 Huge"
         read-only
         append="root=/dev/sda3 vga=normal ro"

Wednesday, January 11, 2017

HDMI Sound in Slackware64 14.2

Phew! Gotta blow some dust off the ol' blog! Anyway, I recently installed Slackware64 14.2 and AlienBob's Plasma 5 packages. I was struggling to get HDMI sound to work. After lots of searching, trial, and error, I finally figured it out. I found that I had to go to the Configuration tab in pavucontrol. There were two options for built-in audio. The one profile said "Digital Stereo (HDMI) Output." I left that one alone. The other one said "Analog Stereo Output." I had to change that one to "Off." Then it worked fine.

Thursday, April 7, 2011

Fatsort

We just got a sweet new Pioneer deck installed in our car. The problem is that if you have music on a USB stick, it plays them back in the order they were saved to the device. Touching the files won't help. Thankfully, an enterprising soul developed Fatsort that will reorganized the file allocation table on a FAT32 or FAT16 device so that things will play in the proper order aka alphabetically. Very cool and easy to use. I heart the OSS community.

Wednesday, January 26, 2011

Android Screenshots in Linux

I've been helping a friend of mine beta test an Android application. A couple of problems I found were easier to show than explain, but Android doesn't have a built-in screenshot capability. I found this page that made things much easier. I already had the Android SDK installed and working. So I just needed to create /etc/udev/rules.d/android.rules with this line in it:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"

Once udev was restarted and I enabled USB Debugging Mode on my phone, I could run the ddms utility with the Android SDK and get all kinds of cool info on my phone, including taking screenshots.

Monday, December 27, 2010

Slackware64 13.1 on an HP Pavilion dv8000

My in-laws got a new laptop, so they wanted to know if we wanted their old one, an HP Pavilion dv8000 (ummmm, yes!). Yesterday I installed Slackware 13.1 on it. I expected to fight with the wireless and the graphics drivers. The drivers that are used automatically (kernel DRM?) work well for 2D stuff. 3D works somewhat. Not sure if that's a driver issue or the fact that the ATI Radeon Xpress 200m is nothing to write home about.

I was able to get the wireless working relatively easily. It uses a Broadcom chipset. I just had to follow these instructions to get the firmware for it installed. After that, it fired up just fine. Very impressive for something that used to be a major PITA.

There are still a few things I want to tweak, but the installation was surprisingly painless.

Friday, January 15, 2010

Compiling Mediatomb

I've been using Mediatomb to stream pictures and MP3s from my computer to my PS3. I had some issues getting it to detect Slackware64 13.0's sqlite3 installation. MySQL worked, but seemed like overkill. With a little help from my friends at LinuxQuestions I was able to get it to work. Turns out I had to do this when issuing ./configure before compiling:

LDFLAGS="-ldl" ./configure --with-js-libs=/usr/lib64/seamonkey --with-js-h=/usr/include/seamonkey/js

After that, it all worked great. I just had to change the one line in my config.xml (which is clearly pointed out in the comments for the file itself) for use with my PS3. Done!

Tuesday, January 12, 2010

digiKam . . . Much Easier Now

Well, I've already found one benefit to installing Slackware 13.0. It's much easier to install digiKam. Now all of the prerequisites are a part of Slack13, so I just have to download the digiKam source and follow the directions.

Adventures in 64-Bit Slackware

I bought myself a new i5-750-based box and am installing Slackware64 13.0 on it. All told everything is going reasonably smoothly. I upgraded to KDE 4.3.1 (using these packages) because of some problems that I've heard with the default 4.2.4. That would have been easy except that I tried to install 4.3.2, not realizing he had made those packages to work with Slackware -current. No wonder it didn't work to well.

All told I'm very happy thus far. The only issue I had is with my onboard LAN. Slackware was setting that up before my wireless card. So I disabled the onboard and we're all good. My only complaint is that my network isn't working so hot so I'm finding easier to transfer files from my old computer via my USB pen drive and sneakernet. Oh well.

Saturday, January 17, 2009

Liberation Fonts

Over the past couple of Slackware releases, Pat and co. have been setting up the fonts to automatically use the Liberation fonts as replacements for the Microsoft Times New Roman, Arial, and Courier New. In the past I reversed those changes and installed the MS fonts. However, I've really wanted to get rid of anything like that. Since the Liberation fonts are metric-compatible with the MS ones, I decided to give them a go. So far, I've been pretty happy with them. I see no reason to go back now.

Thursday, December 25, 2008

Palm TX Reset Fix

I was having a problem with my Palm TX resetting every time I tried to sync the Datebook/Calendar information. I ended up downloading Pimlico Software's DateBk6 and installing a file called dbscan.prc which is in the AdvancedStuff.zip file. I ran the program and followed these steps:
  1. Choose "Other" from the opening screen
  2. Pull down the menu and choose "Remove All Deleted Records"
  3. Push the "PalmOne" button
Apparently there were three deleted records in the Datebook/Calendar database. Now that those are gone, I can sync my PDA via pilot-link and JPilot once again.

Wednesday, December 24, 2008

I Hate It When That Happens

It's a bad idea to run rm -rf on your /media directory when you've got your USB drive mounted there. You'd think I'd know better than that. You'd be wrong. Thankfully there was nothing of massive importance on there.

Tuesday, December 23, 2008

Slackware and KDE's Font Installer

I don't know why this never gets fixed, but for the past several Slackware releases, fonts that you install via KDE's font installer won't show up anywhere. The trick is to add this directory to your /etc/fonts/fonts.conf file under the section marked Font directory list:
/usr/local/share/fonts
I may have to talk with the powers-what-is about that.

Slackware 12.2

Pat and the guys released Slackware 12.2 on the 10th. I downloaded the DVD iso. Unfortunately my other computer won't read DVDs burned by this one, so I have to get the three install CDs too. Thank heavens for broadband. For kicks I decided to upgrade my kids' computer yesterday. Everything went so smoothly that I decided to go ahead and do it on my main box too. I'm just tying up some loose ends right now. So far it seems very slick. Unlike 12.1, the kernel that comes with 12.2 doesn't barf on my DVD drive.

Friday, May 16, 2008

Slackware 12.1

You'd think I'd know better by now. Slackware 12.1 came out and I decided to upgrade my main box with it. There's just one problem. The 2.6.24.5 kernel that comes with it doesn't like my DVD drive. Unfortunately I didn't watch when the DVD was booting so I didn't notice until I had dusted my root partition. I got to the point where I would install all the packages and it wouldn't find the drive. This isn't Slackware-specific; I've heard of people having similar problems with Ubuntu and other distros with that kernel. It may be something specific with Benq-based drives (which my Sony DRU-810A is).

Long story short, I had to reinstall 12.0 and then do a manual upgrade to 12.1. I got everything working in relatively short order. Unfortunately, there were a couple of other screw-ups that I made along the way which are entirely my own fault. Haste makes waste, they say. Plus for some reason I insist on living on the bleeding edge.

So now I'm running a custom 2.6.25.3 kernel. The main benefit I've seen to 12.1 so far (it's only been a day or two) is that I could install Cedega without having to add a bunch of stuff to Python.

Wednesday, April 2, 2008

2.6.25-rc8, Ralink, and wpa_supplicant

Most people know that getting wireless networking working in Linux (especially with native, open-source drivers) is one of the last great hurdles for Linux to overcome. We are doing some moving around in the house. Rather than punch holes in the walls for cat5, I decided to get a wireless card for my kids' computer and see if I could get it set up. I got a Linksys WMP54G v4.1 which uses a Ralink chipset which in turn has open source drivers. Initially, I tried to just compile the rt61 driver and a modified version of wpa_supplicant for WPA support. I just couldn't get it to work.

I read that the Ralink drivers entered the kernel itself with the release of 2.6.24. Unfortunately, the drivers in that kernel version are buggy. I heard that the drivers in the 2.6.25 release candidates were much better. So, I downloaded the 2.6.24 source, patched it to 2.6.25-rc8, did a "make oldconfig" making sure to tell it to compile the Ralink drivers as modules, and let it compile overnight (Celeron 400s don't compile kernels that rapidly). In the morning, I got everything installed. I then compiled and installed wpa_supplicant 0.5.10.

The final hurdle was configuring wpa_supplicant and Slackware 12.0's networking scripts. Here is the bits from /etc/rc.d/rc.inet1.conf:

IFNAME[4]="wlan0"
IPADDR[4]="192.168.1.4"
NETMASK[4]="255.255.255.0"
USE_DHCP[4]="no"
DHCP_HOSTNAME[4]=""
WLAN_ESSID[4]="My SSID"
WLAN_MODE[4]=Managed
WLAN_WPA[4]="wpa_supplicant"

This configured Slackware to give me a static IP and use wpa_supplicant to take care of WPA encryption. Here is the bits from /etc/wpa_supplicant.conf:

# WPA protected network, supply your own ESSID and WPAPSK here:
network={
scan_ssid=1
ssid="My SSID"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk=password
}

I had to add scan_ssid=1 because my router does not broadcast its SSID. That way the network would come up properly on boot. Replace "password" with the output of wpa_passphrase. Obviously in both cases you'd need to enter the actual SSID.

Now everything works great! I can download stuff at my cable connection's maximum speed. I'll need to test it for a while for stability, but so far it seems great. The only other problem I had is that the NVIDIA drivers require a patch to compile with the 2.6.25 release candidates. You can imagine how long it took me to figure that one out.

Monday, March 3, 2008

Linux and Hard Drive Partitioning

I don't know if there could be a topic less sexy than partitioning a hard drive for Linux but it is still very important. He lists a couple of common schemes and then gives some extra suggestions for servers. I personally have separate partitions for /boot, /, /home, and /mp3s. That setup has served me well. If I were running a server, I'd probably add one for /var just in case some logging went haywire. Thanks Linux Today.