From a2fb2688e75aa91a80d62df5d2df37cea30562d2 2019-10-24 22:42:01 From: Unknown Date: 2019-10-24 22:42:01 Subject: [PATCH] a --- diff --git a/functions.sh b/functions.sh index d0dd854..5e37c0d 100644 --- a/functions.sh +++ b/functions.sh @@ -75,14 +75,14 @@ chroot_install_cc() { if [ -z "${COMPILER_PACKAGES}" ] ; then COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }') # Install COMPILER_PACKAGES in chroot - NEVER do "${COMPILER_PACKAGES}" -> breaks uboot - chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES} + chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install "${COMPILER_PACKAGES}" fi } chroot_remove_cc() { # Remove c/c++ build environment from the chroot if [ -n "${COMPILER_PACKAGES}" ] ; then - chroot_exec apt-get -qq -y --auto-remove purge ${COMPILER_PACKAGES} + chroot_exec apt-get -qq -y --auto-remove purge "${COMPILER_PACKAGES}" COMPILER_PACKAGES="" fi } @@ -92,8 +92,8 @@ cdr2mask () { # Number of args to shift, 255..255, first non-255 byte, zeroes set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0 - [ $1 -gt 1 ] && shift $1 || shift - echo ${1-0}.${2-0}.${3-0}.${4-0} + [ "$1" -gt 1 ] && shift "$1" || shift + echo "${1-0}"."${2-0}"."${3-0}"."${4-0}" } # GPL v2.0 - #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh @@ -101,7 +101,7 @@ set_kernel_config() { # flag as $1, value to set as $2, config must exist at "./.config" TGT="CONFIG_${1#CONFIG_}" REP="${2}" - if [ grep -q "^${TGT}[^_]" .config ] ; then + if grep -q "^${TGT}[^_]" .config ; then sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" .config else echo "${TGT}"="${2}" >> .config