Creating PXE puppy (solved)

Under development: PCMCIA, wireless, etc.
Message
Author
mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#41 Post by mhanifpriatama »

anyone knows, how to make nfs client run at initrd.gz, so can look at pup.sfs on virtual drive?

gcmartin

Missing PXE fucntions?

#42 Post by gcmartin »

Hi @Mhanifpriatama
mhanifpriatama wrote:anyone knows, how to make nfs client run at initrd.gz, so can look at pup.sfs on virtual drive?
I'm not sure if I understand your question> Are you using the PXE approach mentioned here and finding that it is inadequate for your needs?
Is it missing something critical for PXE?

Let's see if this might help.
  • LightHouse PUP recently completed a major change in Puppy boots such that a booting LIghtHouse PC user can select, at boot time, which SFSs he wants included when he gets to desktop of his LiveCD/PXE. This is a major step forward as I believe we will come to see in Puppyland.
  • Another idea that may help is you may want to create your "PUP.SFS" and make an ISO out of it. If this is done, you could, then, use the DNSMASQ+NETBOOT PETs to setup your PXE environment to let your LAN PCs boot
.would either of these provide an approach that would meet your needs, easily?

Thanks in advance for helping me understand.
Last edited by gcmartin on Sat 19 Feb 2011, 17:53, edited 1 time in total.

User avatar
vezuve
Posts: 1291
Joined: Thu 24 Jan 2008, 15:09

#43 Post by vezuve »

