]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Fix unattended installation.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 1 Dec 2010 23:08:48 +0000 (00:08 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 1 Dec 2010 23:08:48 +0000 (00:08 +0100)
lfs/usb-stick
src/install+setup/install/main.c
src/install+setup/install/unattended.c

index 427efe0de0b89114c9c547ffef5f08914d104da5..acfa409395b45a93b88d7a17e10dbce06ff3c7bf 100644 (file)
@@ -66,8 +66,8 @@ define COPY_TO_IMG
        losetup $$LOOPDEV $$IMAGE && \
        mount -t vfat $$LOOPDEV /install/mnt && \
        cp -fR /install/cdrom/* /install/mnt && \
-       mv /install/mnt/boot/isolinux/{instroot,vmlinuz,unattended.conf,splash.lss,*\.msg,memtest} /install/mnt && \
-       rm -rf /install/mnt/boot && \
+       mv /install/mnt/boot/isolinux/{instroot,vmlinuz,splash.lss,*\.msg,memtest} /install/mnt && \
+       rm -rf /install/mnt/boot/isolinux && \
        cp $(DIR_SRC)/config/syslinux/syslinux.cfg /install/mnt/syslinux.cfg && \
        umount /install/mnt && \
        losetup -d $$LOOPDEV && \
index 5de914f7612c02106428bfd217a93e12d7debeaa..ca2d5bd619b2b7d68da0ea2b7b17d27957992186 100644 (file)
@@ -557,10 +557,11 @@ EXIT:
                fclose(flog);
                newtFinished();
 
-//             if (!unattended) {
-//                     if (system("/usr/sbin/chroot /harddisk /usr/local/sbin/setup /dev/tty2 INSTALL"))
-//                             printf("Unable to run setup.\n");
-//             }
+               if (unattended) {
+                       // Remove Setup autorun after boot
+                       if (system("rm -f /harddisk/etc/rc.d/rcsysinit.d/S75firstsetup"))
+                               printf("Unable to disable setup autorun.\n");
+               }
 
                if (system("/bin/umount /harddisk/proc"))
                        printf("Unable to umount /harddisk/proc.\n"); 
index cfdf3314549efdb6b2ca652c81aaa27bde8a2c74..3e2f3f08865f932782b98b5d69cfcd1c7e51d2e9 100644 (file)
@@ -131,7 +131,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     /* set root password */
     fprintf(flog, "unattended: setting root password\n");
     snprintf(commandstring, STRING_SIZE,
-           "/sbin/chroot /harddisk /bin/sh -c \"echo 'root:%s' | /usr/sbin/chpasswd\"", root_password);
+           "/usr/sbin/chroot /harddisk /bin/sh -c \"echo 'root:%s' | /usr/sbin/chpasswd\"", root_password);
     if (mysystem(commandstring)) {
        errorbox("unattended: ERROR setting root password");
        return 0;
@@ -140,7 +140,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     /* set admin password */
     fprintf(flog, "unattended: setting admin password\n");
     snprintf(commandstring, STRING_SIZE,
-           "/sbin/chroot /harddisk /usr/sbin/htpasswd -c -m -b " CONFIG_ROOT "/auth/users admin '%s'", admin_password);
+           "/usr/sbin/chroot /harddisk /usr/sbin/htpasswd -c -m -b " CONFIG_ROOT "/auth/users admin '%s'", admin_password);
     if (mysystem(commandstring)) {
        errorbox("unattended: ERROR setting admin password");
        return 0;