rootdev

package
v0.0.0-...-423a5b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package rootdev provides functions to locate the root device from which gokrazy was booted.

All functions provided by this package work only once /proc is mounted.

Index

Constants

View Source
const (
	Boot  = 1
	Root2 = 2
	Root3 = 3
	Perm  = 4
)

Matches https://github.com/gokrazy/gokrazy#sd-card-contents

Variables

This section is empty.

Functions

func ActiveRootPartition

func ActiveRootPartition() int

ActiveRootPartition returns 2 or 3, depending on which partition is the currently active root file system.

func BlockDevice

func BlockDevice() string

BlockDevice returns the file system path identifying the block device from which gokrazy was booted.

func InactiveRootPartition

func InactiveRootPartition() int

InactiveRootPartition returns 2 or 3, depending on which partition is currently inactive (i.e. the target for updates).

func PARTUUID

func PARTUUID() string

PARTUUID returns the partition UUID of the block device from which gokrazy was booted, if any (or the empty string).

func Partition

func Partition(number int) string

Partition returns the file system path identifying the specified partition on the root device from which gokrazy was booted.

E.g. Partition(2) = /dev/mmcblk0p2

func PartitionCmdline

func PartitionCmdline(number int) string

PartitionCmdline returns the cmdline identifier (e.g. PARTUUID=aabbccdd-02, or /dev/mmcblk0p2) identifying the specified partition on the root device from which gokrazy was booted.

E.g. PartitionCmdline(2) = PARTUUID=aabbccdd-02

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL