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

DietPi-Config | Serial/UART rework: Allow to toggle login console on single serial devices #2678

Merged
merged 7 commits into from
Apr 8, 2019

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Mar 31, 2019

Status: ready

  • Patch:
    • Remove all masks, disable all serial-getty instances
    • Re-enable only currently active serial-getty instances
  • Changelog: Whoopsie, added changelog to "dev" accidentally
  • DietPi-PREP: Assure best compatible default is set, so that login consoles are enabled on all existing serial devices on first boot. The existing first run setup prompt allows to keep or disable them.
  • Add ARMbian image handling: Detect used serial device within boot.cmd. If it matches the one that is to be enabled, set console=both in armbianEnv.ini. Skip direct boot.cmd adjustments since those can break expacted behaviour of armbianEnv.ini etc.
  • Allow adding individual console entries to boot.ini on Odroids

Reference: #2607

Commit list/description:

  • DietPi-Set_hardware | Serial/UART rework: Allow to toggle login console (+boot messages) on single serial devices. Without input (backwards compatibility) toggle for active devices only based on /dev/tty* existence to prevent e.g. boot error logs because systemd attempts to start serial-getty on unavailable serial devices.
  • DietPi-Set_hardware | Serial/UART rework: On RPi warn when attempting to enable login console on ttyAMA0 while Bluetooth is active and the other way round since onboard Bluetooth uses ttyAMA0.
  • DietPi-Config | Serial/UART rework: Allow to toggle login console on single serial devices
  • DietPi-Config | Adjust Pine A64 options based on ARMbian vs Ayufan/Longsleep image
  • DietPi-Config | Fix: Reset soundcard defaults and with this install alsa-utils if missing when entering Audio Options. Installing alsa-utils was skipped if it was NOT installed.
  • DietPi-Config | Minor coding and wording
  • DietPi-Patch | Cleanup and fix masked/enabled serial-getty instances for non-existent serial devices
  • DietPi-Config | Move Serial/UART options into own menu function so we will not return to parent menu after every selection
  • DietPi-Config | Further minor coding and reorder
  • DietPi-Set_hardware | serialconsole: Add ARMbian image handling: Detect used serial device within boot.cmd. If it matches the one that is to be enabled, set console=display|serial|both|none in armbianEnv.ini.
  • DietPi-Set_hardware | serialconsole: Allow adding individual console entries to boot.ini on Odroids
  • DietPi-Set_hardware | serialconsole: On RPi, only prompt Bluetooth warning if ttyAMA0 is about to be enabled
  • DietPi-Set_hardware | serialconsole: Minor fine tuning
  • DietPi-Config | Serial/UART: Several fixes
  • DietPi-Config | Serial/UART: Enable VM support since VirtualBox and VMware allow to enable virtual serial ports and attach devices from host.

+ DietPi-Set_hardware | Serial/UART rework: Allow to toggle login console (+boot messages) on single serial devices. Without input (backwards compatibility) toggle for active devices only based on /dev/tty* existence to prevent e.g. boot error logs because systemd attempts to start serial-getty on unavailable serial devices.
+ DietPi-Set_hardware | Serial/UART rework: On RPi warn when attempting to enable login console on ttyAMA0 while Bluetooth is active and the other way round since onboard Bluetooth uses ttyAMA0.
+ DietPi-Config | Serial/UART rework: Allow to toggle login console on single serial devices
+ DietPi-Config | Adjust Pine A64 options based on ARMbian vs Ayufan/Longsleep image
+ DietPi-Config | Fix: Reset soundcard defaults and with this install alsa-utils if missing when entering Audio Options. Installing alsa-utils was skipped if it was NOT installed.
+ DietPi-Config | Minor coding and wording
+ DietPi-Patch | Cleanup and fix masked/enabled serial-getty instances for non-existent serial devices
+ DietPi-Config | Move Serial/UART options into own menu function so we will not return to parent menu after every selection
+ DietPi-Config | Further minor coding and reorder
+ DietPi-Set_hardware | serialconsole: Add ARMbian image handling: Detect used serial device within boot.cmd. If it matches the one that is to be enabled, set console=display|serial|both|none in armbianEnv.ini.
+ DietPi-Set_hardware | serialconsole: Allow adding individual console entries to boot.ini on Odroids
+ DietPi-Set_hardware | serialconsole: On RPi, only prompt Bluetooth warning if ttyAMA0 is about to be enabled
+ DietPi-Set_hardware | serialconsole: Minor fine tuning
+ DietPi-Config | Serial/UART: Several fixes
+ DietPi-Config | Serial/UART: Enable VM support since VirtualBox and VMware allow to enable virtual serial ports and attach devices from host.
@MichaIng MichaIng requested a review from Fourdee April 6, 2019 22:02
@MichaIng
Copy link
Owner Author

MichaIng commented Apr 8, 2019

Further ideas:

  • Check ps -t ttyS0 --no-headers o cmd (or o unit or both? Is on systemd every interactive process attached to a (parent) service?) for active processes (systemd units) that use the desired serial device.
    • Works well for serial-getty (> agetty) and should work for other things like Bluetooth as well.
  • Move explicit known conflict cases (RPi: Bluetooth <> ttyAMA0) into DietPi-Config. Check via known hciuart process.
  • Show [On] if ps contains agetty
  • Show [Used by: Bluetooth] if known hciuart process/service is found
  • Show [Used by: <cmd>] (or <service>) with full first ps output line (which is in case parent process) if anything else is attached to the device.
  • When selecting a used tty which is not used by any known process, fallback to dietpi-set_hardware check which simply prints ps -t ttyS0 --no-headers fo cmd,unit and asks to ignore or cancel. Default is cancel so e.g. auto enabling all found serial devices on first run setup will skip them.

However will merge for now current stage to allow testing especially of the boot console configs and UART toggle.

+ DietPi-Config | Serial/UART: Cleanup code and menu on RPi
@MichaIng MichaIng merged commit 9cf6dd3 into dev Apr 8, 2019
@MichaIng MichaIng deleted the serial_uart branch April 8, 2019 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant