[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

vmlinuz-4.9.0-8-armmp-lpae pkg install fails due to /usr/bin/linux-update-symlinks




Mildly annoying :

root@arm7:~# apt-get install linux-image-4.9.0-8-armmp-lpae linux-headers-4.9.0-8-armmp-lpae
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  linux-compiler-gcc-6-arm linux-headers-4.9.0-8-common linux-kbuild-4.9
Suggested packages:
  linux-doc-4.9 debian-kernel-handbook
Recommended packages:
  firmware-linux-free irqbalance
The following NEW packages will be installed:
linux-compiler-gcc-6-arm linux-headers-4.9.0-8-armmp-lpae linux-headers-4.9.0-8-common linux-image-4.9.0-8-armmp-lpae
  linux-kbuild-4.9
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 40.1 MB of archives.
After this operation, 190 MB of additional disk space will be used.
Do you want to continue? [Y/n]
.
.
.
Unpacking linux-headers-4.9.0-8-armmp-lpae (4.9.130-2) ...
Selecting previously unselected package linux-image-4.9.0-8-armmp-lpae.
Preparing to unpack .../linux-image-4.9.0-8-armmp-lpae_4.9.130-2_armhf.deb ...
Unpacking linux-image-4.9.0-8-armmp-lpae (4.9.130-2) ...
Setting up linux-image-4.9.0-8-armmp-lpae (4.9.130-2) ...
Failed to create symlink to vmlinuz-4.9.0-8-armmp-lpae: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-4.9.0-8-armmp-lpae (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up linux-headers-4.9.0-8-common (4.9.130-2) ...
Setting up linux-kbuild-4.9 (4.9.130-2) ...
Setting up linux-compiler-gcc-6-arm (4.9.130-2) ...
Setting up linux-headers-4.9.0-8-armmp-lpae (4.9.130-2) ...
Errors were encountered while processing:
 linux-image-4.9.0-8-armmp-lpae
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@arm7:~# cd /boot
root@arm7:/boot# ls -lapb
total 14701
drwxr-xr-x  5 root root    1024 Jan 22 20:26 ./
drwxr-xr-x 23 root root    4096 Nov  3  2016 ../
-rwxr-xr-x  1 root root  190506 Oct 27 18:46 config-4.9.0-8-armmp-lpae
drwxr-xr-x  2 root root     512 Dec 23 05:22 extlinux/
drwxr-xr-x  2 root root     512 Nov  3  2016 hdmi/
-rwxr-xr-x  1 root root     304 Oct 23 10:44 hw_intf.conf
drwxr-xr-x  2 root root    2560 Oct 23 10:44 overlays/
-rwxr-xr-x  1 root root   72281 Oct 23 10:44 rk3288-miniarm.dtb
-rwxr-xr-x  1 root root 3027355 Oct 27 18:46 System.map-4.9.0-8-armmp-lpae
-rwxr-xr-x  1 root root 3821600 Oct 27 18:46 vmlinuz-4.9.0-8-armmp-lpae
-rwxr-xr-x  1 root root 7930936 Oct 23 10:44 zImage
root@arm7:/boot#

The offending bits are in Ben's script :


sub update_symlink {
    my ($source, $dest) = @_;

$source = File::Spec->abs2rel($source, (File::Spec->splitpath($dest))[1]);

    # Don't make unnecessary changes
    my $old_source = readlink($dest);
    if (defined($old_source) && $old_source eq $source) {
        return;
    }

    # Create a symlink with a temporary name
    my $rand;
while (($rand = int(rand(1000000))) && !symlink($source, "$dest.$rand")) {
        if ($! != POSIX::EEXIST) {
            die "Failed to create symlink to $source: $!";
        }
    }

    # Move it into place atomically
    if (!rename("$dest.$rand", $dest)) {
        my $err = "$!";
        unlink("$dest.$rand");
        die "Failed to create or replace $dest: $err";
    }

    print "I: $dest is now a symlink to $source\n";
}

Easy to fix manually if I can figure out what was supposed to be
symlinked from where to where.

I question the use of 'rand' to create a temporary file name but that
is another issue.

Dennis Clarke


Reply to: