LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 02-27-2020, 02:02 PM   #1
iluvatar1
LQ Newbie
 
Registered: Apr 2014
Posts: 26

Rep: Reputation: Disabled
Pxe server setup from a usb: Updated howto?


Hi,

I need to install slackware (current) onto several computers connected to a single server, so I want to use the pxe method to serve the clients, from the server.

From the pxe howto (here) it seems that installing from a usb is supported (instead that from dvd). I have followed all steps, but it has been impossible to setup the source directory.

To burn the usb I used either one of the following two commands:
dd if=pathtothe.iso of=/dev/sdX
or the recommended (iso image mounted on /mnt/tmp)
bash /mnt/tmp/usb-and-pxe-installers/usbimg2disk.sh -f -i /mnt/tmp/usb-and-pxe-installers/usbboot.img -o /dev/sdX -s /mnt/tmp/slackware64/

Then I start the server from the usb (in both cases it starts) and then use the command pxesetup to setup the pxe server. I cannot configure the source option. First, and contrary to what the manual linked above says, there is no /usbinstall directory automonted. I can either use a device or a previously mounted directory, and I specify any of them and the pxesetup is never able to find what it is looking for.

For instance, if I mount the usb device (let's say /dev/sdc) on /usbinstall, and then I select either the option use a hard drive partition (in this case /dev/sdc1) or a premounted directory (i this case /usbinstall or /usbinstall/slackware64), the program cannot find the kernel sources or the packages or says that the directory is invalid.

It seems that I am doing something wrong/stupid and/or the instructions are outdated. Does anyone knows how to correctly setup the pxe server from a usb?

I know there is another guide like this but I really hope not to need to setup from zero the dhcp server, tftp, etc.

Thanks in advance
 
Old 02-28-2020, 01:04 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I guess that your USB stick contains only the Slackware installer, without any packages?
 
Old 02-28-2020, 05:35 AM   #3
iluvatar1
LQ Newbie
 
Registered: Apr 2014
Posts: 26

Original Poster
Rep: Reputation: Disabled
The slackware packages tree is there (inside the slackware64 directory), both when I copy the full slackware64-current iso with dd or when I use the usbimg2disk.sh script with the -s flag.

How can I be of more help here? is there a log file somewhere showing the commands performed by pxesetup?

Is there a way to get more verbose messages from the pxesetup commands to know why it cannot find the tree or the kernels when I specify a pre-mounted directory?

Or maybe the packages must not be on a subdirectory (like slackware64) but instead on the same level of the disc?

Any help/guidance is appreciated.
 
Old 02-29-2020, 12:46 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
By the way, this "usbimg2disk.sh" script was originally submitted to Slackware by me, for the release of Slackware 13.37 in 2011. For the Slackware 14.1 release, Pat Volkerding removed the part of the script which would modify the initrd image to add the /usbinstall automounting feature. See https://git.slackware.nl/current/com...3dddf9a78a01d1
I don't think I ever tested the PXE installation since Pat removed that functionality.
 
Old 02-29-2020, 01:13 PM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
I do recall that I once tried to use the PXE installer. I, too, had trouble setting up the server. Somehow I managed to find the source tree (trial and err) on the server and start the server. The client did find the server but was never able to download any packages. Since it was only one machine that I wanted to install I dismissed the approach. Did not have time to investigate any further. I will try later to reproduce the steps to at least start the server.
 
Old 02-29-2020, 04:52 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
UPDATE

I had some time to retrace my steps to setup the server. This is what I did on the server:
  1. boot from the usb stick normally
  2. create the missing directory: mkdir /usbinstall
  3. mount /dev/sdc1 (or under whichever device your usb-stick is recoginized) on /usbinstall
  4. run pxesetup
  5. configure the network, either via DHCP or manually, whichever method works in your case
  6. As SOURCE select option 3 (pre-mounted directory); I think this is non-optional
  7. IMPORTANT: When entering the SOURCE directory in the next step you must get the destination right on the first try. If, e.g., you enter /usbinstall the packages will NOT be found. Worse, for some reason the installer unmounted the directory. So even if in the next attempt I entered the correct location, /usbinstall/slackware it did not find the packages. I quit the installer and started at 3 again. The server started when the correct location was entered correctly on the first try.
  8. See post #8 and post #9 for bug description and possible workaround.
This worked and the server started. The client was able to PXE boot, however, I was not able to install over the network with a client. The client was able to download the PACKAGES.TXT file from the server. I then got to the point to select the packages failed to download the packages for installation. Not sure if I made a mistake on the client or if there is still something missing on the server side.

PS: I also experimented with mounting the package sources on another directory, e.g., /usb-stick on the server. Then I created a symlink /usbinstall -> /usb-stick/slackware. This seems to avoid the unmount issue of the pxesetup installer. I am not sure, however, if this may have contributed to the client's failure to download the packages later. Maybe you can experiment a bit with it to and post an update if you get it working.

Last edited by crts; 03-01-2020 at 07:33 AM.
 
Old 03-01-2020, 01:49 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
That was useful troubleshooting crts, thanks. I'll find some time soon to experiment with the PXE setup.
 
Old 03-01-2020, 07:21 AM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
I might be able to save you some time. The bug happens in the initrd in file usr/lib/setup/SeTpxemedia. Here is the problematic part of the code:

Code:
# Find out where the PXE boot files are on the medium.
# Note: 'isolinux' will be used on the DVD and 'syslinux' on the USB stick.
if [ -f $(readlink -f $(cat $TMP/SeTDS))/isolinux/initrd.img ]; then
 SYSLINUXPATH="$(readlink -f $(cat $TMP/SeTDS))/isolinux"
elif [ -f $(readlink -f $(cat $TMP/SeTDS))/../isolinux/initrd.img ]; then
 SYSLINUXPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../isolinux ; pwd)"
elif [ -f $(readlink -f $(cat $TMP/SeTDS))/../syslinux/initrd.img ]; then
 SYSLINUXPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../syslinux ; pwd)"
elif [ -f $(readlink -f $(cat $TMP/SeTDS))/../../syslinux/initrd.img ]; then
 SYSLINUXPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../../syslinux ; pwd)"
else
 SYSLINUXPATH=""
fi

if [ -d $(readlink -f $(cat $TMP/SeTDS))/../kernels ]; then
 KERNELPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../kernels ; pwd)"
elif [ -d $(readlink -f $(cat $TMP/SeTDS))/../../kernels ]; then
 KERNELPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../../kernels ; pwd)"
elif [ -d $(readlink -f $(cat $TMP/SeTDS))/../../syslinux/kernels ]; then
 KERNELPATH="$(cd $(readlink -f $(cat $TMP/SeTDS))/../../syslinux/kernels ; pwd)"
else
 KERNELPATH=""
fi
Notice, that while it searches for SYSLINUXPATH in the base directory provided by the user (i.e., /usbinstall), the KERNELPATH is not searched in the base directory but only in the parent directories. This is why /usbinstall does not work as base directory. If /usbinstall/slackware64 is given by the user, then both paths are found in the parent directory. The PXE server works this way. However, the HTTP server, which will later serve the packages, does not work properly. The base directory /usbinstall/slackware64 gets mounted as the servers root directory, so the folders in the public HTTP directory are a/, ap/ and so on. When the client runs setup it will try to search for those packages in a subfolder slackware/a, slackware/ap etc. The slackware/ parent folder is already mounted as the root folder on the HTTP server and therefore is not found by the setup program. The packages cannot be downloaded and wget gets a 404 response.
Due to this behaviour I do not think it makes much sense to search for the image and kernel in the parent folders. The above code should be shortened to (I do not know why the cd and pwd were there, they seem redundant so I removed them):

Code:
# Find out where the PXE boot files are on the medium.
# Note: 'isolinux' will be used on the DVD and 'syslinux' on the USB stick.
if [ -f $(readlink -f $(cat $TMP/SeTDS))/isolinux/initrd.img ]; then
 SYSLINUXPATH="$(readlink -f $(cat $TMP/SeTDS))/isolinux"
else
 SYSLINUXPATH=""
fi

