summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2018-03-15 14:49:04 -0400
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2018-03-15 14:49:04 -0400
commit4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a (patch)
treea0fd218b0472a33d9c4ab471c9b3a5e2004bb84f
parentadd secureconsole boot option (diff)
downloadlivecd-tools-4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a.tar.gz
livecd-tools-4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a.tar.bz2
livecd-tools-4afe3e67f65cd7e1cf910b02c25fb0bb6dbc0a1a.zip
add some comments when writing make.conf
decrease ambiguity with some comments
-rw-r--r--init.d/autoconfig12
1 files changed, 9 insertions, 3 deletions
diff --git a/init.d/autoconfig b/init.d/autoconfig
index 848a102..fd68011 100644
--- a/init.d/autoconfig
+++ b/init.d/autoconfig
@@ -382,6 +382,12 @@ detect_netdevices() {
return 0
}
+write_emerge_default_opts() {
+ printf "\n# EMERGE_DEFAULT_OPTS is set automatically by livecd-tools autoconfig during first live boot.\n" >> $1
+ printf "# This should be equal to number of processors, see \"man emerge\" for details.\n" >> $1
+ printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> $1
+}
+
start() {
ebegin "Starting autoconfig"
echo "0" > /proc/sys/kernel/printk
@@ -392,13 +398,13 @@ start() {
ebegin "Setting sane defaults in /etc/portage/make.conf"
if [ -f "/etc/portage/make.conf" ] && checkpath -W /etc/portage/make.conf; then
if ! grep -q 'EMERGE_DEFAULT_OPTS=.*--jobs' /etc/portage/make.conf; then
- printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf
+ write_emerge_default_opts /etc/portage/make.conf
fi
elif [ ! -f "/etc/portage/make.conf" ] && [ ! -d "/etc/portage/make.conf" ] && checkpath -W /etc/portage; then
- printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf
+ write_emerge_default_opts /etc/portage/make.conf
elif [ -d "/etc/portage/make.conf" ]; then
if [ ! -f "/etc/portage/make.conf/livecd-tools-autoconfig" ] && checkpath -W /etc/portage/make.conf/livecd-tools-autoconfig; then
- printf "EMERGE_DEFAULT_OPTS=\"\${EMERGE_DEFAULT_OPTS} --jobs=${numcpu} --load-average=${numcpu}\"\n" >> /etc/portage/make.conf/livecd-tools-autoconfig
+ write_emerge_default_opts /etc/portage/make.conf/livecd-tools-autoconfig
fi
else
false