|
From: <ow...@us...> - 2008-01-21 21:46:34
|
Revision: 1015
http://ipcop.svn.sourceforge.net/ipcop/?rev=1015&view=rev
Author: owes
Date: 2008-01-21 13:46:37 -0800 (Mon, 21 Jan 2008)
Log Message:
-----------
Some gettext changes.
Change some window sizes.
Make possible to install on USB stick (might even work).
cp udev net rules, will needs some more tweaking to fully work on installed system.
Modified Paths:
--------------
ipcop/trunk/src/installer/hardware.c
ipcop/trunk/src/installer/host_domain.c
ipcop/trunk/src/installer/installer.c
ipcop/trunk/src/installer/networking.c
ipcop/trunk/src/installer/partition.c
ipcop/trunk/src/installer/passwords.c
Property Changed:
----------------
ipcop/trunk/src/installer/networking.c
Modified: ipcop/trunk/src/installer/hardware.c
===================================================================
--- ipcop/trunk/src/installer/hardware.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/hardware.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -99,12 +99,12 @@
}
hardwares[numhardwares].description = strdup(vendordesc);
- fprintf(flog, " Add %3d, %s, %s, %s\n", type, hardwares[numhardwares].module,
+ fprintf(flog, " HWadd %3d, %s, %s, %s\n", type, hardwares[numhardwares].module,
hardwares[numhardwares].device,
hardwares[numhardwares].description);
if ( install_setup )
{
- fprintf(fhwdetect, " Add %3d, %s, %s, %s\n", type, hardwares[numhardwares].module,
+ fprintf(fhwdetect, " HWadd %3d, %s, %s, %s\n", type, hardwares[numhardwares].module,
hardwares[numhardwares].device,
hardwares[numhardwares].description);
}
@@ -194,7 +194,7 @@
}
}
- /* look for SCSI SATA harddisk */
+ /* look for SCSI SATA harddisk, USB stick */
for (deviceletter = 'a'; deviceletter <= 'z'; deviceletter++)
{
snprintf(procname, STRING_SIZE, "/sys/block/sd%c/device/model", deviceletter);
@@ -204,6 +204,11 @@
continue;
}
+ /*
+ we need some mechanism to differentiate between installation from USB
+ or installation on USB stick
+ */
+
if ( fgets(model, STRING_SIZE, f) )
{
char device[4];
@@ -397,6 +402,7 @@
) )
{
type = specialmodule;
+ /* in some cases the modulename is empty ? */
}
/*
@@ -421,16 +427,30 @@
}
else
{
+ fprintf(flog, " Add %s %s, %s\n",
+ busclass,
+ module == NULL ? "---" : module,
+ description == NULL ? "---" : description);
+ if ( install_setup )
+ {
+ fprintf(fhwdetect, " Add %s %s, %s\n",
+ busclass,
+ module == NULL ? "---" : module,
+ description == NULL ? "---" : description);
+ }
hardwareadd(type, module, NULL, discover_device_get_vendor_name(devices), description, discover_device_get_vendor_id(devices), discover_device_get_model_id(devices));
}
/*
Some special handling for special devices
*/
- if ( install_setup && (module != NULL) && (type == specialmodule) )
+ if ( install_setup && (type == specialmodule) )
{
- snprintf(command, STRING_SIZE, "/sbin/modprobe %s", module);
- mysystem(command);
+ if ( module != NULL )
+ {
+ snprintf(command, STRING_SIZE, "/sbin/modprobe %s", module);
+ mysystem(command);
+ }
/* SCSI, add some modules */
if ( !strcmp(busclass, "0100") )
@@ -455,6 +475,13 @@
/* USB, probe */
if ( !strcmp(busclass, "0c03") )
{
+ /*
+ Dependancies will load sd_mod, but sd_mod will not be in initramfs .
+ Not sure if installing onto USB stick is a good idea though.
+ */
+ snprintf(command, STRING_SIZE, "/sbin/modprobe %s", "sd_mod");
+ mysystem(command);
+ hardwareadd(specialmodule, "sd_mod", NULL, NULL, NULL, NULL, NULL);
snprintf(command, STRING_SIZE, "/sbin/modprobe %s", "usb-storage");
mysystem(command);
hardwareadd(specialmodule, "usb-storage", NULL, NULL, NULL, NULL, NULL);
@@ -475,6 +502,10 @@
firstscan = TRUE;
while ( install_setup && (numharddisk == 0) )
{
+ if ( install_setup )
+ {
+ fflush(fhwdetect);
+ }
statuswindow(72, 5, ipcop_gettext("TR_TITLE_HARDWARE"), ipcop_gettext("TR_PROBING_HARDWARE"), "drives");
if ( !firstscan )
Modified: ipcop/trunk/src/installer/host_domain.c
===================================================================
--- ipcop/trunk/src/installer/host_domain.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/host_domain.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -4,7 +4,7 @@
* This program is distributed under the terms of the GNU General Public
* Licence. See the file COPYING for details.
*
- * (c) 2007, the IPCop team
+ * (c) 2007-2008, the IPCop team
*
* $Id$
*
@@ -108,7 +108,7 @@
for (;;)
{
rc = newtWinEntries(gettext("TR_HOSTNAME"), gettext("TR_ENTER_HOSTNAME"),
- 50, 5, 5, 40, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
+ 65, 5, 5, 40, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
if ( rc == 1 )
{
@@ -175,7 +175,7 @@
for (;;)
{
rc = newtWinEntries(gettext("TR_DOMAINNAME"), gettext("TR_ENTER_DOMAINNAME"),
- 50, 5, 5, 40, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
+ 65, 5, 5, 40, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
if ( rc == 1 )
{
Modified: ipcop/trunk/src/installer/installer.c
===================================================================
--- ipcop/trunk/src/installer/installer.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/installer.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -231,7 +231,7 @@
if ( mysystem(string) )
{
fprintf(flog, "Failed to mount CDROM\n");
- errorbox(ipcop_gettext("TR_CDROM_ERROR"));
+ errorbox(ipcop_gettext("TR_UNABLE_TO_MOUNT_CDROM"));
newtPopWindow();
continue;
}
@@ -300,9 +300,11 @@
harddisklist = realloc(harddisklist, sizeof(char *) * (c + 1));
harddisklist[c] = NULL;
+ /* default to the first disk */
+ c = 0;
// Choose the disk to use
- rc = newtWinMenu(ipcop_gettext("TR_SELECT_HARDDISK"),
+ rc = newtWinMenu(ipcop_gettext("TR_TITLE_DISK"),
ipcop_gettext("TR_SELECT_DEVICE_FOR_INSTALLATION"),
65, 5, 5, 8,
harddisklist,
@@ -341,7 +343,7 @@
if (*disk_size < DISK_MINIMUM)
{
fprintf(flog, "HARDDISK %s: really to small.\n", hardwares[*ddisk].device);
- errorbox(ipcop_gettext("TR_DISK_TO_SMALL"));
+ errorbox(ipcop_gettext("TR_DISK_TOO_SMALL"));
return 2; // force cancel
}
fclose(handle);
@@ -510,12 +512,14 @@
if ( system("/bin/chroot /harddisk /usr/local/sbin/setup INSTALL") )
printf("Unable to run setup.\n");
+ /* Propagate udev rules for network cards to our freshly build IPCop */
+ mysystem("/bin/cp /etc/udev/rules.d/70-persistent-net.rules /harddisk/etc/udev/rules.d");
+
/* cleanup possible udhcp parameters */
mysystem("/bin/rm -f /harddisk/tmp/dhcp-*.params");
// All done, just have to unmount everything...
- statuswindow(72, 5, get_title(),
- ipcop_gettext("TR_UNMOUNTING"));
+ statuswindow(72, 5, get_title(), ipcop_gettext("TR_UNMOUNTING"));
mysystem("/bin/umount -n /harddisk/dev");
mysystem("/bin/umount -n /harddisk/proc");
Modified: ipcop/trunk/src/installer/networking.c
===================================================================
--- ipcop/trunk/src/installer/networking.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/networking.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -6,7 +6,7 @@
*
* (c) 2007-2008, the IPCop team
*
- * $Id: passwords.c 590 2007-10-29 09:05:10Z owes $
+ * $Id$
*
*/
@@ -84,13 +84,23 @@
{
int i;
newtComponent networkform;
+ newtComponent text;
newtComponent ok, cancel;
struct newtExitStruct exitstruct;
char keyvalue[STRING_SIZE];
-
- newtCenteredWindow(44, 13, gettext("TR_RED_CONFIGURATION_TYPE"));
+ char message[STRING_SIZE_LARGE];
+ int numLines;
+
+ snprintf(message, STRING_SIZE, gettext("TR_RED_CONFIGURATION_TYPE"));
+ text = newtTextboxReflowed(1, 1, message, 68, 0, 0, 0);
+ numLines = newtTextboxGetNumLines(text);
+
+ snprintf(message, STRING_SIZE, gettext("TR_INTERFACE"), "RED");
+ newtCenteredWindow(72, 14+numLines, message);
networkform = newtForm(NULL, NULL, 0);
+ newtFormAddComponent(networkform, text);
+ /* No point in translating all */
char *radio_text[CFG_RED_COUNT+1] = { NULL, gettext("TR_ANALOG_MODEM"), "ISDN", "PPPOE", "PPTP", gettext("TR_STATIC"), "DHCP" };
char *cfg_text[CFG_RED_COUNT+1] = { "", "ANALOG", "ISDN", "PPPOE", "PPTP", "STATIC", "DHCP" };
newtComponent radio[CFG_RED_COUNT+1];
@@ -105,12 +115,12 @@
/* build radio buttons and add to window */
for (i = 1; i <= CFG_RED_COUNT ; i++)
{
- radio[i] = newtRadiobutton(2, i, radio_text[i], (strcmp(keyvalue, cfg_text[i]) == 0), i == 1 ? NULL : radio[i-1]);
+ radio[i] = newtRadiobutton(2, i+numLines+1, radio_text[i], (strcmp(keyvalue, cfg_text[i]) == 0), i == 1 ? NULL : radio[i-1]);
newtFormAddComponents(networkform, radio[i], NULL);
}
- ok = newtButton(8, 8, gettext("TR_OK"));
- cancel = newtButton(26, 8, gettext("TR_CANCEL"));
+ ok = newtButton(6, 9+numLines, gettext("TR_OK"));
+ cancel = newtButton(26, 9+numLines, gettext("TR_CANCEL"));
newtFormAddComponents(networkform, ok, cancel, NULL);
newtRefresh();
@@ -241,34 +251,45 @@
static void changehostname(void)
{
newtComponent networkform;
- newtComponent header;
+ newtComponent text;
newtComponent ok, cancel;
struct newtExitStruct exitstruct;
char keyvalue[STRING_SIZE];
- char message[STRING_SIZE];
+ char message[STRING_SIZE_LARGE];
newtComponent dhcphostnamelabel;
newtComponent dhcphostnameentry;
const char *dhcphostnameresult;
int error;
+ int numLines;
- newtCenteredWindow(44, 11, gettext("TR_DHCP_HOSTNAME"));
+ snprintf(message, STRING_SIZE_LARGE, gettext("TR_DHCP_HOSTNAME_LONG"));
+ text = newtTextboxReflowed(1, 1, message, 68, 0, 0, 0);
+ numLines = newtTextboxGetNumLines(text);
+
+ snprintf(message, STRING_SIZE, gettext("TR_INTERFACE"), "RED");
+ newtCenteredWindow(72, 9+numLines, message);
networkform = newtForm(NULL, NULL, 0);
+ newtFormAddComponent(networkform, text);
- snprintf(message, STRING_SIZE, gettext("TR_ENTER_THE_DHCP_HOSTNAME"));
- header = newtTextboxReflowed(1, 1, message, 42, 0, 0, 0);
- newtFormAddComponent(networkform, header);
-
/* DHCP hostname */
- dhcphostnamelabel = newtTextbox(2, 4, 18, 1, 0);
+ dhcphostnamelabel = newtTextbox(2, 2+numLines, 18, 1, 0);
newtTextboxSetText(dhcphostnamelabel, gettext("TR_DHCP_HOSTNAME"));
strcpy(keyvalue, "");
- find_kv_default(eth_kv, "RED_DHCP_HOSTNAME", keyvalue);
- dhcphostnameentry = newtEntry(20, 4, keyvalue, 20, &dhcphostnameresult, 0);
+ if ( find_kv_default(eth_kv, "RED_DHCP_HOSTNAME", keyvalue) == 0 )
+ {
+ NODEKV *main_kv = NULL;
+ if ( read_kv_from_file(&main_kv, CONFIG_ROOT "/main/settings") )
+ {
+ find_kv_default(main_kv, "HOSTNAME", keyvalue);
+ free_kv(&main_kv);
+ }
+ }
+ dhcphostnameentry = newtEntry(20, 2+numLines, keyvalue, 20, &dhcphostnameresult, 0);
newtFormAddComponent(networkform, dhcphostnamelabel);
newtFormAddComponent(networkform, dhcphostnameentry);
- ok = newtButton(8, 7, gettext("TR_OK"));
- cancel = newtButton(26, 7, gettext("TR_CANCEL"));
+ ok = newtButton(6, 4+numLines, gettext("TR_OK"));
+ cancel = newtButton(26, 4+numLines, gettext("TR_CANCEL"));
newtFormAddComponents(networkform, ok, cancel, NULL);
newtRefresh();
@@ -307,7 +328,7 @@
static void changeaddress(char *colour, int *changed_flag)
{
newtComponent networkform;
- newtComponent header;
+ newtComponent text;
newtComponent ok, cancel;
struct newtExitStruct exitstruct;
char keyvalue[STRING_SIZE];
@@ -323,6 +344,7 @@
const char *netmaskresult;
char message[STRING_SIZE_LARGE];
int error;
+ int numLines;
/* Build some key strings. */
sprintf(addresskey, "%s_ADDRESS", colour);
@@ -330,16 +352,17 @@
sprintf(netaddresskey, "%s_NETADDRESS", colour);
sprintf(broadcastkey, "%s_BROADCAST", colour);
+ snprintf(message, STRING_SIZE, gettext("TR_ENTER_THE_IP_ADDRESS_INFORMATION"), colour);
+ text = newtTextboxReflowed(1, 1, message, 68, 0, 0, 0);
+ numLines = newtTextboxGetNumLines(text);
+
snprintf(message, STRING_SIZE, gettext("TR_INTERFACE"), colour);
- newtCenteredWindow(44, 12, message);
+ newtCenteredWindow(72, 10+numLines, message);
networkform = newtForm(NULL, NULL, 0);
+ newtFormAddComponent(networkform, text);
- snprintf(message, STRING_SIZE, gettext("TR_ENTER_THE_IP_ADDRESS_INFORMATION"), colour);
- header = newtTextboxReflowed(1, 1, message, 42, 0, 0, 0);
- newtFormAddComponent(networkform, header);
-
/* Address */
- addresslabel = newtTextbox(2, 4, 18, 1, 0);
+ addresslabel = newtTextbox(2, 2+numLines, 18, 1, 0);
newtTextboxSetText(addresslabel, gettext("TR_IP_ADDRESS_PROMPT"));
if ( !strcmp(colour, "GREEN") )
{
@@ -351,23 +374,23 @@
strcpy(keyvalue, "");
}
find_kv_default(eth_kv, addresskey, keyvalue);
- addressentry = newtEntry(20, 4, keyvalue, 20, &addressresult, 0);
+ addressentry = newtEntry(20, 2+numLines, keyvalue, 20, &addressresult, 0);
newtEntrySetFilter(addressentry, filter_ip, NULL);
newtFormAddComponent(networkform, addresslabel);
newtFormAddComponent(networkform, addressentry);
/* Netmask */
- netmasklabel = newtTextbox(2, 5, 18, 1, 0);
+ netmasklabel = newtTextbox(2, 3+numLines, 18, 1, 0);
newtTextboxSetText(netmasklabel, gettext("TR_NETMASK_PROMPT"));
strcpy(keyvalue, default_netmask);
find_kv_default(eth_kv, netmaskkey, keyvalue);
- netmaskentry = newtEntry(20, 5, keyvalue, 20, &netmaskresult, 0);
+ netmaskentry = newtEntry(20, 3+numLines, keyvalue, 20, &netmaskresult, 0);
newtEntrySetFilter(netmaskentry, filter_ip, NULL);
newtFormAddComponent(networkform, netmasklabel);
newtFormAddComponent(networkform, netmaskentry);
- ok = newtButton(8, 7, gettext("TR_OK"));
- cancel = newtButton(26, 7, gettext("TR_CANCEL"));
+ ok = newtButton(6, 5+numLines, gettext("TR_OK"));
+ cancel = newtButton(26, 5+numLines, gettext("TR_CANCEL"));
newtFormAddComponents(networkform, ok, cancel, NULL);
newtRefresh();
@@ -442,7 +465,7 @@
static void changednsgateway(void)
{
newtComponent networkform;
- newtComponent header;
+ newtComponent text;
newtComponent ok, cancel;
struct newtExitStruct exitstruct;
char keyvalue[STRING_SIZE];
@@ -457,46 +480,48 @@
const char *gatewayresult;
char message[STRING_SIZE_LARGE];
int error;
+ int numLines;
- newtCenteredWindow(54, 14, gettext("TR_DNS_AND_GATEWAY_SETTINGS"));
+ snprintf(message, STRING_SIZE, gettext("TR_DNS_AND_GATEWAY_SETTINGS_LONG"));
+ text = newtTextboxReflowed(1, 1, message, 68, 0, 0, 0);
+ numLines = newtTextboxGetNumLines(text);
+
+ newtCenteredWindow(72, 11+numLines, gettext("TR_DNS_AND_GATEWAY_SETTINGS"));
networkform = newtForm(NULL, NULL, 0);
+ newtFormAddComponent(networkform, text);
- snprintf(message, STRING_SIZE, gettext("TR_DNS_AND_GATEWAY_SETTINGS_LONG"));
- header = newtTextboxReflowed(1, 1, message, 52, 0, 0, 0);
- newtFormAddComponent(networkform, header);
-
/* DNS1 */
- dns1label = newtTextbox(2, 5, 18, 1, 0);
+ dns1label = newtTextbox(2, 2+numLines, 18, 1, 0);
newtTextboxSetText(dns1label, gettext("TR_PRIMARY_DNS"));
strcpy(keyvalue, "");
find_kv_default(eth_kv, "DNS1", keyvalue);
- dns1entry = newtEntry(20, 5, keyvalue, 20, &dns1result, 0);
+ dns1entry = newtEntry(20, 2+numLines, keyvalue, 20, &dns1result, 0);
newtEntrySetFilter(dns1entry, filter_ip, NULL);
newtFormAddComponent(networkform, dns1label);
newtFormAddComponent(networkform, dns1entry);
/* DNS2 */
- dns2label = newtTextbox(2, 6, 18, 1, 0);
+ dns2label = newtTextbox(2, 3+numLines, 18, 1, 0);
newtTextboxSetText(dns2label, gettext("TR_SECONDARY_DNS"));
strcpy(keyvalue, "");
find_kv_default(eth_kv, "DNS2", keyvalue);
- dns2entry = newtEntry(20, 6, keyvalue, 20, &dns2result, 0);
+ dns2entry = newtEntry(20, 3+numLines, keyvalue, 20, &dns2result, 0);
newtEntrySetFilter(dns2entry, filter_ip, NULL);
newtFormAddComponent(networkform, dns2label);
newtFormAddComponent(networkform, dns2entry);
/* Gateway */
- gatewaylabel = newtTextbox(2, 7, 18, 1, 0);
+ gatewaylabel = newtTextbox(2, 4+numLines, 18, 1, 0);
newtTextboxSetText(gatewaylabel, gettext("TR_DEFAULT_GATEWAY"));
strcpy(keyvalue, "");
find_kv_default(eth_kv, "DEFAULT_GATEWAY", keyvalue);
- gatewayentry = newtEntry(20, 7, keyvalue, 20, &gatewayresult, 0);
+ gatewayentry = newtEntry(20, 4+numLines, keyvalue, 20, &gatewayresult, 0);
newtEntrySetFilter(gatewayentry, filter_ip, NULL);
newtFormAddComponent(networkform, gatewaylabel);
newtFormAddComponent(networkform, gatewayentry);
- ok = newtButton(8, 9, gettext("TR_OK"));
- cancel = newtButton(26, 9, gettext("TR_CANCEL"));
+ ok = newtButton(8, 6+numLines, gettext("TR_OK"));
+ cancel = newtButton(26, 6+numLines, gettext("TR_CANCEL"));
newtFormAddComponents(networkform, ok, cancel, NULL);
newtRefresh();
@@ -596,10 +621,14 @@
changeaddress("GREEN", &changed_green);
find_kv_default(eth_kv, "RED_TYPE", keyvalue);
- if ( !strcmp(keyvalue, "PPTP") )
+ if ( !strcmp(keyvalue, "PPPOE") )
{
changeaddress("RED", &changed_red);
}
+ else if ( !strcmp(keyvalue, "PPTP") )
+ {
+ changeaddress("RED", &changed_red);
+ }
else if ( !strcmp(keyvalue, "STATIC") )
{
changeaddress("RED", &changed_red);
@@ -619,7 +648,7 @@
{
rc = newtWinMenu(gettext("TR_NETWORK_CONFIGURATION_MENU"),
- gettext("TR_SELECT_THE_ITEM"), 50, 5, 5, 11,
+ gettext("TR_SELECT_THE_ITEM"), 65, 5, 5, 11,
menuchoices, &choice, gettext("TR_OK"), gettext("TR_QUIT"), NULL);
if (rc == 2)
Property changes on: ipcop/trunk/src/installer/networking.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ipcop/trunk/src/installer/partition.c
===================================================================
--- ipcop/trunk/src/installer/partition.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/partition.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -621,7 +621,7 @@
/* TODO make sure we do not run out of space (STRING_SIZE_LARGE) */
for (i = 0; i < numhardwares; i++)
{
- if ( hardwares[i].type == specialmodule )
+ if ( (hardwares[i].type == specialmodule) && hardwares[i].module[0] )
{
strcat(bigstring, hardwares[i].module);
strcat(bigstring, ",");
Modified: ipcop/trunk/src/installer/passwords.c
===================================================================
--- ipcop/trunk/src/installer/passwords.c 2008-01-21 21:38:06 UTC (rev 1014)
+++ ipcop/trunk/src/installer/passwords.c 2008-01-21 21:46:37 UTC (rev 1015)
@@ -33,8 +33,8 @@
do
{
done = 1;
- rc = newtWinEntries(get_title(), text,
- 50, 5, 5, 20, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
+ rc = newtWinEntries(gettext("TR_TITLE_PASSWORD"), text,
+ 68, 5, 5, 20, entries, gettext("TR_OK"), gettext("TR_CANCEL"), NULL);
if (rc != 2)
{
@@ -88,8 +88,13 @@
char commandstring[STRING_SIZE];
int rc;
+ // dummy line for .po file gettext("TR_ENTER_ROOT_PASSWORD")
+ // dummy line for .po file gettext("TR_ENTER_ADMIN_PASSWORD")
+ // dummy line for .po file gettext("TR_ENTER_BACKUP_PASSWORD")
+
if ( !strcmp(user, "root") )
{
+ // dummy line for .po file gettext("TR_ENTER_ROOT_PASSWORD")
strcpy(message, "TR_ENTER_ROOT_PASSWORD");
}
else if ( !strcmp(user, "admin") )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|