This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cucumber_linux_from_scratch [2018/11/07 17:37] z5t1 [Adding the lfs user] |
cucumber_linux_from_scratch [2018/11/14 00:12] (current) z5t1 [The End] |
||
---|---|---|---|
Line 119: | Line 119: | ||
Create a directory to download the phase 1 source tarballs to: | Create a directory to download the phase 1 source tarballs to: | ||
- | mkdir /opt/culfs/lfscript/sources | + | mkdir /opt/culfs/lfscript/sources |
====== Chapter 5 - Building Phase 1 ====== | ====== Chapter 5 - Building Phase 1 ====== | ||
Line 139: | Line 138: | ||
./lfscript -B | ./lfscript -B | ||
| | ||
- | Note that lfscript will exit with a reported failure. This is because lfscript will attempt to continue on after chapter 5 and begin building chapter 6. It will fail at building chapter 6 (because we don't use it for that part on Cucumber Linux), but will still build the tools tarball successfully. Therefore, this error can be safely ignored. When you reach the error message, press ''^C''. | + | |
===== Installing /tools to the Chroot ===== | ===== Installing /tools to the Chroot ===== | ||
Line 146: | Line 145: | ||
cd ../chroot | cd ../chroot | ||
- | tar -xvJf ../lfscript/packages-*/lfs-*/toolchain.bak.txz | + | tar -xvJf ../lfscript/packages-*/toolchain.bak.txz |
| | ||
===== Preparing the Chroot ===== | ===== Preparing the Chroot ===== | ||
Line 190: | Line 189: | ||
At the end of this phase, the system will be capable of running itself (without the /tools directory), but will not be capable of compiling itself yet. | At the end of this phase, the system will be capable of running itself (without the /tools directory), but will not be capable of compiling itself yet. | ||
+ | |||
+ | |||
===== Enter the Chroot ===== | ===== Enter the Chroot ===== | ||
Line 293: | Line 294: | ||
chmod 600 /var/log/btmp | chmod 600 /var/log/btmp | ||
+ | ==== Customize Portmake ==== | ||
+ | If desired, you can customize the Portmake configuration. This will let you change the build tag from ''localport''. This step is optional. | ||
+ | |||
+ | cp -v /usr/ports/utilities/templates/portmake.conf /etc/ | ||
+ | |||
+ | If desired, edit the file /etc/portmake.conf to your liking. | ||
===== Build a few Packages Manually ===== | ===== Build a few Packages Manually ===== | ||
Line 346: | Line 353: | ||
chmod 755 /tools/bin/gpg | chmod 755 /tools/bin/gpg | ||
+ | |||
+ | Also create a dummy sudo to satisfy a dependency in Portmake: | ||
+ | |||
+ | cat > /tools/bin/sudo << EOF | ||
+ | #!/bin/bash | ||
+ | | ||
+ | while [ \$# -ne 0 ]; do | ||
+ | case \$1 in | ||
+ | '-u') | ||
+ | shift 2 | ||
+ | ;; | ||
+ | *) | ||
+ | exec \$@ | ||
+ | ;; | ||
+ | esac | ||
+ | done | ||
+ | EOF | ||
+ | chmod 755 /tools/bin/sudo | ||
Build and install them: | Build and install them: | ||
Line 465: | Line 490: | ||
At the end of this phase the system will be complete. | At the end of this phase the system will be complete. | ||
- | Similarly, this entire process can be automated with portmake as well. Note that this will take a //very long// time (even longer than phases 1. 2 & 3). | + | ===== Modifying the Chroot Environment ===== |
- | /usr/ports/utilities/tools/portmake install phase4 | + | Before we can build the remainder of the system, we must make a few modifications to the chroot environment to enable the ports tree and portmake to function properly. |
- | ====== Chapter 9 - Creating the Installer Image ====== | + | ==== Set up DNS ==== |
- | We are done building the packages now, so exit the chroot environment. | + | Create a resolv.conf so the chroot can resolve DNS queries. Feel free to substitute in your favorite DNS servers here. |
- | exit | + | cat > /etc/resolv.conf << EOF |
+ | nameserver 208.67.222.222 | ||
+ | nameserver 208.67.220.220 | ||
+ | EOF | ||
- | ===== Getting the Installer Buildscripts ===== | + | ==== Remove the Tools Directory ==== |
- | Navigate to /opt/culfs and download the installer buildscripts from the Cucumber Linux mirror: | + | The ''/tools'' directory is no longer needed, so remove it to ensure that the tools located there do not impact phase 4 and update the PATH variable accordingly. |
- | cd /opt/culfs | + | rm -rf /tools |
- | rsync mirror.cucumberlinux.com::cucumber/cucumber-current/installer ./ -rv | + | export PATH=/bin:/usr/bin:/sbin:/usr/sbin |
- | ===== Preparing the Installer Build Environment ===== | + | ===== Building the Packages ===== |
- | Create a symlink to the directory containing the binary packages. Replace ''$CUCARCH'' with the architecture you are building for (''i686'' or ''x86_64''). If you are building for both architectures, create a separate symlink for each one. | + | Proceed to build the phase 4 packages. Similarly to phase 3, this entire process can be automated with portmake. Note that this will take a //very long// time (even longer than phases 1. 2 & 3). |
- | ln -s chroot/opt/packages/cucumber cucumber-$CUCARCH | + | /usr/ports/utilities/tools/portmake install phase4 |
- | ===== Building the Installer ===== | + | ====== Chapter 9 - Creating the Installer Image ====== |
- | ==== Build the Initrds ==== | + | We are done building the packages now, so exit the chroot environment. |
- | If desired, rebuild the initrds. This step is optional; if you skip it, the prebuilt initrds in the official Cucumber Linux source tree will be used instead. See the file installer/README for instructions on this. | + | exit |
- | ==== Build the ISOs ==== | + | ===== Getting the Installer Buildscripts ===== |
- | Cd to the installer/iso directory. | + | Navigate to /opt/culfs and download the installer buildscripts from GitHub: |
- | cd installer/iso | + | cd /opt/culfs |
+ | git clone https://github.com/cucumberlinux/installer.git | ||
+ | |||
+ | ===== Building the Installer ===== | ||
- | If you are not building the ISOs for every architecture, you will need to modify iso.buildscript. If you are building for all architectures you can skip this step. | + | Enter the installer directory. |
- | In iso.buildscript, find the line that reads: | + | cd installer |
- | for a in x86_64 i686; do | + | Run the build-iso.sh script, setting some special variables. |
- | Delete the architectures that you are not building from that line. | + | PORTSDIR=/opt/culfs/chroot/usr/ports PKGDIR=/opt/culfs/chroot/opt/packages ./build-iso.sh |
- | Finally, run iso.buildscript. This will build your installer ISO images and place them in /tmp. | + | This will the installer ISO file and place it in /tmp. |
- | ./iso.buildscript | + | ====== The End ====== |
+ | Congrats, you made it! |