Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aidatorajiro/rpizero-linux-build
This is a script to build a custom raspberry pi kernel, including a kernel patch to fix dwc2 wakeup issue.
https://github.com/aidatorajiro/rpizero-linux-build
dwc2 hid linux-kernel raspberry-pi
Last synced: about 1 month ago
JSON representation
This is a script to build a custom raspberry pi kernel, including a kernel patch to fix dwc2 wakeup issue.
- Host: GitHub
- URL: https://github.com/aidatorajiro/rpizero-linux-build
- Owner: aidatorajiro
- License: other
- Created: 2024-05-15T07:24:29.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-09-17T08:58:39.000Z (about 2 months ago)
- Last Synced: 2024-09-29T14:42:50.348Z (about 1 month ago)
- Topics: dwc2, hid, linux-kernel, raspberry-pi
- Language: Python
- Homepage:
- Size: 145 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raspberry pi zero kernel build tool & other scripts
This is a script to build a custom raspberry pi kernel, including a kernel patch to fix dwc2 wakeup issue. I haven't tested, but probably works for Pi4 or Pi5.
Also, the directory `raspi_scripts` contains utilities to setup HID keyboard, RNDIS or ECM. Using a python library by @Danny-Dasilva ()
Patch reference:
1. (if you are using selinux, run this script to allow write access from docker) `sudo sh selinux.sh`
1. `sh download.sh`
1. `sh docker.sh`
1. (inside docker) `cd /rpizero-linux-build`
1. (inside docker) `sh clean.sh`
1. (inside docker) `sh build.sh`
1. (inside docker) `exit`
1. Create a file named `names.sh` and set the contents as follows.
```
MYHOSTNAME=
MYUSERNAME=
MY_KERNEL_SUFFIX=wakeup
MY_KERNEL_NAME=kernel-$MY_KERNEL_SUFFIX
```
1. `sh pack.sh`
1. `sh packsend.sh` make sure you have SSH access to the rpi zero and it is connected to the local network. Alternatively, you can just copy generated files at `install/` to the SD card. First, copy `boot/firmware` into `/` of the EFI partition (usually the first partition). Second, copy `lib/modules` into `lib/modules` of the root partition (usually the second partition). Beware of file ownership. All files should be owned by `root`.
1. ssh into the rpizero and edit `/boot/firmware/config.txt`. Add following lines to the boot configuration. Alternatively, you can edit the SD. The file is at `/config.txt` in the EFI partition. If anything wrong happens (eg. the system doesn't start), please edit SD directly and delete these lines to revert all changes made to the system.
```
[all]
dtoverlay=dwc2
kernel=kernel-wakeup.img
```
1. ssh into the rpizero and reboot## scripts and configs for rpi zero
- `raspi_scripts/`: scripts to be run inside raspberry pi
- `etc/rc.local`: rc file to enable HID mouse and keyboard on startup
- `home/someusername`: scripts to control USB device
- `keyboard2.py`: control HID keyboard via command line
Example1 : `p CONTROL ALT DEL`
Example2 : `p ALT F4`
Example3 : `p DOWN_ARROW`
Example4 : `w sometext12345`
- `root/`: scripts to enable HID/Ether feature on startup
- `geth.sh`: Enable an old driver for ethernet over USB using RNDIS. On windows, you have to install a special driver to connect to the rpi zero. Go to , and download the driver file named "Acer Incorporated. - Other hardware - USB Ethernet/RNDIS Gadget". On linux, it works without any configration.
- `hid-and-eth.sh`: enable both HID and Ethernet-over-USB at the same time using a new driver. Unfortunately, there is no signed Windows driver for it.
- `hid-double.sh`: enable both HID keyboard and Mouse.
- `hid.sh`: enable only HID keyboard.
- `remove.sh`: unloads all drivers so that you can use any of these scripts again. very unstable, so it is better to restart the rpi zero instead.- `host_scripts/`: scripts to be run from the remote computer that will control raspberry pi
- `qt.py`: Use PyQt5 to synchronize keyboard input and mouse movement
USAGE: Alt+G to toggle mouse grabbing. After switching mouse grabbing on, just type text or moving mouse. Note that on MacOS, CTRL is interpreted as COMMAND/WINDOWS key, and COMMAND/WINDOWS is interpreted as CTRL key.
- `mouse.py`: Use Xlib to synchronize mouse movement