Skip to content
Snippets Groups Projects
Verified Commit c0bb6791 authored by Karel Koci's avatar Karel Koci :metal: Committed by Josef Schlehofer
Browse files

compile_pkgs: don't run it under sudo and build everything

Parameter -e is now obsolete and by default, we want to build everything.
Removed it from turris-build.conf.example

Because of that we or users don't need to select packages in make
menuconfig which we or they want to build. Now each package will be selected
but not compiled which depends on user choice.

Also, compile_pkgs shouldn't be run under root or with sudo. Do it as
normal user.
parent 28601aa8
Branches
Tags
No related merge requests found
......@@ -75,7 +75,6 @@ openwrt_feed() {
# Configuration variables
. "$src_dir/defaults.sh"
FORCE="" # Force build
EVERYTHING="" # Set this variable to build all packages not only minimal set
CLONE_DEEP="" # Set this variable to clone OpenWRT tree in full depth not just latest commit
BUILD_ARGS=() # Additional arguments passed to OpenWRT make call (note that this is for all make calls in OpenWRT)
BUILD_JOBS="$(nproc)" # Number of jobs to be passed to make calls
......@@ -188,8 +187,6 @@ available_commands+=( ["configure"]="Recreates configuration for target boards"
configure() {
_report "Creating default configuration"
[ -n "${TARGET_BOARD}" ] || _die "No board selected!"
local everything
[ "$EVERYTHING" = yes ] && everything=y || everything=n
cat "${src_dir}"/configs/common/* "${src_dir}/configs/${TARGET_BOARD}"/* > ./.config
{
echo "CONFIG_DEVEL=y"
......@@ -201,8 +198,8 @@ configure() {
echo "CONFIG_VERSION_HOME_URL=\"https://www.turris.cz/\""
echo "CONFIG_VERSION_BUG_URL=\"https://gitlab.labs.nic.cz/groups/turris/-/issues\""
echo "CONFIG_VERSION_SUPPORT_URL=\"https://www.turris.cz/support/\""
echo "CONFIG_ALL_KMODS=$everything"
echo "CONFIG_ALL=$everything"
echo "CONFIG_ALL_KMODS=y"
echo "CONFIG_ALL=y"
} >> .config
_make defconfig diffconfig
OPENWRT_ARCH="$(sed -n 's|^CONFIG_TARGET_BOARD="\([^"]*\)"|\1|p' .config)"
......@@ -562,7 +559,6 @@ print_help() {
echo "Compile TurrisOS packages. This script fetches, patches and configures OpenWRT tree."
echo
echo "Primary options:"
echo " -e Build everything, not just minimal set"
echo " -t BOARD Set target board to BOARD. This is required for almost all commands."
echo " -jNUM Number of jobs in paralel to be run. In default number of CPUs is used."
echo " -a ARG Add build arguments - passed directly to make. This option can be specified multiple times."
......@@ -591,7 +587,7 @@ steps=()
while [ $# -gt 0 ]; do
case "$1" in
-e)
EVERYTHING="yes"
echo "-e option is obsoleted and execution now always runs as with this option." >&2
;;
-j*)
BUILD_JOBS="${1#-j}"
......@@ -647,8 +643,9 @@ while [ $# -gt 0 ]; do
shift
done
[ ${#steps[@]} -gt 0 ] || steps=( "${DEFAULT_STEPS[@]}" )
[ "$(id -u)" != 0 ] || _die "Build should not be run under root!"
[ ${#steps[@]} -gt 0 ] || steps=( "${DEFAULT_STEPS[@]}" )
for step in "${steps[@]}"; do
"$step"
done
......@@ -8,8 +8,6 @@
# This file is sourced to bash script (compile_pkgs) so you can use any bash
# compatible syntax here.
# Set this variable to build all packages not only minimal set
EVERYTHING=y
# Number of jobs to be passed to make calls
BUILD_JOBS="$(nproc)"
# Path to private signing key
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment