Hello,

This patch adds --splash argument to s2both, s2disk, resume.
It is required especially for resume when you want to disable splash in 
initramfs
as result of kernel parameter, even if it usually turned on on suspend.conf you
wish to turn it off.

This is handy if you get oops or cannot boot and see no messages.

Alon.

---

diff -urNp suspend.org/resume.c suspend.sp1/resume.c
--- suspend.org/resume.c        2007-05-13 20:53:13.000000000 +0300
+++ suspend.sp1/resume.c        2007-08-05 00:10:49.000000000 +0300
@@ -53,7 +53,7 @@ static char decrypt;
 #else
 #define decrypt 0
 #endif
-static char splash_param;
+static char splash_param = 0;
 static int use_platform_suspend;
 
 static struct splash splash;
@@ -752,6 +752,10 @@ static inline int get_config(int argc, c
                       "resume_offset\0offset of swap file in resume device.",  
                       required_argument,       NULL, 'o'
                   },
+                  { 
+                      "splash\0\t\toverride splash settings.",
+                      required_argument,       NULL, 'p'
+                  },
                   { NULL,              0,                      NULL,  0 }
        };
        int i, error;
@@ -760,7 +764,9 @@ static inline int get_config(int argc, c
        unsigned long long int off = 0;
        int set_rdev = 0;
        char *rdev = NULL;
-       const char *optstring = "hf:o:r:";
+       char splash_arg = 0;
+       int set_splash = 0;
+       const char *optstring = "hf:o:r:p:";
 
        while ((i = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
                switch (i) {
@@ -778,6 +784,10 @@ static inline int get_config(int argc, c
                        rdev  = optarg;
                        set_rdev = 1;
                        break;
+               case 'p':
+                       splash_arg = *optarg;
+                       set_splash = 1;
+                       break;
                default:
                        usage("resume", options, optstring);
                        return -EINVAL;
@@ -794,6 +804,9 @@ static inline int get_config(int argc, c
        if (set_off)
                resume_offset = off;
 
+       if (set_splash)
+               splash_param = splash_arg;
+
        if (optind < argc)
                strncpy(resume_dev_name, argv[optind], MAX_STR_LEN - 1);
 
diff -urNp suspend.org/suspend.c suspend.sp1/suspend.c
--- suspend.org/suspend.c       2007-07-29 21:30:27.000000000 +0300
+++ suspend.sp1/suspend.c       2007-08-05 00:11:12.000000000 +0300
@@ -78,7 +78,7 @@ static char password[PASS_SIZE];
 static char s2ram;
 #endif
 static char early_writeout;
-static char splash_param;
+static char splash_param = 0;
 #define SHUTDOWN_LEN   16
 static char shutdown_method_value[SHUTDOWN_LEN] = "";
 static enum {
@@ -1207,6 +1207,10 @@ static inline int get_config(int argc, c
                       "image_size\0\tdesired size of the image.",
                       required_argument,       NULL, 's'
                   },
+                  { 
+                      "splash\0\t\toverride splash settings.",
+                      required_argument,       NULL, 'p'
+                  },
 #ifdef CONFIG_BOTH
                   HACKS_LONG_OPTS
 #endif
@@ -1220,7 +1224,9 @@ static inline int get_config(int argc, c
        unsigned long int im_size = 0;
        char *rdev = NULL;
        int set_rdev = 0;
-       const char *optstring = "hf:s:o:r:";
+       char splash_arg = 0;
+       int set_splash = 0;
+       const char *optstring = "hf:s:o:r:p:";
 
        while ((i = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
                switch (i) {
@@ -1242,6 +1248,10 @@ static inline int get_config(int argc, c
                        rdev  = optarg;
                        set_rdev = 1;
                        break;
+               case 'p':
+                       splash_arg = *optarg;
+                       set_splash = 1;
+                       break;
                case '?':
                        usage(my_name, options, optstring);
                        return -EINVAL;
@@ -1278,6 +1288,9 @@ static inline int get_config(int argc, c
 
        if (set_size)
                pref_image_size = im_size;
+       
+       if (set_splash)
+               splash_param = splash_arg;
 
        if (optind < argc)
                strncpy(resume_dev_name, argv[optind], MAX_STR_LEN - 1);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to