mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-26 06:26:29 +00:00
Allow udev rules & make it persistent (#210)
* Install default to lib * Create hmip-rfusb.rules * Create etc-udev-rules.d.mount * Update hassos-config * Update configuration.md * Update rauc.sh * Add ln
This commit is contained in:
parent
8ffcd3efb9
commit
398b684d8d
@ -8,12 +8,14 @@ Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG`. Use the following
|
||||
```
|
||||
network/
|
||||
modules/
|
||||
udev/
|
||||
authorized_keys
|
||||
hassos-xy.raucb
|
||||
```
|
||||
|
||||
- The `network` folder can contain any kind of NetworkManager connection files. For more information see [Network][network.md].
|
||||
- The `modules` folder is for modules-load configuration files.
|
||||
- The `udev` folder is for udev rules files.
|
||||
- The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Hassio][debug-hassio].
|
||||
- The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page.
|
||||
|
||||
@ -30,6 +32,10 @@ You can edit or create a `cmdline.txt` into your boot partition. That will be re
|
||||
|
||||
The kernel module folder `/etc/modules-load.d` is persistent and you can add your config files there. See [Systemd modules load][systemd-modules].
|
||||
|
||||
### Udev rules
|
||||
|
||||
The udev rules folder `/etc/udev/rules.d` is persistent and you can add your configuration files there.
|
||||
|
||||
### Network
|
||||
|
||||
You can manual add, edit or remove connections configs from `/etc/NetworkManager/system-connections`.
|
||||
|
@ -24,8 +24,8 @@ define BLUETOOTH_BCM43XX_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -d $(TARGET_DIR)/lib/firmware/brcm
|
||||
$(INSTALL) -m 0644 $(@D)/*.hcd $(TARGET_DIR)/lib/firmware/brcm/
|
||||
|
||||
$(INSTALL) -d $(TARGET_DIR)/etc/udev/rules.d
|
||||
$(INSTALL) -m 0644 $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/etc/udev/rules.d/
|
||||
$(INSTALL) -d $(TARGET_DIR)/usr/lib/udev/rules.d
|
||||
$(INSTALL) -m 0644 $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/usr/lib/udev/rules.d/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
@ -0,0 +1 @@
|
||||
/usr/lib/systemd/system/etc-udev-rules.d.mount
|
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Udev persistent rules.d
|
||||
Requires=mnt-overlay.mount
|
||||
After=mnt-overlay.mount
|
||||
Before=systemd-udevd.service hassos-config.service
|
||||
|
||||
[Mount]
|
||||
What=/mnt/overlay/etc/udev/rules.d
|
||||
Where=/etc/udev/rules.d
|
||||
Type=None
|
||||
Options=bind
|
||||
|
||||
[Install]
|
||||
WantedBy=hassos-bind.target
|
@ -0,0 +1 @@
|
||||
ACTION=="add", ATTRS{idVendor}=="1b1f", ATTRS{idProduct}=="c020", RUN+="/sbin/modprobe cp210x" RUN+="/bin/sh -c 'echo 1b1f c020 >/sys/bus/usb-serial/drivers/cp210x/new_id'"
|
@ -33,6 +33,15 @@ if [ -d /mnt/config/modules ]; then
|
||||
cp -f /mnt/config/modules/* /etc/modules-load.d/*
|
||||
fi
|
||||
|
||||
##
|
||||
# Udev
|
||||
if [ -d /mnt/config/udev ]; then
|
||||
echo "[Info] Update Udev configuration!"
|
||||
|
||||
rm -rf /etc/udev/rules.d/*
|
||||
cp -f /mnt/config/udev/* /etc/udev/rules.d/*
|
||||
fi
|
||||
|
||||
##
|
||||
# SSH know hosts
|
||||
if [ -f /mnt/config/authorized_keys ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user