2023-04-22 08:19:45 -07:00
|
|
|
#!/bin/bash
|
|
|
|
echo "------------- CORE INSTALLATION ------------"
|
2024-01-14 14:57:09 -08:00
|
|
|
export BUILDING=true
|
|
|
|
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
2023-04-22 08:19:45 -07:00
|
|
|
source /opt/core_run.env
|
|
|
|
if [[ -f ./build.env ]]; then
|
|
|
|
echo sourcing a custom core build enviornment
|
|
|
|
cat ./build.env
|
|
|
|
echo "--------"
|
|
|
|
source ./build.env
|
|
|
|
fi
|
|
|
|
source $LIB_DIR/verbose.lib
|
2024-01-29 15:11:57 -08:00
|
|
|
|
2023-04-22 08:19:45 -07:00
|
|
|
echo appending pkg commands to core_run.env
|
|
|
|
echo appending sourcing of $ENV_DIR/run.env if it exists
|
|
|
|
cat <<ENV >> /opt/core_run.env
|
|
|
|
export INSTALL_PKGS="$INSTALL_PKGS"
|
|
|
|
export UPDATE_PKGS="$UPDATE_PKGS"
|
|
|
|
[ -f "\$ENV_DIR/run.env" ] && [ -z "\$BUILDING" ] && source \$ENV_DIR/run.env
|
|
|
|
ENV
|
|
|
|
quiet cat /opt/core_run.env
|
|
|
|
mkdir -p /etc/profile.d
|
|
|
|
echo creating login sourcing file for core_run.env in /etc/profile.d
|
|
|
|
echo "source /opt/core_run.env" > /etc/profile.d/01-core-run-env.sh
|
2024-01-29 15:11:57 -08:00
|
|
|
|
|
|
|
# if UCI_SHELL is set then USER must be login user
|
2024-01-14 14:57:09 -08:00
|
|
|
[[ $USER_PW ]] && export USER=${USER:-host}
|
|
|
|
if [[ $USER ]]; then
|
|
|
|
export UHID=${UHID:-1000}
|
|
|
|
chown -R -h $UHID:$UHID /opt $VOLUME_DIRS
|
2024-01-29 15:11:57 -08:00
|
|
|
$LIB_DIR/user-create
|
2024-01-14 14:57:09 -08:00
|
|
|
fi
|
2024-01-29 15:11:57 -08:00
|
|
|
[[ $UCI_SHELL ]] && $LIB_DIR/uci-shell
|
|
|
|
quiet ls -la /etc/profile.d
|
|
|
|
quiet cat /etc/profile
|
2023-04-22 08:19:45 -07:00
|
|
|
ls -la /opt
|
|
|
|
echo "done ------------- CORE INSTALLATION ------------"
|