FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-04-2011, 11:08 AM
Ben Hutchings
 
Default kernel hooks: Enable error-exit (sh -e)

We should not continue after a command unexpectedly fails.

Change the $INITRD test so that failure is not treated as unexpected.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
kernel/postinst.d/initramfs-tools | 6 ++++--
kernel/postrm.d/initramfs-tools | 6 +++++-
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools
index f312e43..b36d713 100755
--- a/kernel/postinst.d/initramfs-tools
+++ b/kernel/postinst.d/initramfs-tools
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e

version="$1"
bootopt=""
@@ -13,7 +13,9 @@ fi
if [ -n "$2" ]; then
if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then
# exit if custom kernel does not need an initramfs
- [ "$INITRD" = 'No' ] && exit 0
+ if [ "$INITRD" = 'No' ]; then
+ exit 0
+ fi
bootdir=$(dirname "$2")
bootopt="-b ${bootdir}"
else
diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools
index 051c8de..36fb61f 100755
--- a/kernel/postrm.d/initramfs-tools
+++ b/kernel/postrm.d/initramfs-tools
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e

version="$1"
bootopt=""
@@ -12,6 +12,10 @@ fi
# kernel-package passes an extra arg
if [ -n "$2" ]; then
if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then
+ # exit if custom kernel does not need an initramfs
+ if [ "$INITRD" = 'No' ]; then
+ exit 0
+ fi
bootdir=$(dirname "$2")
bootopt="-b ${bootdir}"
else
--
1.7.4.1
 
Old 03-27-2011, 07:33 PM
maximilian attems
 
Default kernel hooks: Enable error-exit (sh -e)

On Fri, 04 Mar 2011, Ben Hutchings wrote:

> We should not continue after a command unexpectedly fails.
>
> Change the $INITRD test so that failure is not treated as unexpected.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> kernel/postinst.d/initramfs-tools | 6 ++++--
> kernel/postrm.d/initramfs-tools | 6 +++++-
> 2 files changed, 9 insertions(+), 3 deletions(-)
>

thanks applied as is to ben/hook_pol.


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110327193314.GB22442@stro.at">http://lists.debian.org/20110327193314.GB22442@stro.at
 

Thread Tools




All times are GMT. The time now is 10:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org