28 lines
655 B
Plaintext
28 lines
655 B
Plaintext
|
#!/bin/bash
|
||
|
#remaster lib
|
||
|
[ -d "$LIBDR"] || export LIBDIR="/usr/lib/remaster/"
|
||
|
[ -d "$LIBDR"] || { echo "LIBDR not exist"; exit 1; }
|
||
|
|
||
|
#chroot_initial [chroot_dir]
|
||
|
function chroot_initial() {
|
||
|
echo -n "initial chroot ... "
|
||
|
|
||
|
#check chroot dir
|
||
|
chroot_dir="$1"
|
||
|
[ -d "$chroot_dir" ] || {
|
||
|
echo "### ERROR ### chroot_initial: chroot directory not exist"
|
||
|
return 12
|
||
|
}
|
||
|
|
||
|
#mount virus definitions
|
||
|
mount -t tmpfs tmpfs "$chroot_dir/tmp"
|
||
|
mount -t tmpfs tmpfs "$chroot_dir/root"
|
||
|
mount --bind /dev "$chroot_dir/dev"
|
||
|
mount --bind /proc "$chroot_dir/proc"
|
||
|
|
||
|
rm "$chroot_dir/etc/resolv.conf"
|
||
|
cp "/etc/resolv.conf" "$chroot_dir/etc/resolv.conf"
|
||
|
|
||
|
echo "done"
|
||
|
}
|