vmd.ko in installer
by andygoth from LinuxQuestions.org on (#5J748)
In order to install Slackware to an x86_64 Asus VivoBook 15.6, I need vmd.ko in the installer's initrd. For now I'm customizing my installer, but surely this will be a problem for others with similar computers who aren't in a position to customize the installer before using it.
Reading build_installer.sh, the bulk of the modules are populated by add_netmods(). However, this function includes the line "rm -rf${VERBOSE1} ... pci ..." which wipes out pci/controller/vmd.ko.xz, the file that I really need.
Here are all the files in the 5.10.38 pci modules subdirectory:
Code:pci/controller/pci-hyperv-intf.ko
pci/controller/pci-hyperv.ko
pci/controller/vmd.ko
pci/pci-stub.ko
pci/pcie/aer_inject.ko
pci/switch/switchtec.ko
pci/pci-pf-stub.ko
pci/hotplug/acpiphp_ibm.koOut of this list, my Asus laptop needs only vmd.ko.
To delete everything but vmd.ko, I suppose we could remove "pci" from the aforementioned "rm -rf" command and then add:
Code:find pci -type f -not -name vmd.ko -delete
find pci -type d -depth -empty -deleteThough there's another way to do it, as shown by the "Save the Hyper-V keyboard module" code immediately surrounding the rm, as well as other *.orig shuffles throughout the function. But if it were entirely up to me, I'd rewrite those to use the above find method to delete files other than those specifically named, then delete empty directories at the end. Takes one line rather than four per instance. Here's a sample of the existing method:
Code:# Save the Hyper-V keyboard module:
mkdir -p input.orig/serio
cp -a input/serio/hyperv-keyboard.ko input.orig/serio
rm -rf${VERBOSE1} ... input ...
mv input.orig inputInstead I'd like to see:
Code:find input -type f -not -name hyperv-keyboard.ko -deleteAnd then put the empty directory delete near the end of the function.
The trouble is the lack of support for verbose mode. That can be added back with something like the following:
Code:find input -type f -not -name hyperv-keyboard.ko -printf "removed '%p'\n" -deleteHowever, this has embedded spaces, only one of which is to be regarded as an argument delimiter. bash only seems to support this via arrays, but array expansion syntax is too clumsy for my liking ("${array[@]}" in place of $array). Instead I'll use \40 which find (not bash) will replace with a space:
Code:VERBOSEDELFILE="-printf removed\40'%p'\n"
find input -type f -not -name hyperv-keyboard.ko $VERBOSEDELFILE -deleteThen for deleting directories:
Code:VERBOSEDELDIR="-printf removed\40directory\40'%p'\n"
find pci -type d -depth -empty $VERBOSEDELDIR -deleteIf there's any interest, I'll create and test a patch for whichever method is preferred.
For reference, here are the previous posts where I've mentioned the need for vmd.ko. I've not gotten any responses about vmd.ko so I'm making a thread specific to this topic.
Reading build_installer.sh, the bulk of the modules are populated by add_netmods(). However, this function includes the line "rm -rf${VERBOSE1} ... pci ..." which wipes out pci/controller/vmd.ko.xz, the file that I really need.
Here are all the files in the 5.10.38 pci modules subdirectory:
Code:pci/controller/pci-hyperv-intf.ko
pci/controller/pci-hyperv.ko
pci/controller/vmd.ko
pci/pci-stub.ko
pci/pcie/aer_inject.ko
pci/switch/switchtec.ko
pci/pci-pf-stub.ko
pci/hotplug/acpiphp_ibm.koOut of this list, my Asus laptop needs only vmd.ko.
To delete everything but vmd.ko, I suppose we could remove "pci" from the aforementioned "rm -rf" command and then add:
Code:find pci -type f -not -name vmd.ko -delete
find pci -type d -depth -empty -deleteThough there's another way to do it, as shown by the "Save the Hyper-V keyboard module" code immediately surrounding the rm, as well as other *.orig shuffles throughout the function. But if it were entirely up to me, I'd rewrite those to use the above find method to delete files other than those specifically named, then delete empty directories at the end. Takes one line rather than four per instance. Here's a sample of the existing method:
Code:# Save the Hyper-V keyboard module:
mkdir -p input.orig/serio
cp -a input/serio/hyperv-keyboard.ko input.orig/serio
rm -rf${VERBOSE1} ... input ...
mv input.orig inputInstead I'd like to see:
Code:find input -type f -not -name hyperv-keyboard.ko -deleteAnd then put the empty directory delete near the end of the function.
The trouble is the lack of support for verbose mode. That can be added back with something like the following:
Code:find input -type f -not -name hyperv-keyboard.ko -printf "removed '%p'\n" -deleteHowever, this has embedded spaces, only one of which is to be regarded as an argument delimiter. bash only seems to support this via arrays, but array expansion syntax is too clumsy for my liking ("${array[@]}" in place of $array). Instead I'll use \40 which find (not bash) will replace with a space:
Code:VERBOSEDELFILE="-printf removed\40'%p'\n"
find input -type f -not -name hyperv-keyboard.ko $VERBOSEDELFILE -deleteThen for deleting directories:
Code:VERBOSEDELDIR="-printf removed\40directory\40'%p'\n"
find pci -type d -depth -empty $VERBOSEDELDIR -deleteIf there's any interest, I'll create and test a patch for whichever method is preferred.
For reference, here are the previous posts where I've mentioned the need for vmd.ko. I've not gotten any responses about vmd.ko so I'm making a thread specific to this topic.
- [SOLVED] Difficulty seeing NVMe
- Requests for -current (14.2-->15.0) (first post)
- Requests for -current (14.2-->15.0) (bump)