Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

albus: add udev rules #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# On the host:

Alternatively, if you want to create the file with the udev rules on your “host” machine you can run the following command inside your halium folder, replacing [codename] with your device’s codename:

```
cat out/target/product/[codename]/root/ueventd*.rc | grep ^/dev | sed -e 's/^\/dev\///' | awk '{printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,$3,$4,$2}' | sed -e 's/\r//' > 70-[codename].rules
```

You can then use either ssh or adb push to push the file to the right location:

## SSH:

```bash
cat 70-[codename].rules | ssh 10.15.19.82 'cat > /tmp/udev.rules'
ssh 10.15.19.82
sudo cp /tmp/udev.rules /etc/udev/rules.d/70-[codename].rules
```

## ADB:
Reboot into recovery. If your rootfs is mounted at /data/halium-rootfs/ you can push it with:

```bash
adb push 70-[codename].rules /data/halium-rootfs/etc/udev/rules.d/
```

Send upstream:

In order for other users to be able to use the udev rules send a pull request to the lxc-android repository. Similar to: https://github.com/Halium/lxc-android/pull/12/files
73 changes: 73 additions & 0 deletions usr/lib/lxc-android/70-albus.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
ACTION=="add", KERNEL=="null", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="zero", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="full", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="ptmx", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="tty", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="random", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="urandom", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="hw_random", OWNER="root", GROUP="system", MODE="0440"
ACTION=="add", KERNEL=="ashmem", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="binder", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="hwbinder", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="vndbinder", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="pmsg0", OWNER="root", GROUP="log", MODE="0222"
ACTION=="add", KERNEL=="msm_hw3dc", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="kgsl", OWNER="root", GROUP="root", MODE="0666"
ACTION=="add", KERNEL=="dri/*", OWNER="root", GROUP="graphics", MODE="0666"
ACTION=="add", KERNEL=="diag", OWNER="radio", GROUP="radio", MODE="0660"
ACTION=="add", KERNEL=="diag_arm9", OWNER="radio", GROUP="radio", MODE="0660"
ACTION=="add", KERNEL=="ttyMSM0", OWNER="bluetooth", GROUP="bluetooth", MODE="0600"
ACTION=="add", KERNEL=="uhid", OWNER="uhid", GROUP="uhid", MODE="0660"
ACTION=="add", KERNEL=="uinput", OWNER="system", GROUP="bluetooth", MODE="0660"
ACTION=="add", KERNEL=="alarm", OWNER="system", GROUP="radio", MODE="0664"
ACTION=="add", KERNEL=="rtc0", OWNER="system", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="tty0", OWNER="root", GROUP="system", MODE="0660"
ACTION=="add", KERNEL=="graphics/*", OWNER="root", GROUP="graphics", MODE="0660"
ACTION=="add", KERNEL=="msm_hw3dm", OWNER="system", GROUP="graphics", MODE="0660"
ACTION=="add", KERNEL=="input/*", OWNER="root", GROUP="input", MODE="0660"
ACTION=="add", KERNEL=="v4l-touch*", OWNER="root", GROUP="input", MODE="0660"
ACTION=="add", KERNEL=="eac", OWNER="root", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="cam", OWNER="root", GROUP="camera", MODE="0660"
ACTION=="add", KERNEL=="pmem", OWNER="system", GROUP="graphics", MODE="0660"
ACTION=="add", KERNEL=="pmem_adsp*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="pmem_camera*", OWNER="system", GROUP="camera", MODE="0660"
ACTION=="add", KERNEL=="oncrpc/*", OWNER="root", GROUP="system", MODE="0660"
ACTION=="add", KERNEL=="adsp/*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="snd/*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="mt9t013", OWNER="system", GROUP="system", MODE="0660"
ACTION=="add", KERNEL=="msm_camera/*", OWNER="system", GROUP="system", MODE="0660"
ACTION=="add", KERNEL=="akm8976_daemon", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="akm8976_aot", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="akm8973_daemon", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="akm8973_aot", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="bma150", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="cm3602", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="akm8976_pffd", OWNER="compass", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="lightsensor", OWNER="system", GROUP="system", MODE="0640"
ACTION=="add", KERNEL=="msm_pcm_out*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_pcm_in*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_pcm_ctl*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_snd*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_mp3*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="audience_a1026*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="tpa2018d1*", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_audpre", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="msm_audio_ctl", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="htc-acoustic", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="vdec", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="q6venc", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="snd/dsp", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="snd/dsp1", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="snd/mixer", OWNER="system", GROUP="audio", MODE="0660"
ACTION=="add", KERNEL=="smd0", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="qmi", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="qmi0", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="qmi1", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="qmi2", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="bus/usb/*", OWNER="root", GROUP="usb", MODE="0660"
ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="mtp", MODE="0660"
ACTION=="add", KERNEL=="usb_accessory", OWNER="root", GROUP="usb", MODE="0660"
ACTION=="add", KERNEL=="tun", OWNER="system", GROUP="vpn", MODE="0660"
ACTION=="add", KERNEL=="ts0710mux*", OWNER="radio", GROUP="radio", MODE="0640"
ACTION=="add", KERNEL=="ppp", OWNER="radio", GROUP="vpn", MODE="0660"
ACTION=="add", KERNEL=="dvb*", OWNER="root", GROUP="system", MODE="0660"