Magellan Linux

Diff of /trunk/mkinitrd-magellan/klibc/usr/kinit/run-init/runinitlib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1296 by niro, Sat Sep 1 22:45:15 2007 UTC revision 1297 by niro, Fri May 27 15:12:11 2011 UTC
# Line 40  Line 40 
40   * On failure, returns a human-readable error message.   * On failure, returns a human-readable error message.
41   */   */
42    
 #include <alloca.h>  
43  #include <assert.h>  #include <assert.h>
44  #include <dirent.h>  #include <dirent.h>
45  #include <errno.h>  #include <errno.h>
# Line 157  static int nuke(const char *what) Line 156  static int nuke(const char *what)
156  const char *run_init(const char *realroot, const char *console,  const char *run_init(const char *realroot, const char *console,
157       const char *init, char **initargs)       const char *init, char **initargs)
158  {  {
159   struct stat rst, cst, ist;   struct stat rst, cst;
160   struct statfs sfs;   struct statfs sfs;
161   int confd;   int confd;
162    
# Line 176  const char *run_init(const char *realroo Line 175  const char *run_init(const char *realroo
175   if (rst.st_dev == cst.st_dev)   if (rst.st_dev == cst.st_dev)
176   return "current directory on the same filesystem as the root";   return "current directory on the same filesystem as the root";
177    
  /* The initramfs should have /init */  
  if (stat("/init", &ist) || !S_ISREG(ist.st_mode))  
  return "can't find /init on initramfs";  
   
178   /* Make sure we're on a ramfs */   /* Make sure we're on a ramfs */
179   if (statfs("/", &sfs))   if (statfs("/", &sfs))
180   return "statfs /";   return "statfs /";

Legend:
Removed from v.1296  
changed lines
  Added in v.1297