]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge branch 'kernel25'
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 29 Sep 2008 20:21:52 +0000 (22:21 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 29 Sep 2008 20:21:52 +0000 (22:21 +0200)
config/rootfiles/common/stage2
config/syslinux/unattended.conf
html/cgi-bin/ovpnmain.cgi
src/install+setup/install/main.c
src/install+setup/install/unattended.c
src/scripts/backupiso [new file with mode: 0644]

index f41e6f7e6a9016d5f42b3c35f7d60b4adfaee1c1..93451abdbf0ab4cf8d395273156b9a2228682a3f 100644 (file)
@@ -56,6 +56,7 @@ tmp
 #usr/lib
 usr/lib/libgcc_s.so
 usr/lib/libgcc_s.so.1
+usr/local/bin/backupiso
 usr/local/bin/connscheduler
 usr/local/bin/dialctrl.pl
 usr/local/bin/hddshutdown
index 5adf279001c2c7274bbf8235a77172086a7284ee..39f6bca25540c2d8ae5927f8d0bd4b45ffa0433e 100644 (file)
@@ -10,3 +10,4 @@ GREEN_NETADDRESS=192.168.180.0
 GREEN_BROADCAST=192.168.180.255
 ROOT_PASSWORD=ipfire
 ADMIN_PASSWORD=ipfire
+RESTORE_FILE=
index 746f7eece5aa95527a8994ccac2ade097417bf84..374b25f5ea39f7d0a71ba565ce96f2e2ab9094fe 100644 (file)
@@ -1378,6 +1378,7 @@ END
     }
     print CLIENTCONF "verb 3\r\n";
     print CLIENTCONF "ns-cert-type server\r\n";
+    print CLIENTCONF "tls-remote $vpnsettings{ROOTCERT_HOSTNAME}\r\n";
     close(CLIENTCONF);
     $zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n";
     my $status = $zip->writeToFileNamed($zippathname);
index 0d596a56fb488e0ad9305e025d13caaa708f0545..d4f31b38b562e33a83384ca18ffae684be421228 100644 (file)
@@ -66,6 +66,7 @@ int main(int argc, char *argv[])
        int unattended = 0;
        struct keyvalue *unattendedkv = initkeyvalues();
        int hardyn = 0;
+       char restore_file[STRING_SIZE] = "";
 
        setlocale (LC_ALL, "");
        sethostname( SNAME , 10);
@@ -208,6 +209,7 @@ int main(int argc, char *argv[])
            fprintf(flog, "unattended: Reading unattended.conf\n");
 
            (void) readkeyvalues(unattendedkv, UNATTENDED_CONF);
+           findkey(unattendedkv, "RESTORE_FILE", restore_file);            
        }
        
        /* Make the hdparms struct and print the contents.
@@ -548,6 +550,13 @@ int main(int argc, char *argv[])
                goto EXIT;
        }
        
+       /* Copy restore file from cdrom */
+       if (unattended && (strlen(restore_file) > 0)) {
+               fprintf(flog, "unattended: Copy restore file\n");
+           snprintf(commandstring, STRING_SIZE, 
+                       "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);
+       }
+       
        mysystem("umount /cdrom");
        snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);
        mysystem(commandstring);
index 1acace1b003687f3d6160052fbc725bf70ab5c2b..754946aa22fee778205620b7e80de94fe6b01ccb 100644 (file)
@@ -41,7 +41,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     char green_broadcast[STRING_SIZE];
     char root_password[STRING_SIZE];
     char admin_password[STRING_SIZE];
-    char restore_file[STRING_SIZE];
+    char restore_file[STRING_SIZE] = "";
 
     findkey(unattendedkv, "DOMAINNAME", domainname);
     findkey(unattendedkv, "HOSTNAME", hostname);
@@ -147,13 +147,12 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     }
 
        /* restore backup */
-       if (!strcmp(restore_file, "")) {
+       if (strlen(restore_file) > 0) {
                fprintf(flog, "unattended: Restoring Backup\n");
            snprintf(commandstring, STRING_SIZE,
-                   "cd /harddisk && /bin/tar -xvz --preserve -f /cdrom/%s", restore_file);
+                   "cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file);
            if (mysystem(commandstring)) {
-               errorbox("unattended: ERROR setting admin password");
-               return 0;
+               errorbox("unattended: ERROR restoring backup");
            }
        }
 
diff --git a/src/scripts/backupiso b/src/scripts/backupiso
new file mode 100644 (file)
index 0000000..04b675c
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# FIXME: edit this lines before release
+#URL=http://download.ipfire.org/iso/
+#ISO=ipfire-2.3-beta4.i586-full.iso
+URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20080929-6uhr/
+ISO=ipfire-2.3-test.i586-full.iso
+
+if [ -z "$1" ]; then 
+       echo usage: $0 backup-file
+       exit
+fi
+
+TS=$1
+
+mkdir -p /var/tmp/backupiso
+cd /var/tmp/backupiso
+
+echo "Fetching ${URL}${ISO}"
+wget --quiet -c ${URL}${ISO}
+echo "Fetching ${URL}md5sums.txt"
+wget --quiet -O md5sums.txt ${URL}md5sums.txt
+
+echo "Checking md5 of ${ISO}"
+cat md5sums.txt | grep iso | tr '\r' '\n' | md5sum --status -c
+RETVAR="$?"
+if [ $RETVAR -eq 0 -o $RETVAR -eq 24 ]
+       then
+                echo "md5 is OK"
+       else
+                echo "md5 mismatch"
+               echo "Fetching again ${URL}${ISO}"
+               wget --quiet -O ${ISO} ${URL}${ISO}
+fi
+
+echo "Remastering iso"
+mkdir -p backupiso.tmp.${TS}
+mount -o loop ${ISO} backupiso.tmp.${TS}
+cp -pr backupiso.tmp.${TS} backupiso.${TS}
+umount backupiso.tmp.${TS}
+rm -r backupiso.tmp.${TS}
+
+echo "RESTORE=${TS}.ipf" >> backupiso.${TS}/boot/unattended.conf
+cp /var/ipfire/backup/${TS}.ipf backupiso.${TS}
+
+echo "Running mkisofs"
+mkisofs -J -r -V "ipfire backup ${TS}" \
+            -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
+            -c boot/isolinux/boot.catalog backupiso.${TS} > `basename ${ISO} .iso`-${TS}.iso
+
+echo "Cleaning up"
+rm -rf backupiso.${TS}