ucode-intel/ucode-intel.spec
Thomas Renninger 46cd6918d1 - mkinitrd scripts:
- mkinitrd_setup-intel_microcode.sh
      Adding microcode to the initrd
    - mkinitrd_boot-intel_microcode.sh
      Triggering the reload at boot

OBS-URL: https://build.opensuse.org/package/show/Base:System/ucode-intel?expand=0&rev=12
2013-12-06 11:10:31 +00:00

78 lines
2.7 KiB
RPMSpec

#
# spec file for package ucode-intel
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ucode-intel
Version: 20130906
Release: 0
Summary: Microcode Updates for Intel x86/x86-64 CPUs
License: SUSE-Firmware
Group: Hardware/Other
#License is: Intel Software License Agreement
Url: http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=22508&keyword=Microcode&lang=eng
Source0: microcode-%{version}.tgz
Source1: intel-microcode2ucode.c
Source2: LICENSE
Source3: mkinitrd_setup-intel_microcode.sh
Source4: mkinitrd_boot-intel_microcode.sh
Supplements: modalias(x86cpu:vendor%3A0000%3Afamily%3A*%3Amodel%3A*%3Afeature%3A*)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64
%description
This package contains the microcode update blobs for Intel x86 and x86-64 CPUs.
%prep
%setup -q -c intel-ucode
cp %{SOURCE2} .
%build
%{__cc} -fwhole-program %{optflags} %{SOURCE1} -o generate_microcode
./generate_microcode microcode.dat
%install
install -D -m 0755 %{SOURCE3} %{buildroot}/lib/mkinitrd/scripts/setup-intel_microcode.sh
install -D -m 0755 %{SOURCE4} %{buildroot}/lib/mkinitrd/scripts/boot-intel_microcode.sh
install -D -m 0755 generate_microcode %{buildroot}%{_bindir}/generate_microcode
for file in intel-ucode/*; do
install -D -m 0644 $file %{buildroot}/lib/firmware/$file
done
%post
#if this fails, the user must either reboot or reload manually.
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
test -f /sys/devices/system/cpu/microcode/reload && /bin/echo 1 > /sys/devices/system/cpu/microcode/reload || exit 0
%files
%defattr(-,root,root)
%doc LICENSE
%{_bindir}/generate_microcode
/lib/firmware/intel-ucode/
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/setup-intel_microcode.sh
/lib/mkinitrd/scripts/boot-intel_microcode.sh
%changelog