char commandstring[STRING_SIZE];
char mkfscommand[STRING_SIZE];
char *fstypes[] = { "Reiser4", "ReiserFS", "ext3", NULL };
- int fstype = REISER4;
+ int fstype = REISERFS;
int choice;
int i;
int found = 0;
int unattended = 0;
struct keyvalue *unattendedkv = initkeyvalues();
int hardyn = 0;
+ char restore_file[STRING_SIZE] = "";
setlocale (LC_ALL, "");
sethostname( SNAME , 10);
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.
ctr[TR_CANCEL], NULL);
} else {
rc = 1;
- fstype = REISER4; // Reiser4 is our standard filesystem. Love it or shut up!
+ fstype = REISERFS;
}
if (rc == 2)
goto EXIT;
"/bin/touch /harddisk/lib/modules/%s-ipfire/modules.dep",
KERNEL_VERSION);
mysystem(commandstring);
- snprintf(commandstring, STRING_SIZE,
+/* snprintf(commandstring, STRING_SIZE,
"/bin/touch /harddisk/lib/modules/%s-ipfire-smp/modules.dep",
KERNEL_VERSION);
mysystem(commandstring);
+*/
+ snprintf(commandstring, STRING_SIZE,
+ "/bin/touch /harddisk/lib/modules/2.6.25.17-ipfire/modules.dep");
+ mysystem(commandstring);
+
/* Rename uname */
rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
if (fstype == REISER4) {
replace("/harddisk/etc/fstab", "FSTYPE", "reiser4");
- replace("/harddisk/etc/mkinitcpio.conf", "MODULES=\"", "MODULES=\"reiser4 ");
replace("/harddisk/boot/grub/grub.conf", "MOUNT", "rw");
} else if (fstype == REISERFS) {
replace("/harddisk/etc/fstab", "FSTYPE", "reiserfs");
}
replace("/harddisk/etc/fstab", "FSTYPE", "ext3");
NOJOURNAL:
- replace("/harddisk/etc/mkinitcpio.conf", "MODULES=\"", "MODULES=\"ext3 ");
replace("/harddisk/boot/grub/grub.conf", "MOUNT", "ro");
}
replace("/harddisk/boot/grub/grub.conf", "KVER", KERNEL_VERSION);
+ /* Build the emergency ramdisk with all drivers */
+ mysystem("cp -f /harddisk/etc/mkinitcpio.conf /harddisk/etc/mkinitcpio.conf.org");
+
+ replace("/harddisk/etc/mkinitcpio.conf", " autodetect ", " ");
+ snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-emergency.img -k %s-ipfire", KERNEL_VERSION, KERNEL_VERSION);
+ runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
+
+ mysystem("cp -f /harddisk/etc/mkinitcpio.conf.org /harddisk/etc/mkinitcpio.conf");
+
/* mkinitcpio has a problem if ide and pata are included */
if ( scsi_disk==1 ) {
/* Remove the ide hook if we install sda */
/* Going to make our initrd... */
snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s.img -k %s-ipfire", KERNEL_VERSION, KERNEL_VERSION);
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
- snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-smp.img -k %s-ipfire-smp", KERNEL_VERSION, KERNEL_VERSION );
+/* snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-smp.img -k %s-ipfire-smp", KERNEL_VERSION, KERNEL_VERSION );
+ runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
+*/
+ snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-2.6.25.17.img -k 2.6.25.17-ipfire");
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
+
+
sprintf(string, "root=%s3", hdparams.devnode_part_run);
replace( "/harddisk/boot/grub/grub.conf", "root=ROOT", string);
mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
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);