WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: PXE Boot  (Read 7896 times)

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #15 on: June 20, 2022, 06:16:21 AM »
Quote
By default it is saved in /etc/sysconfig/tcedir and will be restored on boot.

i did a reboot as a test i had to to do every thin again from the beginning nothing was restored and the  file /mnt/nfs/ws1/tce/mydata.tgz  disappear :-\

and i don't understand how should it be restored if it not saved on the bootserver somewhere ?
« Last Edit: June 20, 2022, 06:32:23 AM by Rabie »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14816
Re: PXE Boot
« Reply #16 on: June 20, 2022, 06:40:15 AM »
isn't nfs.lst just the nfs list for listing the extensions i need on boot like the file "onboot.lst" take just the tcz files ?

And in the directory optional are all extensions with all  *tcz.dep and *tcz.md5.txt ?

Ah - I misunderstood, yes, onboot.lst only needs the extension name

Offline tacpilot

  • Newbie
  • *
  • Posts: 30
Re: PXE Boot
« Reply #17 on: June 20, 2022, 11:09:20 AM »
Quote
i did a reboot as a test i had to to do every thin again from the beginning nothing was restored and the  file /mnt/nfs/ws1/tce/mydata.tgz  disappear :-\
There is a lot going on at your end after boot. Take a step back and lets make sure
every thing is correct at square one before making any changes.

first and foremost .. ensure that /mnt/nfs is a sustained mount  from
the worker nodes to the server and not just a directory thats been populated post boot.

the worker nodes must maintain this mount point to the server in
order for node related changes to be persistent across boots

if the node to server network mount point is not maintained you
need to work on the nfs side of things before doing any thing else.
Never limit your creativity by the imagination of others.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #18 on: June 20, 2022, 11:41:21 AM »
Hi Rabie
OK, after rereading the Wiki multiple times, I think I'm starting to see what's going on.

nfs/ws1: ws1 is the directory workstation #1 will use. Other workstations will need their own directories.

Note - Unlabeled quotes are from:
https://web.archive.org/web/20200209190220/http://wiki.tinycorelinux.net/wiki:netbooting#putting_it_all_together
Quote
Note: If you are running Core 5.2 or newer, nfs-utils depends on rpcbind,tcz and libtirpc.tcz. These will need to be added to the nfs.list.
That is because TFTP loads only what is in the list. I don't think it uses  tce-load  so it does not resolve dependencies.

Make sure the  nfs/ws1/  directory includes  nfs-utils.tcz, rpcbind,tcz and libtirpc.tcz.
Make sure the  nfs/ws1/nfs.list  file contains only:
Code: [Select]
nfs/ws1/nfs-utils.tcz
nfs/ws1/rpcbind,tcz
nfs/ws1/libtirpc.tcz.
I'm not sure whether leading slashes belong there or not. The Wiki shows it both ways depending on where you look.

Create a  nfs/ws1/tce/onboot.lst  containing:
Code: [Select]
graphics-KERNEL.tcz
xf86-video-intel.tcz
Xorg-7.7.tcz
wireless_tools.tcz
firmware-iwl9000.tcz
firmware-iwlax20x.tcz
firmware-iwlwifi.tcz
firmware-rtl_nic.tcz
openbox-config.tcz
aterm.tcz
wbar.tcz
nano.tcz
conky.tcz
openssh.tcz
That should be enough to get you to a desktop. When  tc-config (part of  core.gz ) runs, it should call  tce-load  to
load the contents of  onboot.lst.

The goal here is to get you to a desktop automatically, not load all of your apps. Once that is working, you should
be able to use the  Maintenance  mode of the  Apps  utility to  Add/Remove  items from  onboot.lst.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #19 on: June 23, 2022, 09:36:29 AM »
Hi Rich,

Quote
#nfs/ws1: #ws1 is the directory workstation #1 will use Other workstations will need their own directories
that is what i thought too

Quote
#Make sure the  nfs/ws1/  directory includes  nfs-utils.tcz, rpcbind,tcz and libtirpc.tcz.
Code: [Select]
#ls -al nfs/ws1/
#drwxr-xr-x 3 root root     4096 23. Jun 15:09 .
#drwxrwxrwx 3 root root     4096 17. Jun 13:49 ..
#-rw-r--r-- 1 root root    65536 23. Jun 15:04 libtirpc.tcz
#-rw-r--r-- 1 root root       63 23. Jun 15:08 nfs.lst
#-rw-r--r-- 1 root root   180224 14. Jun 13:49 nfs-utils.tcz
#-rw-r--r-- 1 root root    28672 23. Jun 15:04 rpcbind.tcz
#drwxr-xr-x 5 root root     4096 23. Jun 15:12 tce

Quote
#Make sure the  nfs/ws1/nfs.list  file contains only:
Code: [Select]
#nfs/ws1/nfs-utils.tcz
#nfs/ws1/rpcbind,tcz
#nfs/ws1/libtirpc.tcz.
i did that but now those are only the extensions are loaded after boot
Code: [Select]
cat nfs/ws1/nfs.lst
nfs/ws1/nfs-utils.tcz
nfs/ws1/libtirpc.tcz
nfs/ws1/rpcbind.tcz
Code: [Select]
#ls /tmp/tce/optional/
#nfs-utils.tcz  libtirpc.tcz  rpcbind.tcz


Quote
Create a  nfs/ws1/tce/onboot.lst  containing:
Code: [Select]
graphics-KERNEL.tcz
xf86-video-intel.tcz
Xorg-7.7.tcz
wireless_tools.tcz
firmware-iwl9000.tcz
firmware-iwlax20x.tcz
firmware-iwlwifi.tcz
firmware-rtl_nic.tcz
openbox-config.tcz
aterm.tcz
wbar.tcz
nano.tcz
conky.tcz
openssh.tcz
i also did that but those were not loaded

Edit:
and i get the error that it couldn't open the Framebuffer:
Code: [Select]
open /dev/fb0: no such device
« Last Edit: June 23, 2022, 09:44:06 AM by Rabie »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #20 on: June 23, 2022, 10:25:37 AM »
Hi Rabie
... i did that but now those are only the extensions are loaded after boot
Code: [Select]
cat nfs/ws1/nfs.lst
nfs/ws1/nfs-utils.tcz
nfs/ws1/libtirpc.tcz
nfs/ws1/rpcbind.tcz
Code: [Select]
#ls /tmp/tce/optional/
#nfs-utils.tcz  libtirpc.tcz  rpcbind.tcz
...
What do you find here:
Code: [Select]
ls -l /tmp/tcloop

If you enter  tce-load -i bash  does it load or give an error?
If it loads, run:
Code: [Select]
hash -r
bash
help
Does print out a help screen or say  command not found ?


Quote
... Edit:
and i get the error that it couldn't open the Framebuffer:
Code: [Select]
open /dev/fb0: no such device
Maybe you need to add  fbv.tcz  to  onboot.lst.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #21 on: June 24, 2022, 05:05:12 AM »
Quote
What do you find here:
ls -l /tmp/tcloop

Code: [Select]
ls -l /tmp/tcloop/
drwxr-xr-x    3 tc       staff           26 Jan 18  2021 libtirpc/
drwxr-xr-x    3 tc       staff           26 Apr 11  2016 nfs-utils/

Quote
If you enter  tce-load -i bash  does it load or give an error?
it gives that bash.tcz not found

if i downdload bash from internet with tce-load -wi and run hash -r i get nothing  :-\

Quote
open /dev/fb0: no such device
Maybe you need to add  fbv.tcz  to  onboot.lst.
that did't help too, but i think just because that the System doesn't load the List nfs/ws1/tce/onboot.lst on boot

i need to know how to make it load the file mydata.tgz and save to it when i run filetool.sh -b, i think that would solve the problem

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #22 on: June 24, 2022, 08:04:34 AM »
Hi Rabie
...
Quote
If you enter  tce-load -i bash  does it load or give an error?
it gives that bash.tcz not found ...
That should not be. In a previous post you stated:
Code: [Select]
readlink /etc/sysconfig/tcedir
/mnt/nfs/ws1/tce
So  tce-load  should know where to find it.
What do these 3 commands return:
Code: [Select]
ls -l /etc/sysconfig/tcedir
ls -l /etc/sysconfig/tcedir/
ls -l /etc/sysconfig/tcedir/optional

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #23 on: June 24, 2022, 09:22:27 AM »
Hi Rich,

Quote
That should not be. In a previous post you stated:
Quote from: Rabie on June 20, 2022, 02:47:21 AM
Code: [Select]
readlink /etc/sysconfig/tcedir
/mnt/nfs/ws1/tce
yes that was when i have listed all extensions in nfs.lst and they where loaded to that path (/mnt/nfs/ws1/tce)

