Commits

Eric Dowd  committed 48eb3e7

Fixed makeopts.start

  • Participants
  • Parent commits f3e0e54

Comments (0)

Files changed (1)

File remote_gentoo.sh

 cat <<'EOF'>/mnt/gentoo/etc/local.d/makeopts.start
 # /etc/local.d/makeopts.start
 
+LAST_PROCESSOR="`grep "^processor" /proc/cpuinfo | tail -n 1`"
+CORES="`echo $LAST_PROCESSOR | awk '{ print $3 + 1 }'`"
+THREADS="`echo $LAST_PROCESSOR | awk '{ print $3 + 2 }'`"
 cp /etc/portage/make.conf /etc/portage/make.conf.orig
 sed \
--e "s/MAKEOPTS=.*/MAKEOPTS=\"-j`grep "^processor" /proc/cpuinfo | awk '{ print $3 + 2 }'`\"/g" \
+-e "s/MAKEOPTS=.*/MAKEOPTS=\"-j${THREADS}\"/g" \
 /etc/portage/make.conf.orig \
 | sed \
--e "s/EMERGE_DEFAULT_OPTS=.*/EMERGE_DEFAULT_OPTS=\"--jobs=`grep "^processor" /proc/cpuinfo | awk '{ print $3 + 1 }'` --load-average=`grep "^processor" /proc/cpuinfo | awk '{ print $3 + 2 }'`.0\"/g" \
+-e "s/EMERGE_DEFAULT_OPTS=.*/EMERGE_DEFAULT_OPTS=\"--jobs=${CORES} --load-average=${THREADS}.0\"/g" \
 > /etc/portage/make.conf
 EOF
     chmod 755 /mnt/gentoo/etc/local.d/makeopts.start