blob: e5189b90fa8597b0bc2c8e7d501dcdef96856016 [file] [log] [blame]
do_mounts()
{
mount --bind /proc debian/proc/ > /dev/null
mount --bind /dev debian/dev/ > /dev/null
mount --bind /dev/pts debian/dev/pts > /dev/null
mount --bind /sys debian/sys/ > /dev/null
mount --bind /sys/kernel/debug/ debian/sys/kernel/debug/ > /dev/null
mount --bind /sys/kernel/debug/tracing/ debian/sys/kernel/debug/tracing/
# Fix up weirdness with debugfs permission changing because of
# above mounts.
chmod 0777 /sys/kernel/debug > /dev/null
chmod 0777 debian/sys/kernel/debug > /dev/null
chmod 0777 /sys/kernel/debug/tracing > /dev/null
chmod 0777 debian/sys/kernel/debug/tracing > /dev/null
# Mount Android partitions
if [ -d /d/ ]; then
if [ ! -d debian/d ]; then ln -s /sys/kernel/debug debian/d; fi
fi
if [ -d /data/ ]; then
mkdir -p debian/data/
mount --bind /data debian/data/
fi
if [ -d /system/ ]; then
mkdir -p debian/system/
mount --bind /system debian/system/
fi
if [ -d /vendor/ ]; then
mkdir -p debian/vendor/
mount --bind /vendor debian/vendor/
fi
}
mount | grep debian > /dev/null
if [ $? -ne 0 ]; then do_mounts; fi