Iterate over present disks to collect "sfdisk -d" information
[grml-hwinfo.git] / grml-hwinfo
index a5374f3..c8d299f 100755 (executable)
@@ -211,10 +211,23 @@ cd "${OUTDIR}" || exit 1
 
   # proc stuff
   for i in cpuinfo interrupts cmdline devices dma fb iomem ioports \
-    mdstat meminfo modules mtrr pci version ; do
+    mdstat meminfo modules mtrr pci uptime version ; do
     [ -r /proc/$i ] && cat /proc/$i > proc_$i
   done
+
+  if ! $_opt_quiet ; then
+    echo "Starting sysdump..."
+    echo "  NOTE: if it seems to be hanging at this stage file a bug report with output of:"
+    echo "        lsof -p \$(pgrep -f "\$\(which sysdump\)")"
+  fi
   exectest sysdump  && sysdump > ./sysdump 2>./sysdump.error
+  if ! $_opt_quiet ; then
+    echo "Execution of sysdump finished."
+  fi
+
+  exectest cpuid && cpuid > ./cpuid 2>./cpuid.error
+
+  exectest uptime && uptime > ./uptime 2>./uptime.error
 
   # log
   dmesg > dmesg.cur
@@ -225,9 +238,10 @@ cd "${OUTDIR}" || exit 1
   exectest numactl  && numactl --hardware > ./numactl
   exectest x86info  && x86info > ./x86info 2>./x86info.error
   exectest lscpu    && lscpu > ./lscpu
+  exectest lscpu    && lscpu -e > ./lscpu_extended
 
   # EFI
-  exectest efibootmgr && efibootmgr -v > efibootmgr
+  exectest efibootmgr && efibootmgr -v >efibootmgr 2>efibootmgr.error
 
   # net stuff, net-tools:
   exectest ifconfig && ifconfig -v -a > ./ifconfig
@@ -241,12 +255,13 @@ cd "${OUTDIR}" || exit 1
   exectest ip && ip mroute show    > ip_mroute
   exectest ip && ip mrule show     > ip_mrule 2>ip_mrule.error
   exectest ip && ip neigh show     > ip_neigh
+  exectest ip && ip netconf        > ip_netconf
   exectest ip && ip netns list     > ip_netns
   exectest ip && ip ntable show    > ip_ntable
   exectest ip && ip route show     > ip_route
   exectest ip && if [ -r /etc/iproute2/rt_tables ] ; then
                    grep -v '^#' /etc/iproute2/rt_tables | while read table _ ; do
-                     ip route show table "${table}" > "ip_route_table_${table}"
+                     ip route show table "${table}" > "ip_route_table_${table}" 2> "ip_route_table_${table}".error
                    done
                  fi
   exectest ip && ip rule show      > ip_rule
@@ -300,6 +315,10 @@ cd "${OUTDIR}" || exit 1
     cp /var/log/$i log_$i 2>/dev/null
   done
 
+  if [ -r "$HOME"/.local/share/xorg/Xorg.0.log ] ; then
+    cp "$HOME"/.local/share/xorg/Xorg.0.log user_Xorg.0.log
+  fi
+
   cp /etc/X11/xorg.conf    xorg.conf    2>/dev/null
   cp /etc/modules          modules      2>/dev/null
   cp /etc/X11/XF86Config-4 XF86Config-4 2>/dev/null
@@ -310,7 +329,7 @@ cd "${OUTDIR}" || exit 1
   else
     echo "running as root" > root
     disk_info
-    exectest sfdisk     && sfdisk -d > ./sfdisk 2>./sfdisk.error
+
     exectest dmidecode  && dmidecode > ./dmidecode
 
     exectest dconf && dconf -o dconf
@@ -334,6 +353,10 @@ cd "${OUTDIR}" || exit 1
       acpidump > ./acpidump 2>./acpidump.error
     fi
 
+    if exectest mokutil ; then
+      mokutil --sb-state > ./mokutil_state 2>./mokutil_state.error
+    fi
+
     # proxmox
     exectest qm && qm list > ./qm 2>./qm.error
     # libvirt
@@ -371,6 +394,10 @@ cd "${OUTDIR}" || exit 1
     fi
 
     for disk in $disklist; do
+      if exectest sfdisk && [[ -b "/dev/${disk}" ]] ; then
+        sfdisk -d "/dev/${disk}" > "./sfdisk_${disk}" 2>"./sfdisk_${disk}.error"
+      fi
+
       if exectest smartctl ; then
         echo -e "smartctl -a /dev/${disk}:\n" >> smartctl
         smartctl -a "/dev/$disk" >> ./smartctl