if [ -d $(readlink -f $(cat $TMP/SeTDS))/kernels ]; then
 KERNELPATH="$(readlink -f $(cat $TMP/SeTDS))/kernels"
else
 KERNELPATH=""
fi
Instead of trying to provide some error tolerance, so the user does not have to specify the correct directory, it is IMO more feasible to search and mount the USB-stick and set the base-directory automatically - like the normal setup program does. The premounted directory option can remain as an expert option. Not sure if you like this idea of if I am missing something.


EDIT: Thinking about it a bit more I think my conclusion to adjust the message is a bit too "radical" and centered on a PXE setup. I still think the message is misleading but I will raise this as a separate issue.

On a related matter, the description in the file usr/lib/setup/INSURL is also misleading:
Code:
 cat << EOF > $TMP/tempmsg

 There must be a directory on the server with the Slackware
 packages and files arranged in a tree like the FTP site.

 The installation script needs to know the name of the
 directory below your Samba share that contains the series
 subdirectories. For example, if your A series is found at 
 /slack/slackware64/a, then you would respond: /slack/slackware64
 
 What is the Slackware source directory?
EOF
As you state in the documentation, the default value should not be changed. The client does not (and should not!) know what the local filesystem structure on the server looks like. The user entry is just a '/' here. The description should probably be replaced by something like:

Code:
 cat << EOF > $TMP/tempmsg

 Enter the Slackware source directory on the server?
 
 ONLY CHANGE THE DEFAULT IF YOU KNOW WHAT YOU ARE DOING!
EOF
This option should only be adjusted if the user is using his own custom installation stick.

This is the exact same message as in usr/lib/setup/INSSMB, by the way, do not know if it is also wrong there.

Last edited by crts; 03-02-2020 at 05:29 AM.
 
Old 03-01-2020, 07:29 AM   #9
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
A possible workaround for OP

@OP: The procedure is similar as that in post #6 but before you start pxesetup on the server issue this command:
Code:
sed -i 's|TDS))/\.\./kernels|TDS))/kernels|' /usr/lib/setup/SeTpxemedia
Forget point 7 in my previous post #6. When the program (pxesetup on the server) asks you for the base directory enter the directory under which you mounted the usb-stick, i.e., in this example /usbinstall.
When asked to enter the source directory on the clientside just accept the default '/' entry.
I got it working with those settings. I had to reboot due to the random unmount problem, which also happened when I entered the correct directory the first time, so do not give up if it does not work on the first attempt.

Please keep us posted if it works for you and if the installation succeeded.
 
Old 03-02-2020, 11:43 AM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Ok, I opened a new thread for the misleading description issue.
 
Old 04-20-2020, 09:36 PM   #11
iluvatar1
LQ Newbie
 
Registered: Apr 2014
Posts: 26

Original Poster
Rep: Reputation: Disabled
Hi, I just want to thank you for your work trying to update and fix the pxe server stuff.

I apologize for not having tested yet the pxe server stuff with the line you shared, but currently and since more than a month I do not have physical access to the computers, so I cannot test.

At the end I made a virtualbox slackware golden image with clonezilla, imaged the internal computers with clonezilla server, and configured them . This procedure also had its own challenges and the pxe server install was one of the alternative options that unfortunately did not work.

Maybe later I will test again with the pxe server.

Thanks again to you both.
 
  


Reply

Tags
configuration, installation, pxe, slackware64-current, usb



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
[SOLVED] efi pxe 0 for IPv4/efi pxe 0 for IPv6 upon trying to install on a no OS pc diveceroc Linux - Newbie 2 08-18-2019 01:49 PM
pxe-server - client getting pxe-t01 error gwsj Linux - Networking 4 07-13-2016 07:22 PM
issue with uefi pxe boot on rhel 6.5 as pxe server geekmaxwell Linux - Networking 3 04-02-2014 02:27 PM
pxe boot "PXE-T01 file not found" ssharma_02 Linux - Networking 16 05-18-2011 03:21 PM
Howto: Diskless client Linux-machine with extra old AMD <300Mhz, without PXE&USB boot frenchn00b Linux - General 1 11-13-2007 04:34 PM

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

All times are GMT -5. The time now is 08:29 PM.

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