Bug#849532: flash-kernel does not remove dtb backups

2018-01-19 Thread Vagrant Cascadian
On 2017-01-02, Martin Michlmayr wrote:
> * Heinrich Schuchardt  [2016-12-28 10:10]:
>> The .bak file should not be created on the first install of a Linux kernel.
>
> Yeah, that's a separate issue but it's definitely something I noticed
> too.  The DTB handling code is run several times under some
> circumstances, see e.g. the log below.

For one thing, flash-kernel has hooks in both the kernel and
initramfs-tools directories:

  $ dpkg -L flash-kernel | grep -E 'post' | grep flash-kernel
  /etc/initramfs/post-update.d/flash-kernel
  /etc/kernel/postinst.d/zz-flash-kernel
  /etc/kernel/postrm.d/zz-flash-kernel

So, at the very least, on a new kernel install, it's likely to be called
at least twice.


> I'm afraid to touch that code and hope Ian will look into it at some
> point.
>
> ...
> Taking backup of tegra210-p2371-2180.dtb.
> Installing new tegra210-p2371-2180.dtb.
> flash-kernel: deferring update (trigger activated)
> /etc/kernel/postinst.d/zz-flash-kernel:
> DTB: tegra210-p2371-2180.dtb
> Installing 
> /usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
> /boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
> Taking backup of tegra210-p2371-2180.dtb.
> Installing new tegra210-p2371-2180.dtb.
> Installing 
> /usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
> /boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
> Taking backup of tegra210-p2371-2180.dtb.
> Installing new tegra210-p2371-2180.dtb.
> flash-kernel: deferring update (trigger activated)
> Processing triggers for flash-kernel (3.73) ...
> DTB: tegra210-p2371-2180.dtb
> Installing 
> /usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
> /boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
> Taking backup of tegra210-p2371-2180.dtb.
> Installing new tegra210-p2371-2180.dtb.
> flash-kernel: installing version 4.9.0-trunk-arm64
> Generating boot script u-boot image... done.
> Taking backup of boot.scr.
> Installing new boot.scr.

But this is obviously more than just that... and I've seen it too. *sigh*


live well,
  vagrant


signature.asc
Description: PGP signature


Bug#849532: flash-kernel does not remove dtb backups

2017-01-02 Thread Martin Michlmayr
* Heinrich Schuchardt  [2016-12-28 10:10]:
> The .bak file should not be created on the first install of a Linux kernel.

Yeah, that's a separate issue but it's definitely something I noticed
too.  The DTB handling code is run several times under some
circumstances, see e.g. the log below.

I'm afraid to touch that code and hope Ian will look into it at some
point.

...
Taking backup of tegra210-p2371-2180.dtb.
Installing new tegra210-p2371-2180.dtb.
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
DTB: tegra210-p2371-2180.dtb
Installing 
/usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
/boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
Taking backup of tegra210-p2371-2180.dtb.
Installing new tegra210-p2371-2180.dtb.
Installing 
/usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
/boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
Taking backup of tegra210-p2371-2180.dtb.
Installing new tegra210-p2371-2180.dtb.
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.73) ...
DTB: tegra210-p2371-2180.dtb
Installing 
/usr/lib/linux-image-4.9.0-trunk-arm64/nvidia/tegra210-p2371-2180.dtb into 
/boot/dtbs/4.9.0-trunk-arm64/tegra210-p2371-2180.dtb
Taking backup of tegra210-p2371-2180.dtb.
Installing new tegra210-p2371-2180.dtb.
flash-kernel: installing version 4.9.0-trunk-arm64
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.

-- 
Martin Michlmayr
http://www.cyrius.com/



Bug#849532: flash-kernel does not remove dtb backups

2016-12-28 Thread Heinrich Schuchardt
Package: flash-kernel
Version: 3.72
Severity: normal

Dear Maintainer,

when a Linux kernel is installed flash-kernel creates a dtb backup file.

This file is not removed when the Linux kernel is remove. E.g.

sudo apt-get remove linux-image-4.8.0-1-armmp
left file
/boot/dtbs/4.8.0-1-armmp/imx6q-wandboard-revb1.dtb.bak

As it is flash-kernel that creates both the
/boot/dtbs/$version/$model.dtb
as well as the
/boot/dtbs/$version/$model.dtb.bak
files it should also take care of removing them fully.

The .bak file should not be created on the first install of a Linux kernel.

Best regards

Heinrich Schuchardt

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armhf (armv7l)

Kernel: Linux 4.8.0-2-armmp (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages flash-kernel depends on:
ii  debconf [debconf-2.0]  1.5.59
ii  devio  1.2-1.2
ii  initramfs-tools0.126
ii  linux-base 4.5
ii  mtd-utils  1:2.0.0~rc1-1
ii  ucf3.0036

Versions of packages flash-kernel recommends:
ii  u-boot-tools  2016.11+dfsg1-1

flash-kernel suggests no packages.

-- debconf information:
  flash-kernel/linux_cmdline: quiet