]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
Die Mindestgröße des Dateisystems nochmal reduziert für die Installation
[people/teissler/ipfire-2.x.git] / src / install+setup / install / main.c
index d300dfbc0f5fd066c39b4da16b25e8794de6ee75..43ee6973414ac38acdf500b12667dcee4cd216d5 100644 (file)
@@ -14,7 +14,7 @@
 #define CDROM_INSTALL 0
 #define URL_INSTALL 1
 #define DISK_INSTALL 2
-#define INST_FILECOUNT 6000
+#define INST_FILECOUNT 6200
 #define UNATTENDED_CONF "/cdrom/boot/unattended.conf"
 
 #define REISER4 0
@@ -66,7 +66,7 @@ long calc_rootsize(long free, long max) {
        long root;
        
        root = max / 2;
-       if (root < 512) {
+       if (root < 256) {
                return 0;
        }
        if (root > 2048) {
@@ -378,16 +378,15 @@ int main(int argc, char *argv[])
        
        swap_file = calc_swapsize(memory, maximum_free);
 
-       if (maximum_free < 768 + swap_file ) {
-               if (maximum_free < 768) {
+       if (maximum_free < 512 + swap_file ) {
+               if (maximum_free < 700) {
                        errorbox(ctr[TR_DISK_TOO_SMALL]);
                        goto EXIT;
                }
 
                if (!unattended) {
                    rc = newtWinChoice(title, ctr[TR_OK], ctr[TR_CANCEL], ctr[TR_CONTINUE_NO_SWAP]);
-               }
-               else {
+               } else {
                    rc = 1;
                }
                
@@ -399,7 +398,7 @@ int main(int argc, char *argv[])
        boot_partition = 20; /* in MB */
        current_free = maximum_free - boot_partition - swap_file;
 
-       if (current_free < 768) {
+       if (current_free < 700) {
                errorbox(ctr[TR_DISK_TOO_SMALL]);
                goto EXIT;
        }
@@ -451,10 +450,10 @@ int main(int argc, char *argv[])
                sprintf(mkfscommand, "/sbin/mkreiserfs -f");
        } else if (fstype == EXT3) {
                mysystem("/sbin/modprobe ext3");
-               sprintf(mkfscommand, "/bin/mke2fs -T ext3 -c");
+               sprintf(mkfscommand, "/sbin/mke2fs -T ext3 -c");
        }
 
-       snprintf(commandstring, STRING_SIZE, "/bin/mke2fs -T ext2 -c %s1", hdparams.devnode_part);
+       snprintf(commandstring, STRING_SIZE, "/sbin/mke2fs -T ext2 -c %s1", hdparams.devnode_part);
        if (runcommandwithstatus(commandstring, ctr[TR_MAKING_BOOT_FILESYSTEM]))
        {
                errorbox(ctr[TR_UNABLE_TO_MAKE_BOOT_FILESYSTEM]);
@@ -577,14 +576,30 @@ int main(int argc, char *argv[])
                replace("/harddisk/etc/fstab", "FSTYPE", "reiserfs");
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
        } else if (fstype == EXT3) {
+               snprintf(commandstring, STRING_SIZE, "tune2fs -j %s3", hdparams.devnode_part);
+               if (runcommandwithstatus(commandstring, "(TR) Creating journal for ext3..."))
+               {
+                       errorbox("(TR) Unable to create journal. Going back to ext2.");
+                       replace("/harddisk/etc/fstab", "FSTYPE", "ext2");
+                       goto NOJOURNAL;
+               }
+               snprintf(commandstring, STRING_SIZE, "tune2fs -j %s4", hdparams.devnode_part);
+               if (runcommandwithstatus(commandstring, "(TR) Creating journal for ext3..."))
+               {
+                       errorbox("(TR) Unable to create journal. Going back to ext2.");
+                       replace("/harddisk/etc/fstab", "FSTYPE", "ext2");
+                       goto NOJOURNAL;
+               }
                replace("/harddisk/etc/fstab", "FSTYPE", "ext3");
+               NOJOURNAL:
+               replace("/harddisk/etc/mkinitcpio.conf", "MODULES=\"", "MODULES=\"ext3 ");
                replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
        }
 
        /* Going to make our initrd... */
-       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -v -g /boot/ipfirerd.img -k %s-ipfire", KERNEL_VERSION);
+       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd.img -k %s-ipfire", KERNEL_VERSION);
        runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
-       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -v -g /boot/ipfirerd-smp.img -k %s-ipfire-smp", KERNEL_VERSION);
+       snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-smp.img -k %s-ipfire-smp", KERNEL_VERSION);
        runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
 
        sprintf(string, "root=%s3", hdparams.devnode_part_run);