mirror of
https://github.com/rancher/os.git
synced 2025-09-02 15:24:32 +00:00
Add the recovery console to the boot menu
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/SvenDowideit/cpuid"
|
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/rancher/os/cmd/cloudinitexecute"
|
"github.com/rancher/os/cmd/cloudinitexecute"
|
||||||
"github.com/rancher/os/config"
|
"github.com/rancher/os/config"
|
||||||
@@ -154,7 +153,6 @@ func generateRespawnConf(cmdline, user string, sshd bool) string {
|
|||||||
respawnConf.WriteString(gettyCmd)
|
respawnConf.WriteString(gettyCmd)
|
||||||
if strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
|
if strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
|
||||||
respawnConf.WriteString(fmt.Sprintf(" -n -l /usr/bin/autologin -o %s:tty%d", user, i))
|
respawnConf.WriteString(fmt.Sprintf(" -n -l /usr/bin/autologin -o %s:tty%d", user, i))
|
||||||
//respawnConf.WriteString(fmt.Sprintf(" --autologin %s", user))
|
|
||||||
}
|
}
|
||||||
respawnConf.WriteString(fmt.Sprintf(" --noclear %s linux\n", tty))
|
respawnConf.WriteString(fmt.Sprintf(" --noclear %s linux\n", tty))
|
||||||
}
|
}
|
||||||
@@ -166,9 +164,7 @@ func generateRespawnConf(cmdline, user string, sshd bool) string {
|
|||||||
|
|
||||||
respawnConf.WriteString(gettyCmd)
|
respawnConf.WriteString(gettyCmd)
|
||||||
if strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
|
if strings.Contains(cmdline, fmt.Sprintf("rancher.autologin=%s", tty)) {
|
||||||
//respawnConf.WriteString(fmt.Sprintf(" -n -l /usr/bin/autologin -o rancher"))
|
|
||||||
respawnConf.WriteString(fmt.Sprintf(" -n -l /usr/bin/autologin -o %s:%s", user, tty))
|
respawnConf.WriteString(fmt.Sprintf(" -n -l /usr/bin/autologin -o %s:%s", user, tty))
|
||||||
//respawnConf.WriteString(fmt.Sprintf(" --autologin %s", user))
|
|
||||||
}
|
}
|
||||||
respawnConf.WriteString(fmt.Sprintf(" %s\n", tty))
|
respawnConf.WriteString(fmt.Sprintf(" %s\n", tty))
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# Add `UI vesamenu.c32` to a new line in `global.cfg` to switch to GUI bootmenu (use `sudo ros config syslinux`)
|
# Add `UI vesamenu.c32` to a new line in `global.cfg` to switch to GUI bootmenu (use `sudo ros config syslinux`)
|
||||||
UI menu.c32
|
UI menu.c32
|
||||||
TIMEOUT 20 #2s
|
TIMEOUT 30 #3s
|
||||||
PROMPT 0
|
PROMPT 0
|
||||||
|
|
||||||
# doesn't appear to work here?
|
# doesn't appear to work here?
|
||||||
|
@@ -9,23 +9,30 @@ LABEL rancheros-${LABEL}
|
|||||||
|
|
||||||
LABEL rancheros-${LABEL}-autologin
|
LABEL rancheros-${LABEL}-autologin
|
||||||
SAY rancheros-${LABEL}-autologin: autologin RancherOS ${VERSION} ${KERNEL_VERSION}
|
SAY rancheros-${LABEL}-autologin: autologin RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||||
MENU LABEL rancher.autologin
|
MENU LABEL Autologin on tty1 and ttyS0
|
||||||
MENU INDENT 2
|
MENU INDENT 2
|
||||||
COM32 cmd.c32
|
COM32 cmd.c32
|
||||||
APPEND rancheros-${LABEL} rancher.autologin=tty1 rancher.autologin=ttyS0
|
APPEND rancheros-${LABEL} rancher.autologin=tty1 rancher.autologin=ttyS0
|
||||||
|
|
||||||
LABEL rancheros-${LABEL}-debug
|
LABEL rancheros-${LABEL}-debug
|
||||||
SAY rancheros-${LABEL}-debug: debug RancherOS ${VERSION} ${KERNEL_VERSION}
|
SAY rancheros-${LABEL}-debug: debug RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||||
MENU LABEL rancher.debug=true
|
MENU LABEL Debug logging
|
||||||
MENU INDENT 2
|
MENU INDENT 2
|
||||||
COM32 cmd.c32
|
COM32 cmd.c32
|
||||||
APPEND rancheros-${LABEL} rancher.debug=true
|
APPEND rancheros-${LABEL} rancher.debug=true
|
||||||
|
|
||||||
LABEL rancheros-${LABEL}-debug-autologin
|
LABEL rancheros-${LABEL}-debug-autologin
|
||||||
SAY rancheros-${LABEL}-debug-autolgin: debug and autologin RancherOS ${VERSION} ${KERNEL_VERSION}
|
SAY rancheros-${LABEL}-debug-autolgin: debug and autologin RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||||
MENU LABEL rancher.debug and rancher.autologin
|
MENU LABEL Autologin on tty1 and ttyS0 plus Debug logging
|
||||||
MENU INDENT 2
|
MENU INDENT 2
|
||||||
COM32 cmd.c32
|
COM32 cmd.c32
|
||||||
APPEND rancheros-${LABEL} rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.debug=true
|
APPEND rancheros-${LABEL} rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.debug=true
|
||||||
|
|
||||||
|
LABEL rancheros-${LABEL}-recovery
|
||||||
|
SAY rancheros-${LABEL}-recovery: recovery console RancherOS ${VERSION} ${KERNEL_VERSION}
|
||||||
|
MENU LABEL Recovery console
|
||||||
|
MENU INDENT 2
|
||||||
|
COM32 cmd.c32
|
||||||
|
APPEND rancheros-${LABEL} rancher.recovery=true
|
||||||
|
|
||||||
MENU SEPARATOR
|
MENU SEPARATOR
|
||||||
|
@@ -311,6 +311,7 @@ if [ "$QEMU" == "1" ]; then
|
|||||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||||
${SECOND_DRIVE_ENABLE} \
|
${SECOND_DRIVE_ENABLE} \
|
||||||
-smp 1 \
|
-smp 1 \
|
||||||
|
-device virtio-rng-pci \
|
||||||
${CLOUD_CONFIG_DISK} \
|
${CLOUD_CONFIG_DISK} \
|
||||||
-fsdev local,security_model=none,id=fsdev1,path=${HOME} \
|
-fsdev local,security_model=none,id=fsdev1,path=${HOME} \
|
||||||
-device virtio-9p-pci,id=fs1,fsdev=fsdev1,mount_tag=home \
|
-device virtio-9p-pci,id=fs1,fsdev=fsdev1,mount_tag=home \
|
||||||
@@ -338,6 +339,7 @@ elif [ "$BOOT_ISO" == "1" ] ||
|
|||||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||||
${SECOND_DRIVE_ENABLE} \
|
${SECOND_DRIVE_ENABLE} \
|
||||||
-smp 1 \
|
-smp 1 \
|
||||||
|
-device virtio-rng-pci \
|
||||||
${ISO_OPTS} \
|
${ISO_OPTS} \
|
||||||
"${@}"
|
"${@}"
|
||||||
elif [ "$QIND" == "1" ]; then
|
elif [ "$QIND" == "1" ]; then
|
||||||
|
Reference in New Issue
Block a user