mirror of
https://github.com/kairos-io/immucore.git
synced 2025-06-25 22:32:01 +00:00
We leave dracut to do its own thing and mount the CD properly Signed-off-by: Itxaka <itxaka@spectrocloud.com>
21 lines
314 B
Go
21 lines
314 B
Go
package utils
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/twpayne/go-vfs"
|
|
)
|
|
|
|
func BootedFromCD(fs vfs.FS) bool {
|
|
cdlabel := regexp.MustCompile("root=live:CDLABEL=")
|
|
cmdLine, err := fs.ReadFile("/proc/cmdline")
|
|
if err != nil {
|
|
return false
|
|
}
|
|
|
|
if cdlabel.MatchString(string(cmdLine)) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|