My thoughts on Slackware, life and everything

Month: April 2011

Out of the box PXE install server in Slackware 13.37

I had a lot of fun creating my Easter Egg for Slackware 13.37. It did not matter that Pat announced it on the slackware.com front page – it’s OK that it got some exposure. The added functionality is useful enough.

So, why an easteregg at all… and what about that PXE server?

In the last weeks before the eventual release it became pretty clear that the go-live date would be somewhere around Easter. All showstoppers had been dealt with. There was a bit of leeway and I skimmed through my TODO file (where I write down the ideas I get for Slackware improvements, as well as reminder notes for fixes that I think are important but not urgent). One of the ideas I wanted to implement was a PXE server that would run out of the box when booting the Slackware DVD.

I decided to do a quick hack session and come up with a proof of concept to see if it worked. Initially my plan was to incorporate the result into a custom initrd to be posted on my own web site, but after two (long!) nights of trying I had something that could be tested by others in the core team.

My good pal mRgOBLIN is a willing subject for this kind of non-public testing. He hammers at everything network related that I add to the installer, and he tends to find all the bugs and corner cases.

Two more days, and I had something that was working well, complete with documentation, and Pat Volkerding added it without hesitation and without mentioning it in the ChangeLog.txt. It has been inside the Slackware installer since April 15… and no one noticed. This was intended as an easteregg (well, at least that’s what I kept calling it) but it adds real valuable functionality to the installer. It’s more than just a prank.

Writing the scripts actually uncovered a couple of bugs in the network configuration of the installer which I fixed. Therefore I decided to write an article about how this “pxeserver”can be used by you.

You probably know that I have an article in my wiki about setting up a PXE boot server for network installation (it’s at http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:pxe) which is what Slackware’s “usb-and-pxe-installers/README_PXE.TXT” file is based on. But even with all the details in those instructions, it’s still one bridge too far for many people – and not everybody has the luxury of having a Slackware server running in his network.

Setup a PXE server

So, one of the ideas written in my TODO file was “add a PXE server to the Slackware installer“. My intention was to provide an easy method for network installations of Slackware, provided you have one spare computer with a network card (no wireless!!!). This is how it goes, using the Slackware 13.37 installation media:

You insert the Slackware 13.37 DVD (or CD1) into the spare computer, and boot from the optical medium:

Instead of typing “setup” as usual, you type “pxesetup” this time:

The “pxesetup” script will load a main dialog which is modeled after the Slackware setup:

There are four relevant main selections (apart from EXIT which will drop you back to the prompt): HELP, NETWORK, SOURCE and ACTIVATE. I will go through these choices using the screenshots below, and you will see that there is surprisingly little for you to configure… it is very user-friendly.

HELP:

The HELP section should be self-explaining – it is the manual for the PXE server:

NETWORK:

The NETWORK section is where you determine how the computer’s network card gets configured:

If you boot this PXE server in a network with a DHCP server for automatic network address assignment (as is the case with your typical domestic setup where the Cable/DSL router provides the DHCP server) then pxesetup will prompt you to use that. It saves you from typing IP addresses and netmasks. You can of course still decide to enter a specific static IP address even if there is a DHCP server available, by clicking “No”:

If no DHCP server was found in your local network (Slackware’s installer checks this when it boots and before you even see the command prompt), then have no choice but to enter a static IP address, netmask and possibly (but not necessarily) a default gateway:

After the network interface has been configured, you will see a number of dialogs that let you determine whether the installer should start a DHCP server or not. If your network already runs a DHCP server, then it should not be disrupted by a “rogue” DHCP server. Instead, pxesetup will only provide the netboot functionality by acting as a proxy DHCP server,:

A working DHCP server is required for PXE boot. So, if your network does not provide one, pxesetup will start its own built-in DHCP server and it will show you two additional dialogs in order to collect the required information:

The setup program tries to make an educated guess about the range of IP addresses to be used if it is going to start a DHCP server. A dialog will present the proposed configuration. There are two configurable items in that dialog: the lower and upper values for the IP address range that will be used by the built-in DHCP server.

The IP addresses in this range will be available for the PXE clients that request a network boot configuration from the PXE server. Please check this address range, and if you think you have a computer in your network that uses an IP address in this range, you can change the values for the upper and/or lower values and resolve the conflict. This range of IP addresses must not be used by any computer on your LAN !

If you are satisfied with the values, select “OK” to continue to the next section.

SOURCE:

The SOURCE section uses the exact same dialog screens as you know from the Slackware installer. The only correct selection is “Use a Slackware DVD” (There is one exception which I will explain in more detail all the way down, and that is when you used the “usbimg2disk.sh” script to create a complete Slackware installer on a bootable USB stick):

The pxesetup program will find the Slackware DVD or CD and that’s it! More information is not required and the PXE server will be started automatically. Another service is started as well at that moment: a HTTP server which will serve up Slackware packages to the clients that use our PXE server.

On-screen you will see the log file of the dnsmasq program which provides most of the netboot functionality. The first screenshot is the case where your network provides a DHCP server, while the second screenshot shows the situation where the Slackware PXE server has started its own internal DHCP server:

You can press the “EXIT” at any time, which will kill the PXE services (DHCP, TFTP and HTTP). You can then restart these services from the main menu again, by selecting the ACTIVATE entry.

PXE server works, what about PXE clients?

There is no fun with a PXE server if you do not have PXE clients that use it to boot from so that you can install Slackware on them! Make sure that the computer that you want to install Slackware on is connected to the network with a cable, and power it up. In the BIOS (or using whatever method is available for that machine) select “LAN boot” and watch what happens when the computer boots. You will see a prompt that says:

Press [F8] for a boot menu…

Actually pressing the [F8] key gives you two choices: continue with netbooting, or fallback to boot-up from the local hard disk. Or if you don’t do anything at all (takes 2 seconds only) your network card will start looking for a PXE server and the communication starts. This can be witnessed on the PXE server’s screen:

What happens next should all look pretty familiar: the Slackware welcome screen will appear and you can either press [ENTER] for the default kernel or make your own choice of parameters. The noteworthy part is where you get to select the package SOURCE. There is only one working option, and that is “Install from FTP/HTTP server“. After selecting this option, your computer’s network card will be configured using DHCP, and then you will notice that the questions for “URL of the ftp or http server where the Slackware sources are stored” and “What is the Slackware source directory?” have default values already filled-in! You should accept these values, since they are supplied by the PXE server!

The remaining steps should be familiar if you have ever tried installing from a HTTP server before.

  • Using a USB based installer instead of the CD/DVD !

I hinted at using a USB installer earlier on. So what else did I cook up? The most recent change I made to the “usbimg2disk.sh” script which you find in the “usb-and-pxe-installers” directory on the DVD or any Slackware mirror, added some functionality for running the PXE server off the USB stick. You need to create a full USB installer for this to work (“full” meaning that the USB stick is made bootable and all Slackware packages are copied to the stick).

  • If you boot this USB installer, the vfat partition on the USB stick (which contains the Slackware packages) will be automatically mounted on directory “/usbinstall”.
  • If you run “pxesetup” (or even if you run the normal “setup” by the way) and come to the point of selecting the packages location in the SOURCE menu, you should pick “3: Use a pre-mounted directory“. Actually, that item will be the default choice! When you select that option, you will notice that there is a value for that directory name already filled in. All you have to do is to accept that directory name.
  • Any questions? Leave them in the comments section below and I will answer them.

    Have fun! Eric

    By the way, have I ever told you how I hate the layout engine of wordpress? I am unable to make this post look the way I want it. Or is it the template? Apologies for the awkward placement of the images.

    Go go! New stable release of Slackware is available: 13.37

    It took way too long to my liking, but I should not complain, it was a lot of fun helping to create it. Eleven months after the previous stable release here we have the next installment of Slackware Linux. The additional polishing in the past three months certainly paid off with regard to stability and features.

    From the ChangeLog.txt:

    Mon Apr 25 13:37:00 UTC 2011
    Slackware 13.37 stable is released!

    Read all about it in the official announcement or check out the ANNOUNCE.TXT directly.

    Slackware is forever free to download with no strings attached, but if you like the product and want to see it survive then I recommended that you consider buying a copy of the DVD or CD-set. It really helps funding the development of the distro (and I am not getting any money out of that). It is not mandatory of course. The ISOs are available for free, and Bittorrent is the fastest way to get them: http://www.slackware.com/getslack/torrents.php. Slackware comes with two Bittorrent clients such as the graphical ktorrent (part of KDE) and the console-based bittorrent (not installed by default but available in the /extra directory). You can find further rsync/http/ftp download links for the ISO images on this page (mind you that not every mirror carries ISO images): http://alphageek.dyndns.org/linux/slackware-mirrors/

    I have my own fast mirror too (also available through rsync):

    Alphageek’s “sligdo files” are a very fast way of creating byte-exact copies of the official ISOs in case you already have a local mirror-copy of the full Slackware 13.37 tree. The ISOs you create with sligdo (http://alphageek.noip.me/linux/sligdo/) will pass the GPG verification test. He should have those sligdo files ready for download in time. If not, I have copies here: http://alien.slackbook.org/sligdo/ .

    If you want to know more about how to create a Slackware USB installer if your computer does not have a CD or DVD drive, read this older article of mine: http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ – or for the Windows users: http://alien.slackbook.org/blog/welcome-windows-user/

    If you install or upgrade to the 64-bit version of Slackware 13.37 and want to have a system which is capable of running 32-bit software too (Slackware64 itself is a pure 64-bit distro), then you can make your Slackware64 multilib capable. Read all about the multilib process (which is painless, fairly easy and straight-forward): http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib

    In the spirit of an Easter release (which is right behind us now) I also managed to sneak in an Easter Egg (with Pat’s approval). Tell me if you managed to find what I added to Slackware 13.37 in secret. Drat! Pat spilled it in the announcement on the website…

    Have fun! Eric

    Edit 01-jun-2-16: Alphageek’s URL changed from http://alphageek.dyndns.org/linux/sligdo/ to http://alphageek.noip.me/linux/sligdo/ .

    Fix for shutdown issue in KDE 4.6.2

    In my previous post (announcing KDE 4.6.2 packages for Slackware) I already mentioned that I ran into a bug with KDM, the graphical login manager for runlevel 4. It would no longer allow the computer to power off, instead dropping you into a tty.

    Thanks for the feedback to that post, folks! I have rebuilt the “kdebase-workspace” package so that it uses “shutdown -h -P now” as the shutdown command. This is the proper way for a Linux system to power off (you could also use “halt” or “poweroff” of course). As stated earlier (also check ?https://bugs.kde.org/show_bug.cgi?id=270228), the “-p” parameter to shutdown may be good for BSD but not for the Linux variant of the shutdown command. I am running the updated package here on the laptop, and powering off the computer works again.

    Get the updated kdebase-workspace-4.6.2 packages from my “ktown” repository or any of its mirrors:

    Cheers, Eric

    Next in series: KDE 4.6.2

    KDE Software Compilation 4.6.2.

    A second bugfix & translation update release for the KDE 4.6 series became available on April 6. Read all about it on the announcement page.

    And since we are nearing the release of Slackware 13.37 it will be safe to say that I have uploaded “my KDE 4.6.2 packages for Slackware 13.37“. If there is no official release yet by the time you read this post, then of course you will be able to run the packages on “Slackware 13.37 Release Candidate 3.14159265358979323846264338327950288419716” as well – because that is what I built them on.

    Be sure to follow the installation/upgrade instructions in the accompanying README file! There are a few of Slackware’s own official packages that have to be upgraded, or even removed. You can search this blog for my earlier KDE 4.6 related posts if you want to know more about its evolution. Or even better, subscribe to the blog’s RSS feed so you don’t miss out on my updates any more.

    Anyway, get the packages from one of the following locations (the mirrors may need a bit of time to get re-synchronized with the master):

    Things did not blow up on my laptop after installation, which was according to plan. The stability of KDE 4.6.x is increasing with every point release.

    However…

    I ran into one regression. There is a “bug” in KDM which prevents shutdown. You will actually end up in a tty and have to manually run “shutdown -h now”. The default shutdown command which is issued by KDM has apparently been changed to “/sbin/shutdown -p now” but the “-p” parameter is not supported on Linux. See https://bugs.kde.org/show_bug.cgi?id=270228 for a description of this KDE 4.6.2 specific bug.

    According to the bug report you can solve this by editing the file “/etc/kde/kdm/kdmrc” and changing a single line:

    HaltCmd=

    to:

    HaltCmd="/sbin/shutdown -h now"

    … but when I tested this it did not make a difference. It just looks as if KDM is not reading that custom commandline. It was well after midnight when I tried it so I gave up and went to bed. I welcome all feedback.

    Have fun! Eric

    © 2024 Alien Pastures

    Theme by Anders NorenUp ↑