My role on team require me to build specific environment to do development. As you know DracOs is a LFS-based linux distribution, means we build it from ground up. We are not remastering or modify another distro. A pure linux tailored for our need.

My development lab is simple. All the build is done on virtual machine, I choose VirtualBox. Two virtual machines are needed. The first VM is Builder while the second one is Target. The Target is the final product of DracOs which can be boot on (theoretically) any environment. So Target will be a VM for running tests. On development process, Target would be mounted to Builder. Builder will do all the works. Basically Builder will build two things: tools and Target.

In this article I will describe the setting I use to create build environment (version 1). This version has not integrated with much stuffs but works for first phase.

Virtual Machines Specification

Builder

  • Arch Linux template
  • Processors: 4 CPUs
  • RAM 4096 MB (4GB)
  • HDD
    • /dev/sda (20GB) Builder.vdi
      • /dev/sda1 – / (8GB) ext4
      • /dev/sda2 – (2GB) swap
      • /dev/sda3 – /tools (5GB) ext4 for x86_64
      • /dev/sda4 – /tools (5GB) ext4 for i386
    • /dev/sdb  (mounted Target.vdi)

Remaining space are unused

Target

  • Arch Linux template
  • Processors 1 CPUs
  • RAM 1024 MB (1GB)
  • HDD
    • /dev/sda (24GB GPT) Target.vdi
      • /dev/sda1 – EFI (1GB) for EFI partition
      • /dev/sda2 – swap for linux swap
      • /dev/sda1 – / (10GB) ext4 for 64bit branch
      • /dev/sda2 – / (10GB) ext4 for 32bit branch

As you see, Target will be mounted to Builder.

I choose Arch Linux because I need lightweight distro to do the job.

At this point, my lab is deviate a little from LFS build environment. The LFS guide recommended to make a partition for LFS with tools as a part of LFS partition. In my lab, I separate both tools and sources in Builder machine and bind them to Target if necessary. This way I won’t need to remove things.

Setup Target

The setup we do is to create proper partition. I know we could do this on Builder, but I decide to separate the two things so we can clearly see each roles and functions.

Boot ArchLinux ISO. Once we are prompted, run fdisk to partition.

My final partition layout would be like this

Then we format each partition.

Shutdown

Setup Builder

I will divide the process into three sections: prepare, install, builder. Each phase has it’s own purpose and identified by the name before the prompt.

I don’t create user other than lfs. This user is comply with LFS guide and would be the only user in system (other than root).

Actually, this is not much different to typical Arch Linux installation.

Prepare Phase

Prepare environment before doing installation.

US keymap is OK for me so nothing to change.

Make sure network is up and we can ping to internet.

Update the system clock. Synchronize with NTP to ensure system clock is accurate.

Part the dist, make following partitions

and format them

mount the file systems.

Install Phase

Select mirrors. All packages downloaded from mirrors so we need to make sure selecting correcting server. Nearby servers are preferred. Open /etc/pacman.d/mirrorlist and start rearranging.

Strap minimum installation

generate fstab with current condition

then chroot

Set the timezone. Here we also generate /etc/localtime.

Uncomment en-US.UTF-8 UTF-8 and other needed localization in /etc/locale.gen. Then generate them with.

Change hostname and hosts.

creating new initramfs is usually not required. However I jsut want to make sure.

Change root password.

Create new username lfs for development only.

Update repository

Install bootloader. I choose GRUB. (see this)

Enable networking services.

Reboot, make sure our base system is installed and ready to use.

Builder Phase

Install linux header. This is important for building DKMS modules. We also need base-devel for building process so it’s a crucial component.

Leveraging CLI to do all stuffs is interesting. However I need to produce script and stuffs for development process thus I install GUI. It is not a necessary thing for build machine.

Next create virtualbox modules so we can interact with Builder from host system

Let’s see the result by starting xfce. Nice desktop and nice mouse logo should be there.

Install and configure some tools

In most case I utilize the builder remotely using SSH so I need to install OpenSSH. This way I can use my freely copy-and-paste commands on my SSH client.

Next time, I should use this to connect (with some name registration in my local machine)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">