- sprintf(message, ctr[TR_RESTORE_CONFIGURATION], NAME);
- if (newtWinChoice(title, ctr[TR_RESTORE], ctr[TR_SKIP], message) == 1)
- {
- /* Temporarily mount /proc under /harddisk/proc,
- * run updfstab to locate the floppy, and unmount /harddisk/proc
- * again. This should be run each time the user tries to restore
- * so it can properly detect removable devices */
- if (mysystem("/bin/mount -n -t proc /proc /harddisk/proc")) {
- errorbox(ctr[TR_UNABLE_TO_MOUNT_PROC_FILESYSTEM]);
- goto EXIT;
- }
- if (mysystem("/bin/chroot /harddisk /usr/sbin/updfstab")) {
- errorbox(ctr[TR_UNABLE_TO_WRITE_ETC_FSTAB]);
- goto EXIT;
- }
- mysystem("/bin/umount /harddisk/proc");
-
- mkdir("/harddisk/tmp/ipcop", S_IRWXU|S_IRWXG|S_IRWXO);
-
- /* Always extract to /tmp/ipcop for temporary extraction
- * just in case floppy fails */
-
- /* try a compressed backup first because it's quicker to fail.
- * In exclude.system, files name must be without leading / or
- * on extraction, name will never match */
- snprintf(commandstring, STRING_SIZE,
- "/bin/chroot /harddisk /bin/tar -X " CONFIG_ROOT "/backup/exclude.system -C /tmp/ipcop -xvzf /dev/floppy > %s 2> /dev/null", mylog);
-
- statuswindow(45, 4, title, ctr[TR_INSTALLING_FILES]);
- rc = system(commandstring);
-
- if (rc) {
- /* if it's not compressed, try uncompressed first before failing*/
- snprintf(commandstring, STRING_SIZE,
- "/bin/chroot /harddisk /bin/tar -X " CONFIG_ROOT "/backup/exclude.system -C /tmp/ipcop -xvf /dev/floppy > %s 2> /dev/null", mylog);
- rc = system(commandstring);
- if (rc) {
- newtPopWindow();
- /* command failed trying to read from floppy */
- errorbox(ctr[TR_UNABLE_TO_INSTALL_FILES]);
-
- /* remove badly restored files */
- mysystem("/bin/chroot /harddisk /bin/rm -rf /tmp/ipcop");
- goto RESTORE;
- } else {
- /* Now copy to correct location */
- mysystem("/bin/chroot /harddisk /bin/cp -af /tmp/ipcop/. /");
- mysystem("/bin/chroot /harddisk /bin/rm -rf /tmp/ipcop");
- newtPopWindow();
- allok_fastexit=1;
-
- /* Upgrade necessary files from v1.2 to v1.3 to v1.4 */
- upgrade_v12_v13();
- upgrade_v130_v140();
- break; /* out of loop at this point because floppy has
- successfully restored */
- }
- }
- else { /* success */
- /* Now copy to correct location */
- mysystem("/bin/chroot /harddisk /bin/cp -af /tmp/ipcop/. /");
- mysystem("/bin/chroot /harddisk /bin/rm -rf /tmp/ipcop");
- newtPopWindow();
- allok_fastexit=1;
-
- /* Upgrade necessary files from v1.2 to v1.3 to v1.4 */
- upgrade_v12_v13();
- upgrade_v130_v140();
- break; /* out of loop at this point because floppy has
- successfully restored */
- }
- }
- else{ /* user chose to skip install from floppy */
- if (installtype == CDROM_INSTALL){
- /* if we installed from CD ROM then we didn't set up the
- network interface yet. Therefore, set up Network
- driver and params just before we need them. */
-
- if (!(networkmenu(ethernetkv))){
- /* network setup failed, tell the world */
- errorbox(ctr[TR_NETWORK_SETUP_FAILED]);