LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-24-2021, 01:10 PM   #1
andygoth
Member
 
Registered: Sep 2017
Distribution: Slackware
Posts: 132

Rep: Reputation: 66
vmd.ko in installer


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.ko
Out 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 -delete
Though 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 input
Instead I'd like to see:

Code:
find input -type f -not -name hyperv-keyboard.ko -delete
And 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" -delete
However, 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 -delete
Then for deleting directories:

Code:
VERBOSEDELDIR="-printf removed\40directory\40'%p'\n"
find pci -type d -depth -empty $VERBOSEDELDIR -delete
If 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.
 
Old 05-28-2021, 07:41 PM   #2
andygoth
Member
 
Registered: Sep 2017
Distribution: Slackware
Posts: 132

Original Poster
Rep: Reputation: 66
The "Wed May 26 19:51:53 UTC 2021" update to initrd added PCI controllers, including vmd.ko, so this is now resolved. Thanks, pat!
 
Old 05-28-2021, 07:44 PM   #3
andygoth
Member
 
Registered: Sep 2017
Distribution: Slackware
Posts: 132

Original Poster
Rep: Reputation: 66
For reference, in case anyone wants to add other stuff to their installer initrd, here's how I was doing it.

Code:
# Extract the initrd tree.
rm -rf initrd-tree
mkdir initrd-tree
xzcat slackware64/EFI/BOOT/initrd.img | cpio -i -D initrd-tree

# Add the vmd kernel module to the initrd tree.
kv=$(echo slackware64/slackware64/a/kernel-modules-*.txz | cut -d- -f3)
mkdir -p initrd-tree/lib/modules/$kv/kernel/drivers/pci/controller
tar -xOf slackware64/slackware64/a/kernel-modules-*.txz \
    lib/modules/$kv/kernel/drivers/pci/controller/vmd.ko | xz -9f -C crc32 > \
    initrd-tree/lib/modules/$kv/kernel/drivers/pci/controller/vmd.ko.xz
touch initrd-tree/lib/modules/$kv/modules.{order,builtin}
zcat slackware64/kernels/huge.s/System.map.gz |
    /sbin/depmod -b initrd-tree -F /dev/stdin $kv

# Build the new initrd.
(cd initrd-tree; find -print0 | cpio -o0 -H newc) | lzma > initrd.img
 
3 members found this post helpful.
Old 05-28-2021, 09:26 PM   #4
andygoth
Member
 
Registered: Sep 2017
Distribution: Slackware
Posts: 132

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by andygoth View Post
For reference, in case anyone wants to add other stuff to their installer initrd, here's how I was doing it.
Haha, I'm glad I made this post, since I ended up needing this script again! One revision to my installation procedure necessitated adding the time zone database to the initrd image, so the above script came in handy!
 
Old 08-12-2021, 02:56 PM   #5
dr.s
Member
 
Registered: Feb 2010
Distribution: Slackware64-current
Posts: 339

Rep: Reputation: 156Reputation: 156
Quote:
Originally Posted by andygoth View Post
Haha, I'm glad I made this post, since I ended up needing this script again! One revision to my installation procedure necessitated adding the time zone database to the initrd image, so the above script came in handy!
Thanks for posting, and for this thread too (Difficulty seeing NVMe)

Installed -current on a new laptop here (HP with a PCIe nvme SSD) only to run into kernel panics upon rebooting,
fixed by building nvme/target and vmd into the kernel.
 
1 members found this post helpful.
  


Reply

Tags
asus, installer, vmd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] vmd source plugins sryzdn Linux - Newbie 2 05-01-2013 11:05 AM
vmd crashes Xserver of x86_64 Centos5.1, openSUSE10.3, and ubuntu 10.3 centguy Linux - Hardware 3 03-29-2008 09:26 PM
Red Hat Installer, vs Debian Installer rmckayfleming Linux - General 6 10-19-2005 01:23 PM
(K)Ubuntu installer failing to load installer components from CD. slackyoda Ubuntu 5 07-20-2005 03:06 PM
What Does The UT2004 Installer Do Behind The Fancy GUI Installer? Tsuroerusu Linux - Games 2 09-09-2004 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration