More PXE Magic
Multi-OS PXE Menu
If all you were interested in was PXE booting a single version of Ubuntu or Debian, you would be done. Of course, what if you wanted the choice of either the 32- or 64-bit versions of a particular release, or what if you wanted to choose between a few different releases? Although you could just overwrite your tftpboot directory every time you wanted to change it up, with only a few extra tweaks to the config, you easily can host multiple releases with the same menu.
Move Precise to a Submenu
To get started, let's clean out any existing files in the /var/lib/tftpboot directory. Let's use the i386 Precise netboot.tar.gz to begin, but let's tweak how the files are organized by isolating precise in its own directory:
$ cd /var/lib/tftpboot $ sudo mkdir precise $ cd precise $ sudo wget http://us.archive.ubuntu.com/ubuntu/dists/precise/ ↪main/installer-i386/current/images/netboot/netboot.tar.gz $ sudo tar xzf netboot.tar.gz
All of the interesting PXE configuration can be found inside the ubuntu-installer/i386 directory, so make a copy of those files back in the root tftpboot directory so you can edit them:
$ cd /var/lib/tftpboot $ sudo cp -a precise/ubuntu-installer/i386/boot-screens ↪precise/ubuntu-installer/i386/pxelinux.0 ↪precise/ubuntu-installer/i386/pxelinux.cfg .
Unfortunately, all of the configuration files under the boot-screens directory you copied reference ubuntu-installer/i386/boot-screens, when you want them to reference just boot-screens, so the next step is to run a quick Perl one-liner to search and remove any instance of ubuntu-installer/i386/ found in the config file:
$ cd /var/lib/tftpboot/boot-screens $ sudo perl -pi -e 's|ubuntu-installer/i386/||' *
The specific pxelinux configuration that points to the Ubuntu Precise kernel and initrd can be found under precise/ubuntu-installer/i386/boot-screens/txt.cfg. If you were to look at that file, it would look something like this:
default install label install menu label ^Install menu default kernel ubuntu-installer/i386/linux append vga=788 initrd=ubuntu-installer/i386/ ↪initrd.gz -- quiet label cli menu label ^Command-line install kernel ubuntu-installer/i386/linux append tasks=standard pkgsel/language-pack-patterns= ↪pkgsel/install-language-support=false vga=788 ↪initrd=ubuntu-installer/i386/initrd.gz -- quiet
What you want to do is make a copy of this config file under your root-level boot-screens directory, but because you extracted the tarball into a directory named precise (instead of the root directory), you need to do another search and replace, and add precise in front of any reference to the ubuntu-installer directory. Otherwise, the paths to the kernel and initrd will be wrong:
$ cd /var/lib/tftpboot/boot-screens $ sudo cp ../precise/ubuntu-installer/i386/boot-screens/txt.cfg ↪precise-i386.cfg $ sudo perl -pi -e 's|ubuntu-installer|precise/ubuntu-installer|g' ↪precise-i386.cfg
When you are done, the /var/lib/tftpboot/boot-screens/precise-i386.cfg file should look something like this:
default install label install menu label ^Install menu default kernel precise/ubuntu-installer/i386/linux append vga=788 initrd=precise/ubuntu-installer/i386/initrd.gz ↪-- quiet label cli menu label ^Command-line install kernel precise/ubuntu-installer/i386/linux append tasks=standard pkgsel/language-pack-patterns= ↪pkgsel/install-language-support=false vga=788 ↪initrd=precise/ubuntu-installer/i386/initrd.gz -- quiet
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- The Qt Company's Qt Start-Up
- Devuan Beta Release
- May 2016 Issue of Linux Journal
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- The Humble Hacker?
- The Death of RoboVM
- BitTorrent Inc.'s Sync
- New Container Image Standard Promises More Portable Apps
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide