2015-11-07 23:29:55 +00:00
|
|
|
#!/bin/sh
|
2014-07-17 00:27:33 +00:00
|
|
|
#
|
|
|
|
# This file should be places in pre-pivot directory in dracut's initramfs
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2015-11-08 02:46:25 +00:00
|
|
|
kver="`uname -r`"
|
|
|
|
if ! [ -d "$NEWROOT/lib/modules/$kver/kernel" ]; then
|
2014-07-17 00:27:33 +00:00
|
|
|
echo "Waiting for /dev/xvdd device..."
|
|
|
|
while ! [ -e /dev/xvdd ]; do sleep 0.1; done
|
|
|
|
|
2015-11-08 02:46:25 +00:00
|
|
|
# Mount only `uname -r` subdirectory, to leave the rest of /lib/modules writable
|
|
|
|
mkdir -p /tmp/modules
|
|
|
|
mount -n -t ext3 /dev/xvdd /tmp/modules
|
|
|
|
if ! [ -d "$NEWROOT/lib/modules/$kver" ]; then
|
|
|
|
mount "$NEWROOT" -o remount,rw
|
|
|
|
mkdir -p "$NEWROOT/lib/modules/$kver"
|
|
|
|
mount "$NEWROOT" -o remount,ro
|
|
|
|
fi
|
|
|
|
mount --bind "/tmp/modules/$kver" "$NEWROOT/lib/modules/$kver"
|
|
|
|
umount /tmp/modules
|
|
|
|
rmdir /tmp/modules
|
2014-07-17 00:27:33 +00:00
|
|
|
fi
|
|
|
|
|
2015-03-21 03:14:01 +00:00
|
|
|
killall udevd systemd-udevd
|