Skip to content

Commit 2df5064

Browse files
authored
Make sure dwc overlay gets added if does not exist
1 parent 4845774 commit 2df5064

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

migration_source/v2.2.2.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Enable usb-host on usb-c port
2-
sudo sed -zi "s/dtoverlay=dwc2/dtoverlay=dwc2,dr_mode=host/" /boot/config.txt
32

3+
#Add it to the dw2 line if it exist
4+
sudo sed -zi "s/dtoverlay=dwc2\n/dtoverlay=dwc2,dr_mode=host\n/" /boot/config.txt
5+
6+
#Add the line if it does not exist
7+
sudo sed -zi '/dtoverlay=dwc2,dr_mode=host\n/!s/$/\ndtoverlay=dwc2,dr_mode=host\n/' /boot/config.txt

0 commit comments

Comments
 (0)