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

Bug#584520: initramfs-tools: copy_exec hook function may exit with a non-zero return value in non-verbose mode



Package: initramfs-tools
Version: 0.95.1
Severity: normal
Tags: patch

copy_exec hook function may exit with a non-zero return value in non-verbose
mode

The copy_exec hook function could exit with a return value of 1 in non-verbose
mode. This happens due to the last command being
[ "${verbose}" = "y" ] && echo "Adding library ${x}"
whose return value will be used as the return value for the function. This
makes hook scripts with a 'set -e' statement abort after the call (see bug
#578065).
I've attached a trivial patch which fixes the problem.



-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 4.9M Jun  4 11:10 /boot/initrd.img-2.6.34
-- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-2.6.34 root=UUID=1c5015ac-38a3-4dc1-a3fa-415f489efc3d
ro quiet resume=/dev/sdb2 splash

-- resume
RESUME=LABEL=swap
-- /proc/filesystems
        ext3
        fuseblk

-- lsmod
Module                  Size  Used by
af_packet              14540  2
sco                     5944  2
bnep                    7628  2
rfcomm                 25836  8
l2cap                  27992  16 bnep,rfcomm
fuse                   46096  3
vboxdrv               135400  0
asb100                  8084  0
hwmon_vid               1836  1 asb100
hwmon                    896  1 asb100
loop                   10168  0
snd_cmipci             20512  2
snd_pcm                45716  1 snd_cmipci
snd_page_alloc          4820  1 snd_pcm
snd_opl3_lib            5964  1 snd_cmipci
snd_hwdep               4016  1 snd_opl3_lib
snd_mpu401_uart         3692  1 snd_cmipci
snd_seq_midi            3200  0
snd_seq_midi_event      3628  1 snd_seq_midi
btusb                   8288  2
snd_rawmidi            13568  2 snd_mpu401_uart,snd_seq_midi
bluetooth              38404  9 sco,bnep,rfcomm,l2cap,btusb
snd_seq                33136  2 snd_seq_midi,snd_seq_midi_event
snd_timer              13936  3 snd_pcm,snd_opl3_lib,snd_seq
snd_seq_device          3384  4 snd_opl3_lib,snd_seq_midi,snd_rawmidi,snd_seq
sg                     18652  0
sr_mod                  9796  0
snd                    31204  13
snd_cmipci,snd_pcm,snd_opl3_lib,snd_hwdep,snd_mpu401_uart,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
cdrom                  28032  1 sr_mod
soundcore               4000  1 snd
evdev                   6144  7
i2c_viapro              4832  0
uhci_hcd               17848  0
8139too                15568  0
via_agp                 4364  1
mii                     2924  1 8139too
nouveau               454640  2
ttm                    33948  1 nouveau
drm_kms_helper         21292  1 nouveau
drm                   114464  4 nouveau,ttm,drm_kms_helper
agpgart                19036  3 via_agp,ttm,drm
firmware_class          4692  1 nouveau
i2c_algo_bit            3728  1 nouveau
i2c_core               12064  6
asb100,i2c_viapro,nouveau,drm_kms_helper,drm,i2c_algo_bit
button                  2880  1 nouveau
unix                   18508  646

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = no
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook = /usr/sbin/update-grub
postrm_hook   = /usr/sbin/update-grub

-- /etc/initramfs-tools/initramfs.conf
MODULES=dep
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
BOOT=local
DEVICE=
NFSROOT=auto

-- /sys/block
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
sda
sdb
sdc
sr0
sr1



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.34 (PREEMPT)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages initramfs-tools depends on:
ii  cpio                         2.11-4      GNU cpio -- a program to manage ar
ii  findutils                    4.4.2-1     utilities for finding files--find,
ii  klibc-utils                  1.5.18-1    small utilities built with klibc f
ii  module-init-tools            3.12~pre2-3 tools for managing Linux kernel mo
ii  udev                         154-1       /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
pn  busybox | busybox-initramfs   <none>     (no description available)

initramfs-tools suggests no packages.

-- Configuration Files:
/etc/initramfs-tools/initramfs.conf changed [not included]
--- hook-functions.orig	2010-05-30 20:46:00.000000000 +0200
+++ hook-functions	2010-06-04 11:02:58.000000000 +0200
@@ -148,7 +148,7 @@
 		mkdir -p "${DESTDIR}/${dirname}"
 		if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then
 			ln -s "${x}" "${DESTDIR}/${dirname}"
-			[ "${verbose}" = "y" ] && echo "Adding library ${x}"
+			[ "${verbose}" = "y" ] && echo "Adding library ${x}" || true
 		fi
 	done
 }

Reply to: