Building a live ISO: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
No edit summary
(new method for creating live ISOs)
Line 1: Line 1:
= How to turn the FAI nfsroot into a file system for diskless clients =
= How to turn the FAI nfsroot into a file system for diskless clients =


Someone asked me about using the FAI nfsroot for a diskless
Building a live ISO:
client setup. The clients should PXE boot and mount it's whole file
system via NFS (NFS v3, v4 is not working with overlayfs) from the install server.


It's pretty easy. Tested with FAI 5.10.1 and Debian 11 (bullseye).
You can create a live ISO using two FAI commands. First, you need to
build your own live environment, containing all software including
configuration that you like to use. Using the command "fai dirinstall"
you do an installation using the FAI config space into a directory
which will become your live system. After that you create a bootable
ISO which includes this directory tree using fai-cd.


First add all packages you like to have for your
<pre>
diskless clients to /etc/fai/NFSROOT.
  Define the FAI classes:


Create the FAI nfsroot
  cl="DEBIAN,BOOKWORM64,AMD64,FAIBASE,XFCE,XORG,DHCPC,DEMO,LIVEISO,LAST"


<code>fai-make-nfsroot -Nv</code>
  Build the live environment directory tree:


The option -N will add nonfree firmware software (for e.g. for Wifi interfaces).
    # LC_ALL=C fai -v dirinstall -u xfce33 -c $cl -s file:///srv/fai/config /srv/xfce
Then disable some FAI specific things inside the nfsroot:


<pre>
  Then create the live ISO:
chroot /srv/fai/nfsroot bash
 
apt purge fai-nfsroot
    # fai-cd -s500 -MH -d none -g /etc/fai/grub.cfg.live -n /srv/xfce live.iso
exit
</pre>
</pre>


That's it. Now, boot your client.
That's it. Now, boot your client.
Since FAI is using overlayfs, the whole filesystem is writeable for the client, even it's mounted read-only.
= How to create a Live CD with Xfce desktop =
Jun 2023
You will have an account called demo, the pw is fai.
You will need FAI >= 6.1
<pre>
# cl="DEBIAN,BOOKWORM64,AMD64,FAIBASE,XFCE,XORG,DHCPC,DEMO,LIVEISO,LAST"
# LC_ALL=C fai -v dirinstall -u debian  -c $cl -s file:///srv/fai/config  /srv/X/xfce
# fai-cd -J -s 500 -MH -d none -n /srv/X/xfce -g grub.cfg-live live.iso
See man page https://fai-project.org/doc/man/fai-cd.html
for more info.
Here's the grub.cfg-live:
<pre>
## grub2 configuration
set default="FAI live system"
set timeout=3


# make sure we can access partitions
insmod part_msdos
insmod part_gpt
insmod all_video
insmod gfxterm
set gfxmode=auto
set color_normal=white/black
set color_highlight=red/black
set menu_color_normal=white/black
set menu_color_highlight=black/yellow
menuentry "FAI live system" --unrestricted {
    search --set=root --file /FAI-CD
    linux  /boot/vmlinuz rd.live.image root=live:CDLABEL=FAI_CD
    initrd  /boot/initrd.img
}
</pre>


Hint: The FAI nfsroot is not needed when building a live ISO.


This disk space for creating new files is limited by the amount of
free space in the disk image (added by -s). You will have about 2.5GB of free disk
space. This is NO persistent storage.




You can download an ISO image, for and example of this Live CD
You can download an ISO image, for and example of this Live CD
https://fai-project.org/fai-cd/debian12-live-xfce.iso
https://fai-project.org/fai-cd/debian12-live-xfce.iso

Revision as of 10:12, 23 January 2024

How to turn the FAI nfsroot into a file system for diskless clients

Building a live ISO:

You can create a live ISO using two FAI commands. First, you need to build your own live environment, containing all software including configuration that you like to use. Using the command "fai dirinstall" you do an installation using the FAI config space into a directory which will become your live system. After that you create a bootable ISO which includes this directory tree using fai-cd.

  Define the FAI classes:

  cl="DEBIAN,BOOKWORM64,AMD64,FAIBASE,XFCE,XORG,DHCPC,DEMO,LIVEISO,LAST"

  Build the live environment directory tree:

    # LC_ALL=C fai -v dirinstall -u xfce33 -c $cl -s file:///srv/fai/config /srv/xfce

  Then create the live ISO:

    # fai-cd -s500 -MH -d none -g /etc/fai/grub.cfg.live -n /srv/xfce live.iso

That's it. Now, boot your client.


Hint: The FAI nfsroot is not needed when building a live ISO.


You can download an ISO image, for and example of this Live CD https://fai-project.org/fai-cd/debian12-live-xfce.iso