diff options
author | Jonathan Bauer | 2020-05-13 13:44:47 +0200 |
---|---|---|
committer | Jonathan Bauer | 2020-05-13 13:44:47 +0200 |
commit | 5a95c9080cc2685fbec7bd7b4f3b14b980441d2f (patch) | |
tree | 2da586bf4fb26eaaa26d06a1b161d7170e391dff | |
parent | build-initramfs.sh: new-gen bootstrap (diff) | |
download | systemd-init-5a95c9080cc2685fbec7bd7b4f3b14b980441d2f.tar.gz systemd-init-5a95c9080cc2685fbec7bd7b4f3b14b980441d2f.tar.xz systemd-init-5a95c9080cc2685fbec7bd7b4f3b14b980441d2f.zip |
removed bootstrap.sh since its not integrated
-rwxr-xr-x | bootstrap.sh | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 3bd46a75..00000000 --- a/bootstrap.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env bash -# -*- coding: utf-8 -*- -# region header -# Copyright Torben Sickert (info["~at~"]torben.website) 29.10.2015 -# Janosch Dobler (info["~at~"]jandob.com) 29.10.2015 -# Jonathan Bauer (jonathan.bauer@rz.uni-freiburg.de) 19.09.2019 -# Thiago Abdo (tjabdo@inf.ufpr.br) 06-11-2019 - -# License -# ------- -# This library written by Torben Sickert and Janosch Dobler stand under a -# creative commons naming 3.0 unported license. -# see http://creativecommons.org/licenses/by/3.0/deed.de -## endregion - -declare -g modules="modules.conf" - -print_help_message() { - echo "Bootstrapper script for systemd-init." - echo "" - echo "$0: [--help|-h] [--verbose|-v] <modules_config>" - exit "${1:-0}" -} - -parse_command_line() { - while [ $# -gt 0 ]; do - case "$1" in - --help|-h) - shift - print_help_message 0 - ;; - --verbose|-v) - shift - verbose='yes' - set -x - ;; - *) - modules="$1" - shift - ;; - esac - done - return 0 -} - -vecho() { - [ -n "$verbose" ] && echo $@ -} - -handler_git() { - local path="$1" - local url="$2" - local branch="$3" - local commit="$4" - - rm -rf "$path" - mkdir -p "$path" - - local gitargs=( \ - "--depth" "1" \ - "--single-branch" \ - ) - if [ -n "$branch" ]; then - gitargs+=("--branch" "$branch") - fi - git clone "${gitargs[@]}" "${url}" "${path}" - - [ -z "$commit" ] && return 0 - - # make sure given commit in in the fetched history - local revision="$branch" - if [ -n "$commit" ]; then - revision="$commit" - fi - - # manual "shallow clone" since not all server allow it... - pushd "$path" - local i=50 - while ! git rev-parse --quiet --verify $revision^{commit}; do - git fetch --depth=$(( i+=50 )) - done - git reset --hard "$revision" - popd -} - -handler_http() { - local path="$1" - local url="$2" - - rm -rf "$path" - mkdir --parents "$path" - - curl \ - --location \ - --max-redirs 5 \ - --max-time 7 \ - --connect-timeout 2 \ - --retry 3 \ - --retry-max-time 12 \ - "$url" \ - | tar \ - --extract \ - --gzip \ - --directory "$path" \ - --strip-components 1 -} - -parse_command_line $@ - -if [ ! -f "$modules" ]; then - echo "Missing modules definition file: $modules" - print_help_message 1 -fi - -. $modules - -vecho "Modules file: $modules" -vecho "Modules: ${!module_*}" -vecho "" - -# checkout modules, starting with systemd-init defined in '_core'. -for module in _core "${!module_@}"; do - declare -n _ref="$module" - echo "######################### $module #########################" - vecho "Handler: ${_ref[handler]}" - vecho " URL: ${_ref[url]}" - vecho " Branch: ${_ref[branch]}" - vecho " Commit: ${_ref[commit]}" - vecho " Path: ${_ref[path]}" - handler_${_ref[handler]} \ - "${_ref[path]}" \ - "${_ref[url]}" \ - "${_ref[branch]}" \ - "${_ref[commit]}" -done - -# look for patches and apply them to their module's path -for _dir in $(find $PWD/${_core[path]}/builder/patches/* -maxdepth 0 -type d); do - patches=( ${_dir}/*.patch ) - target_dir="${_dir##*/}" - declare -n target_module="module_${target_dir//-/_}" - pushd "${target_module[path]}" - for patch in "${patches[@]}"; do - patch -p1 < "$patch" - done - popd -done - |