1
0
mirror of https://github.com/rancher/os.git synced 2025-07-01 09:11:48 +00:00

Mount raspberrypi boot partition

This commit is contained in:
Jason-ZW 2019-05-20 17:05:36 +08:00 committed by niusmallnan
parent 2f0d0a9585
commit 404f5b38da

View File

@ -2,9 +2,11 @@ package fsmount
import (
"fmt"
"strings"
"syscall"
"github.com/rancher/os/config"
"github.com/rancher/os/config/cmdline"
"github.com/rancher/os/pkg/init/bootstrap"
"github.com/rancher/os/pkg/log"
"github.com/rancher/os/pkg/util"
@ -34,6 +36,15 @@ func MountBoot(cfg *config.CloudConfig) (*config.CloudConfig, error) {
return cfg, nil
}
rootDevice := cmdline.GetCmdline("root").(string)
if rootDevice != "" && strings.Contains(rootDevice, "mmcblk") {
if err := util.Mount("/dev/mmcblk0p1", config.BootDir, "vfat", ""); err != nil {
log.Debugf("Not mounting BOOT: %v", err)
return cfg, nil
}
}
if err := mountConfigured("boot", cfg.Rancher.State.BootDev, cfg.Rancher.State.BootFsType, config.BootDir); err != nil {
log.Debugf("Not mounting BOOT: %v", err)
} else {