Tue Sep 26 12:31:25 2017 UTC

Preparation of the construction

If you are on NuTyX

Make sure the tools are installed:

get cards.devel git

If you are not on NuTyX

You need to download the NuTyX installation script install-nutyx.

To make this topic transparent for all readers (NuTyX or not NuTyX user), you will need to put the script in a standard directory. You can delete it at the end of the creation.

Switch to root mode:

su -
wget http://downloads.nutyx.org/install-nutyx{,.md5sum}
md5sum -c install-nutyx.md5sum
install-nutyx: OK
chmod -v 755 install-nutyx
mode of 'install-nutyx' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
mv -v install-nutyx /usr/bin/install-nutyx
'install-nutyx' -> '/usr/bin/install-nutyx'

Make sure you have the bstar command installed on your distribution.

You need to use the BASH interpreter.

Check that all the conditions are fulfilled by checking this page

If you have already done this process

It's necessary to remove the user (and its group it belongs to) and the home directory of the user lfs.

So if you need to do it, remove all existing stuff:

userdel lfs
rm -r /home/lfs

Normally, by removing the user, the group is removed as well. If you are not sure give it a try, it will not hurt.

groupdel lfs

Partition preparation

To be able to start the first pass without major trouble, let's see what has to be done. It's quite straightforward.

Normally if we build a linux distribution, it's necessary to plan a partition where to put its construction. It's actually not a necessity, as it's possible to build the distribution in a folder and then make a backup on a USB key or directly use the command rsync to transfer it to the destination disk or partition.

So if you decide to use a dedicated partition, it's time to format it in the file system of your choice and then you mount it on the folder defined by the LFS variable.

In all the articles we will used the same folder, so let's define the LFS variable:

export LFS=/mnt/lfs
Once your partition is formatted, it's time to create the folder and mount your partition on it. In my example, I have chosen the second partition of the first disk, you should adjust those settings to your choice.
mkdir -pv $LFS
mount /dev/sda2 $LFS

Remember to always mount this partition prior to starting the pass 1 or 2. Once the partition is mounted, we can start the first pass.