mirror of
https://github.com/outbackdingo/incus-os.git
synced 2026-01-27 02:19:13 +00:00
base: Add script to show hardware information if IncusOS fails to start
Signed-off-by: Mathias Gibbens <mathias.gibbens@futurfusion.io>
This commit is contained in:
@@ -49,5 +49,7 @@ KernelModulesInitrdInclude=default
|
||||
vmd
|
||||
InitrdPackages=initrd-tmpfs-root
|
||||
kpartx
|
||||
pciutils
|
||||
usbutils
|
||||
RemoveFiles=/boot/*zabbly*
|
||||
/boot/EFI/mkosi.der
|
||||
|
||||
@@ -5,4 +5,6 @@ initrd-tmpfs-root.service usr/lib/systemd/system/
|
||||
|
||||
00-device-timeout.conf usr/lib/systemd/system.conf.d/
|
||||
|
||||
initrd-message.service usr/lib/systemd/system/
|
||||
initrd-message.service usr/lib/systemd/system/
|
||||
initrd-show-devices.service usr/lib/systemd/system/
|
||||
initrd-show-devices.sh usr/bin/
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
usr/lib/systemd/system/initrd-message.service usr/lib/systemd/system/veritysetup.target.wants/initrd-message.service
|
||||
usr/lib/systemd/system/initrd-show-devices.service usr/lib/systemd/system/emergency.target.wants/initrd-show-devices.service
|
||||
|
||||
14
mkosi.packages/initrd-tmpfs-root/initrd-show-devices.service
Normal file
14
mkosi.packages/initrd-tmpfs-root/initrd-show-devices.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Show system devices
|
||||
After=emergency.target
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
Environment=TTYS="/dev/tty1 /dev/ttyS0"
|
||||
|
||||
ExecStart=/usr/bin/initrd-show-devices.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=emergency.target
|
||||
33
mkosi.packages/initrd-tmpfs-root/initrd-show-devices.sh
Executable file
33
mkosi.packages/initrd-tmpfs-root/initrd-show-devices.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shellcheck disable=SC3000-SC4000
|
||||
|
||||
while true; do
|
||||
for TTY in $TTYS; do
|
||||
echo -e "\033cIncusOS failed to start. Debug information follows." > "$TTY" || true
|
||||
echo "$ lsblk" > "$TTY" || true
|
||||
lsblk > "$TTY" || true
|
||||
done
|
||||
sleep 10
|
||||
|
||||
for TTY in $TTYS; do
|
||||
echo -e "\033cIncusOS failed to start. Debug information follows." > "$TTY" || true
|
||||
echo "$ lscpi" > "$TTY" || true
|
||||
lspci > "$TTY" || true
|
||||
done
|
||||
sleep 10
|
||||
|
||||
for TTY in $TTYS; do
|
||||
echo -e "\033cIncusOS failed to start. Debug information follows." > "$TTY" || true
|
||||
echo "$ lsusb" > "$TTY" || true
|
||||
lsusb > "$TTY" || true
|
||||
done
|
||||
sleep 10
|
||||
|
||||
for TTY in $TTYS; do
|
||||
echo -e "\033cIncusOS failed to start. Debug information follows." > "$TTY" || true
|
||||
echo "$ ls -lh /sys/class/block/*/device/driver" > "$TTY" || true
|
||||
ls -lh /sys/class/block/*/device/driver > "$TTY" || true
|
||||
done
|
||||
sleep 10
|
||||
done
|
||||
Reference in New Issue
Block a user