[PATCH]:(remake) missing /dev/stX & /dev/nstX even if rescue mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

as you know, anaconda try to load st.ko for tape support
if we are in rescue mode.

[see the followings (loader2/loader.c)]
-------------------------------------
1658     /* if we are in rescue mode lets load st.ko for tape support */
1659     if (FL_RESCUE(flags))
1660         scsiTapeInitialize(modLoaded, modDeps, modInfo);
-------------------------------------

but /dev/st0, /dev/st1,... are not created by anaconda, even if
scsi tape device(s) is found and load st.ko successfully on
rescue mode.additionally, /dev/nst0,... are also needed.
(--> FYI:RHEL4 has "/dev/st0" and "/dev/st0" statically)


so I made the patch for this condition.
(and then test it on the machine which has two tape device)

thank you very much
diff -u -r1.57 hardware.c
--- loader2/hardware.c  12 Jun 2007 18:54:42 -0000      1.57
+++ loader2/hardware.c  3 Aug 2007 09:06:12 -0000
@@ -135,6 +135,9 @@
 int scsiTapeInitialize(moduleList modLoaded, moduleDeps modDeps,
                       moduleInfoSet modInfo) {
     struct device ** devices;
+    char st[] = "/dev/stX";
+    char nst[] = "/dev/nstX";
+    int n;

     if (FL_TESTING(flags)) return 0;

@@ -154,6 +157,17 @@
        return 1;
     }

+    for (n = 0; devices[n]; n++) {
+        if (n > 9) {
+            logMessage(ERROR, "cannot create tape device files greater than 9");
+            break;
+        }
+        sprintf(st, "/dev/st%d", n);
+        sprintf(nst, "/dev/nst%d", n);
+        mknod(st, 0600 | S_IFCHR, makedev(9, n));
+        mknod(nst, 0600 | S_IFCHR, makedev(9, 128 + n));
+    }
+
     return 0;
 }


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux