Bug#838110: live-tools: exclude initrd backup files
Package: live-tools
Version: 1:20151214+nmu1
Severity: important
Tags: patch
On my Debian Live system update-initramfs fails with the following error message:
cp: cannot stat '/boot/vmlinuz-<my kernel version>.old-dkms': No such file or directory
Please find attached a patch that fixes this issue.
Cheers
Ronny
>From 1431278240b84651947cf56cc27c95177883c2bf Mon Sep 17 00:00:00 2001
From: Ronny Standtke <ronny.standtke@gmx.net>
Date: Sat, 17 Sep 2016 13:56:54 +0200
Subject: [PATCH] exclude initrd backup files
---
bin/live-update-initramfs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/bin/live-update-initramfs b/bin/live-update-initramfs
index 3cdbed3..9ae4b80 100755
--- a/bin/live-update-initramfs
+++ b/bin/live-update-initramfs
@@ -55,12 +55,11 @@ case "${_READ_WRITE}" in
# Updating initramfs
/usr/sbin/update-initramfs.orig.initramfs-tools "${@}"
- # FIXME: needs to exclude initrd backup files
- if [ "$(ls /boot/initrd.img-* | wc -l)" -gt 1 ]
+ if [ "$(ls /boot/initrd.img-* | grep -v old-dkms | wc -l)" -gt 1 ]
then
_NUMBER="1"
- for _INITRD in /boot/initrd.img-*
+ for _INITRD in $(ls /boot/initrd.img-* | grep -v old-dkms)
do
_VERSION="$(basename ${_INITRD} | sed -e 's|initrd.img-||')"
--
2.1.4
Reply to: