* (c) Lawrence Manning, 2001
* Contains main entry point, and misc functions.
*
- * $Id: main.c,v 1.63.2.57 2005/09/25 19:57:46 gespinasse Exp $
- *
*/
#include "install.h"
#define CDROM_INSTALL 0
#define URL_INSTALL 1
-#define LANG_DE_EN
int raid_disk = 0;
FILE *flog = NULL;
char *pcmcia = NULL;
extern char url[STRING_SIZE];
-extern char *bz_tr[];
-extern char *cs_tr[];
-extern char *da_tr[];
extern char *en_tr[];
-extern char *es_tr[];
-extern char *fi_tr[];
-extern char *fr_tr[];
-extern char *hu_tr[];
-extern char *la_tr[];
-extern char *nl_tr[];
extern char *de_tr[];
-extern char *tr_tr[];
-extern char *it_tr[];
-extern char *el_tr[];
-extern char *pl_tr[];
-extern char *pt_tr[];
-extern char *so_tr[];
-extern char *sv_tr[];
-extern char *no_tr[];
-extern char *vi_tr[];
int main(int argc, char *argv[])
{
char *langnames[] = { "English", NULL };
char *shortlangnames[] = { "en", NULL };
char **langtrs[] = { en_tr, NULL };
-#elif LANG_DE_EN
+#else
char *langnames[] = { "Deutsch", "English", NULL };
char *shortlangnames[] = { "de", "en", NULL };
char **langtrs[] = { de_tr, en_tr, NULL };
-#else
- char *langnames[] = { "Brasil", "Cestina", "Dansk", "Deutsch", "English", "Español", "Français", "Hellenic", "Italiano", "Spanish Latino", "Magyar", "Nederlands", "Norsk", "Polski", "Português", "Soomali", "Suomi", "Svenska", "Türkçe", "Tieng Viet", NULL };
- char *shortlangnames[] = { "bz", "cs", "da", "de", "en", "es", "fr", "el", "it", "la", "hu", "nl", "no", "pl", "pt", "so", "fi", "sv", "tr", "vi", NULL };
- char **langtrs[] = { bz_tr, cs_tr, da_tr, de_tr, en_tr, es_tr, fr_tr, el_tr, it_tr, la_tr, hu_tr, nl_tr, no_tr, pl_tr, pt_tr, so_tr, fi_tr, sv_tr, tr_tr, vi_tr, NULL };
-
#endif
char hdletter, cdletter;
char harddrive[5], cdromdrive[5]; /* Device holder. */
/* No need to ask. "choice" already has the index for English */
#else
rc = newtWinMenu("Language selection",
- "Select the language you wish to use for the " NAME ".", 50, 5, 5, 8,
- langnames, &choice, "Ok", NULL);
+ "Select the language you wish to use for your " NAME ".", 50, 5, 5, 8,
+ langnames, &choice, "OK", NULL);
#endif
ctr = langtrs[choice];
strcpy(shortlangname, shortlangnames[choice]);
- if (strcmp(shortlangname, "el") == 0)
- mysystem("/bin/setfont iso07u-16");
- else if (strcmp(shortlangname, "pt") == 0)
- mysystem("/bin/setfont lat1-16");
- else if (strcmp(shortlangname, "bz") == 0)
- mysystem("/bin/setfont lat1-16");
- else if (strcmp(shortlangname, "cs") == 0)
- mysystem("/bin/setfont lat2-16");
- else if (strcmp(shortlangname, "hu") == 0)
- mysystem("/bin/setfont lat2-16");
- else if (strcmp(shortlangname, "pl") == 0)
- mysystem("/bin/setfont lat2-16");
- else if (strcmp(shortlangname, "tr") == 0)
- mysystem("/bin/setfont lat5-16");
- else if (strcmp(shortlangname, "vi") == 0)
- mysystem("/bin/setfont viscii10-8x16");
- else
- mysystem("/bin/setfont lat0-16");
+
+ mysystem("/bin/setfont lat0-16");
newtDrawRootText(14, 0, NAME " v" VERSION " - " SLOGAN );
newtPushHelpLine(ctr[TR_HELPLINE]);
rc = newtWinMenu(ctr[TR_SELECT_INSTALLATION_MEDIA], message,
50, 5, 5, 6, installtypes, &installtype, ctr[TR_OK],
ctr[TR_CANCEL], NULL);
-
+
if (rc == 2)
goto EXIT;
-
+
if (installtype == CDROM_INSTALL)
{
/* First look for an IDE CDROM. */
goto EXIT;
}
- /* Check for ipcop-<VERSION>.tgz */
+ /* Check for ipfire-<VERSION>.tgz */
if (!(checktarball(SNAME "-" VERSION ".tgz")))
{
errorbox(ctr[TR_NO_IPCOP_TARBALL_FOUND]);
swap_file = 0;
}
- boot_partition = 8; /* in MB */
+ boot_partition = 20; /* in MB */
current_free = maximum_free - boot_partition - swap_file;
/* Give more place for add-on, extend root to 25% of current_free, upper limit to 8 gigas */
snprintf(commandstring, STRING_SIZE,
"/bin/wget -O - %s/" SNAME "-" VERSION ".tgz | /bin/tar -C /harddisk -xvzf -", url);
- if (runcommandwithprogress(60, 4, title, commandstring, 4600,
- ctr[TR_INSTALLING_FILES]))
+ /* if (runcommandwithprogress(60, 4, title, commandstring, 4600,
+ * ctr[TR_INSTALLING_FILES]))
+ * {
+ * errorbox(ctr[TR_UNABLE_TO_INSTALL_FILES]);
+ * goto EXIT;
+ * }
+ */
+
+ if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_FILES]))
{
errorbox(ctr[TR_UNABLE_TO_INSTALL_FILES]);
goto EXIT;
}
-
+
/* Save USB controller type to modules.conf */
write_usb_modules_conf();
error and go back to the restore/skip question. This gives
the user the chance to have another go. */
+#ifdef OLD_RESTORECFG
RESTORE:
/* set status variables to nonsense values */
allok_fastexit = 0;
set up and user is notrestarting from floppy*/
}
}
+#else
+ 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]);
+ goto EXIT;
+ }
+ }
+#endif
/* Check the SQUID acl file exists, if not use our 1.4 copy */
{
driver = strtok(line, ".");
fprintf(flog, "Detected SCSI driver %s\n",driver);
if (strlen(driver) > 1) {
- fprintf(flog, "Fixing up ipcoprd.img\n");
+ fprintf(flog, "Fixing up ipfirerd.img\n");
mysystem("/bin/chroot /harddisk /sbin/modprobe loop");
mkdir("/harddisk/initrd", S_IRWXU|S_IRWXG|S_IRWXO);
- snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/mkinitrd --with=scsi_mod --with=%s --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipcoprd.img %s", driver, KERNEL_VERSION);
+ snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/mkinitrd --with=scsi_mod --with=%s --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipfirerd.img %s", driver, KERNEL_VERSION);
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
#ifdef __i386__
- snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/mkinitrd --with=scsi_mod --with=%s --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipcoprd-smp.img %s-smp", driver, KERNEL_VERSION);
+ snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/mkinitrd --with=scsi_mod --with=%s --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipfirerd-smp.img %s-smp", driver, KERNEL_VERSION);
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
mysystem("/bin/chroot /harddisk /bin/mv /boot/grub/scsigrub.conf /boot/grub/grub.conf");
#endif
if (pcmcia_disk)
{
fprintf(flog, "Detected SCSI driver PCMCIA\n");
- fprintf(flog, "Fixing up ipcoprd.img\n");
+ fprintf(flog, "Fixing up ipfirerd.img\n");
mysystem("/bin/chroot /harddisk /sbin/modprobe loop");
mkdir("/harddisk/initrd", S_IRWXU|S_IRWXG|S_IRWXO);
- snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/pcinitrd -r %s /boot/ipcoprd.img", KERNEL_VERSION);
+ snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/pcinitrd -r %s /boot/ipfirerd.img", KERNEL_VERSION);
mysystem(commandstring);
#ifdef __i386__
mysystem("/bin/chroot /harddisk /bin/mv /boot/grub/scsigrub.conf /boot/grub/grub.conf");
errorbox(ctr[TR_UNABLE_TO_INSTALL_GRUB]);
goto EXIT;
}
+ /* Set Bootsplash */
+ mysystem("/bin/installbootsplash.sh");
mysystem("/bin/chroot /harddisk /bin/umount -n /proc");
#endif
#ifdef __alpha__