You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
771 B
33 lines
771 B
#!/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" |
|
} |
|
|
|
#this func is standalone executable |
|
[ -n "$1" ] && { |
|
chroot_initial $@ |
|
}
|
|
|