summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHéctor Orón Martínez <zumbi@debian.org>2018-08-10 18:07:56 +0200
committerHéctor Orón Martínez <zumbi@debian.org>2018-08-10 18:07:56 +0200
commita3819b2c8c823955bb053d5a34da27c94aef4d47 (patch)
tree430633212532264c15f75ca47e02f3e4740c7c3c /doc
parent8ab62bc45ed897f007493d02084538503ade6f37 (diff)
New upstream version 1.0.0+git20180808.5b74d5d
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/example.yaml34
-rw-r--r--doc/examples/overlays/sudo/etc/sudoers.d/user1
-rwxr-xr-xdoc/examples/setup-user.sh10
-rwxr-xr-xdoc/man/create_manpage.sh28
-rw-r--r--doc/man/debos.1132
5 files changed, 205 insertions, 0 deletions
diff --git a/doc/examples/example.yaml b/doc/examples/example.yaml
new file mode 100644
index 0000000..c0b6f55
--- /dev/null
+++ b/doc/examples/example.yaml
@@ -0,0 +1,34 @@
+{{- $architecture := or .architecture "arm64" -}}
+{{- $suite := or .suite "stretch" -}}
+{{ $image := or .image (printf "debian-%s-%s.tgz" $suite $architecture) }}
+
+architecture: {{ $architecture }}
+
+actions:
+ - action: debootstrap
+ suite: "buster"
+ components:
+ - main
+ - contrib
+ - non-free
+ mirror: https://deb.debian.org/debian
+ variant: minbase
+
+ - action: apt
+ description: Install some packages
+ packages: [ sudo, openssh-server, adduser, systemd-sysv, firmware-linux ]
+
+ - action: run
+ chroot: true
+ script: setup-user.sh
+
+ - action: overlay
+ source: overlays/sudo
+
+ - action: run
+ chroot: true
+ command: echo debian > /etc/hostname
+
+ - action: pack
+ file: {{ $image }}
+ compression: gz
diff --git a/doc/examples/overlays/sudo/etc/sudoers.d/user b/doc/examples/overlays/sudo/etc/sudoers.d/user
new file mode 100644
index 0000000..125f22b
--- /dev/null
+++ b/doc/examples/overlays/sudo/etc/sudoers.d/user
@@ -0,0 +1 @@
+%sudo ALL=(ALL) NOPASSWD: /usr/bin/su
diff --git a/doc/examples/setup-user.sh b/doc/examples/setup-user.sh
new file mode 100755
index 0000000..da155d1
--- /dev/null
+++ b/doc/examples/setup-user.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+echo "I: create user"
+adduser --gecos User user
+
+echo "I: set user password"
+echo "user:user" | chpasswd
+adduser user sudo
diff --git a/doc/man/create_manpage.sh b/doc/man/create_manpage.sh
new file mode 100755
index 0000000..acac83a
--- /dev/null
+++ b/doc/man/create_manpage.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Create a manpage from the README.md
+
+# Add header
+echo '''% debos(1)
+
+# NAME
+
+ debos - Debian OS images builder
+''' > debos.md
+
+# Add README.md
+tail -n +2 ../../README.md >> debos.md
+
+# Some tweaks to the markdown
+# Uppercase titles
+sed -i 's/^\(##.*\)$/\U\1/' debos.md
+
+# Remove double #
+sed -i 's/^\##/#/' debos.md
+
+# Create the manpage
+pandoc -s -t man debos.md -o debos.1
+
+# Resulting manpage can be browsed with groff:
+#groff -man -Tascii debos.1
+
+
diff --git a/doc/man/debos.1 b/doc/man/debos.1
new file mode 100644
index 0000000..6e58a40
--- /dev/null
+++ b/doc/man/debos.1
@@ -0,0 +1,132 @@
+.\" Automatically generated by Pandoc 2.2.1
+.\"
+.TH "debos" "1" "" "" ""
+.hy
+.SH NAME
+.IP
+.nf
+\f[C]
+debos\ \-\ \ Debian\ OS\ images\ builder
+\f[]
+.fi
+.SH SYPNOSIS
+.IP
+.nf
+\f[C]
+debos\ [options]\ <recipe\ file\ in\ YAML>
+debos\ [\-\-help]
+\f[]
+.fi
+.PP
+Application Options:
+.IP
+.nf
+\f[C]
+\ \ \ \ \ \ \-\-artifactdir=
+\ \ \-t,\ \-\-template\-var=\ \ \ Template\ variables
+\ \ \ \ \ \ \-\-debug\-shell\ \ \ \ \ Fall\ into\ interactive\ shell\ on\ error
+\ \ \-s,\ \-\-shell=\ \ \ \ \ \ \ \ \ \ Redefine\ interactive\ shell\ binary\ (default:\ bash)
+\ \ \ \ \ \ \-\-scratchsize=\ \ \ \ Size\ of\ disk\ backed\ scratch\ space
+\f[]
+.fi
+.SH DESCRIPTION
+.PP
+debos is a tool to make the creation of various Debian\-based OS images
+simpler.
+While most other tools focus on specific use\-cases, debos is more meant
+as a tool\-chain to make common actions trivial while providing enough
+rope to do whatever tweaking that might be required behind the scene.
+.PP
+debos expects a YAML file as input and will run the actions listed in
+the file sequentially.
+These actions should be self\-contained and independent of each other.
+.PP
+Some of the actions provided by debos to customize and produce images
+are:
+.IP \[bu] 2
+apt: install packages and their dependencies with `apt'
+.IP \[bu] 2
+debootstrap: construct the target rootfs with debootstrap
+.IP \[bu] 2
+download: download a single file from the internet
+.IP \[bu] 2
+filesystem\-deploy: deploy a root filesystem to an image previously
+created
+.IP \[bu] 2
+image\-partition: create an image file, make partitions and format them
+.IP \[bu] 2
+ostree\-commit: create an OSTree commit from rootfs
+.IP \[bu] 2
+ostree\-deploy: deploy an OSTree branch to the image
+.IP \[bu] 2
+overlay: do a recursive copy of directories or files to the target
+filesystem
+.IP \[bu] 2
+pack: create a tarball with the target filesystem
+.IP \[bu] 2
+raw: directly write a file to the output image at a given offset
+.IP \[bu] 2
+run: allows to run a command or script in the filesystem or in the host
+.IP \[bu] 2
+unpack: unpack files from archive in the filesystem
+.PP
+A full syntax description of all the debos actions can be found at:
+https://godoc.org/github.com/go\-debos/debos/actions
+.SH SIMPLE EXAMPLE
+.PP
+The following example will create a arm64 image, install several
+packages in it, change the file /etc/hostname to \[lq]debian\[rq] and
+finally make a tarball.
+.IP
+.nf
+\f[C]
+{{\-\ $image\ :=\ or\ .image\ "debian.tgz"\ \-}}
+
+architecture:\ arm64
+
+actions:
+\ \ \-\ action:\ debootstrap
+\ \ \ \ suite:\ "buster"
+\ \ \ \ components:
+\ \ \ \ \ \ \-\ main
+\ \ \ \ \ \ \-\ non\-free
+\ \ \ \ mirror:\ https://deb.debian.org/debian
+\ \ \ \ variant:\ minbase
+
+\ \ \-\ action:\ apt
+\ \ \ \ packages:\ [\ sudo,\ openssh\-server,\ adduser,\ systemd\-sysv,\ firmware\-linux\ ]
+
+\ \ \-\ action:\ run
+\ \ \ \ chroot:\ true
+\ \ \ \ command:\ echo\ debian\ >\ /etc/hostname
+
+\ \ \-\ action:\ pack
+\ \ \ \ file:\ {{\ $image\ }}
+\ \ \ \ compression:\ gz
+\f[]
+.fi
+.PP
+To run it, create a file named \f[C]example.yaml\f[] and run:
+.IP
+.nf
+\f[C]
+debos\ example.yaml
+\f[]
+.fi
+.PP
+The final tarball will be named \[lq]debian.tgz\[rq] if you would like
+to modify this name, you can provided a different name for the variable
+image like this:
+.IP
+.nf
+\f[C]
+debos\ \-t\ image:"debian\-arm64.tgz"\ example.yaml
+\f[]
+.fi
+.SH OTHER EXAMPLES
+.PP
+This example builds a customized image for a Raspberry Pi 3.
+https://github.com/go\-debos/debos\-recipes
+.SH SEE ALSO
+.PP
+fakemachine at https://github.com/go\-debos/fakemachine