Displaying 3 results from an estimated 3 matches for "device_string".
2006 Jul 11
0
[rfc] standalone kinit/resume
...me requested */
- if (get_flag(argc, argv, "noresume"))
- return 0;
- return resume(resume_file);
+ fprintf(stderr, "Usage: %s /dev/<resumedevice>\n", progname);
+ exit(1);
}
-int resume(const char *resume_file)
+int main(int argc, char *argv[], char *envp[])
{
- char device_string[64];
- int powerfd = -1;
- dev_t resume_device;
- int len;
-
- resume_device = name_to_dev_t(resume_file);
-
- if (major(resume_device) == 0) {
- fprintf(stderr, "Invalid resume device: %s\n", resume_file);
- goto failure;
- }
-
- if ((powerfd = open("/sys/power/resume", O_WRO...
2019 Jan 20
0
[klibc:master] resume: Write resume_offset attribute
.../resume/resumelib.c
index e557b05..03e596a 100644
--- a/usr/kinit/resume/resumelib.c
+++ b/usr/kinit/resume/resumelib.c
@@ -44,8 +44,8 @@ int do_resume(int argc, char *argv[])
int resume(const char *resume_file, unsigned long long resume_offset)
{
dev_t resume_device;
- int powerfd = -1;
- char device_string[64];
+ int attr_fd = -1;
+ char attr_value[64];
int len;
resume_device = name_to_dev_t(resume_file);
@@ -55,30 +55,50 @@ int resume(const char *resume_file, unsigned long long resume_offset)
goto failure;
}
- if ((powerfd = open("/sys/power/resume", O_WRONLY)) < 0)
- goto...
2018 Mar 30
0
[PATCH] resume: Use the kernel API from 4.17 for setting resume offset
...elib.c b/usr/kinit/resume/resumelib.c
index e557b05..5fc2019 100644
--- a/usr/kinit/resume/resumelib.c
+++ b/usr/kinit/resume/resumelib.c
@@ -45,7 +45,9 @@ int resume(const char *resume_file, unsigned long long resume_offset)
{
dev_t resume_device;
int powerfd = -1;
+ int offsetfd = -1;
char device_string[64];
+ char offset_string[64];
int len;
resume_device = name_to_dev_t(resume_file);
@@ -55,13 +57,23 @@ int resume(const char *resume_file, unsigned long long resume_offset)
goto failure;
}
+ /* Write the offset, this won't work on less than 4.17 */
+ offsetfd = open("/sys/pow...