Bug 216664 - We need to re-introduce the raw script and configuration file (again)
We need to re-introduce the raw script and configuration file (again)
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks: 222026 181640 197865
  Show dependency treegraph
 
Reported: 2006-11-21 09:17 EST by Jeffrey Moyer
Modified: 2007-11-30 17:07 EST (History)
5 users (show)

See Also:
Fixed In Version: RC
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-07 19:42:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
udev rules file with examples (442 bytes, text/plain)
2006-11-21 14:14 EST, Bill Nottingham
no flags Details

  None (edit)
Description Jeffrey Moyer 2006-11-21 09:17:19 EST
Description of problem:
We decided to ship raw again in RHEL 5.  Util-linux is building the raw command,
but we need the init script support, too.

Version-Release number of selected component (if applicable):
initscripts-8.45.9.EL-1
Comment 3 Jay Turner 2006-11-21 10:38:20 EST
QE ack for RHEL5.
Comment 4 Bill Nottingham 2006-11-21 11:14:46 EST
*Sigh*. I thought we were feature complete.

So, we can only remove deprecated code if we have three major releases of warning?

This should really be a udev rule.
Comment 5 Bill Nottingham 2006-11-21 11:44:35 EST
Do we need the *same* rawdevices interface, or will any interface to allow the
users to configure raw devices do?
Comment 6 Jeffrey Moyer 2006-11-21 11:57:35 EST
I'll leave that call up to you.  If the process for setting up raw devices
changes, then we should add a release note to that effect.
Comment 7 Bill Nottingham 2006-11-21 14:14:14 EST
Created attachment 141810 [details]
udev rules file with examples

Here's what I think we should add - this is a commented, empty, udev rules file
with examples of how to write udev rules (so we don't need to add any
additional infrastructure.) Where this file would go is up for debate - it
could be in util-linux, or it could be in udev itself.

A release note would be something like the following:

...

The deprecated interface for raw devices has changed in Red Hat Enterprise
Linux 5. It is now configured via udev rules.

To add a mapping for a raw device, add entries to
/etc/udev/rules.d/60-raw.rules in the following formats:

For device names:

ACTION=="add", KERNEL="<device name>", RUN+="raw /dev/raw/rawX %N"

For major/minor numbers:

ACTION=="add", ENV{MAJOR}="A", ENV{MINOR}="B", RUN+="raw /dev/raw/rawX %M %m"

where <device name> is the name of the device you'd like to bind(such as
/dev/sda1), A and B are the major/minor number of the device you'd like to
bind, and X is the raw device number you'd like to use.

If you have a large pre-existing /etc/sysconfig/rawdevices file, you can
convert it with the following script:

#!/bin/sh

grep -v "^ *#" /etc/sysconfig/rawdevices | grep -v "^$" | while read dev major
minor ; do
	if [ -z "$minor" ]; then
		echo "ACTION==\"add\", KERNEL==\"${major##/dev/}\",
RUN+=\"/usr/bin/raw $dev %N\""
	else
		echo "ACTION==\"add\", ENV{MAJOR}==\"$major\",
ENV{MINOR}==\"$minor\", RUN+=\"/usr/bin/raw $dev %M %m\""
	fi
done

....

Opinions?
Comment 8 Jeffrey Moyer 2006-11-21 14:20:07 EST
So long as this works, it's fine with me.  I think the right place for this is
in util-linux.  I'm a big fan of keeping related components together (it would
have prevented this from slipping through the cracks).

Thanks, Bill.
Comment 9 Karel Zak 2006-11-21 15:49:28 EST
Samson, please add Bill's comment #7 to release notes.

Comment 10 Karel Zak 2006-11-21 15:52:00 EST
I'll include the rule to util-linux.
Comment 11 Bill Nottingham 2006-11-21 15:59:29 EST
Note that the shell script in the relnote comment is horribly word-wrapped - if
you include that, that needs fixed.
Comment 13 Karel Zak 2006-11-21 19:13:32 EST
Fixed in util-linux-2.13-0.43.1.el5.
Comment 16 Bill Nottingham 2006-12-05 16:00:09 EST
Potentially silly question - what happens if you change the rules file to call
'/bin/raw' instead of just 'raw'?
Comment 17 Karel Zak 2006-12-05 17:32:17 EST
Michael, try it manually and check if the raw command really works. For example:

 /bin/raw /dev/raw/raw1 8 17

  
Comment 19 Afom T. Michael 2006-12-05 17:55:35 EST
Not silly at all. That did that job. So, I guess you'll need to modify the rule.
Per your suggestion, I edited the rule to the one below and it worked for me (it
also works when device names are used instead of major/minor numbers.

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="17", RUN+="/bin/raw /dev/raw/raw1
%M %m"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="18", RUN+="/bin/raw /dev/raw/raw2
%M %m"
ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="19", RUN+="/bin/raw /dev/raw/raw3
%M %m"
Comment 20 Karel Zak 2006-12-05 18:16:27 EST
OK. Thanks. The rule has been modified in util-linux-2.13-0.43-2.el5 (and brew
is playing his game with it now).
Comment 26 RHEL Product and Program Management 2007-02-07 19:42:46 EST
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.

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