Slackware - Installation This forum is for the discussion of installation issues with Slackware. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-27-2020, 02:02 PM
|
#1
|
LQ Newbie
Registered: Apr 2014
Posts: 26
Rep: 
|
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
|
|
|
02-28-2020, 01:04 AM
|
#2
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
I guess that your USB stick contains only the Slackware installer, without any packages?
|
|
|
02-28-2020, 05:35 AM
|
#3
|
LQ Newbie
Registered: Apr 2014
Posts: 26
Original Poster
Rep: 
|
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.
|
|
|
02-29-2020, 12:46 PM
|
#4
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
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.
|
|
|
02-29-2020, 01:13 PM
|
#5
|
Senior Member
Registered: Jan 2010
Posts: 2,020
|
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.
|
|
|
02-29-2020, 04:52 PM
|
#6
|
Senior Member
Registered: Jan 2010
Posts: 2,020
|
UPDATE
I had some time to retrace my steps to setup the server. This is what I did on the server:
- boot from the usb stick normally
- create the missing directory: mkdir /usbinstall
- mount /dev/sdc1 (or under whichever device your usb-stick is recoginized) on /usbinstall
- run pxesetup
- configure the network, either via DHCP or manually, whichever method works in your case
- As SOURCE select option 3 (pre-mounted directory); I think this is non-optional
- 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.
- 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.
|
|
|
03-01-2020, 01:49 AM
|
#7
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
That was useful troubleshooting crts, thanks. I'll find some time soon to experiment with the PXE setup.
|
|
|
03-01-2020, 07:21 AM
|
#8
|
Senior Member
Registered: Jan 2010
Posts: 2,020
|
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.
|
|
|
03-01-2020, 07:29 AM
|
#9
|
Senior Member
Registered: Jan 2010
Posts: 2,020
|
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.
|
|
|
04-20-2020, 09:36 PM
|
#11
|
LQ Newbie
Registered: Apr 2014
Posts: 26
Original Poster
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 07:51 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|