Bug 171883 - mkinitrd fails if /dev/zero is not present
Summary: mkinitrd fails if /dev/zero is not present
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mkinitrd
Version: 3.0
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Peter Jones
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-27 13:41 UTC by Michael Stahnke
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2007-10-19 18:51:57 UTC


Attachments (Terms of Use)

Description Michael Stahnke 2005-10-27 13:41:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
When trying to create a new ramdisk, via mkinitrd manaully or when upgrading a kernel rpm, mkinitrd will fail if /dev/zero is not present.  The failure message given is very generic, and simply states that mkinitrd fails, and provides a return code of 1.  This would be nicer if the mkinitrd script verified the existance of /dev/zero and provided a useful error message if it was not there. 

Version-Release number of selected component (if applicable):
mkinitrd-3.5.13.6-1

How reproducible:
Always

Steps to Reproduce:
1.  Remove /dev/zero device
2.  Try run mkinitrd (or install a new kernel)
3.
  

Actual Results:  # Manual mkinitrd
[root@bunson root]# mkinitrd -f mytestimage.img 2.4.21-37.ELsmp
[root@bunson root]# echo $?
1
[root@bunson root]#
# Kernel installation
[root@bunson root]# rpm -ivh kernel-2.4.21-37.EL.i686.rpm
Preparing...                ########################################### [100%]
   1:kernel                 ########################################### [100%]
mkinitrd failed
[root@bunson root]#




Expected Results:  # Manual mkinitrd
[root@bunson root]# mkinitrd -f mytestimage.img 2.4.21-37.ELsmp
[root@bunson root]# echo $?
0
[root@bunson root]#
# Kernel installation
[root@bunson root]# rpm -ivh kernel-2.4.21-37.EL.i686.rpm
Preparing...                ########################################### [100%]
   1:kernel                 ########################################### [100%]
[root@bunson root]# echo $?
[root@bunson root]# 0

Additional info:

Here's a potential fix. 

25a26
> #     Michael Stahnke <mastahnke@yahoo.com>
481c482,489
< dd if=/dev/zero of=$IMAGE bs=1k count=$IMAGESIZE 2> /dev/null || exit 1
---
>
> if [ -c /dev/zero ]; then
>    dd if=/dev/zero of=$IMAGE bs=1k count=$IMAGESIZE 2> /dev/null || exit 1
> else
>    echo "Error /dev/zero device required for mkinitrd." >&2
>    exit 1
> fi
>

Comment 1 Peter Jones 2006-02-11 07:30:03 UTC
Under what circumstances is removing /dev/zero a reasonable thing to do?

Comment 2 Michael Stahnke 2006-02-11 14:33:23 UTC
I would say none.  But sadly, it happens on boxes where less than experienced
admins sometimes work.  I have personally seen it three times.  I am not saying
it's common.  I am saying that mkinitrd will fail without it, so maybe it should
be checked for. 

Comment 3 RHEL Product and Program Management 2007-10-19 18:51:57 UTC
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.


Note You need to log in before you can comment on or make changes to this bug.