misc/41949: sysinstall sorts /etc/rc.conf during netboot
Hal Burch
hburch at lumeta.com
Wed Sep 10 13:40:15 PDT 2003
The following reply was made to PR misc/41949; it has been noted by GNATS.
From: Hal Burch <hburch at lumeta.com>
To: freebsd-gnats-submit at freebsd.org
Cc:
Subject: Re: misc/41949: sysinstall sorts /etc/rc.conf during netboot
Date: Wed, 10 Sep 2003 16:33:05 -0400
Proposed fix.
This patch adds two variables to config:
quickInstall (default NO)
YES turns off sleep(2) after starting shell on VTY4 and sleep(1) after
successful installation of package
sortRcConf (default YES)
NO turns off the sort of /etc/rc.conf even when running as init.
Also fixes parantheses bug in tcpip.c: was doing DITEM_STATUS(foo ==
DITEM_SUCCESS) instead of DITEM_STATUS(foo) == DITEM_SUCCESS. I did
not find any operational difficulties with this.
Note that this patch was made before sysinstall was moved to usr.sbin.
diff -c /usr/src/release/sysinstall/config.c ./config.c
*** /usr/src/release/sysinstall/config.c Mon Sep 30 16:18:47 2002
--- ./config.c Mon Oct 21 23:23:28 2002
***************
*** 415,421 ****
fclose(rcSite);
/* Tidy up the resulting file if it's late enough in the installation
for sort and uniq to be available */
! if (RunningAsInit && file_readable("/usr/bin/sort") && file_readable("/usr/bin/uniq"))
(void)vsystem("sort /etc/rc.conf | uniq > /etc/rc.conf.new && mv /etc/rc.conf.new /etc/rc.conf");
}
--- 415,421 ----
fclose(rcSite);
/* Tidy up the resulting file if it's late enough in the installation
for sort and uniq to be available */
! if (RunningAsInit && file_readable("/usr/bin/sort") && file_readable("/usr/bin/uniq") && !variable_cmp(VAR_SORT_RCCONF,"NO"))
(void)vsystem("sort /etc/rc.conf | uniq > /etc/rc.conf.new && mv /etc/rc.conf.new /etc/rc.conf");
}
Common subdirectories: /usr/src/release/sysinstall/help and ./help
diff -c /usr/src/release/sysinstall/package.c ./package.c
*** /usr/src/release/sysinstall/package.c Mon Oct 21 22:47:14 2002
--- ./package.c Mon Oct 28 17:07:03 2002
***************
*** 239,245 ****
/* Now catch any stragglers */
while (wait3(&tot, WNOHANG, NULL) > 0);
! sleep(1);
restorescr(w);
}
}
--- 239,246 ----
/* Now catch any stragglers */
while (wait3(&tot, WNOHANG, NULL) > 0);
! if (ret != DITEM_SUCCESS || variable_cmp(VAR_QUICK, "YES") != 0)
! sleep(1);
restorescr(w);
}
}
diff -c /usr/src/release/sysinstall/sysinstall.h ./sysinstall.h
*** /usr/src/release/sysinstall/sysinstall.h Mon Oct 21 23:10:52 2002
--- ./sysinstall.h Mon Oct 21 23:23:41 2002
***************
*** 166,171 ****
--- 166,172 ----
#define VAR_PORTS_PATH "ports"
#define VAR_PPP_ENABLE "ppp_enable"
#define VAR_PPP_PROFILE "ppp_profile"
+ #define VAR_QUICK "quickInstall"
#define VAR_RELNAME "releaseName"
#define VAR_ROOT_SIZE "rootSize"
#define VAR_ROUTER "router"
***************
*** 173,178 ****
--- 174,180 ----
#define VAR_ROUTERFLAGS "router_flags"
#define VAR_SERIAL_SPEED "serialSpeed"
#define VAR_SLOW_ETHER "slowEthernetCard"
+ #define VAR_SORT_RCCONF "sortRcConf"
#define VAR_SWAP_SIZE "swapSize"
#define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
#define VAR_TRY_DHCP "tryDHCP"
diff -c /usr/src/release/sysinstall/system.c ./system.c
*** /usr/src/release/sysinstall/system.c Mon Oct 21 23:10:52 2002
--- ./system.c Mon Oct 28 17:07:23 2002
***************
*** 511,517 ****
WINDOW *w = savescr();
msgNotify("Starting an emergency holographic shell on VTY4");
! sleep(2);
restorescr(w);
}
else {
--- 511,517 ----
WINDOW *w = savescr();
msgNotify("Starting an emergency holographic shell on VTY4");
! if (variable_cmp(VAR_QUICK,"YES") != 0) sleep(2);
restorescr(w);
}
else {
diff -c /usr/src/release/sysinstall/tcpip.c ./tcpip.c
*** /usr/src/release/sysinstall/tcpip.c Mon Oct 21 23:10:52 2002
--- ./tcpip.c Mon Oct 21 23:32:01 2002
***************
*** 649,662 ****
return devs[0];
}
if (cnt == 1) {
! if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
rval = devs[0];
}
else if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) {
devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK);
cnt = deviceCount(devs);
if (cnt) {
! if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
rval = devs[0];
}
}
--- 649,662 ----
return devs[0];
}
if (cnt == 1) {
! if (DITEM_STATUS(tcpOpenDialog(devs[0])) == DITEM_SUCCESS)
rval = devs[0];
}
else if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) {
devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK);
cnt = deviceCount(devs);
if (cnt) {
! if (DITEM_STATUS(tcpOpenDialog(devs[0])) == DITEM_SUCCESS)
rval = devs[0];
}
}
More information about the freebsd-qa
mailing list