mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-12 09:17:53 +00:00
mkofs improvements
- Always use $PWD/o. if it doesn't exist, say how to create it. - return 2 on unsupported platforms.
This commit is contained in:
parent
b580080af1
commit
6cb0354e19
1 changed files with 5 additions and 6 deletions
|
@ -1,17 +1,16 @@
|
||||||
[[ -f /proc/mounts ]] || {
|
[[ -f /proc/mounts ]] || {
|
||||||
echo "mkofs: only supported on linux" >&2
|
echo "mkofs: only supported on linux" >&2
|
||||||
return 1
|
return 2
|
||||||
}
|
}
|
||||||
local o
|
local o
|
||||||
if [[ -d "$PWD/o" ]]; then
|
if [[ -d o ]]; then
|
||||||
o=$PWD/o
|
o=$(pwd -P)/o
|
||||||
elif [[ -n "$COSMO" && -d "$COSMO/o" ]]; then
|
|
||||||
o=$COSMO/o
|
|
||||||
else
|
else
|
||||||
echo "mkofs: o/ not found" >&2
|
echo "mkofs: o/ not found" >&2
|
||||||
|
echo "suggested preparation:" >&2
|
||||||
|
echo " mkdir -m 555 o" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
o=$(realpath "$o")
|
|
||||||
cut -d' ' -f2 /proc/mounts | while read -r line; do
|
cut -d' ' -f2 /proc/mounts | while read -r line; do
|
||||||
if [[ "$o" = "$line" ]]; then
|
if [[ "$o" = "$line" ]]; then
|
||||||
echo "mkofs: $o already mounted" >&2
|
echo "mkofs: $o already mounted" >&2
|
||||||
|
|
Loading…
Reference in a new issue