but now if i typ readlink /etc/sysconfig/tcedir i get nothing

Quote
What do these 3 commands return:
Code: [Select]
#ls -l /etc/sysconfig/tcedir
#lrwxrwxrwx    1 root     root            16 Jan  1 19:31 /etc/sysconfig/tcedir -> /mnt/nfs/ws1/tce/
Code: [Select]
#ls -l /etc/sysconfig/tcedir/
#total 0
#-rw-rw-r--    1 tc       staff           0 Jan  1 23:56 onboot.lst
#drwxrwsr-x    2 tc       staff           40 Jan  1 19:31 ondemand/
#drwxrwsr-x    2 tc       staff          40 Jan  1 23:56 optional/
Code: [Select]
#ls -l /etc/sysconfig/tcedir/optional/
#total 0

Edit:

if i installe ssh after booting and typ per ssh this command : readlink /etc/sysconfig/tcedir i get an Answer --> /mnt/nfs/ws1/tce

if i typed on the Client without ssh on the client direct, then i get no Answer readlink /etc/sysconfig/tcedir i get  --> nothing
« Last Edit: June 24, 2022, 09:28:17 AM by Rabie »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #24 on: June 24, 2022, 01:11:20 PM »
Hi Rabie
Quote
What do you find here:
ls -l /tmp/tcloop

Code: [Select]
ls -l /tmp/tcloop/
drwxr-xr-x    3 tc       staff           26 Jan 18  2021 libtirpc/
drwxr-xr-x    3 tc       staff           26 Apr 11  2016 nfs-utils/
...
rpcbind didn't load.

... i did that but now those are only the extensions are loaded after boot
Code: [Select]
cat nfs/ws1/nfs.lst
nfs/ws1/nfs-utils.tcz
nfs/ws1/libtirpc.tcz
nfs/ws1/rpcbind.tcz
...
Don't know if it matters, but try reversing the order of that list so dependencies load first:
Code: [Select]
nfs/ws1/rpcbind.tcz
nfs/ws1/libtirpc.tcz
nfs/ws1/nfs-utils.tcz

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #25 on: June 27, 2022, 09:52:53 AM »
Hi Rich,
it was my bad, i had rpcbind.tcz in nfs.lst with comma like that: nfs/ws1/rpcbind,tcz

now it does load, but i don't really know what the next step is :/
Code: [Select]
#ls -l /tmp/tcloop/
drwxr-xr-x    3 tc       staff           26 Jan 18  2021 libtirpc/
drwxr-xr-x    3 tc       staff           26 Apr 11  2016 nfs-utils/
drwxr-xr-x    3 tc       staff           26 Jan 18  2021 rpcbind/

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #26 on: July 28, 2022, 05:42:36 AM »
Hi Rich,

i am trying now to make my bootserver one of the TC Clients itself! Like the Wiki said:

Quote
It is assumed you have now booted Tinycore on one machine, and that your boot media is still connected to that computer. All the clients are expected to be in the same wired LAN as the host

I configured before a Debian Server as a bootserver and it didn't work, so maybe if i made one of the Clients as a Bootserver, it will work.

so i am facing a little Problem with tftp

I ran the following command on the TC Bootserver to make the TFTP directory available in the Network:
Code: [Select]
#sudo udpsvd -vE 0.0.0.0 69 tftpd /tftpboot/
and when i try to boot per PXE from a Client, i get the Following error on the Server:
Code: [Select]
udpsvd: start 10264 132.147.160.190:69-132.147.161.71:2070
udpsvd: status 1/30
tftpd: server error: (0) TFTP Aborted
udpsvd: end 10264 exit 1
udpsvd: status 0/30
udpsvd: start 10265 132.147.160.190:69-132.147.161.71:2071
udpsvd: status 1/30
udpsvd: end 10265 exit 0
udpsvd: status 0/30

any Idea ? :)
« Last Edit: July 28, 2022, 05:47:39 AM by Rabie »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #27 on: July 28, 2022, 09:00:48 AM »
Hi Rabie
Add the  syslog  boot code to your bootloaders config file and reboot.

Change your command to this:
Code: [Select]
sudo udpsvd -vE 0.0.0.0 69 tftpd -l /tftpboot/tftpd  will now log messages to syslog and hopefully provide more information.

