netronome firmware symlinks are overwritten by package upgrade

Bug #1804183 reported by Simon Horman on 2018-11-20

This bug report will be marked for expiration in 19 days if no further activity occurs. (find out why)

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-firmware (Ubuntu)
Undecided
Unassigned

Bug Description

The linux-firmware package includes symlinks to installed Netronome firmware files. These links may be updated by a user but are overwritten when the linux-firmware package is upgraded whereas the desired behaviour is to leave existing symlinks unmodified.

# apt install linux-firmware
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  linux-firmware
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 64.6 MB of archives.
After this operation, 278 MB of additional disk space will be used.
Get:1 http://lon1.mirrors.digitalocean.com/ubuntu bionic-updates/main amd64 linux-firmware all 1.173.1 [64.6 MB]
Fetched 64.6 MB in 1s (43.8 MB/s)
Selecting previously unselected package linux-firmware.
(Reading database ... 59988 files and directories currently installed.)
Preparing to unpack .../linux-firmware_1.173.1_all.deb ...
Unpacking linux-firmware (1.173.1) ...
Setting up linux-firmware (1.173.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
# cd /lib/firmware/netronome/
# ls -l
total 8
drwxr-xr-x 2 root root 4096 Nov 20 09:07 flower
drwxr-xr-x 2 root root 4096 Nov 20 09:07 nic
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0081-0001_1x40.nffw -> nic/nic_AMDA0081-0001_1x40.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0081-0001_4x10.nffw -> nic/nic_AMDA0081-0001_4x10.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0096-0001_2x10.nffw -> nic/nic_AMDA0096-0001_2x10.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0097-0001_2x40.nffw -> nic/nic_AMDA0097-0001_2x40.nffw
lrwxrwxrwx 1 root root 36 May 18 2018 nic_AMDA0097-0001_4x10_1x40.nffw -> nic/nic_AMDA0097-0001_4x10_1x40.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0097-0001_8x10.nffw -> nic/nic_AMDA0097-0001_8x10.nffw
lrwxrwxrwx 1 root root 36 May 18 2018 nic_AMDA0099-0001_1x10_1x25.nffw -> nic/nic_AMDA0099-0001_1x10_1x25.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0099-0001_2x10.nffw -> nic/nic_AMDA0099-0001_2x10.nffw
lrwxrwxrwx 1 root root 31 May 18 2018 nic_AMDA0099-0001_2x25.nffw -> nic/nic_AMDA0099-0001_2x25.nffw
# for i in $(find flower/ -type l); do ln -sf $i $(basename $i); done
# ls -l
total 8
drwxr-xr-x 2 root root 4096 Nov 20 09:07 flower
drwxr-xr-x 2 root root 4096 Nov 20 09:07 nic
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0081-0001_1x40.nffw -> flower/nic_AMDA0081-0001_1x40.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0081-0001_4x10.nffw -> flower/nic_AMDA0081-0001_4x10.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0096-0001_2x10.nffw -> flower/nic_AMDA0096-0001_2x10.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0097-0001_2x40.nffw -> flower/nic_AMDA0097-0001_2x40.nffw
lrwxrwxrwx 1 root root 39 Nov 20 09:09 nic_AMDA0097-0001_4x10_1x40.nffw -> flower/nic_AMDA0097-0001_4x10_1x40.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0097-0001_8x10.nffw -> flower/nic_AMDA0097-0001_8x10.nffw
lrwxrwxrwx 1 root root 36 May 18 2018 nic_AMDA0099-0001_1x10_1x25.nffw -> nic/nic_AMDA0099-0001_1x10_1x25.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0099-0001_2x10.nffw -> flower/nic_AMDA0099-0001_2x10.nffw
lrwxrwxrwx 1 root root 34 Nov 20 09:09 nic_AMDA0099-0001_2x25.nffw -> flower/nic_AMDA0099-0001_2x25.nffw
# apt update
...
# apt install linux-firmware
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
  linux-firmware
1 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.
Need to get 64.6 MB of archives.
After this operation, 30.7 kB of additional disk space will be used.
Get:1 http://lon1.mirrors.digitalocean.com/ubuntu bionic-updates/main amd64 linux-firmware all 1.173.2 [64.6 MB]
Fetched 64.6 MB in 1s (55.1 MB/s)
(Reading database ... 61821 files and directories currently installed.)
Preparing to unpack .../linux-firmware_1.173.2_all.deb ...
Unpacking linux-firmware (1.173.2) over (1.173.1) ...
Setting up linux-firmware (1.173.2) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
root@ubuntu-s-1vcpu-1gb-ams3-01:/lib/firmware/netronome# ls -l
total 8
drwxr-xr-x 2 root root 4096 Nov 20 09:13 flower
drwxr-xr-x 2 root root 4096 Nov 20 09:13 nic
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0081-0001_1x40.nffw -> nic/nic_AMDA0081-0001_1x40.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0081-0001_4x10.nffw -> nic/nic_AMDA0081-0001_4x10.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0096-0001_2x10.nffw -> nic/nic_AMDA0096-0001_2x10.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0097-0001_2x40.nffw -> nic/nic_AMDA0097-0001_2x40.nffw
lrwxrwxrwx 1 root root 36 Nov 6 14:30 nic_AMDA0097-0001_4x10_1x40.nffw -> nic/nic_AMDA0097-0001_4x10_1x40.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0097-0001_8x10.nffw -> nic/nic_AMDA0097-0001_8x10.nffw
lrwxrwxrwx 1 root root 36 Nov 6 14:30 nic_AMDA0099-0001_1x10_1x25.nffw -> nic/nic_AMDA0099-0001_1x10_1x25.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0099-0001_2x10.nffw -> nic/nic_AMDA0099-0001_2x10.nffw
lrwxrwxrwx 1 root root 31 Nov 6 14:30 nic_AMDA0099-0001_2x25.nffw -> nic/nic_AMDA0099-0001_2x25.nffw

Simon Horman (horms-netronome) wrote :

Hi,

Netronome would like to propose the following fix, which is to mark the symlinks as conffiles.
This produces a debian package which does not overwrite the symlinks when installed.

Seth Forshee (sforshee) wrote :

This seems like a bit of an abuse of conffiles, as those files aren't really intended for user modification. It seems like this is a pretty niche use case that doesn't apply to the vast majority of users.

Have you looked at dpkg-divert? This can be used to force packages to install specific files to a diverted location. For example, 'dpkg-divert --add --rename --divert /lib/firmware/nic_AMDA0058-0011_2x40.nffw.foo /lib/firmware/nic_AMDA0058-0011_2x40.nffw' should cause the nic_AMDA0058-0011_2x40.nffw file from linux-firmware updates to be written to nic_AMDA0058-0011_2x40.nffw.foo.

https://debian-administration.org/article/118/Replacing_binaries_with_dpkg-divert

Changed in linux-firmware (Ubuntu):
status: New → Incomplete
tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers