Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identifying BMC AST2400 #1004

Merged
merged 9 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions config/distri_id.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# "KAMIKAZE (bleeding edge, r18571) ------------------"
OpenWRT;/etc/banner;grep -a -o -E "KAMIKAZE.\(bleeding.edge..r[0-9]+\)";sort -u | sed -r 's/(KAMIKAZE) \(bleeding edge, (r[0-9]+)\)/OpenWRT \1 \2/'
OpenWRT;/etc/banner;grep -a -o -E "BACKFIRE.\(bleeding.edge..r[0-9]+\)";sort -u | sed -r 's/(BACKFIRE) \(bleeding edge, (r[0-9]+)\)/OpenWRT \1 \2/'
supermicrox11-bmc;/sbin/net-snmp-config; grep -E "x11.*AST2400.*arm-linux.*PLATFORM_SUPERMICRO"; sed -r 's/.*/supermicro:bmc/' | head -1
# Reboot (17.01.0-rc2, r3131-42f3c1f) -> LEDE
OpenWRT;/etc/openwrt_release;grep -a -o -E -e "^DISTRIB_ID=.*" -a -o -E -e "^DISTRIB_RELEASE=.*[0-9].*" -a -o -E -e "^DISTRIB_REVISION=.*";sort -u | tr '\n' ' ' | sed 's/DISTRIB_ID=//g' | sed 's/DISTRIB_RELEASE=//g' | sed 's/DISTRIB_REVISION=//g' | tr -d \' | tr -d \"
OpenWRT;/etc/openwrt_version;grep -E -e "[0-9]+\.[0-9]+";sed -e 's/^/OpenWrt\ /g'
Expand Down
12 changes: 12 additions & 0 deletions modules/L10_system_emulation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ L10_system_emulation() {

if [[ "${ARCH}" == "MIPS"* || "${ARCH}" == "ARM"* || "${ARCH}" == "x86" ]]; then

bmc_supermicro
HoxhaEndri marked this conversation as resolved.
Show resolved Hide resolved

# WARNING: false was never tested ;)
# Could be interesting for future extensions
set_firmae_arbitration "true"
Expand Down Expand Up @@ -207,6 +209,16 @@ L10_system_emulation() {
module_end_log "${FUNCNAME[0]}" "${MODULE_END}"
}

bmc_supermicro(){
local S06_LOG="${CSV_DIR}/s06_distribution_identification.csv"
if [[ -f "${S06_LOG}" ]]; then
if grep "supermicro:bmc" "${S06_LOG}"; then
print_output "ALERT SUPERMICRO X11 FOUND - SPECIFIC QEMU EMULATION NOT SUPPORTED"
HoxhaEndri marked this conversation as resolved.
Show resolved Hide resolved
write_csv_log "ALERT SUPERMICRO X11 FOUND - SPECIFIC QEMU EMULATION NOT SUPPORTED" "" "" ""
HoxhaEndri marked this conversation as resolved.
Show resolved Hide resolved
fi
fi
}

print_system_emulation_results() {
if [[ -f "${LOG_DIR}"/emulator_online_results.log ]]; then
sub_module_title "System emulation results"
Expand Down
6 changes: 6 additions & 0 deletions modules/S06_distribution_identification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ S06_distribution_identification()
dlink_image_sign
fi

if [[ "${IDENTIFIER}" != *[0-9]* ]] && [[ "${IDENTIFIER}" == *"supermicro:bmc"* ]]; then
print_output "[+] Version information found ${ORANGE}${IDENTIFIER}${GREEN} in file ${ORANGE}$(print_path "${FILE}")${GREEN} with Linux distribution detection"
get_csv_rule_distri "${IDENTIFIER}"
write_csv_log "${FILE}" "Linux" "${IDENTIFIER}" "${CSV_RULE}"
fi

# check if not zero and not only spaces
if [[ -n "${IDENTIFIER// }" ]] && [[ "${IDENTIFIER}" == *[0-9]* ]]; then
if [[ -n "${DLINK_FW_VER}" ]]; then
Expand Down