From bcd68ce86a271c7b11c7e4c711d6be55f951762a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 29 Jan 2018 10:24:52 +0100 Subject: [PATCH] Merge base-files package with rootfs package Signed-off-by: David Oberhollenzer --- cfg/alix/ROOTFS | 1 - cfg/rpi3/ROOTFS | 1 - pkg/base-files/build | 29 ------------------------- pkg/{base-files => rootfs}/bash_profile | 0 pkg/{base-files => rootfs}/bashrc | 0 pkg/rootfs/build | 16 +++++++++++++- pkg/{base-files => rootfs}/group | 0 pkg/{base-files => rootfs}/hostname | 0 pkg/{base-files => rootfs}/hosts | 0 pkg/{base-files => rootfs}/passwd | 0 10 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 pkg/base-files/build rename pkg/{base-files => rootfs}/bash_profile (100%) rename pkg/{base-files => rootfs}/bashrc (100%) rename pkg/{base-files => rootfs}/group (100%) rename pkg/{base-files => rootfs}/hostname (100%) rename pkg/{base-files => rootfs}/hosts (100%) rename pkg/{base-files => rootfs}/passwd (100%) diff --git a/cfg/alix/ROOTFS b/cfg/alix/ROOTFS index 7efb383..693d01a 100644 --- a/cfg/alix/ROOTFS +++ b/cfg/alix/ROOTFS @@ -1,4 +1,3 @@ -base-files coreutils bash bash-completion diff --git a/cfg/rpi3/ROOTFS b/cfg/rpi3/ROOTFS index 915bbb8..10e22ca 100644 --- a/cfg/rpi3/ROOTFS +++ b/cfg/rpi3/ROOTFS @@ -1,4 +1,3 @@ -base-files coreutils bash bash-completion diff --git a/pkg/base-files/build b/pkg/base-files/build deleted file mode 100644 index 66d4619..0000000 --- a/pkg/base-files/build +++ /dev/null @@ -1,29 +0,0 @@ -DEPENDS="" - -build() { - return -} - -deploy() { - local SOURCE="$1" - local BUILD="$2" - local DEPLOY="$3" - - # home directory of root user - mkdir -p "$DEPLOY/root" - chmod 750 "$DEPLOY/root" - - cp "$SCRIPTDIR/pkg/base-files/bash_profile" "$DEPLOY/root/.bash_profile" - cp "$SCRIPTDIR/pkg/base-files/bashrc" "$DEPLOY/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/bash_profile b/pkg/rootfs/bash_profile similarity index 100% rename from pkg/base-files/bash_profile rename to pkg/rootfs/bash_profile diff --git a/pkg/base-files/bashrc b/pkg/rootfs/bashrc similarity index 100% rename from pkg/base-files/bashrc rename to pkg/rootfs/bashrc diff --git a/pkg/rootfs/build b/pkg/rootfs/build index 2979419..b888b25 100755 --- a/pkg/rootfs/build +++ b/pkg/rootfs/build @@ -7,7 +7,7 @@ build() { # setup skeleton mkdir -pv ${BUILD}/{bin,lib,etc,dev,sys,proc,tmp,var,run} - mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt} + mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt,root} mkdir -pv ${BUILD}/cfg/{preserve,overlay} echo "/lib" > "$BUILD/etc/ld-musl-${MUSL_CPU}.path" @@ -16,6 +16,19 @@ build() { cat "$SCRIPTDIR/cfg/$CFG/LDPATH" >> "$BUILD/etc/ld-musl-${MUSL_CPU}.path" fi + chmod 750 "$BUILD/root" + cp "$SCRIPTDIR/pkg/$PKGNAME/bash_profile" "$BUILD/root/.bash_profile" + cp "$SCRIPTDIR/pkg/$PKGNAME/bashrc" "$BUILD/root/.bashrc" + + mkdir -pv ${BUILD}/etc/skel + cp "$SCRIPTDIR/pkg/$PKGNAME/bash_profile" "$BUILD/etc/skel/.bash_profile" + cp "$SCRIPTDIR/pkg/$PKGNAME/bashrc" "$BUILD/etc/skel/.bashrc" + + cp "$SCRIPTDIR/pkg/$PKGNAME/hostname" "$BUILD/etc/hostname" + cp "$SCRIPTDIR/pkg/$PKGNAME/hosts" "$BUILD/etc/hosts" + cp "$SCRIPTDIR/pkg/$PKGNAME/passwd" "$BUILD/etc/passwd" + cp "$SCRIPTDIR/pkg/$PKGNAME/group" "$BUILD/etc/group" + # install packages to rootfs dependencies | tsort | tac | grep -v "$PKGNAME" > "$BUILD/etc/packages" echo "toolchain" >> "$BUILD/etc/packages" @@ -37,6 +50,7 @@ build() { mv ${BUILD}/root ${BUILD}/cfg/preserve mkdir -p ${BUILD}/root chmod 750 ${BUILD}/root + chmod 750 ${BUILD}/cfg/preserve/root } deploy() { diff --git a/pkg/base-files/group b/pkg/rootfs/group similarity index 100% rename from pkg/base-files/group rename to pkg/rootfs/group diff --git a/pkg/base-files/hostname b/pkg/rootfs/hostname similarity index 100% rename from pkg/base-files/hostname rename to pkg/rootfs/hostname diff --git a/pkg/base-files/hosts b/pkg/rootfs/hosts similarity index 100% rename from pkg/base-files/hosts rename to pkg/rootfs/hosts diff --git a/pkg/base-files/passwd b/pkg/rootfs/passwd similarity index 100% rename from pkg/base-files/passwd rename to pkg/rootfs/passwd