4a0bea
%define upstream_version 2.1-13
4a0bea
4a0bea
Summary:        Tool to transform and deploy CPU microcode update for x86.
4a0bea
Name:           microcode_ctl
4a0bea
Version:        2.1
4a0bea
Release:        23.3.atomic%{?dist}
4a0bea
Epoch:          2
4a0bea
Group:          System Environment/Base
4a0bea
License:        GPLv2+ and Redistributable, no modification permitted
4a0bea
URL:            http://fedorahosted.org/microcode_ctl
4a0bea
Source0:        http://fedorahosted.org/released/microcode_ctl/%{name}-%{upstream_version}.tar.xz
4a0bea
Source1:        microcode.service
4a0bea
Source2:        01-microcode.conf
4a0bea
Source3:        06-3f-02
4a0bea
Source4:        06-4f-01
4a0bea
Source5:        06-55-04
4a0bea
Buildroot:      %{_tmppath}/%{name}-%{version}-root
4a0bea
ExclusiveArch:  %{ix86} x86_64
4a0bea
BuildRequires:  systemd-units
4a0bea
Requires(post): systemd
4a0bea
Requires(preun): systemd
4a0bea
Requires(postun): systemd
4a0bea
Requires(posttrans): kernel
4a0bea
4a0bea
%description
4a0bea
The microcode_ctl utility is a companion to the microcode driver written
4a0bea
by Tigran Aivazian <tigran@aivazian.fsnet.co.uk>.
4a0bea
4a0bea
The microcode update is volatile and needs to be uploaded on each system
4a0bea
boot i.e. it doesn't reflash your cpu permanently, reboot and it reverts
4a0bea
back to the old microcode.
4a0bea
4a0bea
%prep
4a0bea
%setup -q -n %{name}-%{upstream_version}
4a0bea
4a0bea
%build
4a0bea
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
4a0bea
4a0bea
%install
4a0bea
rm -rf %{buildroot}
4a0bea
make DESTDIR=%{buildroot} PREFIX=%{_prefix} INSDIR=/usr/sbin install clean
4a0bea
4a0bea
mkdir -p %{buildroot}/usr/lib/dracut/dracut.conf.d
4a0bea
mkdir -p %{buildroot}%{_unitdir}
4a0bea
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
4a0bea
install -m 644 %{SOURCE2} %{buildroot}/usr/lib/dracut/dracut.conf.d
4a0bea
install -m 644 %{SOURCE3} %{buildroot}/lib/firmware/intel-ucode
4a0bea
install -m 644 %{SOURCE4} %{buildroot}/lib/firmware/intel-ucode
4a0bea
install -m 644 %{SOURCE5} %{buildroot}/lib/firmware/intel-ucode
4a0bea
4a0bea
%post
4a0bea
%systemd_post microcode.service
4a0bea
# "reload" file is not presented on a certain virtualized hw
4a0bea
if [ -w /sys/devices/system/cpu/microcode/reload ] ; then
4a0bea
	grep -l GenuineIntel /proc/cpuinfo | xargs grep -l -E "model[[:space:]]*: 79$" > /dev/null || \
4a0bea
	echo 1 > /sys/devices/system/cpu/microcode/reload
4a0bea
fi
4a0bea
4a0bea
%posttrans
4a0bea
# We only want to regenerate the initramfs for a fully booted
4a0bea
# system; if this package happened to e.g. be pulled in as a build
4a0bea
# dependency, it is pointless at best to regenerate the initramfs,
4a0bea
# and also does not work with rpm-ostree:
4a0bea
# https://bugzilla.redhat.com/show_bug.cgi?id=1199582
4a0bea
if [ -d /run/systemd/system ]; then
4a0bea
   dracut -f
4a0bea
fi
4a0bea
4a0bea
%preun
4a0bea
%systemd_preun microcode.service
4a0bea
4a0bea
%postun
4a0bea
%systemd_postun microcode.service
4a0bea
4a0bea
%clean
4a0bea
rm -rf %{buildroot}
4a0bea
4a0bea
%files
4a0bea
/usr/sbin/intel-microcode2ucode
4a0bea
/lib/firmware/*
4a0bea
%config(noreplace) /usr/lib/dracut/dracut.conf.d/01-microcode.conf
4a0bea
%{_unitdir}/microcode.service
4a0bea
%doc /usr/share/doc/microcode_ctl/*
4a0bea
4a0bea
4a0bea
%changelog
4a0bea
* Wed Jan 03 2018 Colin Walters <walters@redhat.com> - 2:2.1-23.3.atomic
4a0bea
- Apply patch for use in Atomic Host builds; also disables
4a0bea
  initramfs regeneration when systemd is not running (e.g. mock buildroots)
4a0bea
- Resolves: #1530400
4a0bea
4a0bea
* Fri Dec 15 2017 Petr Oros <poros@redhat.com> - 2.1-22.2
4a0bea
- Update Intel CPU microde for 06-3f-02, 06-4f-01, and 06-55-04
4a0bea
- Resolves: #1527358
4a0bea
4a0bea
* Tue Jul 25 2017 Petr Oros <poros@redhat.com> - 2.1-22.1
4a0bea
- Update to upstream 2.1-13. Intel CPU microcode update to 20170707.
4a0bea
- Resolves: #1474844
4a0bea
4a0bea
* Wed May 24 2017 Petr Oros <poros@redhat.com> - 2.1-22
4a0bea
- Update to upstream 2.1-12. Intel CPU microcode update to 20170511.
4a0bea
- Resolves: #1384218
4a0bea
4a0bea
* Tue Mar 7 2017 Petr Oros <poros@redhat.com> - 2.1-21
4a0bea
- Rpm scriptlets should only rebuild the current kernel's initrd.
4a0bea
- Resolves: #1420180
4a0bea
4a0bea
* Wed Jan 18 2017 Petr Oros <poros@redhat.com> - 2.1-20
4a0bea
- Fix issue with hot microcode cpu reload.
4a0bea
- Resolves: #1411232
4a0bea
4a0bea
* Mon Jan 9 2017 Petr Oros <poros@redhat.com> - 2.1-19
4a0bea
- Fix broken quoting in ExecStart line.
4a0bea
- Resolves: #1411232
4a0bea
4a0bea
* Fri Dec 16 2016 Petr Oros <poros@redhat.com> - 2.1-18
4a0bea
- Fix issue with hot microcode cpu reload.
4a0bea
- Resolves: #1398698
4a0bea
4a0bea
* Wed Nov 30 2016 Petr Oros <poros@redhat.com> - 2.1-17
4a0bea
- Move dracut call into posttrans phase.
4a0bea
- Resolves: #1398698
4a0bea
4a0bea
* Thu Jul 21 2016 Petr Oros <poros@redhat.com> - 2.1-16
4a0bea
- Update to upstream 2.1-10. Intel CPU microcode update to 20160714.
4a0bea
- Resolves: #1358047
4a0bea
4a0bea
* Wed Jun 29 2016 Petr Oros <poros@redhat.com> - 2.1-15
4a0bea
- Load CPU microcode update only on supproted systems.
4a0bea
- Resolves: #1307179
4a0bea
4a0bea
* Fri Jun 24 2016 Petr Oros <poros@redhat.com> - 2.1-14
4a0bea
- Update to upstream 2.1-9. Intel CPU microcode update to 20160607.
4a0bea
- Resolves: #1253106
4a0bea
4a0bea
* Thu May 19 2016 Petr Oros <poros@redhat.com> - 2.1-13
4a0bea
- Run dracut -f for all kernels.
4a0bea
- Resolves: #1292158
4a0bea
4a0bea
* Fri Jul 3 2015 Petr Oros <poros@redhat.com> - 2.1-12
4a0bea
- Update to upstream 2.1-7. Intel CPU microcode update to 20150121.
4a0bea
- Resolves: #1174983
4a0bea
4a0bea
* Fri Oct 10 2014 Petr Oros <poros@redhat.com> - 2.1-11
4a0bea
- Run dracut -f after install microcode for update initramfs.
4a0bea
- Resolves: #1151192
4a0bea
4a0bea
* Tue Sep 30 2014 Petr Oros <poros@redhat.com> - 2.1-10
4a0bea
- Update to upstream 2.1-6. Intel CPU microcode update to 20140913.
4a0bea
- Resolves: #1142302
4a0bea
4a0bea
* Tue Jul 15 2014 Petr Oros <poros@redhat.com> - 2.1-9
4a0bea
- Update to upstream 2.1-5. Intel CPU microcode update to 20140624.
4a0bea
- Resolves: #1113396
4a0bea
4a0bea
* Tue Jun 3 2014 Petr Oros <poros@redhat.com> - 2.1-8
4a0bea
- Fix bogus time in changelog
4a0bea
- Resolves: #1085117
4a0bea
4a0bea
* Tue Jun 3 2014 Petr Oros <poros@redhat.com> - 2.1-8
4a0bea
- Update to upstream 2.1-4. Intel CPU microcode update to 20140430.
4a0bea
- Resolves: #1085117
4a0bea
4a0bea
* Wed Mar 12 2014 Anton Arapov <anton@redhat.com> - 2.1-7.1
4a0bea
- Fix the microcode's behaviour in virtual environment.
4a0bea
4a0bea
* Fri Feb 28 2014 Anton Arapov <anton@redhat.com> - 2.1-7
4a0bea
- Fix the microcode's dracut configuration file location. 
4a0bea
4a0bea
* Tue Feb 18 2014 Anton Arapov <anton@redhat.com> - 2.1-6
4a0bea
- Enable early microcode capabilities. Systemd and Dracut support. (Jeff Bastian)
4a0bea
4a0bea
* Fri Jan 24 2014 Anton Arapov <anton@redhat.com> - 2.1-5
4a0bea
- Update to upstream 2.1-3. Intel CPU microcode update to 20140122.
4a0bea
4a0bea
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2:2.1-4
4a0bea
- Mass rebuild 2013-12-27
4a0bea
4a0bea
* Mon Sep 09 2013 Anton Arapov <anton@redhat.com> 2.1-3
4a0bea
- Imported to RHEL tree
4a0bea
4a0bea
* Mon Sep 09 2013 Anton Arapov <anton@redhat.com> 2.1-2
4a0bea
- Update to upstream 2.1-2.
4a0bea
4a0bea
* Wed Aug 14 2013 Anton Arapov <anton@redhat.com> 2.1-1
4a0bea
- Update to upstream 2.1-1.
4a0bea
4a0bea
* Sat Jul 27 2013 Anton Arapov <anton@redhat.com> 2.1-0
4a0bea
- Update to upstream 2.1. AMD microcode has been removed, find it in linux-firmware.
4a0bea
4a0bea
* Wed Apr 03 2013 Anton Arapov <anton@redhat.com> 2.0-3.1
4a0bea
- Update to upstream 2.0-3
4a0bea
4a0bea
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2:2.0-3
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4a0bea
4a0bea
* Wed Oct 17 2012 Anton Arapov <anton@redhat.com> 2.0-2
4a0bea
- Update to upstream 2.0-2
4a0bea
4a0bea
* Tue Oct 02 2012 Anton Arapov <anton@redhat.com> 2.0-1
4a0bea
- Update to upstream 2.0-1
4a0bea
4a0bea
* Mon Aug 06 2012 Anton Arapov <anton@redhat.com> 2.0
4a0bea
- Update to upstream 2.0
4a0bea
4a0bea
* Wed Jul 25 2012 Anton Arapov <anton@redhat.com> 1.18-1
4a0bea
- Update to upstream 1.18
4a0bea
4a0bea
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-26
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4a0bea
4a0bea
* Thu Jun 07 2012 Anton Arapov <anton@redhat.com> 1.17-25
4a0bea
- Update to microcode-20120606.dat
4a0bea
4a0bea
* Tue Feb 07 2012 Anton Arapov <anton@redhat.com> 1.17-24
4a0bea
- Update to amd-ucode-2012-01-17.tar
4a0bea
4a0bea
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-22
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4a0bea
4a0bea
* Thu Dec 22 2011 Anton Arapov <anton@redhat.com> 1.17-21
4a0bea
- Fix a segfault that may be triggered by very long parameter [#768803]
4a0bea
4a0bea
* Tue Dec 13 2011 Anton Arapov <anton@redhat.com> 1.17-20
4a0bea
- Update to microcode-20111110.dat
4a0bea
4a0bea
* Tue Sep 27 2011 Anton Arapov <anton@redhat.com> 1.17-19
4a0bea
- Update to microcode-20110915.dat
4a0bea
4a0bea
* Thu Aug 04 2011 Anton Arapov <anton@redhat.com> 1.17-18
4a0bea
- Ship splitted microcode for Intel CPUs [#690930]
4a0bea
- Include tool for splitting microcode for Intl CPUs (Kay Sievers )
4a0bea
4a0bea
* Thu Jun 30 2011 Anton Arapov <anton@redhat.com> 1.17-17
4a0bea
- Fix udev rules (Dave Jones ) [#690930]
4a0bea
4a0bea
* Thu May 12 2011 Anton Arapov <anton@redhat.com> 1.17-14
4a0bea
- Update to microcode-20110428.dat
4a0bea
4a0bea
* Thu Mar 24 2011 Anton Arapov <anton@redhat.com> 1.17-13
4a0bea
- fix memory leak.
4a0bea
4a0bea
* Mon Mar 07 2011 Anton Arapov <anton@redhat.com> 1.17-12
4a0bea
- Update to amd-ucode-2011-01-11.tar
4a0bea
4a0bea
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-11
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4a0bea
4a0bea
* Wed Jan 19 2011 Anton Arapov <anton@redhat.com> 1.17-10
4a0bea
- manpage fix (John Bradshaw ) [#670879]
4a0bea
4a0bea
* Wed Jan 05 2011 Anton Arapov <anton@redhat.com> 1.17-9
4a0bea
- Update to microcode-20101123.dat
4a0bea
4a0bea
* Mon Nov 01 2010 Anton Arapov <anton@redhat.com> 1.17-8
4a0bea
- Update to microcode-20100914.dat
4a0bea
4a0bea
* Wed Sep 29 2010 jkeating - 1:1.17-7
4a0bea
- Rebuilt for gcc bug 634757
4a0bea
4a0bea
* Wed Sep 15 2010 Anton Arapov <anton@redhat.com> 1.17-6
4a0bea
- Update to microcode-20100826.dat
4a0bea
4a0bea
* Tue Sep 07 2010 Toshio Kuratomi <toshio@fedoraproject.org> 1.17-5
4a0bea
- Fix license tag: bz#450491
4a0bea
4a0bea
* Fri Aug 27 2010 Dave Jones <davej@redhat.com> 1.17-4
4a0bea
- Update to microcode-20100826.dat
4a0bea
4a0bea
* Tue Mar 23 2010 Anton Arapov <anton@redhat.com> 1.17-3
4a0bea
- Fix the udev rules (Harald Hoyer )
4a0bea
4a0bea
* Mon Mar 22 2010 Anton Arapov <anton@redhat.com> 1.17-2
4a0bea
- Make microcode_ctl event driven (Bill Nottingham ) [#479898]
4a0bea
4a0bea
* Thu Feb 11 2010 Dave Jones <davej@redhat.com> 1.17-1.58
4a0bea
- Update to microcode-20100209.dat
4a0bea
4a0bea
* Fri Dec 04 2009 Kyle McMartin <kyle@redhat.com> 1.17-1.57
4a0bea
- Fix duplicate message pointed out by Edward Sheldrake.
4a0bea
4a0bea
* Wed Dec 02 2009 Kyle McMartin <kyle@redhat.com> 1.17-1.56
4a0bea
- Add AMD x86/x86-64 microcode. (Dated: 2009-10-09)
4a0bea
  Doesn't need microcode_ctl modifications as it's loaded by
4a0bea
  request_firmware() like any other sensible driver.
4a0bea
- Eventually, this AMD firmware can probably live inside
4a0bea
  kernel-firmware once it is split out.
4a0bea
4a0bea
* Wed Sep 30 2009 Dave Jones <davej@redhat.com>
4a0bea
- Update to microcode-20090927.dat
4a0bea
4a0bea
* Fri Sep 11 2009 Dave Jones <davej@redhat.com>
4a0bea
- Remove some unnecessary code from the init script.
4a0bea
4a0bea
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-1.52.1
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
4a0bea
4a0bea
* Thu Jun 25 2009 Dave Jones <davej@redhat.com>
4a0bea
- Shorten sleep time during init.
4a0bea
  This really needs to be replaced with proper udev hooks, but this is
4a0bea
  a quick interim fix.
4a0bea
4a0bea
* Wed Jun 03 2009 Kyle McMartin <kyle@redhat.com> 1:1.17-1.50
4a0bea
- Change ExclusiveArch to i586 instead of i386. Resolves rhbz#497711.
4a0bea
4a0bea
* Wed May 13 2009 Dave Jones <davej@redhat.com>
4a0bea
- update to microcode 20090330
4a0bea
4a0bea
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-1.46.1
4a0bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
4a0bea
4a0bea
* Fri Sep 12 2008 Dave Jones <davej@redhat.com>
4a0bea
- update to microcode 20080910
4a0bea
4a0bea
* Tue Apr 01 2008 Jarod Wilson <jwilson@redhat.com>
4a0bea
- Update to microcode 20080401
4a0bea
4a0bea
* Sat Mar 29 2008 Dave Jones <davej@redhat.com>
4a0bea
- Update to microcode 20080220
4a0bea
- Fix rpmlint warnings in specfile.
4a0bea
4a0bea
* Mon Mar 17 2008 Dave Jones <davej@redhat.com>
4a0bea
- specfile cleanups.
4a0bea
4a0bea
* Fri Feb 22 2008 Jarod Wilson <jwilson@redhat.com>
4a0bea
- Use /lib/firmware instead of /etc/firmware
4a0bea
4a0bea
* Wed Feb 13 2008 Jarod Wilson <jwilson@redhat.com>
4a0bea
- Fix permissions on microcode.dat
4a0bea
4a0bea
* Thu Feb 07 2008 Jarod Wilson <jwilson@redhat.com>
4a0bea
- Spec cleanup and macro standardization.
4a0bea
- Update license
4a0bea
- Update microcode data file to 20080131 revision.
4a0bea
4a0bea
* Mon Jul  2 2007 Dave Jones <davej@redhat.com>
4a0bea
- Update to upstream 1.17
4a0bea
4a0bea
* Thu Oct 12 2006 Jon Masters <jcm@redhat.com>
4a0bea
- BZ209455 fixes.
4a0bea
4a0bea
* Mon Jul 17 2006 Jesse Keating <jkeating@redhat.com>
4a0bea
- rebuild
4a0bea
4a0bea
* Fri Jun 16 2006 Bill Nottingham <notting@redhat.com>
4a0bea
- remove kudzu requirement
4a0bea
- add prereq for coreutils, awk, grep
4a0bea
4a0bea
* Thu Feb 09 2006 Dave Jones <davej@redhat.com>
4a0bea
- rebuild.
4a0bea
4a0bea
* Fri Jan 27 2006 Dave Jones <davej@redhat.com>
4a0bea
- Update to upstream 1.13
4a0bea
4a0bea
* Fri Dec 16 2005 Jesse Keating <jkeating@redhat.com>
4a0bea
- rebuilt for new gcj
4a0bea
4a0bea
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
4a0bea
- rebuilt
4a0bea
4a0bea
* Mon Nov 14 2005 Dave Jones <davej@redhat.com>
4a0bea
- initscript tweaks.
4a0bea
4a0bea
* Tue Sep 13 2005 Dave Jones <davej@redhat.com>
4a0bea
- Update to upstream 1.12
4a0bea
4a0bea
* Wed Aug 17 2005 Dave Jones <davej@redhat.com>
4a0bea
- Check for device node *after* loading the module. (#157672)
4a0bea
4a0bea
* Tue Mar  1 2005 Dave Jones <davej@redhat.com>
4a0bea
- Rebuild for gcc4
4a0bea
4a0bea
* Thu Feb 17 2005 Dave Jones <davej@redhat.com>
4a0bea
- s/Serial/Epoch/
4a0bea
4a0bea
* Tue Jan 25 2005 Dave Jones <davej@redhat.com>
4a0bea
- Drop the node creation/deletion change from previous release.
4a0bea
  It'll cause grief with selinux, and was a hack to get around
4a0bea
  a udev shortcoming that should be fixed properly.
4a0bea
4a0bea
* Fri Jan 21 2005 Dave Jones <davej@redhat.com>
4a0bea
- Create/remove the /dev/cpu/microcode dev node as needed.
4a0bea
- Use correct path again for the microcode.dat.
4a0bea
- Remove some no longer needed tests in the init script.
4a0bea
4a0bea
* Fri Jan 14 2005 Dave Jones <davej@redhat.com>
4a0bea
- Only enable microcode_ctl service if the CPU is capable.
4a0bea
- Prevent microcode_ctl getting restarted multiple times on initlevel change (#141581)
4a0bea
- Make restart/reload work properly
4a0bea
- Do nothing if not started by root.
4a0bea
4a0bea
* Wed Jan 12 2005 Dave Jones <davej@redhat.com>
4a0bea
- Adjust dev node location. (#144963)
4a0bea
4a0bea
* Tue Jan 11 2005 Dave Jones <davej@redhat.com>
4a0bea
- Load/Remove microcode module in initscript.
4a0bea
4a0bea
* Mon Jan 10 2005 Dave Jones <davej@redhat.com>
4a0bea
- Update to upstream 1.11 release.
4a0bea
4a0bea
* Sat Dec 18 2004 Dave Jones <davej@redhat.com>
4a0bea
- Initial packaging, based upon kernel-utils.
4a0bea