Opened 6 years ago

Closed 6 years ago

#1044 closed defect (invalid)

Syntax error using smartctl

Reported by: Federico Owned by:
Priority: minor Milestone:
Component: smartctl Version: 6.6
Keywords: Cc:

Description

Hi, I'm having difficulty using this tool. First of all, I'm trying to run it in a BRCM63xx-tch ARM71 chipset, so I had to override the architecture compatibility in the opkg.conf file to make the installation of smartmontools possible. After this I was able to install the package but I cannot use it because of an error; I don't know If it's caused because of the incompatibility issue or whatever, anyway when I type the command smartctl i get this error:

/usr/sbin/smartctl: line 5: syntax error: unexpected "&"

Is there a possibility to solve it? Thanks!

Change History (5)

comment:1 by Federico, 6 years ago

Users on www.ilpuntotecnico.com/forum said that there seems to be no differences between BRCM63xx and BRCM63xx-tch userspace apps, so it shouldn't be an incompatibility issue.

in reply to:  description comment:2 by Christian Franke, 6 years ago

Keywords: syntax error smartctl removed
Milestone: undecided
Priority: criticalminor

After this I was able to install the package but I cannot use it because of an error;

Package download URL?
Package version?

/usr/sbin/smartctl: line 5: syntax error: unexpected "&"

Smartctl never prints such a message. This looks like an error message from some shell.
Please try

  file /usr/sbin/smartctl

to check whether smartctl is possibly some wrapper-script.

comment:3 by Federico, 6 years ago

First of all thank you for answering;

I downloaded the package from the OpenWRT repository; this is the link:

http://archive.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/packages/smartmontools_6.6-1_brcm63xx.ipk

The package version is 6.6-1

I cannot run the "file" command from the same system in which smartmontools is installed because it's not present (That's a router and the OS is really hardened) so I copied the file

/usr/sbin/smartctl

into a connected raspberryPi and i ran the command there; this is the output:

smartctl: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mips-sf.so.1, corrupted section header size

comment:4 by Christian Franke, 6 years ago

Output of strings shows that this is a smartctl executable but file and readelf report some file corruption:

$ strings smartctl | grep 'smartmontools [br]'
smartmontools release 6.6 dated 2017-11-05 at 15:20:58 UTC
smartmontools build host: mips-openwrt-linux-gnu
smartmontools build with: C++98, GCC 5.3.0

$ file smartctl
smartctl: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mips-sf.so.1, corrupted section header size

$ readelf -a smartctl >/dev/null
readelf: Warning: Virtual address 0x4891a0 not located in any PT_LOAD segment.
readelf: Error: Reading 0xc bytes extends past end of file for Global Offset Table data

I have no idea how this should lead to the error message line 5: syntax error: unexpected "&". Such strings are not in the executable (and source).

Please report a bug to package maintainer.

comment:5 by Christian Franke, 6 years ago

Milestone: undecided
Resolution: invalid
Status: newclosed

Possibly corrupted smartctl executable in OpenWrt smartmontools package.

Note: See TracTickets for help on using tickets.