aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos.K <freedomrfox@gmail.com>2017-06-21 06:38:50 +0300
committerChristos.K <freedomrfox@gmail.com>2017-06-21 06:38:50 +0300
commit172fd2b012ce40d46cd312c318ed3bec9d2961d4 (patch)
tree240c06a4bc5d4dd599c1f9e9eb4ec1d1bfb3d759 /scripts/chroot_scripts
parentMajor udate: Moved sinit and chroot_sinit parts to functions, imported 1 extr... (diff)
downloadGSE-172fd2b012ce40d46cd312c318ed3bec9d2961d4.tar.gz
GSE-172fd2b012ce40d46cd312c318ed3bec9d2961d4.tar.bz2
GSE-172fd2b012ce40d46cd312c318ed3bec9d2961d4.zip
Inclded time-warp option
Diffstat (limited to 'scripts/chroot_scripts')
-rwxr-xr-xscripts/chroot_scripts/cfunctions84
-rwxr-xr-xscripts/chroot_scripts/chroot_init13
2 files changed, 57 insertions, 40 deletions
diff --git a/scripts/chroot_scripts/cfunctions b/scripts/chroot_scripts/cfunctions
index 4823c4b..6651419 100755
--- a/scripts/chroot_scripts/cfunctions
+++ b/scripts/chroot_scripts/cfunctions
@@ -15,7 +15,7 @@ _subshell() {
die() {
echo "$@" 1>&2 ; exit 1
}
-
+
pass() {
echo -e "[\e[34mDone\e[0m]"
}
@@ -217,7 +217,7 @@ part_portage() {
exit 1
fi
- if echo "$@" | grep -q 'cforce'; then
+ if echo "$@" | grep -q 'cforce' || ! echo "$@" | grep -q '_flag_auto'; then
echo -e "\e[34mEnabling basic profile\e[0m]"
eselect profile set 1 && echo -e "\e[34mEnabled\e[0m" \
|| ask_for_shell "Could not enable basic profile"
@@ -268,28 +268,30 @@ _apply_new() {
build_the_world() {
# EMERGIN WORLD
- while true; do
- echo "----------------------------------------------------------------------------"
- echo "Do you wish to rebuild the system?"
- echo "If catalyst built this system, simply say no"
- echo "Answer Yes or No: "
- read -rp "Input :: <= " YN
- case "${YN}" in
- [yY][eE][sS]|[yY])
- if emerge -eq @world; then
- _e_report_back "World rebuild has been completed"
- _monitor_chroot_flow "REBUILD"; break
- else
- echo "emerge -eq @world" > LAST_FAILED_COMMAND
- combat_medic
- fi;;
- [nN][oO]|[nN])
- echo "Exiting Rebuilding Part"
- sleep 1
- _monitor_chroot_flow "REBUILD"; break;;
- esac
- done
- unset YN
+ if ! echo "$@" | grep -q '_flag_auto'; then
+ while true; do
+ echo "----------------------------------------------------------------------------"
+ echo "Do you wish to rebuild the system?"
+ echo "If catalyst built this system, simply say no"
+ echo "Answer Yes or No: "
+ read -rp "Input :: <= " YN
+ case "${YN}" in
+ [yY][eE][sS]|[yY])
+ if emerge -eq @world; then
+ _e_report_back "World rebuild has been completed"
+ _monitor_chroot_flow "REBUILD"; break
+ else
+ echo "emerge -eq @world" > LAST_FAILED_COMMAND
+ combat_medic
+ fi;;
+ [nN][oO]|[nN])
+ echo "Exiting Rebuilding Part"
+ sleep 1
+ _monitor_chroot_flow "REBUILD"; break;;
+ esac
+ done
+ unset YN
+ fi
}
@@ -647,7 +649,7 @@ _kernel_build() {
env-update > /dev/null 2>&1 && source /etc/profile && export PS1="( 'Part H: Building the Kernel' ) $PS1"
export PATH=${PATH}:${CHDIR}
MKPS=$(grep MAKEOPTS "/etc/portage/make.conf" | sed '/^#/ d' | sed -e "s_\"__g" | awk -F '-j' '{print $2}' | sed '/^\s*$/d')
- if echo "$@" | grep -q 'cforce'; then
+ if echo "$@" | grep -q 'cforce' || ! echo "$@" | grep -q '_flag_auto'; then
echo -e "The \e[34mBuilding kernel\e[0m"
if genkernel --install kernel --kernel-config="${CHDIR}/kernel-conf" \
--makeopts="-j${MKPS}" --btrfs --postclear --e2fsprogs; then
@@ -964,22 +966,26 @@ _do_hs() {
}
_call_hook_points() {
- if echo "${_lawful_args[@]}" | grep -q "$2"; then
- _e_report_back "Lawful entry detected on $2, proceeding..."
- else
- if [[ "$(grep "$1" "${CHDIR}/chsinprog" | awk -F '=' '{ print $2 }')" == 0 || -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then
- if [[ -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then
- _e_report_back "Force entry detected on $3, forcing..."
- eval "$4" "${@:5}" "cforce" || die
- else
- eval "$4" "${@:5}" || die
- fi
- else
- if _repeat_part "$3"; then
- eval "$4" "${@:5}"
+ if ! echo "$@" | grep -q '_flag_auto'; then
+ if echo "${_lawful_args[@]}" | grep -q "$2"; then
+ _e_report_back "Lawful entry detected on $2, proceeding..."
+ else
+ if [[ "$(grep "$1" "${CHDIR}/chsinprog" | awk -F '=' '{ print $2 }')" == 0 || -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then
+ if [[ -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then
+ _e_report_back "Force entry detected on $3, forcing..."
+ eval "$4" "${@:5}" "cforce" || die
+ else
+ eval "$4" "${@:5}" || die
+ fi
else
- _e_report_back "Proceeding"
+ if _repeat_part "$3"; then
+ eval "$4" "${@:5}"
+ else
+ _e_report_back "Proceeding"
+ fi
fi
fi
+ else
+ eval "$4" "${@:5}"
fi
} \ No newline at end of file
diff --git a/scripts/chroot_scripts/chroot_init b/scripts/chroot_scripts/chroot_init
index a9a4ce1..2f2af5a 100755
--- a/scripts/chroot_scripts/chroot_init
+++ b/scripts/chroot_scripts/chroot_init
@@ -6,15 +6,26 @@
# PLEASE DO NOT MODIFY THIS FILE, BUT REFEREE AT CONFIGURATION SUBMENU
# IF YOU NEED TO ADD EXTRA FEATURES TO YOUR SYSTEM.
#
-set -x
+
if echo "${_flag_tty}" | grep -q 'sshd'; then
LC_COLLATE="C"
LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
fi
+
# ENVIROMENTAL ECHO FOR TESTING PHASE
echo "$@"
+if echo "$@" | grep -q '_flag_verbose'; then
+ set -x
+fi
+
+if echo "$@" | grep -q '_flag_chroot_silence'; then
+ _chroot_silence='>/dev/null 2>&1'
+else
+ _chroot_silence=''
+fi
+
# EXPORT IMPORTANT VARIABLES BEFORE GOING ON
source /etc/profile && export PS1="( 'Part C: Preparing to bootstrap' ) $PS1"
export CHDIR="/sinit.d"