PXE Boot integriert.

Installerarbeit fortgesetzt.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@351 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-11-28 20:05:18 +00:00
parent 22b9e40595
commit 9607771add
14 changed files with 825 additions and 735 deletions

View File

@@ -37,7 +37,7 @@ int ejectcdrom(char *dev);
int networkmenu(struct keyvalue *ethernetkv);
/* net.c */
int checktarball(char *);
int checktarball(char *, char *message);
/* config.c */
int write_disk_configs(struct devparams *dp);
@@ -47,12 +47,6 @@ int write_ethernet_configs(struct keyvalue *ethernetkv);
/* pcmcia.c */
char * initialize_pcmcia (void);
/* upgrade_v12_v13.c */
int upgrade_v12_v13();
/* upgrade_v130_v131.c */
int upgrade_v130_v140();
/* usb.c */
int initialize_usb();
int write_usb_modules_conf();

View File

@@ -394,31 +394,48 @@ int main(int argc, char *argv[])
// Starting hardware detection
runcommandwithstatus("/bin/probehw.sh", ctr[TR_PROBING_HARDWARE]);
switch (mysystem("/bin/mountsource.sh")) {
case 0:
installtype = CDROM_INSTALL;
cdmounted = 1;
break;
case 1:
installtype = DISK_INSTALL;
break;
case 10:
errorbox(ctr[TR_NO_CDROM]);
goto EXIT;
/* CDROM INSTALL */
if (installtype == CDROM_INSTALL) {
switch (mysystem("/bin/mountsource.sh")) {
case 0:
installtype = CDROM_INSTALL;
cdmounted = 1;
break;
case 1:
installtype = DISK_INSTALL;
break;
case 10:
errorbox(ctr[TR_NO_CDROM]);
goto EXIT;
}
/* read source drive letter */
if ((handle = fopen("/source_device", "r")) == NULL) {
errorbox("ERROR reading source_device");
}
fgets(sourcedrive, 5, handle);
fprintf(flog, "Source drive: %s\n", sourcedrive);
fclose(handle);
snprintf(cdromparams.devnode, STRING_SIZE, "/dev/%s", sourcedrive);
cdromparams.module = 0;
fprintf(flog, "Source device: %s\n", cdromparams.devnode);
}
/* read source drive letter */
if ((handle = fopen("/source_device", "r")) == NULL) {
errorbox("ERROR reading source_device");
}
fgets(sourcedrive, 5, handle);
fprintf(flog, "Source drive: %s\n", sourcedrive);
fclose(handle);
if (installtype == CDROM_INSTALL) {
snprintf(cdromparams.devnode, STRING_SIZE, "/dev/%s", sourcedrive);
cdromparams.module = 0;
fprintf(flog, "Source device: %s\n", cdromparams.devnode);
/* Configure the network now! */
if (installtype == URL_INSTALL) {
/* Network driver and params. */
if (!(networkmenu(ethernetkv))) {
errorbox(ctr[TR_NETWORK_SETUP_FAILED]);
goto EXIT;
}
/* Check for ipcop-<VERSION>.tbz2 */
if (checktarball(SNAME "-" VERSION ".tbz2", ctr[TR_ENTER_URL])) {
errorbox(ctr[TR_NO_IPCOP_TARBALL_FOUND]);
goto EXIT;
}
}
/* Get device for the HD. This has to succeed. */
@@ -467,6 +484,7 @@ int main(int argc, char *argv[])
} else
sprintf(harddrive, "hd%c", hdletter);
fprintf(flog, "Destination drive: %s\n", harddrive);
/* load unattended configuration */
if (unattended) {
@@ -571,13 +589,12 @@ int main(int argc, char *argv[])
handle = fopen("/tmp/partitiontable", "w");
/* Make swapfile */
if (swap_file) {
fprintf(handle, ",%ld,L,*\n,%ld,S,\n,%ld,L,\n",
fprintf(handle, ",%ld,L,*\n,%ld,S,\n,%ld,L,\n,,L,\n",
boot_partition, swap_file, root_partition);
} else {
fprintf(handle, ",%ld,L,*\n,0,0,\n,%ld,L,\n",
fprintf(handle, ",%ld,L,*\n,0,0,\n,%ld,L,\n,,L,\n",
boot_partition, root_partition);
}
@@ -625,7 +642,7 @@ int main(int argc, char *argv[])
goto EXIT;
}
/* if (raid_disk)
if (raid_disk)
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %sp4", hdparams.devnode);
else
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %s4", hdparams.devnode);
@@ -634,7 +651,7 @@ int main(int argc, char *argv[])
{
errorbox(ctr[TR_UNABLE_TO_MAKE_ROOT_FILESYSTEM]);
goto EXIT;
} */
}
/* Mount harddisk. */
if (raid_disk)
@@ -672,7 +689,7 @@ int main(int argc, char *argv[])
goto EXIT;
}
}
/* if (raid_disk)
if (raid_disk)
snprintf(commandstring, STRING_SIZE, "/sbin/mount %sp4 /harddisk/var", hdparams.devnode);
else
snprintf(commandstring, STRING_SIZE, "/sbin/mount %s4 /harddisk/var", hdparams.devnode);
@@ -680,7 +697,7 @@ int main(int argc, char *argv[])
{
errorbox(ctr[TR_UNABLE_TO_MOUNT_LOG_FILESYSTEM]);
goto EXIT;
} */
}
snprintf(commandstring, STRING_SIZE, "/bin/tar -C /harddisk -xvjf /cdrom/" SNAME "-" VERSION ".tbz2");
@@ -737,8 +754,14 @@ int main(int argc, char *argv[])
goto EXIT;
}
/* mount proc filesystem */
mysystem("mkdir /harddisk/proc");
mysystem("/bin/mount -t proc none /harddisk/proc");
mysystem("/bin/mount --bind /dev /harddisk/dev");
/* if we detected SCSI then fixup */
if ((handle = fopen("/scsidriver", "r")))
mysystem("/bin/probecntrl.sh");
if ((handle = fopen("/cntrldriver", "r")))
{
char *driver;
fgets(line, STRING_SIZE-1, handle);
@@ -750,22 +773,21 @@ int main(int argc, char *argv[])
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/ipfirerd.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 /boot/ipfirerd.img %s", driver, KERNEL_VERSION);
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
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);
snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /sbin/mkinitrd --with=scsi_mod --with=%s --with=sd_mod --with=sr_mod --with=libata /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");
}
}
}
}
/* Build cache lang file */
snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /usr/bin/perl -e \"require '" CONFIG_ROOT "/lang.pl'; &Lang::BuildCacheLang\"");
if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_LANG_CACHE]))
{
errorbox(ctr[TR_UNABLE_TO_INSTALL_LANG_CACHE]);
goto EXIT;
}
/* Build cache lang file */
snprintf(commandstring, STRING_SIZE, "/bin/chroot /harddisk /usr/bin/perl -e \"require '" CONFIG_ROOT "/lang.pl'; &Lang::BuildCacheLang\"");
if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_LANG_CACHE]))
{
errorbox(ctr[TR_UNABLE_TO_INSTALL_LANG_CACHE]);
goto EXIT;
}
if (raid_disk)
sprintf(string, "root=%sp3", hdparams.devnode);
@@ -778,11 +800,6 @@ int main(int argc, char *argv[])
/* restore permissions */
chmod("/harddisk/boot/grub/grubbatch", S_IXUSR | S_IRUSR | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
/* mount proc filesystem */
mysystem("mkdir /harddisk/proc");
mysystem("/bin/mount -t proc none /harddisk/proc");
mysystem("/bin/mount --bind /dev /harddisk/dev");
snprintf(commandstring, STRING_SIZE,
"/bin/chroot /harddisk /boot/grub/grubbatch");
if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_GRUB])) {
@@ -833,7 +850,7 @@ EXIT:
fcloseall();
system("/bin/swapoff /harddisk/swapfile");
system("/sbin/umount /harddisk/var/log");
system("/sbin/umount /harddisk/var");
system("/sbin/umount /harddisk/boot");
system("/sbin/umount /harddisk");

View File

@@ -6,8 +6,6 @@
* (c) Lawrence Manning, 2001
* Stuff for downloading the smoothwall tarball using wget.
*
* $Id: net.c,v 1.8.2.2 2004/04/14 22:05:40 gespinasse Exp $
*
*/
#include "install.h"
@@ -19,11 +17,11 @@ extern char **ctr;
static int got_url = 0;
char url[STRING_SIZE];
char url[STRING_SIZE] = "http://";;
static int gettarballurl();
static int gettarballurl(char *url, char *message);
int checktarball(char *file)
int checktarball(char *file, char *message)
{
int done;
int tries = 0;
@@ -32,7 +30,7 @@ int checktarball(char *file)
done = 0;
while (!done)
{
if (!got_url && gettarballurl() != 1)
if (!got_url && gettarballurl(url, message) != 1)
return 0;
/* remove any successive /'s */
@@ -49,24 +47,22 @@ int checktarball(char *file)
errorbox(ctr[TR_FAILED_TO_FIND]);
got_url = 0;
if (tries == 3)
return 0;
return 1; /* failure */
}
tries++;
}
return 1;
return 0;
}
static int gettarballurl()
static int gettarballurl(char *url, char *message)
{
char *values[] = { NULL, NULL }; /* pointers for the values. */
char *values[] = { url, NULL }; /* pointers for the values. */
struct newtWinEntry entries[] =
{ { "", &values[0], 0,}, { NULL, NULL, 0 } };
char title[STRING_SIZE];
char message[1000];
int rc;
sprintf(message, ctr[TR_ENTER_URL]);
sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);
rc = newtWinEntries(title, message,
60, 5, 5, 50, entries, ctr[TR_OK], ctr[TR_CANCEL], NULL);

View File

@@ -0,0 +1,13 @@
#!/bin/sh
echo "Probing for SCSI controllers"
MODULE=`/bin/kudzu -qps -t 30 -c SCSI | grep driver | cut -d ' ' -f 2 | sort | uniq`
if [ "$?" == "0" ]; then
echo $MODULE > /cntrldriver;
echo "Your controller is: $MODULE"
exit 0
fi
echo "No SCSI controller found"
exit 1

View File

@@ -0,0 +1,12 @@
#!/bin/sh
NUMBER=$1
MODULES=`/bin/kudzu -qps -t 30 -c NETWORK | grep driver | cut -d ' ' -f 2 | sort | uniq`
if [ "$NUMBER" ]; then
NICS=`echo $MODULES | head -$NUMBER`
else
NICS=$MODULES
fi
echo "$NICS" > /nicdriver

File diff suppressed because it is too large Load Diff