scripts/diagnostic: Add support for collecting kernel configs
This commit is contained in:
parent
eaa607d019
commit
becb93c2bf
|
@ -10,6 +10,7 @@ all_components=(
|
||||||
"platform"
|
"platform"
|
||||||
"serial"
|
"serial"
|
||||||
"sam"
|
"sam"
|
||||||
|
"kconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,6 +192,32 @@ if [[ " ${components[*]} " =~ " sam " ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# collect kernel config
|
||||||
|
if [[ " ${components[*]} " =~ " kconfig " ]]; then
|
||||||
|
echo " - kernel configuration"
|
||||||
|
|
||||||
|
# attempt to load module for accessing current kernel config
|
||||||
|
if modinfo configs > /dev/null 2>&1; then
|
||||||
|
sudo modprobe configs
|
||||||
|
fi
|
||||||
|
|
||||||
|
# try to get current config from /proc, if available
|
||||||
|
if [[ -f "/proc/config.gz" ]]; then
|
||||||
|
zcat "/proc/config.gz" > "${tmpdir}/kernel-$(uname -r).conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# try to get current config from /boot, if available
|
||||||
|
if [[ -f "/boot/config" ]]; then
|
||||||
|
cp "/boot/config" "${tmpdir}/kernel-$(uname -r).conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# try to get any config from /boot
|
||||||
|
find "/boot" -name 'config-*' -print0 | while IFS= read -r -d '' file; do
|
||||||
|
name="$(basename "${file}")"
|
||||||
|
cp "${file}" "${tmpdir}/kernel-${name#"config-"}.conf"
|
||||||
|
done;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# bundle to archive
|
# bundle to archive
|
||||||
echo " ==> generating archive..."
|
echo " ==> generating archive..."
|
||||||
|
|
Loading…
Reference in a new issue