[alpine-aports] scripts/bootstrap.sh: Make script usage display

Message ID 20190708135533.30954-1-anthony.t.davies@gmail.com
State New
Headers show
Series
  • [alpine-aports] scripts/bootstrap.sh: Make script usage display
Related show

Commit Message

Anthony Davies July 8, 2019, 1:55 p.m. UTC
---
 scripts/bootstrap.sh | 46 ++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

Patch

diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 6a23e98cfc..5e0b496a47 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -8,6 +8,29 @@  SUDO_APK=abuild-apk
 # optional cross build packages
 KERNEL_PKG="linux-firmware linux-vanilla"
 
+if [ -z "$TARGET_ARCH" ]; then
+	program=$(basename $0)
+	cat <<EOF
+usage: $program TARGET_ARCH
+
+This script creates a local cross-compiler, and uses it to
+cross-compile an Alpine Linux base system for new architecture.
+
+Steps for introducing new architecture include:
+- adding the compiler triplet and arch type to abuild
+- adding the arch type detection to apk-tools
+- adjusting build rules for packages that are arch aware:
+  gcc, openssl, linux-headers
+- create new kernel config for linux-vanilla
+
+After these steps the initial cross-build can be completed
+by running this with the target arch as parameter, e.g.:
+	./$program aarch64
+
+EOF
+	return 1
+fi
+
 # get abuild configurables
 [ -e /usr/share/abuild/functions.sh ] || (echo "abuild not found" ; exit 1)
 CBUILDROOT="$(CTARGET=$TARGET_ARCH . /usr/share/abuild/functions.sh ; echo $CBUILDROOT)"
@@ -33,29 +56,6 @@  msg() {
         printf "${prompt} ${name}: %s\n" "$1" >&2
 }
 
-if [ -z "$TARGET_ARCH" ]; then
-	program=$(basename $0)
-	cat <<EOF
-usage: $program TARGET_ARCH
-
-This script creates a local cross-compiler, and uses it to
-cross-compile an Alpine Linux base system for new architecture.
-
-Steps for introducing new architecture include:
-- adding the compiler triplet and arch type to abuild
-- adding the arch type detection to apk-tools
-- adjusting build rules for packages that are arch aware:
-  gcc, openssl, linux-headers
-- create new kernel config for linux-vanilla
-
-After these steps the initial cross-build can be completed
-by running this with the target arch as parameter, e.g.:
-	./$program aarch64
-
-EOF
-	return 1
-fi
-
 if [ ! -d "$CBUILDROOT" ]; then
 	msg "Creating sysroot in $CBUILDROOT"
 	mkdir -p "$CBUILDROOT/etc/apk/keys"