mirror of
https://github.com/rancher/os.git
synced 2025-08-16 22:08:26 +00:00
Merge pull request #1528 from SvenDowideit/more-installer-fixes
More installer fixes
This commit is contained in:
commit
ac761a3973
@ -74,6 +74,10 @@ var installCommand = cli.Command{
|
|||||||
Name: "kexec",
|
Name: "kexec",
|
||||||
Usage: "reboot using kexec",
|
Usage: "reboot using kexec",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
Usage: "Run installer with debug output",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +85,13 @@ func installAction(c *cli.Context) error {
|
|||||||
if c.Args().Present() {
|
if c.Args().Present() {
|
||||||
log.Fatalf("invalid arguments %v", c.Args())
|
log.Fatalf("invalid arguments %v", c.Args())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Bool("debug") {
|
||||||
|
originalLevel := log.GetLevel()
|
||||||
|
defer log.SetLevel(originalLevel)
|
||||||
|
log.SetLevel(log.DebugLevel)
|
||||||
|
}
|
||||||
|
|
||||||
kappend := strings.TrimSpace(c.String("append"))
|
kappend := strings.TrimSpace(c.String("append"))
|
||||||
force := c.Bool("force")
|
force := c.Bool("force")
|
||||||
kexec := c.Bool("kexec")
|
kexec := c.Bool("kexec")
|
||||||
@ -143,7 +154,7 @@ func runInstall(image, installType, cloudConfig, device, kappend string, force,
|
|||||||
fmt.Printf("Installing from %s\n", image)
|
fmt.Printf("Installing from %s\n", image)
|
||||||
|
|
||||||
if !force {
|
if !force {
|
||||||
if !yes("Continue") {
|
if util.IsRunningInTty() && !yes("Continue") {
|
||||||
log.Infof("Not continuing with installation due to user not saying 'yes'")
|
log.Infof("Not continuing with installation due to user not saying 'yes'")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,13 @@ func SetLevel(level Level) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetLevel() Level {
|
||||||
|
if userHook != nil {
|
||||||
|
return Level(userHook.Level)
|
||||||
|
}
|
||||||
|
return Level(appLog.Level)
|
||||||
|
}
|
||||||
|
|
||||||
func Debugf(format string, args ...interface{}) {
|
func Debugf(format string, args ...interface{}) {
|
||||||
appLog.Debugf(format, args...)
|
appLog.Debugf(format, args...)
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 console=tty0 console=ttyS0 ${APPEND}
|
APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 console=tty0 console=ttyS0 printk.devkmsg=on ${APPEND}
|
||||||
|
@ -19,5 +19,13 @@ COPY ./build/ros /bin/
|
|||||||
|
|
||||||
RUN ln -s /bootiso/boot/ /dist
|
RUN ln -s /bootiso/boot/ /dist
|
||||||
|
|
||||||
|
# need to make a /scripts/set-disk-partitions so that older releases can call the installer
|
||||||
|
RUN echo "#!/bin/sh" > /scripts/set-disk-partitions \
|
||||||
|
&& echo "echo 'set-disk-partitions deprecated'" >> /scripts/set-disk-partitions \
|
||||||
|
&& chmod 755 /scripts/set-disk-partitions
|
||||||
|
|
||||||
|
# work around some really weird ros symptoms
|
||||||
|
RUN rm -rf /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/ros", "install"]
|
ENTRYPOINT ["/bin/ros", "install"]
|
||||||
|
|
||||||
|
@ -4,6 +4,4 @@ FROM rancher/os-installer
|
|||||||
RUN rm /dist/ \
|
RUN rm /dist/ \
|
||||||
&& mkdir -p /dist/
|
&& mkdir -p /dist/
|
||||||
|
|
||||||
#COPY ./ros /bin/
|
|
||||||
COPY ./boot/ /dist/
|
COPY ./boot/ /dist/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user