Please explain this code fragment

I finally managed my wifi adapter to work, after 2 days of searching for a solution. But some steps are not clear to me what exactly they are doing.

  1. git clone https://github.com/xse/rtl8192eu-dkms-git.git
  2. cd rtl8192eu-dkms-git
  3. makepkg -si
  4. echo -e “8192eu\n\nloop” | sudo tee /etc/modules
  5. sudo grub-mkconfig -o /boot/grub/grub.cfg
  6. sudo mkinitcpio -p linuxХХ
    where XX stands for kernel version

I totally understand what the lines 1,2,3,5 do. However, I have two questions regarding 4 and 6:

  1. what is done in the line number 4 and why?
  2. in line 6 I used sudo mkinitcpio -p linux dropping XX completely, and this somehow worked. Did I do anything wrong?

Please could anybody clarify?

1 Like

Echoes the text in the quotes and pipes into a file /etc/modules

So if you ran cat /etc/modules you should see the text.

sudo mkinitcpio -p linuxХХ rebuilds the initial ramdisk for that kernel. Easier would be sudo mkinitcpio -P which builds for all installed kernels.

3 Likes

sudo mkinitcpio -p linux updates the init for the linux package (i.e., the regular Arch kernel). As long as that’s the kernel you’re using, it will work. But if you were using, for example, the lts or zen kernel, it would not.

As @xircon notes above, sudo mkinitcpio -P (capital/uppercase P) handles all installed kernel versions.

3 Likes

As for the what is done: already explained above

As for the why:

The file contains the names of kernel modules that should be loaded at boot time. In your case, that would be the driver for your wifi adapter.

2 Likes

This file is not used in Archlinux.
Instead, we use a drop-in folder with *.conf files, for the same thing.

/etc/modules-load.d/some-module-or-function.conf
2 Likes

There is a folder /etc/modules-load.d but is is empty, there are no hidden files either.
Would it have been better to install the module rtl8192eu in the folder /etc/modules-load.d ?
I did a system update after installing the module rtl8192eu and the system update was stuck for a long time changing the stuff related with the module rtl8192eu…
I wonder maybe I did something wrong and there was a better way to install the module?

Did the updated packages include a new kernel? If positive, so I guess then this:

https://wiki.archlinux.org/title/DKMS

If you want to change to do it the “Arch Way”, please see:

https://wiki.archlinux.org/title/Kernel_Modules#Using_files_in_/etc/modprobe.d/

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.