File: README.md

package info (click to toggle)
golang-github-mvo5-uboot-go 0.4%2Bgit256976a-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 84 kB
  • sloc: sh: 32; makefile: 6
file content (57 lines) | stat: -rw-r--r-- 1,416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[![Build Status][travis-image]][travis-url] 
# Read/write uboot environment

Small go package/app to read/write uboot env files that contain crc32 + 1 byte
padding. Unlike fw_{set,print}env it does not needs a
/etc/fw_env.config config file.

Example of the API:
```
package main

import (
	"fmt"
	"github.com/mvo5/uboot-go/uenv"
	"os"
)

func main() {
	env, _ := uenv.Open(os.Args[1])
	fmt.Print(env)
	env.Set("foo", "bar")
	fmt.Print(env)
}
```

Example of the cmdline app for existing files:
```
$ uboot-go uboot.env print
initrd_addr=0x88080000
uenvcmd=load mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot
bootpart=0:1

$ uboot-go uboot.env set key value
$ uboot-go uboot.env print
initrd_addr=0x88080000
uenvcmd=load mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot
bootpart=0:1
key=value

# echo "$(pwd)/uboot.env 0x000 0x20000" > /etc/fw_env.config
$ fw_printenv
initrd_addr=0x88080000
uenvcmd=load mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot
bootpart=0:1
key=value
```

Example of the cmdline app for creating new env files:
```
$ uboot-go uboot.env create 4096
$ uboot-go uboot.env set foo bar
$ uboot-go uboot.env print
foo=bar
```

[travis-image]: https://travis-ci.org/mvo5/uboot-go.svg?branch=master
[travis-url]: https://travis-ci.org/mvo5/uboot-go