71 lines
2.9 KiB
Bash
Executable File
71 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
ISO=./iso/live-image-amd64.hybrid.iso
|
|
TMP=./.tmp_iso_inspect
|
|
rm -rf "$TMP" && mkdir -p "$TMP"
|
|
|
|
if command -v bsdtar >/dev/null 2>&1; then
|
|
bsdtar -xf "$ISO" -C "$TMP" live/filesystem.squashfs isolinux/isolinux.cfg boot/grub/grub.cfg 2>/dev/null || true
|
|
elif command -v 7z >/dev/null 2>&1; then
|
|
7z x -y -o"$TMP" "$ISO" live/filesystem.squashfs isolinux/isolinux.cfg boot/grub/grub.cfg >/dev/null
|
|
else
|
|
echo "NO_EXTRACTOR"
|
|
exit 2
|
|
fi
|
|
|
|
echo "=== Boot config snippets ==="
|
|
if [ -f "$TMP/isolinux/isolinux.cfg" ]; then
|
|
echo "-- isolinux.cfg --"
|
|
sed -n '1,220p' "$TMP/isolinux/isolinux.cfg"
|
|
fi
|
|
if [ -f "$TMP/boot/grub/grub.cfg" ]; then
|
|
echo "-- grub.cfg --"
|
|
sed -n '1,260p' "$TMP/boot/grub/grub.cfg"
|
|
fi
|
|
|
|
if ! command -v unsquashfs >/dev/null 2>&1; then
|
|
echo "NO_UNSQUASHFS"
|
|
exit 3
|
|
fi
|
|
|
|
SQ="$TMP/live/filesystem.squashfs"
|
|
[ -f "$SQ" ] || { echo "MISSING_SQUASHFS"; exit 4; }
|
|
|
|
echo "=== Squashfs checks (paths) ==="
|
|
unsquashfs -ll "$SQ" | grep -E "/usr/local/sbin/nostr-id-tui$|/etc/systemd/system/nostr-id-tui.service$|/etc/systemd/system/nostr-id-tui-services.service$|/etc/systemd/system/getty@tty1.service.d/n-os-tr-override.conf$|/etc/systemd/system/getty@tty2.service.d/n-os-tr-override.conf$|/etc/systemd/system/multi-user.target.wants/nostr-id-tui.service$|/etc/systemd/system/default.target$|/etc/systemd/system-preset/50-n-os-tr.preset$" || true
|
|
|
|
mkdir -p "$TMP/rootfs"
|
|
unsquashfs -f -d "$TMP/rootfs" "$SQ" \
|
|
etc/systemd/system/nostr-id-tui.service \
|
|
etc/systemd/system/nostr-id-tui-services.service \
|
|
etc/systemd/system/getty@tty1.service.d/n-os-tr-override.conf \
|
|
etc/systemd/system/getty@tty2.service.d/n-os-tr-override.conf \
|
|
etc/systemd/system/default.target \
|
|
etc/systemd/system-preset/50-n-os-tr.preset \
|
|
etc/systemd/system/multi-user.target.wants/nostr-id-tui.service \
|
|
usr/local/sbin/nostr-id-tui >/dev/null
|
|
|
|
echo "=== Extracted file details ==="
|
|
ls -l "$TMP/rootfs/usr/local/sbin/nostr-id-tui"
|
|
|
|
for f in \
|
|
etc/systemd/system/nostr-id-tui.service \
|
|
etc/systemd/system/nostr-id-tui-services.service \
|
|
etc/systemd/system/getty@tty1.service.d/n-os-tr-override.conf \
|
|
etc/systemd/system/getty@tty2.service.d/n-os-tr-override.conf \
|
|
etc/systemd/system/default.target \
|
|
etc/systemd/system-preset/50-n-os-tr.preset; do
|
|
echo "----- $f -----"
|
|
sed -n '1,220p' "$TMP/rootfs/$f" || true
|
|
echo
|
|
done
|
|
|
|
if [ -L "$TMP/rootfs/etc/systemd/system/multi-user.target.wants/nostr-id-tui.service" ]; then
|
|
echo "SYMLINK multi-user.target.wants/nostr-id-tui.service -> $(readlink "$TMP/rootfs/etc/systemd/system/multi-user.target.wants/nostr-id-tui.service")"
|
|
elif [ -e "$TMP/rootfs/etc/systemd/system/multi-user.target.wants/nostr-id-tui.service" ]; then
|
|
echo "WANTS_ENTRY_EXISTS_NOT_SYMLINK"
|
|
ls -l "$TMP/rootfs/etc/systemd/system/multi-user.target.wants/nostr-id-tui.service"
|
|
else
|
|
echo "SYMLINK_MISSING multi-user.target.wants/nostr-id-tui.service"
|
|
fi
|