summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-01-27 04:22:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-01-27 04:22:03 +0000
commit4461a01202018c5120d19f6b997e402f85ee66cd (patch)
treeec29bc7b9d2c4e1cf256110d7bf6e301bd91bffa
parent5ebe15d1c7588ac5784a874d68cdb556bff776a6 (diff)
* improve the MAKEOPTS variable adaptation from any value, not just defaults, to a value detected by $(getconf _NPROCESSORS_ONLN)HEADv2.1812.2master
* expose new --adapt option so one can call it directly whenever CPU's are added or removed, or when CPU cores are enabled or disabled * document the new option in the --help menu * refactor some functions
-rw-r--r--src/backend/f_help.sh5
-rw-r--r--src/backend/f_modeswitch.sh33
-rwxr-xr-xsrc/frontend/cli/vasile.sh3
3 files changed, 32 insertions, 9 deletions
diff --git a/src/backend/f_help.sh b/src/backend/f_help.sh
index ab56fd6..de4237c 100644
--- a/src/backend/f_help.sh
+++ b/src/backend/f_help.sh
@@ -44,6 +44,11 @@ echo -e "\
the live filesystem will be compressed, live services will be autoenabled, live bootloader autoconfigured and in the end live iso image will be built. You will find
a list of predefined live services list hardcoded into "$colorstart"libvasile"$colorstop". Adjust it to suit your needs.
+ "$colorstart"--adapt"$colorstop"
+ This option will allow you to adjust the MAKEOPTS variable of portage. The default value is -j64 (compile using 64 CPU cores), but this is overkill for lower spec machines.
+ You must call this option on a fresh install (to override the above overkill defaults) or when you add, remove, enable or disable CPU's (to adapt to more or less CPU cores).
+ Otherwise, it is called automatically at setup stage.
+
"$colorstart"--reset"$colorstop"
This option will allow you to reset portage. It will remove the portage tree snapshot, the Redcore Linux ebuild overlay, the portage configuration files and reset the system profile.
Usually you will never want to call this option directly, unless you really really really know what are you doing. It is called automatically at setup stage.
diff --git a/src/backend/f_modeswitch.sh b/src/backend/f_modeswitch.sh
index b257daa..432aa7c 100644
--- a/src/backend/f_modeswitch.sh
+++ b/src/backend/f_modeswitch.sh
@@ -58,8 +58,8 @@ setjobs () {
einfo "I am setting portage to use $(getconf _NPROCESSORS_ONLN) jobs to compile packages"
# default MAKEOPTS value is -j64, but that's overkill for lower spec machines
# this will adjust MAKEOPTS to a value detected by $(getconf _NPROCESSORS_ONLN)
- sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/make.conf/00-makeopts.conf # global makeopts (exclude kernel)
- sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/env/makenoise.conf # kernel makeopts
+ sed -i "s/\-j\([0-9]\+\)/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/make.conf/00-makeopts.conf # global makeopts (exclude kernel)
+ sed -i "s/\-j\([0-9]\+\)/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/env/makenoise.conf # kernel makeopts
}
setprofile () {
@@ -68,22 +68,37 @@ setprofile () {
. /etc/profile
}
-reset () {
- checkifroot
+dopurge () {
delmainporttree
deladdonporttree
delportcfgtree
}
-setup () {
- checkifroot
- delmainporttree
- deladdonporttree
- delportcfgtree
+doinject () {
getmainporttree
getaddonporttree
getportcfgtree
+}
+
+dosetup () {
setportage
setjobs
setprofile
}
+
+adapt () {
+ checkifroot
+ setjobs
+}
+
+reset () {
+ checkifroot
+ dopurge
+}
+
+setup () {
+ checkifroot
+ dopurge
+ doinject
+ dosetup
+}
diff --git a/src/frontend/cli/vasile.sh b/src/frontend/cli/vasile.sh
index 5f3f8d2..4282b36 100755
--- a/src/frontend/cli/vasile.sh
+++ b/src/frontend/cli/vasile.sh
@@ -21,6 +21,9 @@ case $1 in
--makeiso)
makeiso
;;
+ --adapt)
+ adapt
+ ;;
--reset)
reset
;;