From 0e0321f376491533dbe1114f2d77d359e20356a6 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 27 Apr 2018 23:24:44 -0500 Subject: Porting Guide: Add more content to chapter 2 --- src/porting/2_bootstrapping.xml | 62 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/src/porting/2_bootstrapping.xml b/src/porting/2_bootstrapping.xml index 70e64e0..a842c0b 100644 --- a/src/porting/2_bootstrapping.xml +++ b/src/porting/2_bootstrapping.xml @@ -3,12 +3,12 @@ Bootstrapping Phase During this phase, you will create a number of necessary tools: - You will create a toolchain to use on your host to compile software for the target. + You will create a toolchain to use on your host to compile software for your target. This is called a "cross-compilation" toolchain. - You will build an essential set of software to bootstrap the target, - including a toolchain to use on the target to compile software directly on the target. - You will configure a kernel to boot on the target. - You will then create a bootable image that you will use to boot the target into Adélie Linux. + You will build an essential set of software to bootstrap your target, + including a toolchain to use on your target to directly compile software (or self host). + You will configure a kernel to boot on your target. + You will then create a bootable image that you will use to boot your target into Adélie Linux.
@@ -24,10 +24,58 @@ Creating the cross-compilation toolchain In this section, you will: - Add the necessary information to abuild and APKBUILDs for essential software; - Install the amended abuild to your host computer; and + Add the necessary information to abuild; + Install the amended abuild to your host computer; + Add your target to APKBUILDs for essential software; and Create the initial cross-compilation toolchain, allowing you to build packages for your target. Please make sure that you are at your host computer's terminal before continuing. +
+ Making <package>abuild</package> aware of your target + Before you can build packages for your target, + you will need to ensure abuild is aware of the architecture. + This is accomplished by modifying a few files in the abuild source code. + You will need to check out a clone of the abuild Git repository, + or use the copy of the abuild Git tree found on the Adélie Linux Platform Group Resource Disc. + In the abuild Git tree, open the functions.sh.in file. + Locate the arch_to_hostspec function, + and add the short name of your target's architecture as a case to the case statement; + it should echo the full build triplet for your target (see ). + Example addition of PA-RISC to <function>arch_to_hostspec</function> + + armhf) echo "armv6-foxkit-linux-muslgnueabihf" ;; + armv7) echo "armv7-foxkit-linux-musleabihf" ;; + hppa) echo "hppa-foxkit-linux-musl" ;; + i528) echo "pentium4-foxkit-linux-musl" ;; + mips) echo "mips-foxkit-linux-musl" ;; + + + Next, locate the hostspec_to_arch function, + and add a string that would match any build triplet for your target's architecture as a case to the case statement; + it should echo the short name you specified in arch_to_hostspec (see ). + Example addition of PA-RISC to <function>hostspec_to_arch</function> + + armv6*-*-*-*eabihf) echo "armhf" ;; + armv7*-*-*-*eabihf) echo "armv7" ;; + hppa-*-*-*) echo "hppa" ;; + i486-*-*-*) echo "x86" ;; + i586-*-*-*) echo "pmmx" ;; + + + Now that you have added your target to abuild, + you will need to create a patch to apply to the APKBUILD. + Commit your work with a descriptive message (such as "Add the PA-RISC architecture to functions"), + then run git format-patch HEAD^ to have Git provide you a patch file. + This patch file will typically be named similar to 0001-Add-foo-architecture-to-functions.patch. + Move (or copy) the patch file you have generated to the directory with abuild's APKBUILD, + then add it to the source list in the APKBUILD and rerun + abuild checksum as with any package update. + Build this new copy of abuild locally, and install it to your host computer. +
+
+ Add your target to essential software build recipes + A few of the essential system software packages for Adélie Linux are customised per target. + In this section, you will add support for your target to these packages. +
-- cgit v1.2.3-70-g09d2