Merge "Fix dhclient in Fedora ramdisks"

This commit is contained in:
Jenkins 2015-04-23 03:58:33 +00:00 committed by Gerrit Code Review
commit 74b777dae8
2 changed files with 15 additions and 3 deletions

View File

@ -1,2 +1,3 @@
dhclient
ip
busybox

View File

@ -52,8 +52,18 @@ function create_ramdisk_base () {
cp -a "$LIB_UDEV/firmware" "$TMP_MOUNT_PATH/lib/udev"
fi
# cjk adding for hwdiscovery support
cp "/sbin/dhclient-script" "$TMP_MOUNT_PATH/sbin"
# cjk adding dhclient for hwdiscovery support
# dhclient scripts on some distros appear in different places, copy any we find
for FILE in /sbin/dhclient-script /usr/sbin/dhclient-script /etc/sysconfig/network-scripts/* /etc/rc.d/init.d/functions /etc/init.d/functions ; do
if [ -f $FILE ] ; then
mkdir -p $(dirname $TMP_MOUNT_PATH/$FILE)
cp $FILE $TMP_MOUNT_PATH/$FILE
fi
done
# /var/lib/dhclient is a directory on Fedora
if [ -d "/var/lib/dhclient" ] ; then
mkdir -p "$TMP_MOUNT_PATH/var/lib/dhclient"
fi
mkdir -p "$TMP_MOUNT_PATH/etc/modprobe.d"
echo "blacklist evbug" > "$TMP_MOUNT_PATH/etc/modprobe.d/blacklist.conf"
@ -143,7 +153,8 @@ function populate_lib () {
for i in "$BUSYBOX" bash lsmod modprobe udevadm \
wget reboot shutdown $UDEVD $UDEV_FIRMWARE \
$(cat /etc/dib_binary_deps) ; do
if busybox_list | grep "^$i\$" >/dev/null; then
# Don't take the ip command from busybox, its missing some features
if busybox_list | grep -v "^ip$" | grep "^$i\$" >/dev/null; then
continue
fi
path=`which $i 2>/dev/null` || path=$i