mirror of https://github.com/cutefishos/appmotor
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
649 B
Bash
32 lines
649 B
Bash
#!/bin/sh
|
|
|
|
CGDIR="/sys/fs/cgroup"
|
|
|
|
# precondition: cgroup mount must exist
|
|
mountpoint -q $CGDIR || exit 1
|
|
|
|
# create booster directory
|
|
if [ ! -d $CGDIR/booster ]; then
|
|
FAIL=1
|
|
if mount -o remount,rw $CGDIR; then
|
|
if mkdir $CGDIR/booster; then
|
|
FAIL=0
|
|
fi
|
|
if ! mount -o remount,ro $CGDIR; then
|
|
FAIL=1
|
|
fi
|
|
fi
|
|
[ $FAIL = 0 ] || exit 1
|
|
fi
|
|
|
|
# mount booster directory
|
|
if ! mountpoint -q $CGDIR/booster; then
|
|
mount -t cgroup -o none,name=booster cgroup $CGDIR/booster || exit 1
|
|
fi
|
|
|
|
# adjust booster directory permissions
|
|
FAIL=0
|
|
chown -R root:privileged $CGDIR/booster || FAIL=1
|
|
chmod 0774 $CGDIR/booster || FAIL=1
|
|
exit $FAIL
|