Revert "rc: make get_systype similar to the old rc_sys function"
This reverts commit f79a7a7be1
.
This commit is contained in:
19
src/rc/rc.c
19
src/rc/rc.c
@ -281,8 +281,12 @@ open_shell(void)
|
||||
struct passwd *pw;
|
||||
|
||||
#ifdef __linux__
|
||||
char *sys = get_systype();
|
||||
const char *sys = NULL;
|
||||
|
||||
sys = detect_container();
|
||||
if (!sys)
|
||||
sys = detect_vm();
|
||||
|
||||
/* VSERVER and OPENVZ systems cannot really drop to shells */
|
||||
if (sys &&
|
||||
(strcmp(sys, "VSERVER") == 0 || strcmp(sys, "OPENVZ") == 0))
|
||||
@ -466,7 +470,7 @@ static void
|
||||
do_sysinit()
|
||||
{
|
||||
struct utsname uts;
|
||||
char *sys = get_systype();
|
||||
const char *sys;
|
||||
|
||||
/* exec init-early.sh if it exists
|
||||
* This should just setup the console to use the correct
|
||||
@ -487,6 +491,9 @@ do_sysinit()
|
||||
uts.machine);
|
||||
#endif
|
||||
|
||||
sys = detect_container();
|
||||
if (!sys)
|
||||
sys = detect_vm();
|
||||
if (sys)
|
||||
printf(" [%s]", sys);
|
||||
|
||||
@ -502,7 +509,9 @@ do_sysinit()
|
||||
|
||||
/* init may have mounted /proc so we can now detect or real
|
||||
* sys */
|
||||
sys = get_systype();
|
||||
sys = detect_container();
|
||||
if (!sys)
|
||||
sys = detect_vm();
|
||||
if (sys)
|
||||
setenv("RC_SYS", sys, 1);
|
||||
}
|
||||
@ -823,7 +832,9 @@ int main(int argc, char **argv)
|
||||
eerrorx("%s: %s", applet, strerror(errno));
|
||||
/* NOTREACHED */
|
||||
case 'S':
|
||||
systype = get_systype();
|
||||
systype = detect_container();
|
||||
if (!systype)
|
||||
systype = detect_vm();
|
||||
if (systype)
|
||||
printf("%s\n", systype);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
Reference in New Issue
Block a user