Bug 171883 - mkinitrd fails if /dev/zero is not present
mkinitrd fails if /dev/zero is not present
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mkinitrd (Show other bugs)
3.0
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Peter Jones
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-27 09:41 EDT by Michael Stahnke
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 14:51:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Stahnke 2005-10-27 09:41:13 EDT
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 02:30:03 EST
Under what circumstances is removing /dev/zero a reasonable thing to do?
Comment 2 Michael Stahnke 2006-02-11 09:33:23 EST
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 14:51:57 EDT
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.