mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-26 13:55:34 +00:00
GSmartControl now uses XDG config directory for per-user configuration on
UNIX and CSIDL_PROFILE directory on Windows. Existing configuration is
migrated automatically.
The names are shown correctly for unsupported devices even with the latest
smartctl snapshots now.
Smartctl SVN revision is shown (if available).
The progress bars update properly when parallel tests are run.
Windows: GSmartControl should be able to operate on any valid filesystem
path (not just locale-representable ones).
Windows: GSmartControl is now officially compilable on x86_64 via mingw64.
Fixed compilation under very old gtkmm/libglademm, and with gcc 4.4.
Fixed parsing of multiple error types in SMART error log.
Added minor features and fixed miscellaneous bugs.
51 lines
1.1 KiB
Bash
Executable File
51 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
############################################################################
|
|
# Copyright:
|
|
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
|
# License: See LICENSE_zlib.txt file
|
|
############################################################################
|
|
|
|
# We use #!/bin/bash of #!/bin/sh because freebsd (tested with 6.3) in its
|
|
# infinite wisdom has csh-like /bin/sh (even though the SUS says it
|
|
# must be bourne-compatible).
|
|
|
|
|
|
if [ "$1" == "" ] | [ "$2" == "" ] | [ "$3" == "" ]; then
|
|
echo "Usage: $0 <input_file> <cpp_file> <symbol_name>";
|
|
exit 1;
|
|
fi
|
|
|
|
if [ ! -e $1 ]; then
|
|
echo "Cannot open input file \"$1\".";
|
|
exit 2;
|
|
fi
|
|
|
|
|
|
in_file="$1";
|
|
out_file="$2";
|
|
sym_name="$3";
|
|
size=`stat -c "%s" "$in_file"`
|
|
|
|
|
|
# header. extern means "global" in this context (needed because const
|
|
# variables are static by default).
|
|
echo "
|
|
|
|
extern const unsigned char ${sym_name}[] = {
|
|
" > "$out_file";
|
|
|
|
|
|
# file binary. "xxd(1) -i" can also do the trick
|
|
hexdump -v -e '1/1 "0x%X,\n"' "$in_file" >> "$out_file";
|
|
|
|
|
|
# footer. add 0x0 byte for easy stringifying
|
|
echo "
|
|
0x0 };
|
|
|
|
extern const unsigned int ${sym_name}_size = ${size};
|
|
|
|
" >> "$out_file";
|
|
|
|
|