29 lines
695 B
Bash
29 lines
695 B
Bash
#!/bin/bash
|
|
#remaster lib
|
|
[ -d "<LIBDIR>" ] || { echo "LIBDIR 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
|
|
}
|
|
|
|
[ -d "/var/lib/lxc/_remaster_/" ] && {
|
|
echo "### Warning ### chroot_initial: lxc container exists"
|
|
[ -f "/var/lib/lxc/_remaster_/config" ] && {
|
|
mv -f "/var/lib/lxc/_remaster_/config" "/var/lib/lxc/_remaster_/config.old"
|
|
}
|
|
}
|
|
mkdir -p "/var/lib/lxc/_remaster_/"
|
|
|
|
rm "$chroot_dir/etc/resolv.conf"
|
|
cp "/etc/resolv.conf" "$chroot_dir/etc/resolv.conf"
|
|
|
|
echo "done"
|
|
}
|