Mdev: Difference between revisions

From Alpine Linux
(better remove warning)
m (apk doesn't have 'install')
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:mdev}}
{{DISPLAYTITLE:mdev}}
{{Draft|This is almost complete but needs testing that it works when followed as a step by step guide.}}
mdev is the default [[Device_Manager|device manager]] on Alpine Linux. It is provided by busybox as alternative to [https://man.archlinux.org/man/udev.7 systemd's udev].
 
mdev is the default [[:Category:Device_Manager|device manager]] on Alpine Linux. It is provided by busybox as alternative to [https://man.archlinux.org/man/udev.7 systemd's udev].
mdev is '''not''' a drop in replacement for udev. See [[eudev]] for that instead. mdev lacks some features which makes it not recommended for a full blown desktop enviroment.
mdev is '''not''' a drop in replacement for udev. See [[eudev]] for that instead. mdev lacks some features which makes it not recommended for a full blown desktop enviroment.


== Installation ==
== Installation ==


The easy way to setup mdev is throught the [[#Setup_Script|setup script]]. For custom installation see the [[#Manually|manually section]]. Note that this is only recommended for advanced users.
The easy way to setup mdev is throught the [[#Setup_Script|setup script]]. For custom installation see the [[#Manually|manually section]]. Note that a manual installation is only recommended for advanced users.


=== Setup Script ===
=== Setup Script ===
Line 13: Line 11:
The {{pkg|alpine-conf}} package privides [https://git.alpinelinux.org/alpine-conf/tree/setup-devd.in setup-devd] to easily install and setup device managers.
The {{pkg|alpine-conf}} package privides [https://git.alpinelinux.org/alpine-conf/tree/setup-devd.in setup-devd] to easily install and setup device managers.


Install {{pkg|alpine-conf}} if not already.
Install {{pkg|alpine-conf}} if it is not already installed.
{{cmd|# apk add {{pkg|alpine-conf}}}}
{{cmd|# apk add {{pkg|alpine-conf}}}}
Setup mdev.
Setup mdev.
Line 21: Line 19:


Mdev is provided by the {{pkg|busybox}} package which is pre installed on any alpine installation. To run mdev the [[OpenRC]] init scripts are required too. If it isn't already installed install it:
Mdev is provided by the {{pkg|busybox}} package which is pre installed on any alpine installation. To run mdev the [[OpenRC]] init scripts are required too. If it isn't already installed install it:
{{cmd|# apk install {{pkg|busybox-mdev-openrc}}}}
{{cmd|# apk add {{pkg|busybox-mdev-openrc}}}}




If you already have a device manager installed you need to remove it before you start mdev.
If you already have a device manager installed you need to stop it before you start mdev.




Line 52: Line 50:
== libudev replacement ==
== libudev replacement ==


{{pkg|libudev-zero}} provides udev apis bit is independent from the device manager used. When installed it will make '''some''' udev reliant programms work with mdev. See [https://github.com/illiliti/libudev-zero/#what-doesnt-work|What doesn't work].
{{pkg|libudev-zero}} provides udev apis but is independent from the device manager used. When installed it will make '''some''' udev reliant programms work with mdev. See <code>[https://github.com/illiliti/libudev-zero/#what-doesnt-work What doesn't work]</code>.
 
== Configuration ==


== Custom network interfaces ==
=== Custom network interfaces ===
See [[Custom network interface names]]
See [[Custom network interface names]]


== USB Printer ==
=== USB Printer ===
See [[Printer_Setup#mdev_hacks_for_USB_printers|mdev hacks for USB printers]]
See [[Printer_Setup#configure_mdev_for_USB_printers|configure mdev for USB printers]]


== Raspberry Pi Bluetooth Speaker ==
=== Raspberry Pi Bluetooth Speaker ===
See [[Raspberry_Pi_Bluetooth_Speaker#Bluetooth|Raspberry Pi Bluetooth Speaker]]
See [[Raspberry_Pi_Bluetooth_Speaker#Bluetooth|Raspberry Pi Bluetooth Speaker]]



Latest revision as of 04:05, 27 March 2024

mdev is the default device manager on Alpine Linux. It is provided by busybox as alternative to systemd's udev. mdev is not a drop in replacement for udev. See eudev for that instead. mdev lacks some features which makes it not recommended for a full blown desktop enviroment.

Installation

The easy way to setup mdev is throught the setup script. For custom installation see the manually section. Note that a manual installation is only recommended for advanced users.

Setup Script

The alpine-conf package privides setup-devd to easily install and setup device managers.

Install alpine-conf if it is not already installed.

# apk add alpine-conf

Setup mdev.

# setup-devd mdev

Manually

Mdev is provided by the busybox package which is pre installed on any alpine installation. To run mdev the OpenRC init scripts are required too. If it isn't already installed install it:

# apk add busybox-mdev-openrc


If you already have a device manager installed you need to stop it before you start mdev.


Enable the mdev service.

# rc-update add mdev sysinit

# rc-update add hwdrivers sysinit

If you are not running in a chroot you will also want to start mdev.

# rc-service mdev start

# rc-service hwdrivers start

You might also want to take a look at libudev replacement if programms you want to use depend on udev.

Remove

Warning: Disabling mdev without setting up a different device manager may cause unexpected issues. If you install a different device manager with the setup script this step is not needed.


First stop the service. This step can be skipped when you are running in a chroot.

# rc-service mdev stop

Then disable it.

# rc-update delete mdev sysinit


You might also want to uninstall the init scripts since they are not used anymore.

# apk del busybox-mdev-openrc

The mdev binary is part of the busybox package and therefor can't be uninstalled.

libudev replacement

libudev-zero provides udev apis but is independent from the device manager used. When installed it will make some udev reliant programms work with mdev. See What doesn't work.

Configuration

Custom network interfaces

See Custom network interface names

USB Printer

See configure mdev for USB printers

Raspberry Pi Bluetooth Speaker

See Raspberry Pi Bluetooth Speaker

See Also