User:Daggystyle/Nfs based binhost setup

NFS based Server/Client BinHost setup
the following tutorial will show how to create a binhost server and client setup for gentoo. the base assumption are follows:
 * both server and client are of the same arch, in my case x86_64.
 * there is an network connection between both setups.

Build Chroot Creation
the below steps will result with a basic build chroot for the binhost server.

img and env preperation:
first, create the proper tree by running the following cmd:

next, allocate an image file on the server with a size which will accommodate the new chroot. my client runs from a 16GB usb thumb drive, so I used that exactly. the cmd is:

the next step will be to load the image so it can be used, the cmd is rather simple:

this will bind /mnt/gentoo_binhost/chroot.img.raw to the first free loop device found on the system. in order to see which loop device was used, run: and examine the output. from now on, is it the same as the install handbook, e.g. create the proper partition table on the image [] (I've decided to go with one full gpt partition.).

next, preform the stage unpack [] and don't forget to mount the root folder.

configuration:
now it is time to setup the system, edit make.conf as follows:

and populate it as follows:

create the bin pkgs target folder:

the last step is to edit /mnt/gentoo_binhost/chroot/etc/profile:

and add the following to the end:

Chroot Utils Creation
this section will introduce the needed utils which will allow easy pkg management.

bh_emerge.sh
bh_emerge.sh is short for binhost emerge, this script will generate the required pkgs for the client to use. execute the following cmd:

and update the file as follows:

don't forget to set the proper permissions as follows:

build_kernel.sh
build_kernel.sh is the script that will compile and pack the kernel. create the file as follows:

and update the file as follows:

don't forget to set the proper permissions as follows:

binhost configuration
this section will configure the binhost.

NFS Server configuration
install nfs-utils []. next, configure the export by executing:

and add the following to it: