Merge pull request #52 from brain-hackers/misc

Misc. addition
This commit is contained in:
Takumi Sueda 2023-03-27 20:01:31 +09:00 committed by GitHub
commit 8ca8a3ab12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 0 deletions

View File

@ -19,3 +19,8 @@ install -g 1000 -o 1000 -m 0644 $SRC/home/user/.config/fcitx/profile $DST/home/u
sudo -u#1000 -g#1000 mkdir -p $DST/home/user/lxterminal
install -g 1000 -o 1000 -m 0644 $SRC/home/user/lxterminal/lxterminal.conf $DST/home/user/lxterminal/lxterminal.conf
install -g root -o root -m 0644 -D $SRC/etc/jwm/system.jwmrc $DST/etc/jwm/system.jwmrc
install -g root -o root -m 0644 $SRC/lib/systemd/system/boot.mount $DST/lib/systemd/system/boot.mount
install -g root -o root -m 0644 $SRC/lib/systemd/system/rndis_gadget.service $DST/lib/systemd/system/rndis_gadget.service
install -g root -o root -m 0755 $SRC/usr/bin/enable_rndis_gadget $DST/usr/bin/enable_rndis_gadget

View File

@ -0,0 +1,10 @@
[Unit]
Description=Mount boot partition
[Mount]
What=/dev/mmcblk1p1
Where=/boot
Options=ro
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Enable RNDIS USB Gadget
[Service]
Type=oneshot
ExecStart=/usr/bin/enable_rndis_gadget
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,25 @@
#!/bin/sh
g=/sys/kernel/config/usb_gadget/eth
mkdir ${g}
echo "0x3066" > ${g}/bcdDevice
echo "1" > ${g}/os_desc/use
echo "0xcd" > ${g}/os_desc/b_vendor_code
echo "MSFT100" > ${g}/os_desc/qw_sign
mkdir ${g}/functions/rndis.rn0
echo "RNDIS" > ${g}/functions/rndis.rn0/os_desc/interface.rndis/compatible_id
echo "5162001" > ${g}/functions/rndis.rn0/os_desc/interface.rndis/sub_compatible_id
echo "8a:15:8b:44:3a:02" > ${g}/functions/rndis.rn0/dev_addr
echo "8a:15:8b:44:3a:01" > ${g}/functions/rndis.rn0/host_addr
mkdir ${g}/configs/c.1
ln -s ${g}/functions/rndis.rn0 ${g}/configs/c.1/
echo "ci_hdrc.0" > ${g}/UDC
sleep 1
ifconfig usb0 up
dhclient

View File

@ -136,6 +136,12 @@ ttymxc0
ttyLP0
EOF
# Enable /boot mount
systemctl enable boot.mount
# Enable RNDIS gadget
systemctl enable rndis_gadget
# Get wild
cat <<EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian bullseye main contrib non-free