Bug#838110: live-tools: exclude initrd backup files
> just a minor thing but I think you should anchor your grep to the end of > the filename: > grep -v "old-dkms$" OK, please find attached an updated patch. I didn't use the quotes around the expression because with quotes I got a build error about bashisms. Cheers Ronny diff --git a/bin/live-update-initramfs b/bin/live-update-initramfs index 3cdbed3..eeb4840 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-||')"
Bug#838110: live-tools: exclude initrd backup files
Hi Ronny, just a minor thing but I think you should anchor your grep to the end of the filename: grep -v "old-dkms$" Cheers Daniel On 09/17/2016 02:13 PM, Ronny Standtke wrote: > 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-.old-dkms': No such file or > directory > > Please find attached a patch that fixes this issue. > > Cheers > > Ronny >
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-.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 StandtkeDate: 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