console_linux.go
func (c *linuxConsole) mount(rootfs, mountLabel string, uid, gid int) error {
	oldMask := syscall.Umask(0000)
	defer syscall.Umask(oldMask)
	if err := label.SetFileLabel(c.slavePath, mountLabel); err != nil {
		return err
	}
	dest := filepath.Join(rootfs, "/dev/console")
	f, err := os.Create(dest)
	if err != nil && !os.IsExist(err) {
		return err
	}
	if f != nil {
		f.Close()
	}
	return syscall.Mount(c.slavePath, dest, "bind", syscall.MS_BIND, "")
}
func (c *linuxConsole) mount(rootfs, mountLabel string, uid, gid int) error {
	oldMask := syscall.Umask(0000)
	defer syscall.Umask(oldMask)
	if err := label.SetFileLabel(c.slavePath, mountLabel); err != nil {
		return err
	}
	dest := filepath.Join(rootfs, "/dev/console")
	f, err := os.Create(dest)
	if err != nil && !os.IsExist(err) {
		return err
	}
	if f != nil {
		f.Close()
	}
	return syscall.Mount(c.slavePath, dest, "bind", syscall.MS_BIND, "")
}
func ( c * linuxConsole ) mount ( rootfs , mountLabel string , uid , gid int ) error { oldMask := syscall . Umask ( 0000 ) defer syscall . Umask ( oldMask ) if err := label . SetFileLabel ( c . slavePath , mountLabel ) ; err != nil { return err } dest := filepath . Join ( rootfs , " " ) f , err := os . Create ( dest ) if err != nil && ! os . IsExist ( err ) { return err } if f != nil { f . Close ( ) } return syscall . Mount ( c . slavePath , dest , " " , syscall . MS_BIND , " " ) }
// mount initializes the console inside the rootfs mounting with the specified mount label
// and applying the correct ownership of the console.
mount initializes the console inside the rootfs mounting with the specified mount label and applying the correct ownership of the console .