Changeset 1579 in MondoRescue
- Timestamp:
- Jul 27, 2007, 1:19:42 AM (17 years ago)
- Location:
- branches/2.2.5/mondo/src/mondorestore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/mondorestore/mondo-restore.c
r1547 r1579 614 614 clean_blkid(bkpinfo); 615 615 protect_against_braindead_sysadmins(); 616 // modify_rclocal_one_time( MNT_RESTORING "/etc" );617 616 retval += unmount_all_devices(mountlist); 618 617 /* if (restore_some || restore_all || */ … … 853 852 clean_blkid(bkpinfo); 854 853 protect_against_braindead_sysadmins(); 855 // modify_rclocal_one_time( MNT_RESTORING "/etc" );856 854 retval += unmount_all_devices(mountlist); 857 855 mvaddstr_and_log_it(g_currentY, -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools-EXT.h
r912 r1579 8 8 extern int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please); 9 9 extern void kill_petris(void); 10 extern int modify_rclocal_one_time(char *path);11 10 extern int mount_cdrom(struct s_bkpinfo *bkpinfo); 12 11 extern int mount_all_devices(struct mountlist_itself *, bool); -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c
r1547 r1579 526 526 *END_KILL_PETRIS * 527 527 **************************************************************************/ 528 529 530 /**531 * (Disabled) Modify rc.local to fix some things on first boot.532 * This function currently doesn't do anything except make sure /tmp has the533 * right permissions.534 * @param path The path to /etc on the user's filesystem.535 * @return 0 for success, nonzero for failure.536 */537 int modify_rclocal_one_time(char *path)538 {539 /** malloc **/540 char *rclocal_fname;541 char *newfile_fname;542 char *tmp;543 544 malloc_string(rclocal_fname);545 malloc_string(newfile_fname);546 malloc_string(tmp);547 assert_string_is_neither_NULL_nor_zerolength(path);548 549 sprintf(rclocal_fname, "%s/rc.local", path);550 551 // sprintf(tmp, "chmod 1777 %s/tmp", MNT_RESTORING);552 // run_program_and_log_output( tmp, FALSE );553 return (0); /* remove this line to open the floodgates... */554 555 if (!does_file_exist(rclocal_fname)) {556 sprintf(rclocal_fname, "%s/rc.d/rc.local", path);557 }558 if (!does_file_exist(rclocal_fname)) {559 paranoid_free(rclocal_fname);560 paranoid_free(newfile_fname);561 paranoid_free(tmp);562 return (1);563 }564 sprintf(newfile_fname, "%s/rc.local.mondorescue", path);565 sprintf(tmp, "grep mondorescue %s > /dev/null 2> /dev/null",566 rclocal_fname);567 if (system(tmp)) {568 sprintf(tmp, "echo \"[ -e %s ] && %s\n\" >> %s",569 newfile_fname, newfile_fname, rclocal_fname);570 571 paranoid_system(tmp);572 }573 sprintf(tmp, "echo -en \"#!/bin/sh\574 \\n\575 \\n\576 grep -v mondorescue %s > %s\\n\577 rm -f /var/lock/subsys/*xfs*\\n\578 rm -f /var/run/xfs.*\\n\579 killall xfs\\n\580 service xfs start\\n\581 yes | rm -f %s\\n\582 \" > %s", rclocal_fname, rclocal_fname, newfile_fname, newfile_fname);583 sprintf(tmp, "chmod +x \"%s\"", newfile_fname);584 run_program_and_log_output(tmp, FALSE);585 paranoid_free(rclocal_fname);586 paranoid_free(newfile_fname);587 paranoid_free(tmp);588 return (0);589 }590 591 /**************************************************************************592 *END_ MODIFY_RCLOCAL_ONE_TIME *593 **************************************************************************/594 595 596 597 528 598 529 -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.h
r1052 r1579 8 8 int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please); 9 9 void kill_petris(void); 10 int modify_rclocal_one_time(char *path);11 10 int mount_cdrom(struct s_bkpinfo *bkpinfo); 12 11 int mount_device(char *, char *, char *, bool);
Note:
See TracChangeset
for help on using the changeset viewer.