Quick Start: Difference between revisions

From LFScript
mNo edit summary
NilsB (talk | contribs)
m align the scripts compression method to the main page
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
This page will explain how to set up your computer so that you can run LFScript for the first time. It assumes that you have read [[Linux From Scratch]] at least once and that you know [[About LFScript|what LFScript is]].
[[Category:Documentation]]
This page will explain how to set up your computer so that you can run LFScript for the first time. It assumes that you have read [http://www.linuxfromscratch.org/lfs/view/development/ Linux From Scratch] at least once and that you know [[Documentation|what LFScript is]].


There also is a video tutorial available, which shows you exactly what happens when you execute the commands presented here.
There also is a video tutorial available, which shows you exactly what happens when you execute the commands presented here.
Line 5: Line 6:


== Before you start ==
== Before you start ==
It is recommended that you use LFScript on a virtual machine like [[VirtualBox]]. This allows you to experiment freely without any risk that you destroy your host system. You can use the [[fsOS]] Live CD to boot the virtual machine.
It is recommended that you use LFScript on a virtual machine like [[Setting up Virtualbox|VirtualBox]]. This allows you to experiment freely without any risk that you destroy your host system. You can use the [[fsOS]] Live CD to boot the virtual machine.


=== System requirements ===
=== System requirements ===
In addition to the system requirements set by [[Linux From Scratch]], your host system needs to have <code>wget</code> installed if you want LFScript to download source code automatically. Having <code>wget</code> installed is highly recommended, because there could be several hundred files which must be downloaded.
Before you run LFScript, make sure your system meets the [[Host System Requirements]].


It has been reported that the build of <code>GCC</code> will fail if you have less than 1 GigaByte of memory. LFScript will not run unless you have at least that amount of memory, or if you acknowledge that you have less by giving the <code>-M</code> switch to LFScript. You could try to set up SWAP space to overcome memory issues, but this may slow down the build.
It has been reported that the build of <code>GCC</code> will fail if you have less than 1 GigaByte of memory. LFScript will not run unless you have at least that amount of memory, or if you acknowledge that you have less by giving the <code>-M</code> switch to LFScript. You could try to set up SWAP space to overcome memory issues, but this may slow down the build.
Line 26: Line 27:
Building an OS from source requires a lot of free space. Luckily, modern computers come with very large hard disks. Running LFScript could require up to 20 GB of free disk space.
Building an OS from source requires a lot of free space. Luckily, modern computers come with very large hard disks. Running LFScript could require up to 20 GB of free disk space.


=== Preparing the hard disk (virtual machine only) ===
Depending on your use of a Live CD, you should execute the commands from one of the following subsections:
 
=== Preparing the hard disk (if you use a Live CD) ===
If you are running in a virtual machine as recommended, you need to partition and format your virtual hard disk first.
If you are running in a virtual machine as recommended, you need to partition and format your virtual hard disk first.


Line 43: Line 46:
If you only want to build a Live CD of your system you will only need one partition though.
If you only want to build a Live CD of your system you will only need one partition though.


You can bring any SWAP space online immediately:
You can bring any SWAP space online immediately, which is recommended if you are running low on memory:


<pre>swapon /dev/sda3</pre>
<pre>mkswap /dev/sda3
swapon /dev/sda3</pre>


Format and mount the partition you want to use for building your system:
Format and mount the partition you want to use for building your system:
Line 54: Line 58:
cd /mnt/lfscript</pre>
cd /mnt/lfscript</pre>


=== Choose a directory (non-virtual machine only) ===
=== Choose a directory (only if you don't use a Live CD) ===
Although it is started by root, LFScript will reduce it's privileges when it builds the temporary toolchain. For this reason, you must choose a directory which is accessible (and writable) by all users but has enough space to run LFScript.
Although it is started by root, LFScript will reduce it's privileges when it builds the temporary toolchain. For this reason, you must choose a directory which is accessible (and writable) by all users but has enough space to run LFScript.


Line 67: Line 71:
Download the latest version:
Download the latest version:


<pre>&#119;get lfscript.org/latest.tar.bz2
<pre>&#119;get lfscript.org/latest.tar.xz
tar xf *.tar.bz2
tar xf *.tar.xz
cd lfscript4-revision*</pre>
cd lfscript4-revision*</pre>
'''Important''': [[Kernel configuration|Configure your kernel]]. If you don't, you may need to rebuild your kernel later.


You can now build your system using LFScript.
You can now build your system using LFScript.
Line 82: Line 88:


That command would build LFS, <code>nano</code>, <code>wget</code> and everything it needs for the X Window System.
That command would build LFS, <code>nano</code>, <code>wget</code> and everything it needs for the X Window System.
== Important further reading ==
* [[LFScript Switches]]
* [[Aborting and Resuming]]

Latest revision as of 10:53, 28 November 2017

This page will explain how to set up your computer so that you can run LFScript for the first time. It assumes that you have read Linux From Scratch at least once and that you know what LFScript is.

There also is a video tutorial available, which shows you exactly what happens when you execute the commands presented here.

Before you start

It is recommended that you use LFScript on a virtual machine like VirtualBox. This allows you to experiment freely without any risk that you destroy your host system. You can use the fsOS Live CD to boot the virtual machine.

System requirements

Before you run LFScript, make sure your system meets the Host System Requirements.

It has been reported that the build of GCC will fail if you have less than 1 GigaByte of memory. LFScript will not run unless you have at least that amount of memory, or if you acknowledge that you have less by giving the -M switch to LFScript. You could try to set up SWAP space to overcome memory issues, but this may slow down the build.

Log in as the root user

LFScript requires root access (which is another great reason to build only in a virtual machine).

If you have not logged in as the root user (or if this is disabled on your host system), run the following command to become root:

su - root

On Ubuntu (and probably other systems where you can not log in as root), you may need sudo to become root:

sudo su - root

Preparing the host system

Building an OS from source requires a lot of free space. Luckily, modern computers come with very large hard disks. Running LFScript could require up to 20 GB of free disk space.

Depending on your use of a Live CD, you should execute the commands from one of the following subsections:

Preparing the hard disk (if you use a Live CD)

If you are running in a virtual machine as recommended, you need to partition and format your virtual hard disk first.

The cfdisk utility makes it easy to partition your hard disk.

cfdisk

If you want to install your system later, you need to reserve at least one extra partition for your new OS.

The page that explains the installation of your system assumes that you have created four partitions on your hard disk:

  • sda1 (Linux filesystem, Bootable) is where the root file system of your new OS will be.
  • sda2 (Linux filesystem) is where /usr will be mounted (optional).
  • sda3 (SWAP) will be used as SWAP space.
  • sda4 (Linux filesystem) is where we will run LFScript.

If you only want to build a Live CD of your system you will only need one partition though.

You can bring any SWAP space online immediately, which is recommended if you are running low on memory:

mkswap /dev/sda3
swapon /dev/sda3

Format and mount the partition you want to use for building your system:

mkdir /mnt/lfscript
mkfs.ext4 /dev/sda4
mount /dev/sda4 /mnt/lfscript
cd /mnt/lfscript

Choose a directory (only if you don't use a Live CD)

Although it is started by root, LFScript will reduce it's privileges when it builds the temporary toolchain. For this reason, you must choose a directory which is accessible (and writable) by all users but has enough space to run LFScript.

You may choose to use a separate partition for this, but any directory will do.

mkdir /home/lfscript_tmp
cd /home/lfscript_tmp

Fetch and go!

One of the core features of LFScript is that it should be extremely easy to use.

Download the latest version:

wget lfscript.org/latest.tar.xz
tar xf *.tar.xz
cd lfscript4-revision*

Important: Configure your kernel. If you don't, you may need to rebuild your kernel later.

You can now build your system using LFScript.

./lfscript -B

This is the most basic command you can give to LFScript. It instructs it to build the full basic system (LFS).

You can also instruct it to build extra packages, for example:

./lfscript -Bx "nano wget x-window-system"

That command would build LFS, nano, wget and everything it needs for the X Window System.

Important further reading