summaryrefslogtreecommitdiff
path: root/create.sh
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-08 02:50:28 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-08 02:52:25 +0100
commit656d3fceae502565242be4f903ecc71c736015f6 (patch)
treef866b601ca559308fe447d1513e30e4991b24fda /create.sh
initial commit - adding PKGBUILDS for riscv64-linux-gnu prefixed toolchain and some READMEs
Diffstat (limited to 'create.sh')
-rwxr-xr-xcreate.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/create.sh b/create.sh
new file mode 100755
index 0000000..1dec4ef
--- /dev/null
+++ b/create.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+ ##############################################################################
+ # parabola-riscv64-bootstrap #
+ # #
+ # Copyright (C) 2018 Andreas Grapentin #
+ # #
+ # This program is free software: you can redistribute it and/or modify #
+ # it under the terms of the GNU General Public License as published by #
+ # the Free Software Foundation, either version 3 of the License, or #
+ # (at your option) any later version. #
+ # #
+ # This program is distributed in the hope that it will be useful, #
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+ # GNU General Public License for more details. #
+ # #
+ # You should have received a copy of the GNU General Public License #
+ # along with this program. If not, see <http://www.gnu.org/licenses/>. #
+ ##############################################################################
+
+set -eu
+
+die() { echo "$*" 1>&2 ; exit 1; }
+export -f die
+
+[ $(id -u) -ne 0 ] && die "must be root"
+[ -z "${SUDO_USER:-}" ] && die "SUDO_USER not set"
+
+export _builddir=build
+mkdir -p $_builddir
+chown $SUDO_USER "$_builddir"
+
+export _toolchain=riscv64-linux-gnu
+
+# stage 0: prepare host
+./src/stage0.sh
+
+# cleanup
+rm -rf "$_builddir"
+echo "all done :)"