*/
#define verbose 1
+static void mount_proc (void);
static void print_uptime (void);
static void insmod (const char *filename);
static void show_directory (const char *dir);
int
main ()
{
+ mount_proc ();
+
print_uptime ();
fprintf (stderr, "febootstrap: ext2 mini initrd starting up\n");
}
}
+/* Mount /proc unless it's mounted already. */
+static void
+mount_proc (void)
+{
+ if (access ("/proc/uptime", R_OK) == -1) {
+ mkdir ("/proc", 0755);
+
+ if (verbose)
+ fprintf (stderr, "febootstrap: mounting /proc\n");
+
+ if (mount ("proc", "/proc", "proc", 0, "") == -1) {
+ perror ("mount: /proc");
+ /* Non-fatal. */
+ }
+ }
+}
+
/* Print contents of /proc/uptime. */
static void
print_uptime (void)