Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 42 lines (35 sloc) 1.07 KB
#!/bin/sh
error() { echo "$@" 1>&2; }
fail() { [ $# -eq 0 ] || error "$@"; exit 1; }
rootd=${1}
[ -n "${rootd}" -a -d "${rootd}" ] || exit 1
rm -Rf "$rootd/home/default"
# no need for visudo
rm -f "$rootd/usr/sbin/visudo"
# buildroot symlinks stuff in /var to /tmp
links="lib/pcmcia pcmcia lock cache log spool pcmcia"
for f in $links; do
p="/var/$f"
if [ -L "$rootd/$p" ]; then
rm "$rootd/$p" ||
fail "failed to remove file $p"
elif [ -d "$rootd/$p" ]; then
rmdir "$rootd/$p" ||
fail "rmdir $p failed"
else
[ -e "$rootd/$p" ] &&
fail "don't know what to do with $p. not dir or link"
fi
done
mkdir -p $rootd/var
( cd "$rootd/var" && mkdir -p $links ) ||
fail "failed to create directories in /var"
( cd "$rootd/var" && rm -Rf tmp run &&
ln -s ../run run && ln -s ../run/var.tmp tmp ) ||
fail "failed to make var/run and var/tmp"
rm -f $rootd/etc/resolv.conf &&
ln -sf ../run/resolv.conf "$rootd/etc/resolv.conf" ||
fail "failed to create resolv.conf symlink"
if [ -L "$rootd/sbin/blkid" -a -x "$rootd/usr/sbin/blkid" ]; then
rm -f "$rootd/sbin/blkid"
fi
You can’t perform that action at this time.