Changeset 2903 in MondoRescue for branches/3.0/mondo/src/common/libmondo-files.c
- Timestamp:
- Nov 21, 2011, 3:20:17 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/libmondo-files.c
r2887 r2903 1338 1338 } 1339 1339 1340 1341 1342 /**1343 * Create a small script that mounts /boot, calls @c grub-install, and syncs the disks.1344 * @param outfile Where to put the script.1345 * @return 0 for success, 1 for failure.1346 */1347 int make_grub_install_scriptlet(char *outfile)1348 {1349 FILE *fout;1350 char *tmp;1351 int retval = 0;1352 1353 malloc_string(tmp);1354 if ((fout = fopen(outfile, "w"))) {1355 fprintf(fout,1356 "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n");1357 paranoid_fclose(fout);1358 log_msg(2, "Created %s", outfile);1359 sprintf(tmp, "chmod +x %s", outfile);1360 paranoid_system(tmp);1361 retval = 0;1362 } else {1363 retval = 1;1364 }1365 paranoid_free(tmp);1366 return (retval);1367 }1368 1369 1340 /* @} - end fileGroup */
Note:
See TracChangeset
for help on using the changeset viewer.