Closed ydcool closed 2 years ago
does it get restored when you run sudo depmod -a
after the install on the host again?
@rck no, I have to backup the dep file and restore it after injection, and then run depmod -a
, finally works.
local depFile="/lib/modules/$(uname -r)/modules.dep"
local backFile="${depFile}.bakcup.$(date +%Y%m%d)"
cp $depFile $backFile
docker run \
-v /sys:/sys \
-v /dev:/dev \
-v /usr/src:/usr/src:ro \
-v /lib/modules:/lib/modules \
-e LB_HOW=compile \
-e LB_INSTALL=yes \
--privileged \
--rm \
-i "${DrbdInjectImage}"
if [ $? -ne 0 ]; then
echo "drbd kernel module inject failed!"
exit 1
fi
# if modules.dep contents lost, we'll recover with backup file
if [ $(grep -v drbd /lib/modules/$(uname -r)/modules.dep | wc -l) -eq 0 ]; then
echo "[WARN] modules.dep contents lost, we'll recover it with backup file..."
while read line; do
if ! grep -q "$line" $backFile; then
echo "$line" >>$backFile
fi
done <$depFile
install -b -p $backFile $depFile
depmod -a
fi
hm, weird, I have to look into this, this certainly should be fixed. FWIW and not knowing your exact use-case, the module injector mainly makes sense on container distributions with read-only file systems. If you have a normal distribution, make && make install
from the tarball should work and would be easier.
Our use-case is to setup drbd on various managed hosts, like a new created k8s cluster, while without spend time on setting up the build environment for different OS and arches, so this container injection is a light-wight solution for me.
And this issue only occurred on aarch64 Kylin OS
for now, I'm not sure if that has something to do with that vendor, and I know very little about what changes the vendor has made to the CentOS
liked os ;-(
I really can not point my finger at it, but IIRC I once had to work with that distribution and wanted to run away because it felt like a very bad clone where people don't know what they are actually copying around. Kernel macros? It was bad. Anyways, thanks for looking into it, but for now I consider it a bug in that distribution. If it shows up somewhere else, feel free to re-open that issue and I'm happy to debug it, for now I will close it.
After inject drbd kernel module, the contents in
modules.dep
was lost:OS info:
Kernel version:
How to reproduce:
Injection logs: