summaryrefslogtreecommitdiffstats
path: root/upslak.sh
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2019-11-02 13:30:34 +0100
committer Eric Hameleers <alien@slackware.com>2019-11-02 13:30:34 +0100
commitaac7e7f7138a9576dfe084dc1da22d2b13c3822c (patch)
treec16647cf26ca1647e7f71924ad2abdcbb5430fa0 /upslak.sh
parent09db7c1245ab4ef3aa465cb16d0d50cfdbf48854 (diff)
downloadliveslak-aac7e7f7138a9576dfe084dc1da22d2b13c3822c.tar.gz
liveslak-aac7e7f7138a9576dfe084dc1da22d2b13c3822c.tar.xz
NFS root (PXE boot): add virtio drivers required for older VM
The virtio_pci driver is required in some cases when using older types of virtual machine software.
Diffstat (limited to 'upslak.sh')
-rw-r--r--upslak.sh42
1 files changed, 22 insertions, 20 deletions
diff --git a/upslak.sh b/upslak.sh
index 92f549b..c1559df 100644
--- a/upslak.sh
+++ b/upslak.sh
@@ -134,7 +134,7 @@ COMPR="xz --check=crc32"
KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:mmc-core:mmc-block:sdhci:sdhci-pci:sdhci-acpi:usb-storage:hid:usbhid:i2c-hid:hid-generic:hid-apple:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:ntfs"}
# Network kernel modules to include for NFS root support:
-NETMODS="kernel/drivers/net"
+NETMODS="kernel/drivers/net kernel/drivers/virtio"
# Network kernel modules to exclude from above list:
NETEXCL="appletalk arcnet bonding can dummy.ko hamradio hippi ifb.ko irda macvlan.ko macvtap.ko pcmcia sb1000.ko team tokenring tun.ko usb veth.ko wan wimax wireless xen-netback.ko"
@@ -329,25 +329,27 @@ collect_kmods() {
# Do we have to add network support?
if [ $NETSUPPORT -eq 1 ]; then
# The initrd already contains dhcpcd so we just need to add kmods:
- cd ${KMODDIR}
- mkdir -p ${IMGDIR}/lib/modules/${KVER}
- cp -a --parents ${NETMODS} ${IMGDIR}/lib/modules/${KVER}/
- cd - 1>/dev/null
- # Prune the ones we do not need:
- for KNETRM in ${NETEXCL} ; do
- find ${IMGDIR}/lib/modules/${KVER}/${NETMODS} \
- -name $KNETRM -depth -exec rm -rf {} \;
- done
- # Add any dependency modules:
- for MODULE in $(find ${IMGDIR}/lib/modules/${KVER}/${NETMODS} -type f -exec basename {} .ko \;) ; do
- modprobe --dirname ${KMODDIR%%/lib/modules/${KVER}} --set-version $KVER --show-depends --ignore-install $MODULE 2>/dev/null |grep "^insmod " |cut -f 2 -d ' ' |while read SRCMOD; do
- if [ "$(basename $SRCMOD .ko)" != "$MODULE" ]; then
- cd ${KMODDIR}
- # Need to strip ${KMODDIR} from the start of ${SRCMOD}:
- cp -a --parents $(echo $SRCMOD |sed 's|'${KMODDIR}'/|./|' ) \
- ${IMGDIR}/lib/modules/${KVER}/
- cd - 1>/dev/null
- fi
+ for NETMODPATH in ${NETMODS} ; do
+ cd ${KMODDIR}
+ mkdir -p ${IMGDIR}/lib/modules/${KVER}
+ cp -a --parents ${NETMODPATH} ${IMGDIR}/lib/modules/${KVER}/
+ cd - 1>/dev/null
+ # Prune the ones we do not need:
+ for KNETRM in ${NETEXCL} ; do
+ find ${IMGDIR}/lib/modules/${KVER}/${NETMODPATH} \
+ -name $KNETRM -depth -exec rm -rf {} \;
+ done
+ # Add any dependency modules:
+ for MODULE in $(find ${IMGDIR}/lib/modules/${KVER}/${NETMODPATH} -type f -exec basename {} .ko \;) ; do
+ modprobe --dirname ${KMODDIR%%/lib/modules/${KVER}} --set-version $KVER --show-depends --ignore-install $MODULE 2>/dev/null |grep "^insmod " |cut -f 2 -d ' ' |while read SRCMOD; do
+ if [ "$(basename $SRCMOD .ko)" != "$MODULE" ]; then
+ cd ${KMODDIR}
+ # Need to strip ${KMODDIR} from the start of ${SRCMOD}:
+ cp -a --parents $(echo $SRCMOD |sed 's|'${KMODDIR}'/|./|' ) \
+ ${IMGDIR}/lib/modules/${KVER}/
+ cd - 1>/dev/null
+ fi
+ done
done
done
fi