Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 4498b81413d3bfb782e6b286934ad6c5 > files > 9

udev-114-7mdv2008.0.src.rpm

--- udev-0.054.orig/extras/ide-model.sh
+++ udev-0.054/extras/ide-model.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+# read the first line of the file $1
+read_value() {
+  local value
+  read -r value < $1 || true
+  echo $value
+}
+
+# strip the partition number, if present
+DEV="${1%[0-9]*}"
+
+FILE="/proc/ide/$DEV/model"
+
+[ -e $FILE ] || exit 1
+
+read_value $FILE
+
+exit 0