mirror of
https://github.com/rancher/os.git
synced 2025-07-16 08:05:51 +00:00
add --debug logging option to installer, and a dummy set-disk-partitions
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
ad5fad46ee
commit
8e5eba0ac5
@ -74,6 +74,10 @@ var installCommand = cli.Command{
|
||||
Name: "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() {
|
||||
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"))
|
||||
force := c.Bool("force")
|
||||
kexec := c.Bool("kexec")
|
||||
|
@ -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{}) {
|
||||
appLog.Debugf(format, args...)
|
||||
}
|
||||
|
@ -19,5 +19,10 @@ COPY ./build/ros /bin/
|
||||
|
||||
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
|
||||
|
||||
ENTRYPOINT ["/bin/ros", "install"]
|
||||
|
||||
|
@ -4,6 +4,4 @@ FROM rancher/os-installer
|
||||
RUN rm /dist/ \
|
||||
&& mkdir -p /dist/
|
||||
|
||||
#COPY ./ros /bin/
|
||||
COPY ./boot/ /dist/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user