Commit 95fc0bae authored by Carlos Neira's avatar Carlos Neira

lx addons

parent d6bef67a
{
"cpu_cap": 100,
"image_uuid": "91ba9d4d-a54c-11e7-aac0-f1a39030aaa2",
"image_uuid": "bb4bada0-a556-11e7-aac0-f1a39030aaa2",
"hostname": "lx-jail00",
"uuid": "81ba9d4d-a54c-11e7-aac0-f1a39030aaa2",
"max_physical_memory": 1024,
"quota": 100,
"brand": "lx-jail",
......
#!/usr/local/bin/bash
#set -x
declare -a DIRS=("bin" "dev" "mnt" "proc" "tmp" "etc/defaults")
declare -a EXECS=("COPYRIGHT" "/libexec/ld-elf.so.1" "bin/sh" "/sbin/ifconfig" "/sbin/route" "usr/sbin/jail")
ARCH=$(uname -m)
......@@ -53,6 +55,22 @@ do
chmod 775 /${ROOT}/$ID/root/$d
done
cp /etc/defaults/devfs.rules /${ROOT}/$ID/root/etc/defaults
for e in "${EXECS[@]}"
do
FILES=("${FILES[@]}" $(ldd -a /$e 2> /dev/null | awk '/=>/{print $(NF-1)}'))
FILES=("${FILES[@]}" "$e")
done
for f in "${FILES[@]}"
do
mkdir -p /${ROOT}/$ID/root/$(dirname $f)
cp /$f /${ROOT}/$ID/root/$f
done
# Write some basic CentOS configuration files:
cp /etc/resolv.conf /${ROOT}/$ID/root/etc/resolv.conf
echo "linproc /jails/centos/proc linprocfs rw 0 0" >> /${ROOT}/$ID/fstab_centos6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment