mirror of https://github.com/aredn/aredn.git
feature: add bootloader version to supporttool output (#8)
* feature: add U-Boot version to supporttool output * feature: add bootloader version to supporttool output
This commit is contained in:
parent
d33df3dab7
commit
3e4e6270b7
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CFG=/etc/board.json
|
||||||
|
|
||||||
|
. /usr/share/libubox/jshn.sh
|
||||||
|
|
||||||
|
[ -f $CFG ] || exit 1
|
||||||
|
json_init
|
||||||
|
json_load "$(cat ${CFG})"
|
||||||
|
json_select model
|
||||||
|
json_get_vars name
|
||||||
|
set -- $name
|
||||||
|
echo "$1" > /tmp/sysinfo/hardware_mfg
|
||||||
|
cat /tmp/sysinfo/hardware_mfg
|
|
@ -88,10 +88,18 @@ use perlfunc;
|
||||||
"/usr/local/bin/get_hardwaretype",
|
"/usr/local/bin/get_hardwaretype",
|
||||||
"/usr/local/bin/get_boardid",
|
"/usr/local/bin/get_boardid",
|
||||||
"/usr/local/bin/get_model",
|
"/usr/local/bin/get_model",
|
||||||
|
"/usr/local/bin/get_hardware_mfg",
|
||||||
|
);
|
||||||
|
|
||||||
|
@cmds_ubnt = (
|
||||||
|
"cat /dev/mtd0|grep 'U-Boot'|head -n1",
|
||||||
);
|
);
|
||||||
|
|
||||||
$FREE_SPACE_TMP=get_free_space("/tmp");
|
$FREE_SPACE_TMP=get_free_space("/tmp");
|
||||||
|
|
||||||
|
$mfg = `/usr/local/bin/get_hardware_mfg`;
|
||||||
|
chomp($mfg);
|
||||||
|
|
||||||
if ($FREE_SPACE_TMP eq "N/A" || $FREE_SPACE_TMP <= 2*1024) {
|
if ($FREE_SPACE_TMP eq "N/A" || $FREE_SPACE_TMP <= 2*1024) {
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
@ -133,6 +141,16 @@ foreach $cmd (@cmds) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $mfg eq "Ubiquiti" ) {
|
||||||
|
foreach $cmd (@cmds_ubnt) {
|
||||||
|
print $CMDS_OUT "========== $cmd (UBNT only) ==========\n";
|
||||||
|
open(my $CMD_PIPE, "-|", $cmd ) or next;
|
||||||
|
while (<$CMD_PIPE>) {
|
||||||
|
print { $CMDS_OUT } $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
close ($CMDS_OUT);
|
close ($CMDS_OUT);
|
||||||
|
|
||||||
system("tar", "-zcf", "/tmp/supportdata.tgz", "-C", "/tmp/sd", "./");
|
system("tar", "-zcf", "/tmp/supportdata.tgz", "-C", "/tmp/sd", "./");
|
||||||
|
|
Loading…
Reference in New Issue