Sample Header Ad - 728x90

dpkg -i my-kernel_5.10.9-2lEIW6BD_arm64.deb fails with "unable to make backup link of './boot/Image' before installing new version: Operation not..."

0 votes
1 answer
106 views
I've made my own kernel package for a custom iMX8M board, which passes lintian without warnings or errors. The top three layers of the package tree are:
/tmp/my-kernel_5.10.9-2lEIW6BD_arm64
|-- DEBIAN
|   |-- control
|   `-- preinst
|-- boot
|   |-- Image
|   `-- dtbs
|       `-- imx8mq-smarc.dtb
|-- lib
|   `-- modules
`-- usr
    `-- share
        `-- doc
preinst makes sure that /boot is mounted:
fadedbee@box ~ $ sudo cat /tmp/my-kernel_5.10.9-2lEIW6BD_arm64/DEBIAN/preinst 
#!/bin/bash
set -e
if grep -qs '/dev/mmcblk1p1 /boot' /proc/mounts; then
  echo "/boot is mounted."
else
  echo "/boot is not yet mounted, mounting..."
  mount /dev/mmcblk1p1 /boot
fi
exit 0
It mounts /boot, if not already mounted and relies on the dpkg to put all of the files in place. It currently fails.
root@arm:~# dpkg -i /tmp/my-kernel_5.10.9-2lEIW6BD_arm64.deb 
(Reading database ... 45956 files and directories currently installed.)
Preparing to unpack .../my-kernel_5.10.9-2lEIW6BD_arm64.deb ...
/boot is not yet mounted, mounting...
Unpacking my-kernel (5.10.9) ...
dpkg: error processing archive /tmp/my-kernel_5.10.9-2lEIW6BD_arm64.deb (--install):
 unable to make backup link of './boot/Image' before installing new version: Operation not permitted
Errors were encountered while processing:
 /tmp/my-kernel_5.10.9-2lEIW6BD_arm64.deb
The permissions on /boot/Image are as expected:
root@arm:~# ls -lsa /boot/Image
28680 -rwxr-xr-x 1 root root 29366784 Mar 25 11:48 /boot/Image
The /boot partition is vfat and mounted R/W:
root@arm:~# mount | grep boot
/dev/mmcblk1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
Why might this operation be failing? Is there a work-around? --- Update: I've checked what's inside a "normal" debian kernel package. It also relies on normal behaviour to install the kernel image in /boot.
root@debian:/tmp/tmp# tree -L 3
.
├── boot
│   ├── config-6.1.0-18-amd64
│   ├── System.map-6.1.0-18-amd64
│   └── vmlinuz-6.1.0-18-amd64
├── lib
│   └── modules
│       └── 6.1.0-18-amd64
└── usr
    └── share
        ├── bug
        ├── doc
        └── lintian

10 directories, 3 files
Asked by fadedbee (1113 rep)
Mar 26, 2024, 11:19 AM
Last activity: Mar 27, 2024, 09:15 AM