Try to PXE boot from a Client and then run this on the server:
Code: [Select]
tail -n 25 /var/log/messagesSee if that provides additional information.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: PXE Boot
« Reply #28 on: July 28, 2022, 09:40:56 AM »
Hi Rich,

Quote
Change your command to this:

Code: [Select]
sudo udpsvd -vE 0.0.0.0 69 tftpd -l /tftpboot/
i think the parameter "-l" need a Name according to --help:
Code: [Select]

udpsvd
BusyBox v1.34.1 (2021-11-06 14:03:23 UTC) multi-call binary.

Usage: udpsvd [-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG

Create UDP socket, bind to IP:PORT and wait for incoming packets.
Run PROG for each packet, redirecting all further packets with same
peer ip:port to it.

        IP PORT         IP:PORT to listen on
        PROG ARGS       Program to run
        -u USER[:GRP]   Change to user/group after bind
        -c N            Up to N connections simultaneously (default 30)
        -E              Don't set up environment
        -h              Look up peer's hostname
        -l NAME         Local hostname (else look up local hostname in DNS)
        -v              Verbose

Environment if no -E:
PROTO='UDP'
UDPREMOTEADDR='ip:port' ('[ip]:port' for IPv6)
UDPLOCALADDR='ip:port'
If -h:
UDPLOCALHOST='hostname' (-l NAME is used if specified)
UDPREMOTEHOST='hostname'



the only log about tftp in /var/log/messages is the command i ran last:

Code: [Select]
tail -n 25 /var/log/messages
Jul 28 15:23:23 box kern.info kernel: wlan0: send auth to b0:a7:b9:85:be:b6 (try 1/3)
Jul 28 15:23:23 box kern.info kernel: wlan0: send auth to b0:a7:b9:85:be:b6 (try 2/3)
Jul 28 15:23:23 box kern.info kernel: wlan0: send auth to b0:a7:b9:85:be:b6 (try 3/3)
Jul 28 15:23:23 box kern.info kernel: wlan0: authentication with b0:a7:b9:85:be:b6 timed out
Jul 28 15:23:23 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/usr/sbin/crond -L /dev/null
Jul 28 15:23:23 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/usr/local/bin/Xorg -logfile /tmp/xorg.log -nolisten tcp
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/mv /tmp/work9752 /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/opt/Scripts/.wlan_off.sh
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/rm -rf /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/cp /usr/local/share/wbar/dot.wbar /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chown root.staff /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chmod g+w /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/mv /tmp/wbar.9852 /usr/local/tce.icons
Jul 28 15:23:24 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chmod g+w /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/rm -rf /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/cp /usr/local/share/wbar/dot.wbar /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chown root.staff /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chmod g+w /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/mv /tmp/wbar.10005 /usr/local/tce.icons
Jul 28 15:23:31 box authpriv.notice sudo:       tc : TTY=tty1 ; PWD=/home/tc ; USER=root ; COMMAND=/bin/chmod g+w /usr/local/tce.icons
Jul 28 15:23:41 box auth.info sshd[10068]: Accepted password for tc from 10.210.0.17 port 63246 ssh2
Jul 28 15:23:41 box auth.info sshd[10068]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Jul 28 15:23:41 box auth.info sshd[10068]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Jul 28 15:23:41 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/home/tc ; USER=root ; COMMAND=/usr/bin/tee /etc/sysconfig/backup
Jul 28 15:25:36 box authpriv.notice sudo:       tc : TTY=pts/0 ; PWD=/home/tc ; USER=root ; COMMAND=/usr/bin/udpsvd -vE 0.0.0.0 69 tftpd -l /tftpboot/


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: PXE Boot
« Reply #29 on: July 28, 2022, 10:02:50 AM »
Hi Rabie
The  -l  is used by the  tftpd  command.

... the only log about tftp in /var/log/messages is the command i ran last:

Code: [Select]
tail -n 25 /var/log/messages
 -----Snip -----
Jul 28 15:25:36 box authpriv.notice sudo:       tc : TTY=pts/0 ; PWD=/home/tc ; USER=root ; COMMAND=/usr/bin/udpsvd -vE 0.0.0.0 69 tftpd -l /tftpboot/
After you try PXE booting one of your clients you should see at least one error message from  tftpd  when running the  tail  command.