Skip to main content

BYOL: Build Your Own Linux From Scratch

Course

Intro Video

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics. He now leads the Training Architects to produce the courses and content we all know and love!

Length

02:31:45

Difficulty

Intermediate

Videos

23

Course Details

By the end of this course, you will have built an understanding of how the Linux kernel interoperates with glibc (and the rest of the binary toolchain). This, in turn, will enlighten your understanding of how various software packages rely on the kernel and glibc to provide interfaces and services, as well as the “why” behind many of the features and idiosyncrasies of the Kernel and glibc.

Syllabus

Part 1: Intro

Introduction

00:05:49

Lesson Description:

In this video, we discuss what is required to complete this course successfully, what subjects will be covered, and what can be learned.

Part 2: Configuring the Build Environment

Setting Up Our VirtualMachine

00:09:15

Lesson Description:

Partitioning hard disks, setting up the 'byol' user, and configuring environment variables for the build process.

Obtaining Source Code

00:10:12

Lesson Description:

In this video, we obtain the source code files (as compressed TAR files) necessary to build a Linux distribution from scratch.

Stage 1: Building a Temporary Toolchain

In this section, we execute the work necessary to create a temporary toolchain, which we need to build our compiler, linker, and libc implementation natively.

Compiling binutils

00:06:04

Lesson Description:

Compiling binutils from source, Stage 1.

Compiling GCC

00:06:27

Lesson Description:

Compiling GCC from source, Stage 1.

Installing the Kernel Header Files

00:02:57

Lesson Description:

Installing the Kernel Header files, which define the API for interacting with the kernel.

Compiling glibc

00:04:40

Lesson Description:

Our Stage 1 compile of glibc, the GNU implementation of the Standard C Library.

Sanity Check: DO NOT SKIP

00:03:53

Lesson Description:

In this video, we run a quick check of our toolchain as installed so far. If your toolchain doesn't pass the checks as demonstated in this video, something has gone wrong!

Compiling libstdc++

00:02:38

Lesson Description:

Here we compile the C++ compiler package of GCC. This is the only time we have to compile this package.

Stage 2: Building a Native Toolchain

Stage 2: Building bintuils

00:05:14

Lesson Description:

In this video, we undertake the Stage 2 build of binutils, using the toolchain we compiled in Stage 1.

Stage 2: Building GCC

00:08:19

Lesson Description:

Now we build GCC, again using the temporary toolchain built in Stage 1.

Stage 2: Sanity Check

00:01:28

Lesson Description:

This video walks through the performance of a check which ensures our toolchain is built properly.

Stage 2: Test Suite Dependencies

00:13:24

Lesson Description:

We step through the installation of the software needed to run the tests embedded with the binutils, GCC, and glibc packages in this video.

Stage 2: Preparing for Stage 3

00:11:51

Lesson Description:

We make the final changes in preparation for undertaking our Stage 3 builds in this video, including changing file ownership and permissions.

Stage 2: Backing Up Before Stage 3

00:03:00

Lesson Description:

This is a good place to backup your work, using the export utility of your virtualization suite, or another method (if you're using hardware).

Stage 3: Building the Distro

Stage 3: Preparing the Environment

00:11:51

Lesson Description:

We execute most of the Stage 3 build in a chroot jail. In this video, we prepare that environment, inclusive of creating devices nodes and mounting pseudo and virtual filesystems.

Stage 3: Installing glibc

00:08:56

Lesson Description:

We complete the Stage 3 build and install of glibc in this video.

Stage 3: Adjusting the Toolchain

00:03:24

Lesson Description:

We modify our toolchain to use local libraries, instead of relying on the temporary toolchain we've built in previous build stages.

Stage 3: binutils

00:04:56

Lesson Description:

In this video we cover the Stage 3 installation of binutils.

Stage 3: GCC

00:10:53

Lesson Description:

We perform our final installation of GCC in this video.

Stage 3: Building the Userland

00:03:48

Lesson Description:

In this video, we demonstrate the process required to build and install the software packages which will form our userland.

Stage 4: Configuration

Post-build Configuration

00:10:57

Lesson Description:

In this video, we execute the post-build configuration, and boot into our new distro.

What's Next?

00:01:38

Lesson Description:

Wondering where to go next? Check out this video!

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial