Changeset 764


Ignore:
Timestamp:
Jul 4, 2016, 11:27:28 PM (3 years ago)
Author:
ehem
Message:

Fix build issue with dash update?

It was /supposed/ to do filename expansion at this one point, did it
recieve inadaquate testing before, or did a newer dash really break
pathname expansion at the one point?!

Make sure many error messages go to stderr instead of stdout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/debian/linux-image/build.sh

    r719 r764  
    2525if ! [ -f "${basedir}/configs/${device}.vars" ]
    2626then
    27         echo $0\: error\: device \"${device}\" is unsupported
     27        echo $0\: error\: device \"${device}\" is unsupported 1>&2
    2828        exit 1
    2929fi
     
    3232if ! which make-kpkg > /dev/null
    3333then
    34         echo $0\: kernel-package is absent, please install the package \"kernel-package\"
     34        echo $0\: kernel-package is absent, please install the package \"kernel-package\" 1>&2
    3535        exit 1
    3636fi
     
    5353if dpkg --compare-versions "${kpkg_rev}" lt "${min_kpkg}"
    5454then
    55         echo $0\: installed version of kernel-package \("${kpkg_rev}"\) is too old, need at least version "${min_kpkg}" to build
    56         exit 1
    57 fi
    58 
    59 kernsrc="/usr/src/linux-source-${linuxver}.tar.*"
     55        echo $0\: installed version of kernel-package \("${kpkg_rev}"\) is too old, need at least version "${min_kpkg}" to build 1>&2
     56        exit 1
     57fi
     58
     59kernsrc="/usr/src/linux-source-${linuxver}.tar."*
     60# WTF! pathname expansion *isn't* happening above?!
     61kernsrc=`echo ${kernsrc}`
    6062
    6163archfull=`dpkg-architecture "-a${arch}" -qDEB_HOST_MULTIARCH`
     
    6769if ! which ${CC} > /dev/null
    6870then
    69         echo $0\: GCC for architecture \"${arch}\" not found, please install package c-compiler\:${arch} or c-compiler-${archfull}
     71        echo $0\: GCC for architecture \"${arch}\" not found, please install package c-compiler\:${arch} or c-compiler-${archfull} 1>&2
    7072        fail=64
    7173fi
     
    7375if ! [ -f "${kernsrc}" ]
    7476then
    75         echo $0\: Linux kernel source for version ${linuxver} is absent, please install package linux-source-${linuxver}
     77        echo $0\: Linux kernel source for version ${linuxver} is absent, please install package linux-source-${linuxver} 1>&2
    7678        fail=64
    7779fi
     
    8183        if ! [ -d /usr/src/${patch} ]
    8284        then
    83                 echo $0\: Linux patch \"${patch}\" for kernel version ${linuxver} is absent, please install ${patch}
     85                echo $0\: Linux patch \"${patch}\" for kernel version ${linuxver} is absent, please install ${patch} 1>&2
    8486                fail=64
    8587        elif ! [ -d /usr/src/${patch}/patches-${linuxver} ]
    8688        then
    87                 echo $0\: Linux patch \"${patch}\" for kernel version ${linuxvar} is absent, please install a version of ${patch}, which includes Linux ${linuxvar} support
     89                echo $0\: Linux patch \"${patch}\" for kernel version ${linuxvar} is absent, please install a version of ${patch}, which includes Linux ${linuxvar} support 1>&2
    8890                fail=64
    8991        fi
     
    9496        if ! [ -f /usr/src/${mod}.tar.bz2 ]
    9597        then
    96                 echo $0\: Linux module \"${mod}\" is absent, please install package
     98                echo $0\: Linux module \"${mod}\" is absent, please install package 1>&2
    9799                fail=64
    98100        fi
     
    117119        rm -rf "${linuxdir}"
    118120        case "${kernsrc}" in
    119         *.xz)
     121        (*.xz)
    120122                unpack="unxz -c"
    121123        ;;
    122         *.bz2)
     124        (*.bz2)
    123125                unpack="bunzip2 -c"
    124126        ;;
    125         *.gz)
     127        (*.gz)
    126128                unpack="gunzip -c"
    127129        ;;
     130        (*)
     131                echo $0: Fatal, don\'t know how to unpack file \""${kernsrc}"\" 1>&2
     132                exit 64
     133        ;;
    128134        esac
    129         echo ${unpack} \| tar -C \""${DEBIAN_BUILD_DIR}"\" -xf \""${kernsrc}"\"
    130         ${unpack} | tar -C "${DEBIAN_BUILD_DIR}" -xf "${kernsrc}"
     135        echo ${unpack} \""${kernsrc}"\" \| tar -C \""${DEBIAN_BUILD_DIR}"\" -xf -
     136        ${unpack} "${kernsrc}" | tar -C "${DEBIAN_BUILD_DIR}" -xf -
    131137fi
    132138
     
    205211if ! yes "" 2>/dev/null | MODULE_LOC="${linuxdir}/modules" make-kpkg --config config --arch "${arch}" --stem linux-debwrt --initrd --append_to_version "-${device}${EXTRAEXTRAVERSION}" --revision "${revision}" --cross-compile "${archfull}-" kernel_image modules_image kernel_headers
    206212then
    207         echo ; echo Kernel build failed\!
     213        echo ; echo Kernel build failed\! 1>&2
    208214        exit 1
    209215fi
     
    219225if ! mv -t "${INSTALL_DIR_DEBIAN_PACKAGES}" ${packages} > /dev/null 2>&1
    220226then
    221         echo ; echo Output files missing, did kernel build fail\?
     227        echo ; echo Output files missing, did kernel build fail\? 1>&2
    222228        exit 1
    223229fi
Note: See TracChangeset for help on using the changeset viewer.