275 |
static char buf[1025]; |
static char buf[1025]; |
276 |
char *s = NULL; |
char *s = NULL; |
277 |
char *ret = NULL; |
char *ret = NULL; |
278 |
char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv"; |
char *envFile = info->envFile ? info->envFile : "/boot/grub/grubenv"; |
279 |
int rc = asprintf(&s, "grub2-editenv %s list | grep '^%s='", envFile, name); |
int rc = asprintf(&s, "grub-editenv %s list | grep '^%s='", envFile, name); |
280 |
|
|
281 |
if (rc < 0) |
if (rc < 0) |
282 |
return NULL; |
return NULL; |
340 |
{ |
{ |
341 |
char *s = NULL; |
char *s = NULL; |
342 |
int rc = 0; |
int rc = 0; |
343 |
char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv"; |
char *envFile = info->envFile ? info->envFile : "/boot/grub/grubenv"; |
344 |
|
|
345 |
unquote(value); |
unquote(value); |
346 |
value = shellEscape(value); |
value = shellEscape(value); |
347 |
if (!value) |
if (!value) |
348 |
return -1; |
return -1; |
349 |
|
|
350 |
rc = asprintf(&s, "grub2-editenv %s set '%s=%s'", envFile, name, value); |
rc = asprintf(&s, "grub-editenv %s set '%s=%s'", envFile, name, value); |
351 |
free(value); |
free(value); |
352 |
if (rc <0) |
if (rc <0) |
353 |
return -1; |
return -1; |