Это потенциально может быть сделано с помощью ужасных вещей с помощью accept-line
:
function _accept-line() {
if [[ $BUFFER == "." ]]; then
BUFFER="source ~/.zshrc"
fi
zle .accept-line
}
zle -N accept-line _accept-line
Ответ адаптирован из SuperUser: https://superuser. com/questions/309840/how-can-i-point-dev-random-to-dev-urandom
Все, что вам нужно сделать, это создать что-то вроде /etc/udev/rules.d/70-harware-randomizer-enable.rules
со следующим содержимым:
# /etc/udev/rules.d/70-disable-random-entropy-estimation.rules
# Disables /dev/random entropy estimation (it's mostly snake oil anyway).
#
# udevd will warn that the kernel-provided name 'random' and NAME= 'ttyACM0'
# disagree. You can ignore this warning.
# Use /dev/ttyACM0 instead of /dev/random for the entropy-estimating RNG.
KERNEL=="random", NAME="ttyACM0"
# Remove any existing /dev/random, then create symlink /dev/random pointing to
# /dev/urandom
KERNEL=="urandom", PROGRAM+="/bin/rm -f /dev/random", SYMLINK+="random"
Я не могу вспомнить, делал ли я что-то еще, но кажется, что я создал /etc/systemd/system/rngd@.service
со следующим:
[Unit]
Description=rngd service on %I
[Service]
Type=simple
ExecStartPre=/bin/stty -F /dev/%I raw -echo -parenb
ExecStart=/usr/sbin/rngd -f --fill-watermark=4000 --rng-device=/dev/%I
Затем, sudo systemctl enable rngd@ttyACM0.service
иsudo systemctl start rngd@ttyACM0.service