openap-cvs
[Top][All Lists]
Advanced

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

[openap-cvs] : linux/arch/i386/boot/tools build.c,1.1.1.1,1.2


From: David Kimdon <address@hidden>
Subject: [openap-cvs] : linux/arch/i386/boot/tools build.c,1.1.1.1,1.2
Date: Mon, 15 Jul 2002 14:22:46 -0400

Update of /cvsroot/openap/linux/arch/i386/boot/tools
In directory subversions:/tmp/cvs-serv4337

Modified Files:
        build.c 
Log Message:
build.c (main) : allow specification of root device as two integers (major
minor)on the command line.



Index: build.c
===================================================================
RCS file: /cvsroot/openap/linux/arch/i386/boot/tools/build.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- build.c     14 May 2002 18:15:59 -0000      1.1.1.1
+++ build.c     15 Jul 2002 18:22:44 -0000      1.2
@@ -66,7 +66,7 @@
 
 void usage(void)
 {
-       die("Usage: build [-b] bootsect setup system [rootdev] [> image]");
+       die("Usage: build [-b] bootsect setup system [rootdev|major minor] [> 
image]");
 }
 
 int main(int argc, char ** argv)
@@ -81,9 +81,9 @@
            is_big_kernel = 1;
            argc--, argv++;
          }
-       if ((argc < 4) || (argc > 5))
+       if ((argc < 4) || (argc > 6))
                usage();
-       if (argc > 4) {
+       if (argc == 5) {
                if (!strcmp(argv[4], "CURRENT")) {
                        if (stat("/", &sb)) {
                                perror("/");
@@ -102,10 +102,20 @@
                        major_root = 0;
                        minor_root = 0;
                }
-       } else {
+       } else if (argc == 6) {
+               char *endptr;
+               major_root = (byte) strtol(argv[4], &endptr, 10);
+                if (endptr == argv[4])
+                        die("Invalid major device (%s)", argv[4]);
+
+               minor_root = (byte) strtol(argv[5], &endptr, 10);
+                if (endptr == argv[4])
+                        die("Invalid minor device (%s)", argv[5]);
+
+        } else {
                major_root = DEFAULT_MAJOR_ROOT;
                minor_root = DEFAULT_MINOR_ROOT;
-       }
+        }
        fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
        file_open(argv[1]);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]