From a4a1d46251c394c504e54d943d101b9424f1c335 Mon Sep 17 00:00:00 2001 From: cryobry <38270216+cryobry@users.noreply.github.com> Date: Mon, 4 May 2020 10:26:52 -0400 Subject: [PATCH] Official containers are not updated often enough to be useful -- abandon --- openwrtContainerBuild | 126 ------------------------------------------ 1 file changed, 126 deletions(-) delete mode 100755 openwrtContainerBuild diff --git a/openwrtContainerBuild b/openwrtContainerBuild deleted file mode 100755 index 287ab83..0000000 --- a/openwrtContainerBuild +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env bash -source ./functions - -##################### -##### DEFAULTS ###### -##################### - -_image="ath79-generic-19.07.2" -_profile="tplink_archer-c7-v2" -_debug="true" # Turn debugging on by default (useful for testing) - -##################### -##### FUNCTIONS ##### -##################### -printHelpAndExit () { - - runDebug "${FUNCNAME[0]}" - - cat <<-'EOF' -USAGE: -buildOpenWRT [[OPTION] [VALUE]]... - -OPTIONS - --image, -i OPENWRT_IMAGE - Default: "ath79-generic-19.07.2" - --profile, -p PROFILE - Default: tplink_archer-c7-v2 - --builddir, -b PATH - Default: Current working directory - --package - Add this package to the packages array declared in DEFAULTS - Supports multiple --package directives - --ssh-backup SSH_PATH - Example: root@192.168.1.1 - --backup PATH - Add this file or directory to the packages array declared in DEFAULTS - --debug, -d - --help, -h -EOF - # Exit using passed exit code - [[ -z $1 ]] && exit 0 || exit "$1" -} - - -parseInput () { - - runDebug "${FUNCNAME[0]}" - - if _input=$(getopt -o +i:p:b:dh -l image:,profile:,builddir:,ssh-backup:,backup:,package:,debug,help -- "$@"); then - eval set -- "$_input" - while true; do - case "$1" in - --image|-i) - shift && _image="$1" - ;; - --profile|-p) - shift && _profile="$1" - ;; - --package) - shift && _packages+=("$1") - ;; - --builddir|-b) - shift && _builddir="$1" - ;; - --ssh-backup) - shift && _ssh_backup="$1" - ;; - --backup) - shift && _backedup+=("$1") - ;; - --debug|-d) - echo "Debugging on" - _debug="true" - ;; - --help|-h) - _printHelpAndExit 0 - ;; - --) - shift - break - ;; - esac - shift - done - else - echo "Incorrect options provided" - printHelpAndExit 1 - fi -} - - -mkDirs () { - - runDebug "${FUNCNAME[0]}" - - [[ ! -d "$_filesroot" ]] && \ - mkdir -p "$_filesroot" - - [[ ! -d "$_builddir/bin" ]] && \ - mkdir -p "$_builddir/bin" - - - # fix SELinux contexts - chcon -t container_file_t -R "$_builddir/bin" - chcon -t container_file_t -R "$_filesroot" -} - - -__main() { - - parseInput "$@" - - mkDirs - - [[ -n $_ssh_backup ]] && sshBackup - - podman run \ - --rm \ - --userns="keep-id" \ - -v "$_builddir/bin/:/home/build/openwrt/bin" \ - -v "$_filesroot:$_filesroot" \ - openwrtorg/imagebuilder:"$_image" \ - make image PROFILE="$_profile" PACKAGES="${_packages[*]}" FILES="$_filesroot" -} - -__main "$@"