Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 222)
+++ /trunk/docs/Changelog	(revision 223)
@@ -1,3 +1,6 @@
-2.5.3:
+2.5.4:
+	* option KernelCheckPCI to switch off check of PCI expansion ROMs
+	
+2.5.3 (25-02-2009):
 	* disable dnmalloc on MacOS X, doesn't work properly
 	* stat -> lstat in sh_unix_file_exists (OS X nameforks, report
Index: /trunk/include/sh_kern.h
===================================================================
--- /trunk/include/sh_kern.h	(revision 222)
+++ /trunk/include/sh_kern.h	(revision 223)
@@ -16,4 +16,5 @@
 int sh_kern_set_timer    (const char * c);
 int sh_kern_set_idt      (const char * c);
+int sh_kern_set_pci      (const char * c);
 int sh_kern_set_sct_addr (const char * c);
 int sh_kern_set_sc_addr  (const char * c);
Index: /trunk/src/sh_kern.c
===================================================================
--- /trunk/src/sh_kern.c	(revision 222)
+++ /trunk/src/sh_kern.c	(revision 223)
@@ -86,4 +86,8 @@
     N_("kernelcheckidt"),
     sh_kern_set_idt
+  },
+  {
+    N_("kernelcheckpci"),
+    sh_kern_set_pci
   },
   {
@@ -120,4 +124,5 @@
 static int     ShKernDelay    = 100; /* milliseconds */
 static int     ShKernIDT      = S_TRUE;
+static int     ShKernPCI      = S_TRUE;
 
 /* The address of system_call
@@ -979,16 +984,25 @@
        */
       fd = open ( pcipath, O_RDWR );
-      do {
-	status = write( fd, "1", 1 );
-      } while (status < 0 && errno == EINTR);
-      close ( fd );
-
-      check_rom(pcipath, name);
-
-      fd = open ( pcipath, O_RDWR );
-      do {
-	status = write( fd, "0", 1 );
-      } while (status < 0 && errno == EINTR);
-      close ( fd );
+      if (fd)
+	{
+	  do {
+	    status = write( fd, "1", 1 );
+	  } while (status < 0 && errno == EINTR);
+	  close ( fd );
+
+	  if (status > 0)
+	    {
+	      check_rom(pcipath, name);
+	      
+	      fd = open ( pcipath, O_RDWR );
+	      if (fd)
+		{
+		  do {
+		    status = write( fd, "0", 1 );
+		  } while (status < 0 && errno == EINTR);
+		  close ( fd );
+		}
+	    }
+	}
     }
   return;
@@ -1001,4 +1015,7 @@
   DIR * df;
   struct dirent * entry;
+
+  if (ShKernPCI != S_TRUE)
+    return;
 
   sl_strlcpy(pci_dir, SYS_BUS_PCI, sizeof(pci_dir));
@@ -1028,4 +1045,5 @@
       closedir(df);
     }
+  return;
 }
 
@@ -1930,4 +1948,12 @@
 }
 
+int sh_kern_set_pci (const char * c)
+{
+  int i;
+  SL_ENTER(_("sh_kern_set_pci"));
+  i = sh_util_flagval(c, &ShKernPCI);
+  SL_RETURN(i, _("sh_kern_set_pci"));
+}
+
 int sh_kern_set_sc_addr (const char * c)
 {
Index: /trunk/test/testhash.sh
===================================================================
--- /trunk/test/testhash.sh	(revision 222)
+++ /trunk/test/testhash.sh	(revision 223)
@@ -37,5 +37,5 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug
+	${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug 
 	#
 	fail=0
