2021-05-15 19:26:49 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
RUNC=${RUNC:=runc}
|
|
|
|
|
|
|
|
if [ -f config.json ]; then
|
|
|
|
mv config.json config.old.json
|
2021-05-15 19:28:43 +08:00
|
|
|
jq -c '.mounts |= . + [
|
|
|
|
{
|
|
|
|
"destination": "/dev/kvm",
|
|
|
|
"type": "bind",
|
|
|
|
"source": "/dev/kvm",
|
|
|
|
"options": [ "bind", "rw" ]
|
|
|
|
}
|
2021-05-15 20:12:00 +08:00
|
|
|
] |
|
|
|
|
.linux.resources.devices |= . + [
|
|
|
|
{
|
|
|
|
"allow": true,
|
|
|
|
"type": "c",
|
|
|
|
"major": 10,
|
|
|
|
"minor": 232,
|
|
|
|
"access": "rwm"
|
|
|
|
}
|
2021-05-15 19:28:43 +08:00
|
|
|
]' config.old.json > config.json
|
2021-05-15 20:12:00 +08:00
|
|
|
cp config.json /tmp/config.json
|
2021-05-15 19:26:49 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
exec $RUNC "$@"
|