Hello,
Online translation-traduction en ligne
I would like to know if there is the possibility of having the pupsave on the server, so that the customer (slave) puppy could have access by network.
Originale
Je voudrais savoir si il y a la possibilité d'avoir le pupsave sur le serveur, afin que le puppy client (esclave) puisse avoir accès par le réseau.
@+
Recherche
[url=http://wellminded.com/puppy/pupsearch.html]sur PUPPY[/url] anglai + souven
[url=http://puppylinux.org/wikka/PageIndex]PUPPY wikka tou sur tou[/url] anglai

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#44 Post by mhanifpriatama »

thanks gc.martin,
I want my server run nfs server. I think that kernel module.
So, my server can offer drive-sharing (like virtual hard drive).
I want my client run nfs-client. I think that kernel module too.
So, my client can see the virtual drive.

If nfs-client can run before loading my lupu_520.sfs, I can place it at virtual drive, then the init script can mount it.

I think this will solve the old computer client with very low ram.

Sorry. My native is not english.

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#45 Post by mhanifpriatama »

@vezuve, I think we have same Idea but differ purpose.
upload of pupsave file is init script job. I think, I must do some experiment. I'll report it if I success.
Of course, if any one have known a lot of init's work, and also nfs work, may be this is an easy things.
And ... I am not a bash programmer.

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#46 Post by Aitch »

maybe these can help with NFS share?

http://www.murga-linux.com/puppy/viewtopic.php?t=12523

http://www.murga-linux.com/puppy/viewtopic.php?t=27109

http://www.murga-linux.com/puppy/viewtopic.php?t=45090

http://www.murga-linux.com/puppy/viewtopic.php?p=234545

Note:
sunburnt wrote:I think Barry has added PXE booting of Puppy-2.16.
In our discussion he mentioned NFS, so maybe it's part of Puppy-2.16.
Otherwise.. I think that there's a DotPup or something for installing NFS.

Note: NFS doesn't seem to be used so much anymore.
Samba is much more popular & is easier to setup (I've read & my personal experiance).
Samba is about as fast as NFS & much more secure, it's size is a little larger.

Puppy already has good Samba client tools, it just needs Samba server.
There's a Samba server DotPup at MU's site: http://puppyfiles.org
I suggested to Barry that he might include it so Puppy would be just like Win.
So maybe samba is better?
gcmartin tutorial
http://murga-linux.com/puppy/viewtopic.php?p=459206

HTH,

Aitch :)

gcmartin

#47 Post by gcmartin »

mhanifpriatama wrote:thanks gc.martin,
I want my server run nfs server. I think that kernel module.
So, my server can offer drive-sharing (like virtual hard drive).
I want my client run nfs-client. I think that kernel module too.
So, my client can see the virtual drive.

If nfs-client can run before loading my lupu_520.sfs, I can place it at virtual drive, then the init script can mount it.

I think this will solve the old computer client with very low ram. ....
Good, now I have a better understanding. I CANNOT solve either the NFS issue you raise NOR the changing boot structure that a LiveCD (or PXE) gives you. But, I will try to help by showing you 2 things.

Assumption: you have a 300+MB PC which is PXE capable and has a HDD. (PXE is NOT going to solve any RAM issue with any PCs. If will get you to a desktop in the same manner as if you were using a LiveCD)

Thought#1: PXE boot and do a PUPSAVE to your HDD.
Thought#2: Take Implementation #2 in the Document you see referenced here, then use F2 to stop and enter any boot-time changes you desire.

@Aitch also references that the SAMBA client in your PUP allows you to read and write to another location on your LAN. I use this all the time. My PXE server is also my NAS. I run SAMBA 3.5.6 provided by the PUP Distro makers. My PXE clients, after booting to desktop of course, can read and write to that SAMBA server using either the GUI tools provide in the PXE's PUP or using the "mount" feature of the system. If you need a reference on how to set server up, either Post/PM and I will respond. (Oh, if you have a Microsoft machine on your LAN, then it has the ability to do what the SAMBA server does without installing anything on the Microsoft machine. ALSO, If you have a "major" Linux distro running, they all, except Puppy, have SAMBA server 3.5.6 already without installing anything.)

Hope this helps

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#48 Post by mhanifpriatama »

thanks,
This not actually my problem. Just an alternative that may be helps some one, and of course of my curious. My client hardware have no hdd, all new modern PC with 1G RAM.
But any way, I want this thing clear for me. ( Hey, I'm so glad to be member of this forum, and solve some problem ... just like a hobby)

gc.martin said :
My PXE clients, after booting to desktop of course, can read and write to that SAMBA server using either the GUI tools provide in the PXE's PUP or using the "mount" feature of the system.
So ... after booting to desktop.. hmmm ...
if only I could hack init script, so can mount before sfs file.

@aitch : Thanks for links.
but it will another big problem, how to mount the virtual drive and looking for the pup sfs.

I think, I will end up this discussion. I'll look for another information of this. Thanks for all.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#49 Post by jamesbond »

Just to give it an idea of what it takes:
1. NFS server - relatively easy - if your puppy version doesn't support in-kernel nfs server, you can always get this http://unfs3.sourceforge.net/ and compile yourself a server.
2. NFS client - to mount SFS from the nfs - this is also relatively easy, I believe most puppies support it:

Code: Select all

mount -t nfs server_ip_address:/sharename /mnt/mountpoint
followed by

Code: Select all

mount -o loop /mnt/mountpoint/pup.sfs /initrd/pup_ro2
3. Now the hard part. To be able to do the mounting as above, all the plumbing must be ready. That is:
- you must have an IP address
- oh, that means you need to configure static IP address or have dhcp running on your network adapter
- oh, that means you have must have a configured network adapter
- oh, that means you must detect the correct network adapter
- and oh, the driver for that network adapter must be in initrd

All these plumbing are stuff which is usually done in rc.sysinit in pup.sfs, so you'll have to move all these to initrd.

NB: Alternatively to 2 & 3, you can compile yourself a kernel capable of using NFS as root filesystem.

Good luck, and share with us if you've got yourself a working solution :)
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#50 Post by Master_wrong »

1. NFS server - relatively easy - if your puppy version doesn't support in-kernel nfs server, you can always get this http://unfs3.sourceforge.net/ and compile yourself a server.
i already compile them
http://www.murga-linux.com/puppy/viewtopic.php?t=64491

otherwise you can use mike's kernel -nfs
http://www.murga-linux.com/puppy/viewto ... 996#496996

btw about pupsave... couldnt we load them after we boot ?
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#51 Post by jamesbond »

Thank you master. Indeed, I got the reference to unfs3 from your original post. Now I forgot something - one also need to have portmapper running to be able to use it. If you could compile it for other puppies it would be very helpful.

As for loading pupsave after boot - this depends on exactly "when". if one has a customised settings in pupsave (e.g. for Xorg), then one definitely wants to load pupsave before Xorg starts ...

Actually, mounting samba shares and nfs shares is equally easy, and since samba pets and instructions are readily available, it may be worthwhile to consider it.

My point no 3 still applies whichever share technology you use ....
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#52 Post by Master_wrong »

one also need to have portmapper running to be able to use it. If you could compile it for other puppies it would be very helpful.
sorry, but no
my startup script did not use the portmapper because it use -p option
Quote:
-p
Do not register with the portmapper. This will prevent other hosts from finding out the port numbers used for the MOUNT and NFS services by querying the portmap daemon. Clients will need to manually specify the port numbers to use (on Linux clients, use the mountport and port mount options).
if you see the script you will understand.
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#53 Post by jamesbond »

Thanks Master, I know that. It happens to work fine in puppy, but newer versions of nfs-utils (e.g. like the one I have in Fatdog) won't mount if you don't use portmap or if you don't specify non-standard ports. But nevermind - for the purpose of this thread, it works.

Here's a teaser screenshot :D
Attachments
puppy_over_nfs.png
(139.79 KiB) Downloaded 959 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#54 Post by mhanifpriatama »

I did an experiment.

I tried master_wrong's unfs script. Client can see server's root.

But, I placed unfs script at init script, under section "module loading".

Code: Select all

##############END MODULE LOADING TO ACCESS DRIVES####################
mkdir /mnt/try
mount -o port=4711,mountport=4711,mountvers=3,nfsvers=3,nolock,tcp 169.254.33.219:/root /mnt/try
#######################FINDING PUPPY FILES###########################

There is nothing in /mnt/try

I tried again .... with manually typing after warning that pup sfs not found :

Code: Select all

#mount -o port=4711,mountport=4711,mountvers=3,nfsvers=3,nolock,tcp 169.254.33.219:/root /mnt/try

mount: mounting 169.254.33.219:root on /mnt/try failed
Something I don't know....

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#55 Post by jamesbond »

Another teaser (running on 512MB machine).

See my step 3 above.
- Can you ping your nfs server?
- Do you have any IP configured for your network card?
- Is your network card working?
Attachments
fatdog_over_nfs.png
(131.46 KiB) Downloaded 935 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#56 Post by Master_wrong »

@mhanifpriatama

did you try to boot pxe and nfs ?

did you change setting in tftpboot ?

I never try it myself but i already think about it and do some research
from...
http://www.digitalpeer.com/id/linuxnfs
/tftpboot/pxelinux.cfg/default
must be something like this
prompt 1
default linux
timeout 100

label linux
kernel bzImage
append init=/sbin/init root=/dev/nfs rw nfsroot=192.168.0.1:/nfsroot ip=192.168.0.254:192.168.0.1:192.168.0.1:255.255.255.0:llama0::off noapic acpi=off
also

http://www.devcollective.org/wordpress/ ... fs-and-pxe

@jamesbond

is that teaser means you can boot with pxe and nfs already ?
thats awesome...
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#57 Post by jamesbond »

Master_wrong wrote:@jamesbond

is that teaser means you can boot with pxe and nfs already ?
thats awesome...
Yes, I booted Fatdog over nfs. There are two ways of doing it:
a) running puppy modified to load its pup.sfs from nfs [my first screenshot] - this is like running frugal install but the "harddisk" where the pup.sfs is stored is nfs
b) running puppy modified to mount its rootfs directly from nfs [my second screenshot] - this is like running full-install but the harddisk is nfs.
Your links all refer to the second method. This is also another good link to get started (also the second method) https://wiki.archlinux.org/index.php/Di ... t_NFS_root.
Either way, I did it manually, just want to show what's possible.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#58 Post by mhanifpriatama »

hmmm .... to configure network manually is hard to do, for me of course.
hmmm .... to compile a kernel?? I never did that before.
hmmm .... many linux commands that simplify network setup does not exist in initrd.gz (because I'm not linux master, just a curious user)

I will try this (if I have enough time):

After load a complete desktop :
- copy almost all files (and folder) to nfs-mount folder (exp. /mnt/try)
- change almost all files (and folder) to symlinks to /mnt/try
- remaster it.
So, I have small pup sfs with a lot symlinks.
One thing, what files that must be left? I'll look at standard pet packages list.

I'll report it ....

Btw, to jamesbond :
a) running puppy modified to load its pup.sfs from nfs [my first screenshot] - this is like running frugal install but the "harddisk" where the pup.sfs is stored is nfs
Can I get your "puppy modified"? That just init script?

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#59 Post by jamesbond »

Here's the manual steps behind it - I don't have any script or anything.

Method one - Load pup.sfs from nfs
1. re-compiled kernel to include network card driver (this isn't strictly necessary - there are other ways of doing it, but I'm lazy)
2. put a full version of busybox (which has udhcpc) to initrd (this isn't necessary if you're willing to use static ip for testing) - there is one in here http://www.murga-linux.com/puppy/viewto ... 6&start=30 thanks to technosaurus
3. run the nfs server, making sure that pup.sfs is available somewhere
4. boot the new kernel with the new initrd - it will fail because "cannot find pup.sfs" and drops you to ramdisk (or instead you can go straight to shell by putting rdinit=/bin/ash in the boot command line, but then you'll have to do more things ...)
5. get ip address for the network card - either use busybox udhcpc as above, or just do "ifconfig eth0 your-ip-address netmask your-netmask"
6. mount the nfs shared directory, let's say at /mnt/dev_save (use the mount -t nfs command as above)
7. mount the pup.sfs file ("mount -o loop /mnt/dev_save/pup.sfs /pup_ro2")
8. make the tmpfs for pup_rw ("mount -t tmpfs tmpfs /pup_rw")
9. join them together in aufs dance ("mount -t aufs -o br:/pup_rw=rw:/pup_ro2=ro unionfs /pup_new")
10. delete rc.network from /pup_new/etc/rc.d (if you don't do this, boot will fail because rc.network will try to reconfigure the network card, thus cutting off the nfs connection :wink: )
11. switch root - "exec switch_root /pup_new /sbin/init"
12. Watch in awe that your puppy boots over nfs :)
Step 7-11 - we're doing manually what the puppy init script usually does it automatically for us. In fact, we only need to modify initscript to do step 5,6,7, and the we can continue where we left off in init ...
13. In step 1, I recompiled the kernel but this isn't necessary. As an alternative, instead of recompiling the kernel, you can copy the network driver to the initrd, and do a "depmod -a" and "modprobe your-card-driver" before starting step 5.

Method two - Load rootfs from nfs
1. re-compiled kernel to include:
a) network card driver
b) include nfs client as part of kernel
c) using nfs as root
d) enable kernel ip autoconfiguration
2. make sure nfs server uses portmap
3. make the contents of pup.sfs available for exports, and make sure it's shared as writable (you can unsquashfs pup.sfs and export the resulting squashfs-root directory)
4. delete rc.network from this shared directory
5. boot the new kernel with this parameter:
kernel bzImage root=/dev/nfs ip=dhcp loglevel=7 nfsroot=ip-of-your-nfsserver:/your-unsquashed-root,v3
(If you don't use dhcp, you can change ip=xxx.xxx.xxx.xxx to use static ip)
6. Watch in awe that your puppy boots over nfs :)
7. Note: no initrd is necessary with this method. But you definitely need to re-compile the kernel.

Note: those steps above are working but aren't clean, they're used for proof-of-concept only that it works. They won't shutdown cleanly, I think there's some shutdown code which mucks with the network. I did the test with Fatdog, but it should work with all puppies.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#60 Post by Master_wrong »

Note: those steps above are working but aren't clean, they're used for proof-of-concept only that it works. They won't shutdown cleanly, I think there's some shutdown code which mucks with the network. I did the test with Fatdog, but it should work with all puppies.
maybe nfs need to be unmounted first... ?
sometimes i experience hung during shutdown if using nfs too ?

clean or not clean they are working concept.
thank you jamesbond...

btw would you create script to automate-pxe-nfs ?
like the one you posted with normal pxe ?
the 1.st step sounds difficult you know :D
thank again for the tutorial...
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

Post Reply