WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Build a PXE-boot tftp-only files  (Read 11694 times)

Offline erlis

  • Newbie
  • *
  • Posts: 1
Build a PXE-boot tftp-only files
« on: August 28, 2014, 03:33:23 AM »
Hi,

To build a PXE-boot version of Tiny Core with only files from tftp (or http if using pxelinux) one can do this (assumption of the TC-iso is mounted in /Volumes/TC):

Code: [Select]
cp -rf /Volumes/TC/cde/* tmp/builtin/
cat tmp/builtin/copy2fs.lst tmp/builtin/xbase.lst >> tmp/builtin/onboot.lst
chmod 777 tmp
sudo chown root tmp
sudo chown -R root tmp/*
find tmp | sudo cpio -o -H newc |gzip -9 > tc.gz

Copy tc.gz, /Volumes/TC/boot/core.gz & /Volumes/TC/boot/vmlinuz to your tftpdir.

Use the following entry for pxelinux:

Code: [Select]
  label tclinux
    menu label Tiny Core Linux
    kernel vmlinuz
    initrd core.gz,tc.gz cde quiet


Offline Hose Careras

  • Newbie
  • *
  • Posts: 4
Re: Build a PXE-boot tftp-only files
« Reply #1 on: November 28, 2014, 05:46:18 PM »
I did all that and tinycore loaded over pxe but only in command prompt . all the extensions did load but graphical interface (X window) did not load.
I did launch it manually with : sudo xtartx
It did ask me what screen resolution i want and what type of mouse  i have . After i did chose the right options X windows started but .....its only a big black blank screen and a cursor in the middle . There is no wbar and right/left mouse clicks do absolutely nothing . How do I launch X window with all the stuff it should have from a normal CD boot ?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Build a PXE-boot tftp-only files
« Reply #2 on: November 28, 2014, 05:48:48 PM »
Do not sudo startx.  Just run startx.
You also need to install a window manager and wbar along with aterm.

Use a persistent nfs tce directory per the wiki.

Offline Hose Careras

  • Newbie
  • *
  • Posts: 4
Re: Build a PXE-boot tftp-only files
« Reply #3 on: November 28, 2014, 06:05:08 PM »
This is the list of extensions that are loading during pxe boot :
Xlibs.tcz
Xprogs.tcz
Xvesa.tcz
aterm.tcz
fltk-1.1.10.tcz
flwm_topside.tcz
freetype.tcz
imlib2-bin.tcz
imlib2.tcz
libICE.tcz
libSM.tcz
libX11.tcz
libXau.tcz
libXdmcp.tcz
libXext.tcz
libXfont.tcz
libXi.tcz
libXmu.tcz
libXpm.tcz
libXrandr.tcz
libXrender.tcz
libXt.tcz
libfontenc.tcz
libjpeg-turbo.tcz
libpng.tcz
libxcb.tcz
wbar.tcz
ntfs-3g.tcz
mc.tcz

They are the same extensions are loading during Cd boot . If i try load Xwindows with startx instead of sudo startx i get a error :
cat: cant open "/etc/sysconfig/Xserver"  : No such file or directory

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Build a PXE-boot tftp-only files
« Reply #4 on: November 28, 2014, 06:09:46 PM »
The cde boot option is ONLY for CDs.

Offline Hose Careras

  • Newbie
  • *
  • Posts: 4
Re: Build a PXE-boot tftp-only files
« Reply #5 on: November 28, 2014, 06:13:36 PM »
Yes but it did load the extensions over pxe also  . What i don't understand is why xwindows don't start automatically and when i try load it manually its just xwindows with nothing in it .Just a blank screen and a cursor in it . All the extensions are loaded during pxe boot and location is in the /tmp/buildin/optional directory .

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 760
Re: Build a PXE-boot tftp-only files
« Reply #6 on: November 28, 2014, 06:36:00 PM »
My two cents:

1) Remaster core.gz (it's horribly simple) by merging the apps/extensions into the new core.gz
2) Update either tc-config or bootsync.sh to launch X

Mind you, this builds a larger core.gz considering the number of extensions you're adding (mc itself adds quite a few!) but in my opinion, it's the best you're going to get when you PXE boot and you don't want to utilize a mirror or build a mirror of your own.  My CoreI.gz file is about 25MB which includes Xvesa, IceWM, MC and a few others including tc-install which is pretty good considering what's needed and it only takes about a minute to do.  I have an automation script...  but it does so many things you're not likely to do that it would be overkill.

To get started, first pull in a copy of core.gz and vmlinuz from your preferred TC version.  Then...
1) Extract core.gz (then delete the original)
2) Extract the extensions, then copy them on top of the extracted core*
3) Rebuild core.gz
General instructions can be found: http://wiki.tinycorelinux.net/wiki:remastering

* I prefer to loop-mount my extensions and just copy the mounted files instead of using SquashFS to extract...  fewer apps...  fewer resources...  fewer conflicts IMO.

When you're finished, just rename the new core.gz file into something like coreX.gz and create a PXE menu item and alter the APPEND such as:
Code: [Select]
APPEND initrd=/path/to/coreX.gz ...

Hope this helps!


EDIT: I forgot to add one vital piece of information...  When merging extensions into CORE, there are scripts found in /usr/local/tce.installed that will need to be executed for many of the extensions to function correctly.  Add this to your bootsync.sh file to do so:
Code: [Select]
for file in /usr/local/tce.installed
do
     sh $file
done
If memory serves, this is also where startx is also created/launched from.
« Last Edit: November 28, 2014, 06:47:18 PM by centralware »

Offline Hose Careras

  • Newbie
  • *
  • Posts: 4
Re: Build a PXE-boot tftp-only files
« Reply #7 on: November 28, 2014, 06:48:32 PM »
Thks for help .I did figure it out what was the problem . I did miss 3 steps on the procedure . I did not change ownership of tmp dir and its content to root use before build tc.gz file . I did that and now its working excactly like the cd version .

Offline sebus

  • Jr. Member
  • **
  • Posts: 96
Re: Build a PXE-boot tftp-only files
« Reply #8 on: December 26, 2015, 04:16:14 PM »
Easiest/quickest is to remaster with core-remaster, making sure that these are copied to the remastered cpio gz:

/etc/sysconfig/*
(without this desktop would not "start")
 
and (already mentioned above)

/usr/local/tce.installed

And unsquashed extensions, as per this copied to mounted filesystem (required, from cde folder in iso & any additions one might want/need)
« Last Edit: December 26, 2015, 04:21:20 PM by sebus »