diff --git a/pkg/bash/build b/pkg/bash/build index 1bad43d..671d177 100755 --- a/pkg/bash/build +++ b/pkg/bash/build @@ -39,7 +39,5 @@ deploy() { mv "$DEPLOY/lib" "$DEVDEPLOY" mv "$DEPLOY/include" "$DEVDEPLOY" - mkdir -p "$DEPLOY/etc/" - cp "$SCRIPTDIR/pkg/bash/bashrc" "$DEPLOY/etc/" - cp "$SCRIPTDIR/pkg/bash/profile" "$DEPLOY/etc/" + cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY" } diff --git a/pkg/bash/bashrc b/pkg/bash/etc/bashrc similarity index 100% rename from pkg/bash/bashrc rename to pkg/bash/etc/bashrc diff --git a/pkg/bash/profile b/pkg/bash/etc/profile similarity index 100% rename from pkg/bash/profile rename to pkg/bash/etc/profile diff --git a/pkg/rootfs/bash_profile b/pkg/bash/etc/skel/.bash_profile similarity index 100% rename from pkg/rootfs/bash_profile rename to pkg/bash/etc/skel/.bash_profile diff --git a/pkg/rootfs/bashrc b/pkg/bash/etc/skel/.bashrc similarity index 100% rename from pkg/rootfs/bashrc rename to pkg/bash/etc/skel/.bashrc diff --git a/pkg/rootfs/build b/pkg/rootfs/build index 5724bba..0202ead 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,root} + mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt} mkdir -pv ${BUILD}/cfg/{preserve,overlay} echo "/lib" > "$BUILD/etc/ld-musl-${MUSL_CPU}.path" @@ -16,21 +16,7 @@ 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/shadow" "$BUILD/etc/shadow" - cp "$SCRIPTDIR/pkg/$PKGNAME/group" "$BUILD/etc/group" - - ln -s /proc/self/mounts "$BUILD/etc/mtab" + cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$BUILD" # install packages to rootfs dependencies | tsort | tac | grep -v "$PKGNAME" > "$BUILD/etc/packages" @@ -44,6 +30,10 @@ build() { cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD" done < "$BUILD/etc/packages" + # setup root home directory + cp -r "$BUILD/etc/skel" "$BUILD/root" + chmod 750 "$BUILD/root" + # move configuration to preserve directory mv ${BUILD}/etc ${BUILD}/cfg/preserve mkdir -p ${BUILD}/etc diff --git a/pkg/rootfs/group b/pkg/rootfs/etc/group similarity index 100% rename from pkg/rootfs/group rename to pkg/rootfs/etc/group diff --git a/pkg/rootfs/hostname b/pkg/rootfs/etc/hostname similarity index 100% rename from pkg/rootfs/hostname rename to pkg/rootfs/etc/hostname diff --git a/pkg/rootfs/hosts b/pkg/rootfs/etc/hosts similarity index 100% rename from pkg/rootfs/hosts rename to pkg/rootfs/etc/hosts diff --git a/pkg/rootfs/etc/mtab b/pkg/rootfs/etc/mtab new file mode 120000 index 0000000..27e43cc --- /dev/null +++ b/pkg/rootfs/etc/mtab @@ -0,0 +1 @@ +/proc/self/mounts \ No newline at end of file diff --git a/pkg/rootfs/passwd b/pkg/rootfs/etc/passwd similarity index 100% rename from pkg/rootfs/passwd rename to pkg/rootfs/etc/passwd diff --git a/pkg/rootfs/shadow b/pkg/rootfs/etc/shadow similarity index 100% rename from pkg/rootfs/shadow rename to pkg/rootfs/etc/shadow