Skip to content

Commit

Permalink
Script modified to deal with crontab usage.
Browse files Browse the repository at this point in the history
Specifically, dealing with the case where TERM set to 'dumb'
or unset (causes tput to fail); also exporting variables
necessary for build.
Version moved to 1.0.3
  • Loading branch information
sakaki- committed Jul 27, 2014
1 parent 786b3e5 commit 05044fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions buildkernel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ shopt -s nullglob
# ********************** variables *********************
PROGNAME="$(basename "${0}")"
CONFFILE="/etc/${PROGNAME}.conf"
VERSION="1.0.2"
VERSION="1.0.3"
DEFAULTEFIBOOTFILE="bootx64.efi"
EFIBOOTFILE="${DEFAULTEFIBOOTFILE}"
NEWVERSION="$(basename $(realpath "/usr/src/linux"))"
Expand Down Expand Up @@ -67,15 +67,20 @@ CMDLINE_REAL_RESUME="/dev/mapper/vg1-swap"
# you can use xconfig etc if you like - override in /etc/buildkernel.conf
CONFIGTYPE="menuconfig"
# following should already be in the environment; but to be safe...
NUMCPUS=$(grep -E 'processor\s+:' /proc/cpuinfo | wc -l)
NUMCPUSPLUSONE=$(( NUMCPUS + 1 ))
export NUMCPUS=$(grep -E 'processor\s+:' /proc/cpuinfo | wc -l)
export NUMCPUSPLUSONE=$(( NUMCPUS + 1 ))
export MAKEOPTS="${MAKEOPTS--j${NUMCPUSPLUSONE} -l${NUMCPUS}}"
export EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS---jobs=${NUMCPUSPLUSONE} --load-average=${NUMCPUS}}"
# below silently updates an old config, auto-choosing defaults for new values
CONFIGUPDATETYPE="olddefconfig"
SILENTUPDATETYPE="olddefconfig"
RED_TEXT="$(tput setaf 1)$(tput bold)"
GREEN_TEXT="$(tput setaf 2)$(tput bold)"
YELLOW_TEXT="$(tput setaf 3)$(tput bold)"
RESET_ATTS="$(tput sgr0)"
RED_TEXT="" GREEN_TEXT="" YELLOW_TEXT="" RESET_ATTS=""
if [[ -v TERM && -n "${TERM}" && "${TERM}" != "dumb" ]]; then
RED_TEXT="$(tput setaf 1)$(tput bold)"
GREEN_TEXT="$(tput setaf 2)$(tput bold)"
YELLOW_TEXT="$(tput setaf 3)$(tput bold)"
RESET_ATTS="$(tput sgr0)"
fi
# used in subshells
UNCOMPRESSEDINITRAMFS="${BOOTDIR}/initramfs.cpio"
INITRAMFSDIR="${BOOTDIR}/initramfs"
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 8 "Version 1.0.2: July 2014"
.TH BUILDKERNEL 8 "Version 1.0.3: July 2014"
.SH NAME
buildkernel \- build secure boot kernel, save to EFI system partition
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.conf.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 5 "Version 1.0.2: July 2014"
.TH BUILDKERNEL 5 "Version 1.0.3: July 2014"
.SH NAME
buildkernel.conf \- a configuration file for \fBbuildkernel\fR(8)
.SH SYNOPSIS
Expand Down

0 comments on commit 05044fb

Please sign in to comment.