From b363b49a56303e257b185d5f94fa6506534bdee6 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 18 Jan 2018 21:23:04 +0100 Subject: [PATCH] Add basic system files - passwd and group files with entries for "root" - user directory for "root" - hosts and hostname files Signed-off-by: David Oberhollenzer --- pkg/base-files/bash_profile | 3 +++ pkg/base-files/bashrc | 3 +++ pkg/base-files/build | 27 +++++++++++++++++++++++++++ pkg/base-files/group | 1 + pkg/base-files/hostname | 1 + pkg/base-files/hosts | 8 ++++++++ pkg/base-files/passwd | 1 + pkg/rootfs-alix/depends | 1 + pkg/rootfs-rpi3/depends | 1 + 9 files changed, 46 insertions(+) create mode 100644 pkg/base-files/bash_profile create mode 100644 pkg/base-files/bashrc create mode 100644 pkg/base-files/build create mode 100644 pkg/base-files/group create mode 100644 pkg/base-files/hostname create mode 100644 pkg/base-files/hosts create mode 100644 pkg/base-files/passwd diff --git a/pkg/base-files/bash_profile b/pkg/base-files/bash_profile new file mode 100644 index 0000000..b1b93f7 --- /dev/null +++ b/pkg/base-files/bash_profile @@ -0,0 +1,3 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi diff --git a/pkg/base-files/bashrc b/pkg/base-files/bashrc new file mode 100644 index 0000000..626377e --- /dev/null +++ b/pkg/base-files/bashrc @@ -0,0 +1,3 @@ +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/pkg/base-files/build b/pkg/base-files/build new file mode 100644 index 0000000..f63e6b4 --- /dev/null +++ b/pkg/base-files/build @@ -0,0 +1,27 @@ +build() { + return +} + +deploy() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + + # home directory of root user + mkdir -p "$DEPLOY/usr/root" + chmod 750 "$DEPLOY/usr/root" + + cp "$SCRIPTDIR/pkg/base-files/bash_profile" "$DEPLOY/usr/root/.bash_profile" + cp "$SCRIPTDIR/pkg/base-files/bashrc" "$DEPLOY/usr/root/.bashrc" + + # /etc base files + mkdir -p "$DEPLOY/etc/skel" + + cp "$SCRIPTDIR/pkg/base-files/bash_profile" "$DEPLOY/etc/skel/.bash_profile" + cp "$SCRIPTDIR/pkg/base-files/bashrc" "$DEPLOY/etc/skel/.bashrc" + + cp "$SCRIPTDIR/pkg/base-files/hostname" "$DEPLOY/etc/hostname" + cp "$SCRIPTDIR/pkg/base-files/hosts" "$DEPLOY/etc/hosts" + cp "$SCRIPTDIR/pkg/base-files/passwd" "$DEPLOY/etc/passwd" + cp "$SCRIPTDIR/pkg/base-files/group" "$DEPLOY/etc/group" +} diff --git a/pkg/base-files/group b/pkg/base-files/group new file mode 100644 index 0000000..1dbf901 --- /dev/null +++ b/pkg/base-files/group @@ -0,0 +1 @@ +root:x:0: diff --git a/pkg/base-files/hostname b/pkg/base-files/hostname new file mode 100644 index 0000000..92f72ed --- /dev/null +++ b/pkg/base-files/hostname @@ -0,0 +1 @@ +blank diff --git a/pkg/base-files/hosts b/pkg/base-files/hosts new file mode 100644 index 0000000..e3b79cc --- /dev/null +++ b/pkg/base-files/hosts @@ -0,0 +1,8 @@ +127.0.0.1 localhost +::1 localhost ipv6-localhost ipv6-loopback +fe00::0 ipv6-localnet + +ff00::0 ipv6-mcastprefix +ff02::1 ipv6-allnodes +ff02::2 ipv6-allrouters +ff02::3 ipv6-allhosts diff --git a/pkg/base-files/passwd b/pkg/base-files/passwd new file mode 100644 index 0000000..585df8a --- /dev/null +++ b/pkg/base-files/passwd @@ -0,0 +1 @@ +root:x:0:0:root:/usr/root:/bin/bash diff --git a/pkg/rootfs-alix/depends b/pkg/rootfs-alix/depends index c95edbb..a9ade44 100644 --- a/pkg/rootfs-alix/depends +++ b/pkg/rootfs-alix/depends @@ -1,3 +1,4 @@ +base-files coreutils bash nano diff --git a/pkg/rootfs-rpi3/depends b/pkg/rootfs-rpi3/depends index 85b0218..25f840c 100644 --- a/pkg/rootfs-rpi3/depends +++ b/pkg/rootfs-rpi3/depends @@ -1,3 +1,4 @@ +base-files coreutils bash linux_modules