X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/47c4e0c19ae8526b14ce4e0d7b243f7a4dc6fafd..bffa3430fbbaaad29bec0b5bee9c1f0bfc7fd068:/lunaix-os/scripts/mkrootfs-layout diff --git a/lunaix-os/scripts/mkrootfs-layout b/lunaix-os/scripts/mkrootfs-layout new file mode 100755 index 0000000..f500084 --- /dev/null +++ b/lunaix-os/scripts/mkrootfs-layout @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +base="$1" +content="$2" + +if [ -z "$base" ]; then + echo "please specify the working directory" + exit 2 +fi + +cd "$base" || exit 2 + +echo "creating basic layout." + +mkdir bin dev sys task mnt lib usr \ + || has_err=1 + +if [ -n "${content}" ]; then + echo "copying contents" + + cp -R "${content}"/* . +else + echo "Note: no content is specified, only basic layout is created"\ + "You may need to add them later" + has_err=1 +fi + +echo "ownership set to root:root" + +chown -R root:root . \ + || has_err=1 + +exit "${has_err:-0}" \ No newline at end of file