ardangelo / beepy-gen

Raspberry Pi OS gen scripts - Beepy fork
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

v1.0-rc 'apt upgrade' hung with DKMS recompile of beepy-kbd due to whiptail #3

Closed makergamer closed 6 months ago

makergamer commented 6 months ago

Trying out the new v1.0-rc on my Beepy+RPIZero2W. Like always, immediately after getting on the network, I issue an 'apt update && apt upgrade'. Once it reaches the DKMS portion, it drags on for evah:

Unpacking raspi-utils (20240402-2) over (20240402-1) ...
Setting up linux-libc-dev (1:6.6.28-1+rpt1) ...
Setting up linux-image-6.6.28+rpt-rpi-v7l (1:6.6.28-1+rpt1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.6.28+rpt-rpi-v7l.
Sign command: /lib/modules/6.6.28+rpt-rpi-v7l/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j4 KERNELRELEASE=6.6.28+rpt-rpi-v7l && make -C /var/lib/dkms/beepy-kbd/2.11/source install_aux BUILD_DIR=/var/lib/dkms/beepy-kbd/2.11/build ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Progress: [ 53%] [####################################################..............................................]

I've seen this kind of thing before. I bet it is some interactive thing like whiptail or dialog. Yup.

pi@bb:~ $ ps -ef f > ps-ef--forest.out
pi@bb:~ $ cat ps-ef--forest.out

UID        PID  PPID  C STIME TTY      STAT   TIME CMD
root         2     0  0 14:26 ?        S      0:00 [kthreadd]
root         3     2  0 14:26 ?        S      0:00  \_ [pool_workqueue_release]
...
root      5261     2  0 15:16 ?        I      0:00  \_ [kworker/u11:1-events_unbound]
root         1     0  0 14:26 ?        Ss     0:20 /sbin/init
root       230     1  0 14:26 ?        Ss     0:01 /lib/systemd/systemd-udevd
root       264     1  0 14:26 ?        Ss     0:01 /lib/systemd/systemd-journald
root       355     1  0 14:26 ?        Ss     0:00 /usr/sbin/cron -f
message+   371     1  0 14:26 ?        Ss     0:04 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root       377     1  0 14:26 ?        Ss     0:00 /lib/systemd/systemd-logind
root       385     1  0 14:26 ?        Ss     0:00 /usr/libexec/bluetooth/bluetoothd
pi         468     1  0 14:27 ?        Ss     0:00 /lib/systemd/systemd --user
pi         469   468  0 14:27 ?        S      0:00  \_ (sd-pam)
avahi      512     1  0 14:27 ?        Ss     0:05 avahi-daemon: running [beepy.local]
avahi      525   512  0 14:27 ?        S      0:00  \_ avahi-daemon: chroot helper
polkitd    522     1  0 14:27 ?        Ssl    0:00 /usr/lib/polkit-1/polkitd --no-debug
systemd+   523     1  0 14:27 ?        Ssl    0:00 /lib/systemd/systemd-timesyncd
nobody     524     1  0 14:27 ?        Ss     0:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*
root       526     1  0 14:27 ?        Ss     0:00 /sbin/wpa_supplicant -u -s -O DIR=/run/wpa_supplicant GROUP=netdev
root       561     1  0 14:27 ?        Ssl    0:01 /usr/sbin/NetworkManager --no-daemon
root       582     1  0 14:27 ?        Ssl    0:00 /usr/sbin/ModemManager
root       641     1  0 14:27 ?        Ss     0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
root      1598   641  0 14:52 ?        Ss     0:00  \_ sshd: pi [priv]
pi        1605  1598  0 14:52 ?        S      0:00      \_ sshd: pi@pts/3
pi        1606  1605  0 14:52 pts/3    Ss     0:00          \_ -bash
pi        1623  1606  0 14:52 pts/3    S+     0:00              \_ tmux
root      1086     1  0 14:34 tty6     Ss+    0:00 /sbin/agetty -o -p -- \u --noclear - linux
root      1087     1  0 14:34 tty1     Ss     0:00 /bin/login -f
pi        1088  1087  0 14:34 tty1     S+     0:00  \_ -bash
pi        1110  1088  0 14:34 tty1     S+     0:00      \_ tmux -u
pi        1112     1  0 14:34 ?        Ss     0:18 tmux -u
pi        1113  1112  0 14:34 pts/0    Ss+    0:00  \_ -bash
pi        1426  1112  0 14:37 pts/2    Ss+    0:00  \_ -bash
pi        1624  1112  0 14:52 pts/4    Ss+    0:00  \_ -bash
pi        1660  1112  0 14:53 pts/5    Ss     0:00  \_ -bash
root      1784  1660  0 14:56 pts/5    S+     0:00  |   \_ sudo su -
root      1785  1784  0 14:56 pts/6    Ss     0:00  |       \_ sudo su -
root      1786  1785  0 14:56 pts/6    S      0:00  |           \_ su -
root      1787  1786  0 14:56 pts/6    S      0:00  |               \_ -bash
root      2103  1787  0 14:59 pts/6    S+     0:07  |                   \_ apt upgrade
root      2706  2103  0 15:04 pts/1    Ss+    0:00  |                       \_ /usr/bin/dpkg --status-fd 22 --configure --pending
root      2709  2706  0 15:04 pts/1    S+     0:00  |                           \_ /bin/sh -e /var/lib/dpkg/info/linux-image-6.6.28+rpt-rpi-v7l.postinst configure
root      2722  2709  0 15:05 pts/1    S+     0:00  |                               \_ run-parts --report --exit-on-error --arg=6.6.28+rpt-rpi-v7l --arg=/boot/vmlinuz-6.6.28+rpt-rpi-v7l /etc/kernel/postinst.d
root      2723  2722  0 15:05 pts/1    S+     0:00  |                                   \_ /bin/sh /usr/lib/dkms/dkms_autoinstaller start 6.6.28+rpt-rpi-v7l
root      2730  2723  0 15:05 pts/1    S+     0:00  |                                       \_ /bin/bash /usr/sbin/dkms autoinstall --kernelver 6.6.28+rpt-rpi-v7l
root      4167  2730  0 15:05 pts/1    S+     0:00  |                                           \_ /bin/bash /usr/sbin/dkms autoinstall --kernelver 6.6.28+rpt-rpi-v7l
root      4168  4167  0 15:05 pts/1    S+     0:00  |                                               \_ /bin/bash /usr/sbin/dkms autoinstall --kernelver 6.6.28+rpt-rpi-v7l
root      4292  4168  0 15:05 pts/1    S+     0:00  |                                                   \_ /bin/bash /usr/sbin/dkms autoinstall --kernelver 6.6.28+rpt-rpi-v7l
root      4659  4292  0 15:05 pts/1    S+     0:00  |                                                   |   \_ make -C /var/lib/dkms/beepy-kbd/2.11/source install_aux BUILD_DIR=/var/lib/dkms/beepy-kbd/2.11/build
root      4676  4659  0 15:05 pts/1    S+     0:00  |                                                   |       \_ /bin/sh -c dpkg-reconfigure keyboard-configuration \ ?|| echo "dpkg-reconfigure failed, keymap may not be applied"
root      4677  4676  0 15:05 pts/1    S+     0:02  |                                                   |           \_ /usr/bin/perl -w /usr/sbin/dpkg-reconfigure keyboard-configuration
root      4706  4677  0 15:06 pts/1    S+     0:00  |                                                   |               \_ /bin/sh /var/lib/dpkg/info/keyboard-configuration.config reconfigure 1.221rpt1
root      4822  4677  0 15:06 pts/1    S+     0:00  |                                                   |               \_ whiptail --backtitle Package configuration --title Configuring keyboard-configuration --output-fd 11 --default-item Generic 105-key PC --menu Please select the model of the keyboard of this machine.  Keyboard model: 21 61 11 -- A4Tech KB-21  A4Tech KBS-8  A4Tech Wireless Desktop RFKB-23  Acer AirKey V  Acer C300  Acer Ferrari 4000  Acer laptop  Advance Scorpius KI  Amiga  Apple  Apple Aluminium (ANSI)  Apple Aluminium (ISO)  Apple Aluminium (JIS)  Apple laptop  Asus laptop  Atari TT  Azona RF2300 Wireless Internet  BTC 5090  BTC 5113RF Multimedia  BTC 5126T  BTC 6301URF  BTC 9000  BTC 9000A  BTC 9001AH  BTC 9019U  BTC 9116U Mini Wireless Internet and Gaming  BenQ X-Touch  BenQ X-Touch 730  BenQ X-Touch 800  Brother Internet  Cherry B.UNLIMITED  Cherry Blue Line CyBo@rd  Cherry Blue Line CyBo@rd (alt.)  Cherry CyBo@rd USB-Hub  Cherry CyMotion Expert  Cherry CyMotion Master Linux  Cherry CyMotion Master XPress  Chicony Internet  Chicony KB-9885  Chicony KU-0108  Chicony KU-0420  Chromebook  Classmate PC  Compaq Armada laptop  Compaq Easy Access  Compaq Internet (13 keys)  Compaq Internet (18 keys)  Compaq Internet (7 keys)  Compaq Presario laptop  Compaq iPaq  Creative Desktop Wireless 7000  DTK2000  Dell  Dell 101-key PC  Dell Inspiron 6000/8000 laptop  Dell Latitude laptop  Dell Precision M laptop  Dell Precision M65 laptop  Dell SK-8125  Dell SK-8135  Dell USB Multimedia  Dexxa Wireless Desktop  Diamond 9801/9802  Ennyah DKB-1008  Everex STEPnote  FL90  Fujitsu-Siemens Amilo laptop  Generic 101-key PC  Generic 102-key PC  Generic 104-key PC  Generic 104-key PC with L-shaped Enter key  Generic 105-key PC  Generic 86-key PC  Genius Comfy KB-12e  Genius Comfy KB-16M/Multimedia KWD-910  Genius Comfy KB-21e-Scroll  Genius KB-19e NB  Genius KKB-2050HS  Gyration  Happy Hacking  Happy Hacking for Mac  Hewlett-Packard Internet  Hewlett-Packard Mini 110 laptop  Hewlett-Packard NEC SK-2500 Multimedia  Hewlett-Packard Omnibook 500  Hewlett-Packard Omnibook 500 FA  Hewlett-Packard Omnibook 6000/6100  Hewlett-Packard Omnibook XE3 GC  Hewlett-Packard Omnibook XE3 GF  Hewlett-Packard Omnibook XT1000  Hewlett-Packard Pavilion ZT1100  Hewlett-Packard Pavilion dv5  Hewlett-Packard nx9020  Honeywell Euroboard  IBM Rapid Access  IBM Rapid Access II  IBM Space Saver  IBM ThinkPad 560Z/600/600E/A22E  IBM ThinkPad R60/T60/R61/T61  IBM ThinkPad Z60m/Z60t/Z61m/Z61t  Keytronic FlexPro  Kinesis  Logitech  Logitech Access  Logitech Cordless Desktop  Logitech Cordless Desktop (alt.)  Logitech Cordless Desktop EX110  Logitech Cordless Desktop LX-300  Logitech Cordless Desktop Navigator  Logitech Cordless Desktop Optical  Logitech Cordless Desktop Pro (2nd alt.)  Logitech Cordless Desktop iTouch  Logitech Cordless Freedom/Desktop Navigator  Logitech G15 extra keys via G15daemon  Logitech Internet  Logitech Internet 350  Logitech Internet Navigator  Logitech Ultra-X  Logitech Ultra-X Cordless Media Desktop  Logitech diNovo  Logitech diNovo Edge  Logitech iTouch  Logitech iTouch Cordless Y-RB6  Logitech iTouch Internet Navigator SE  Logitech iTouch Internet Navigator SE USB  MacBook/MacBook Pro  MacBook/MacBook Pro (intl.)  Macintosh  Macintosh Old  Memorex MX1998  Memorex MX2500 EZ-Access  Memorex MX2750  Microsoft Comfort Curve 2000  Microsoft Internet  Microsoft Internet Pro (Swedish)  Microsoft Natural  Microsoft Natural Elite  Microsoft Natural Ergonomic 4000  Microsoft Natural Pro OEM  Microsoft Natural Pro USB/Internet Pro  Microsoft Natural Pro/Internet Pro  Microsoft Natural Wireless Ergonomic 7000  Microsoft Office Keyboard  Microsoft Surface  Microsoft Wireless Multimedia 1.0A  NEC SK-1300  NEC SK-2500  NEC SK-6200  NEC SK-7100  Northgate OmniKey 101  OLPC  Ortek Multimedia/Internet MCK-800  PC-98  Propeller Voyager KTEZ-1000  QTronix Scorpius 98N+  SVEN Ergonomic 2500  SVEN Slim 303  Samsung SDM 4500P  Samsung SDM 4510P  Sanwa Supply SKB-KG3  Silvercrest Multimedia Wireless  SteelSeries Apex 300 (Apex RAW)  Sun Type 4  Sun Type 5  Sun Type 6 (Japanese)  Sun Type 6 USB (Japanese)  Sun Type 6 USB (Unix)  Sun Type 6/7 USB  Sun Type 6/7 USB (European)  Sun Type 7 USB  Sun Type 7 USB (European)  Sun Type 7 USB (Japanese)/Japanese 106-key  Sun Type 7 USB (Unix)  Super Power Multimedia  Symplon PaceBook tablet  Targa Visionary 811  Toshiba Satellite S3000  Truly Ergonomic 227  Truly Ergonomic 229  Trust Direct Access  Trust Slimline  Trust Wireless Classic  TypeMatrix EZ-Reach 2020  TypeMatrix EZ-Reach 2030 PS2  TypeMatrix EZ-Reach 2030 USB  TypeMatrix EZ-Reach 2030 USB (102/105:EU mode)  TypeMatrix EZ-Reach 2030 USB (106:JP mode)  Unitek KB-1925  ViewSonic KU-306 Internet  Winbook Model XP5  Yahoo! Internet  eMachines m6800 laptop
root      4293  4168  0 15:05 pts/1    S+     0:00  |                                                   \_ /bin/bash /usr/sbin/dkms autoinstall --kernelver 6.6.28+rpt-rpi-v7l
root      5276  4293  0 15:16 pts/1    S+     0:00  |                                                       \_ sleep 3
pi        2126  1112  0 15:01 pts/7    Ss     0:00  \_ -bash
pi        5281  2126 99 15:17 pts/7    R+     0:00      \_ ps -ef f

I had to kill this process to resume as killing whiptail wasn't enough:

/usr/bin/perl -w /usr/sbin/dpkg-reconfigure keyboard-configuration

but then repeat the kill for every image it was trying to build, and clean up the orphaned whiptail processes.

ardangelo commented 6 months ago

Thanks for finding this! I did find that dpkg-reconfigure keyboard-configuration opens a whiptail menu if a USB keyboard is attached. Do you by chance also have one attached? (Also figuring out how to disable the menu)

makergamer commented 6 months ago

Ooo. that's a possibility. It's been a few days and just left on-call so I cannot be for sure given my fried memory.

I have attached a micro keyboard dongle as needed for things I haven't learned the chord/overlay combos for. So there's a real possibility a "usb keyboard" could have been attached, if the dongle was plugged in, even if I didn't have the real keyboard powered on & using it.

Is there an option for the make file to flag for non-interactive/headless mode as to skip the dpkg-reconfigure keyboard-configuration?

I can imaging the interactive appearing if another kind of HID device is plugged in - like a retro controller that maps to keys, etc.

I could always do updates using an ssh+tmux session (and double check the dongle is not connected).

ardangelo commented 6 months ago

Figured out that setting DEBIAN_FRONTEND=noninteractive before the Makefile runs dpkg-reconfigure keyboard-configuration will fix this issue. I've updated the beepy-kbd repo and packages to automatically apply this when building the module.