Bug#1060200: intel-microcode: diff for NMU version 3.20240531.1+nmu1

2024-06-10 Thread Chris Hofstaedtler
* Henrique de Moraes Holschuh  [240604 02:51]:
> Hello Chris,
> 
> Did you test the result?   Does the system boots with an updated microcode 
> after the change ?

I do not have access to x86 hardware with an intel cpu.

> It has to be tested with mkinitramfs and Dracut, the resulting 
> early-initramfs must be "almost" byte-equal (timestamps can change, but not 
> the paths/filenames inside, nor the *offset* where the data starts relative 
> to start-of-file. THIS IS IMPORTANT.
> 
> I believe it should really just work with mkinitramfs, since we ask 
> iucode_tool to generate the early-initramfs in that case, and iucode_tool 
> doesn't care where the source data is, as long as it can read it.  One should 
> still test it to be sure.
> 
> Dracut, I haven't looked into what it is doing. Hopefully it also uses 
> iucode_tool nowadays...

Generally I think we should be good, because the files are in the
same place *on the installed filesystem* as before.

Many moons ago I checked that the initramfs output was the same, but
I cannot remember if it was bit identical or not.

I'd appreciate it if anyone could do a verification test with the
expected hardware and/or provide an autopkgtest.

Chris



Bug#1060200: intel-microcode: diff for NMU version 3.20240531.1+nmu1

2024-06-03 Thread Henrique de Moraes Holschuh
Hello Chris,

Did you test the result?   Does the system boots with an updated microcode 
after the change ?

It has to be tested with mkinitramfs and Dracut, the resulting early-initramfs 
must be "almost" byte-equal (timestamps can change, but not the paths/filenames 
inside, nor the *offset* where the data starts relative to start-of-file. THIS 
IS IMPORTANT.

I believe it should really just work with mkinitramfs, since we ask iucode_tool 
to generate the early-initramfs in that case, and iucode_tool doesn't care 
where the source data is, as long as it can read it.  One should still test it 
to be sure.

Dracut, I haven't looked into what it is doing. Hopefully it also uses 
iucode_tool nowadays...

-- 
  Henrique de Moraes Holschuh 



Bug#1060200: intel-microcode: diff for NMU version 3.20240531.1+nmu1

2024-06-03 Thread Chris Hofstaedtler
Control: tags 1060200 + patch
Control: tags 1060200 + pending


Dear maintainer,

I've prepared an NMU for intel-microcode (versioned as 3.20240531.1+nmu1) and
uploaded it to DELAYED/10. Please feel free to tell me if I
should delay it longer.

Regards.

diff -Nru intel-microcode-3.20240531.1/debian/changelog intel-microcode-3.20240531.1+nmu1/debian/changelog
--- intel-microcode-3.20240531.1/debian/changelog	2024-06-01 16:49:47.0 +0200
+++ intel-microcode-3.20240531.1+nmu1/debian/changelog	2024-06-03 22:45:50.0 +0200
@@ -1,3 +1,11 @@
+intel-microcode (3.20240531.1+nmu1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Install aliased files into /usr (DEP17 M2) (Closes: #1060200)
+  * Add superficial autopkgtest for initramfs hook.
+
+ -- Chris Hofstaedtler   Mon, 03 Jun 2024 22:45:50 +0200
+
 intel-microcode (3.20240531.1) unstable; urgency=medium
 
   * New upstream microcode datafile 20240531
diff -Nru intel-microcode-3.20240531.1/debian/initramfs.hook intel-microcode-3.20240531.1+nmu1/debian/initramfs.hook
--- intel-microcode-3.20240531.1/debian/initramfs.hook	2024-06-01 16:47:45.0 +0200
+++ intel-microcode-3.20240531.1+nmu1/debian/initramfs.hook	2024-06-03 22:44:38.0 +0200
@@ -45,7 +45,7 @@
 	IUCODE_TOOL=/usr/sbin/iucode_tool
 fi
 
-IUCODE_FW_DIR=/lib/firmware/intel-ucode
+IUCODE_FW_DIR=/usr/lib/firmware/intel-ucode
 if [ "$MODULES" = "most" ]; then
 	IUCODE_TOOL_INITRAMFS=early
 	IUCODE_TOOL_SCANCPUS=no
diff -Nru intel-microcode-3.20240531.1/debian/intel-microcode.dirs intel-microcode-3.20240531.1+nmu1/debian/intel-microcode.dirs
--- intel-microcode-3.20240531.1/debian/intel-microcode.dirs	2024-06-01 16:46:07.0 +0200
+++ intel-microcode-3.20240531.1+nmu1/debian/intel-microcode.dirs	2024-06-03 22:44:38.0 +0200
@@ -1,3 +1,3 @@
-lib/firmware/intel-ucode
+usr/lib/firmware/intel-ucode
 etc/default
 etc/modprobe.d
diff -Nru intel-microcode-3.20240531.1/debian/rules intel-microcode-3.20240531.1+nmu1/debian/rules
--- intel-microcode-3.20240531.1/debian/rules	2024-06-01 16:46:07.0 +0200
+++ intel-microcode-3.20240531.1+nmu1/debian/rules	2024-06-03 22:44:38.0 +0200
@@ -32,13 +32,13 @@
 	dh_install
 
 	# split microcode pack
-	$(IUCODE_TOOL) -q --write-firmware="$(PKGDIR)/lib/firmware/intel-ucode" $(IUCODE_FILE)
+	$(IUCODE_TOOL) -q --write-firmware="$(PKGDIR)/usr/lib/firmware/intel-ucode" $(IUCODE_FILE)
 
 	# apply best-effort blacklist
 	if [ -r debian/ucode-blacklist.txt ] ; then \
 		cat debian/ucode-blacklist.txt | while read -r fn crap ; do \
-			if [ -r "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}" ] ; then \
-mv "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}" "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}.initramfs" ;\
+			if [ -r "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}" ] ; then \
+mv "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}" "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}.initramfs" ;\
 echo "Renaming blacklisted microcode $${fn}" ; \
 			fi ; \
 		done ; \
diff -Nru intel-microcode-3.20240531.1/debian/tests/control intel-microcode-3.20240531.1+nmu1/debian/tests/control
--- intel-microcode-3.20240531.1/debian/tests/control	1970-01-01 01:00:00.0 +0100
+++ intel-microcode-3.20240531.1+nmu1/debian/tests/control	2024-06-03 22:44:38.0 +0200
@@ -0,0 +1,7 @@
+Tests: initramfs
+Architecture: amd64
+Depends:
+ @,
+ linux-image-amd64,
+ initramfs-tools,
+Restrictions: needs-root, allow-stderr, superficial
diff -Nru intel-microcode-3.20240531.1/debian/tests/initramfs intel-microcode-3.20240531.1+nmu1/debian/tests/initramfs
--- intel-microcode-3.20240531.1/debian/tests/initramfs	1970-01-01 01:00:00.0 +0100
+++ intel-microcode-3.20240531.1+nmu1/debian/tests/initramfs	2024-06-03 22:44:38.0 +0200
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -ex -o pipefail
+
+update-initramfs -kall -u
+INITRDS=(/boot/initrd.img-*)
+
+unmkinitramfs "${INITRDS[0]}" initramfs/
+find initramfs/
+
+test -e initramfs/early/kernel/x86/microcode/GenuineIntel.bin
+echo '# everything seems ok'
+