~ubuntu-branches/ubuntu/utopic/intel-microcode/utopic

« back to all changes in this revision

Viewing changes to debian/initramfs.hook

  • Committer: Package Import Robot
  • Author(s): Henrique de Moraes Holschuh
  • Date: 2013-06-20 22:07:04 UTC
  • mfrom: (3.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20130620220704-pz70lwb8c7v212ks
Tags: 1.20130222.4
initramfs: fix xargs error when iucode-tool is not installed
in the early firmware update mode code path (closes: #712943)

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        no|0)
57
57
            exit 0
58
58
            ;;
59
 
        auto|yes|early|1)
 
59
        auto)
 
60
            # auto mode, simplistic because short of grepping the kernel config, there is no
 
61
            # way to detect whether early firmware updates are supported or not
 
62
            if [ "${IUCODE_TOOL_INITRAMFS}" = "auto" ] ; then
 
63
                if $(dpkg --compare-versions 3.9 le ${version}) ; then
 
64
                        IUCODE_TOOL_INITRAMFS=early
 
65
                else
 
66
                        IUCODE_TOOL_INITRAMFS=yes
 
67
                fi
 
68
            fi
 
69
            ;;
 
70
        yes|early|1)
60
71
            ;;
61
72
        *)
62
73
            echo "E: intel-microcode: invalid IUCODE_TOOL_INITRAMFS, using auto mode" >&2
88
99
        fi
89
100
fi
90
101
 
91
 
# auto mode, simplistic because short of grepping the kernel config, there is no
92
 
# way to detect whether early firmware updates are supported or not
93
 
if [ "${IUCODE_TOOL_INITRAMFS}" = "auto" ] ; then
94
 
        if $(dpkg --compare-versions 3.9 le ${version}) ; then
95
 
                IUCODE_TOOL_INITRAMFS=early
96
 
        else
97
 
                IUCODE_TOOL_INITRAMFS=yes
98
 
        fi
99
 
fi
100
 
 
101
102
# try early initramfs first, so that we can fallback to standard initramfs
102
 
if [ "${IUCODE_TOOL_INITRAMFS}" = "early" ] ; then
 
103
if [ ! -z "${IUCODE_TOOL}" ] && [ "${IUCODE_TOOL_INITRAMFS}" = "early" ] ; then
103
104
        # generate early firmware image and prepend
104
105
        verbose "Using early firmware update mode (Linux v3.9 and later)..."
105
106
        EFW=$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-EFW_XXXXXXXXXX") || {
131
132
# Generate firmware dir
132
133
mkdir -m 755 -p "${DESTDIR}${IUCODE_FW_DIR}"
133
134
 
134
 
if [ -x "${IUCODE_TOOL}" ] ; then
 
135
if [ ! -z "${IUCODE_TOOL}" ] ; then
135
136
        ( find /usr/share/misc -maxdepth 1 -type f -name 'intel-microcode*' -print0 ;
136
137
          find "${IUCODE_FW_DIR}" -maxdepth 0 -type d -print0 ) 2>/dev/null | \
137
138
                xargs -0 -r -x \