Skip to content

Commit 04fa67e

Browse files
committed
skel
1 parent b6cd49a commit 04fa67e

24 files changed

+1791
-2
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/abroot/abroot
2+
/overlay_test
3+
/abroot*.deb
4+
/abroot*.buildinfo
5+
/abroot*.changes
6+
/abroot*.dsc
7+
/abroot*.tar.xz
8+
/obj-x86_64-linux-gnu
9+
/debian/*.debhelper
10+
/debian/*.substvars
11+
/debian/debhelper-build-stamp
12+
/debian/abroot
13+
/abroot

COPYING.md

+675
Large diffs are not rendered by default.

README.md

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
# ABRoot
2-
ABRoot is a utility that provides complete immutability and atomicity by transacting between 2 root partitions (A<->B), it also allows on-demand transactions via a transactional shell.
1+
<div align="center">
2+
<img src="abroot-logo.svg" height="120">
3+
<h1 align="center">ABRoot</h1>
4+
<p align="center">Provides full immutability and atomicity by transacting between 2 root partitions (A&lt;->B), it also allows on-demand transactions via a transactional shell.</p>
5+
</div>
6+
7+
> **Note**: This is a work in progress. It is not ready for production use.
8+
9+
The intention of this project is to replace Almost in the first RC of Vanilla OS.
10+
11+
### Read here
12+
This program is meant to be used with PackageKit and [apx](https://github.com/vanilla-os/apx),
13+
an apt replacement for VanillaOS.
14+
15+
### Help
16+
```
17+
Usage:
18+
abroot [options] [command]
19+
20+
Options:
21+
--help/-h show this message
22+
--verbose/-v show more verbosity
23+
--version/-V show version
24+
25+
Commands:
26+
enter set the filesystem as ro or rw until reboot
27+
config show the current configuration
28+
check check whether the filesystem is read-only or read-write
29+
```

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

abroot-logo.svg

+1
Loading

cmd/exec.go

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
"github.com/vanilla-os/ABRoot/core"
8+
)
9+
10+
func execUsage(*cobra.Command) error {
11+
fmt.Print(`Description:
12+
Execute a command in a transactional shell in the future root and switch to it on next boot.
13+
14+
Usage:
15+
exec [command]
16+
17+
Options:
18+
--help/-h show this message
19+
20+
Examples:
21+
abroot exec ls -l /
22+
`)
23+
return nil
24+
}
25+
26+
func NewExecCommand() *cobra.Command {
27+
cmd := &cobra.Command{
28+
Use: "exec",
29+
Short: "Execute a command in a transactional shell in the future root and switch to it on next boot.",
30+
RunE: execCommand,
31+
}
32+
cmd.SetUsageFunc(execUsage)
33+
return cmd
34+
}
35+
36+
func execCommand(cmd *cobra.Command, args []string) error {
37+
if !core.RootCheck(true) {
38+
return nil
39+
}
40+
41+
return nil
42+
}

cmd/get.go

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
8+
"github.com/vanilla-os/ABRoot/core"
9+
)
10+
11+
func getUsage(*cobra.Command) error {
12+
fmt.Print(`Description:
13+
Get the present or future root partition.
14+
15+
Usage:
16+
get [partition]
17+
18+
Options:
19+
--help/-h show this message
20+
21+
Partition:
22+
present get the present root partition
23+
future get the future root partition
24+
25+
Examples:
26+
abroot get present
27+
abroot get future`)
28+
return nil
29+
}
30+
31+
func NewGetCommand() *cobra.Command {
32+
cmd := &cobra.Command{
33+
Use: "get",
34+
Short: "Get the present or future root partition",
35+
RunE: get,
36+
}
37+
cmd.SetUsageFunc(getUsage)
38+
return cmd
39+
}
40+
41+
func get(cmd *cobra.Command, args []string) error {
42+
if !core.RootCheck(true) {
43+
return nil
44+
}
45+
46+
return nil
47+
}

cmd/shell.go

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
"github.com/vanilla-os/ABRoot/core"
8+
)
9+
10+
func shellUsage(*cobra.Command) error {
11+
fmt.Print(`Description:
12+
Enter a transactional shell in the future root and switch root on next boot
13+
14+
Usage:
15+
shell
16+
17+
Options:
18+
--help/-h show this message
19+
20+
Examples:
21+
abroot shell
22+
`)
23+
return nil
24+
}
25+
26+
func NewShellCommand() *cobra.Command {
27+
cmd := &cobra.Command{
28+
Use: "shell",
29+
Short: "Enter a transactional shell in the future root and switch root on next boot",
30+
RunE: shell,
31+
}
32+
cmd.SetUsageFunc(shellUsage)
33+
return cmd
34+
}
35+
36+
func shell(cmd *cobra.Command, args []string) error {
37+
if !core.RootCheck(true) {
38+
return nil
39+
}
40+
41+
return nil
42+
}

cmd/sync.go

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
"github.com/vanilla-os/ABRoot/core"
8+
)
9+
10+
func syncUsage(*cobra.Command) error {
11+
fmt.Print(`Description:
12+
Sync the future root with the present root.
13+
14+
Usage:
15+
_sync-future
16+
17+
Options:
18+
--help/-h show this message
19+
20+
Examples:
21+
abroot sync
22+
`)
23+
return nil
24+
}
25+
26+
func NewSyncCommand() *cobra.Command {
27+
cmd := &cobra.Command{
28+
Use: "_sync-future",
29+
Short: "Sync the future root with the present root",
30+
RunE: sync,
31+
}
32+
cmd.SetUsageFunc(syncUsage)
33+
return cmd
34+
}
35+
36+
func sync(cmd *cobra.Command, args []string) error {
37+
if !core.RootCheck(true) {
38+
return nil
39+
}
40+
return nil
41+
}

cmd/update-boot.go

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
8+
"github.com/vanilla-os/ABRoot/core"
9+
)
10+
11+
func updateBootUsage(*cobra.Command) error {
12+
fmt.Print(`Description:
13+
Update the boot partition.
14+
15+
Usage:
16+
_update-boot
17+
18+
Options:
19+
--help/-h show this message`)
20+
return nil
21+
}
22+
23+
func NewUpdateBootCommand() *cobra.Command {
24+
cmd := &cobra.Command{
25+
Use: "_update-boot",
26+
Short: "Update the boot partition",
27+
RunE: status,
28+
}
29+
cmd.SetUsageFunc(updateBootUsage)
30+
return cmd
31+
}
32+
33+
func status(cmd *cobra.Command, args []string) error {
34+
if !core.RootCheck(true) {
35+
return nil
36+
}
37+
38+
return nil
39+
}

0 commit comments

Comments
 (0)