Skip to content

Commit 9665e98

Browse files
committed
dietpi-patches: switch UART node when migrating to Rockchip mainline kernel
The Rockchip vendor kernel provides `/dev/ttyFIQ0` for the primary/debug UART console, mainline Linux provides `/dev/ttyS2` instead. Switch the node accordingly, to keep boot/kernel output and login prompt on the serial console functional.
1 parent 03ede0b commit 9665e98

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.update/patches

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,12 @@ Patch_9_20()
20852085
# The /boot/dtb symlink has been found to be missing after kernel removed, despite a newer kernel being installed already. Assure it is present and correct.
20862086
[[ -d '/boot/dtb' ]] || G_EXEC_OUTPUT=1 G_EXEC dpkg-reconfigure -f noninteractive linux-image-current-rockchip64
20872087
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc
2088+
G_EXEC sed --follow-symlinks -i 's/ttyFIQ0/ttyS2/' /boot/dietpiEnv.txt
2089+
if systemctl -q is-enabled serial-getty@ttyFIQ0
2090+
then
2091+
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware serialconsole 0 ttyFIQ0
2092+
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware serialconsole 1 ttyS2
2093+
fi
20882094
fi
20892095

20902096
G_DIETPI-NOTIFY 2 'Masking unnecessary systemd-firstboot service'
@@ -2240,6 +2246,12 @@ Patch_10_1()
22402246
# The /boot/dtb symlink has been found to be missing after kernel removed, despite a newer kernel being installed already. Assure it is present and correct.
22412247
[[ -d '/boot/dtb' ]] || G_EXEC_OUTPUT=1 G_EXEC dpkg-reconfigure -f noninteractive linux-image-current-rockchip64
22422248
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc
2249+
G_EXEC sed --follow-symlinks -i 's/ttyFIQ0/ttyS2/' /boot/dietpiEnv.txt
2250+
if systemctl -q is-enabled serial-getty@ttyFIQ0
2251+
then
2252+
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware serialconsole 0 ttyFIQ0
2253+
G_EXEC_OUTPUT=1 G_EXEC /boot/dietpi/func/dietpi-set_hardware serialconsole 1 ttyS2
2254+
fi
22432255

22442256
# NanoPi R5C
22452257
elif (( $G_HW_MODEL == 76 )) && grep -q 'R5C' /proc/device-tree/model

0 commit comments

Comments
 (0)