]>
Commit | Line | Data |
---|---|---|
832b75ed GG |
1 | Smartmontools installation instructions |
2 | ======================================= | |
3 | ||
f4e463df | 4 | $Id: INSTALL 3555 2012-06-01 21:07:33Z chrfranke $ |
832b75ed GG |
5 | |
6 | Please also see the smartmontools home page: | |
7 | http://smartmontools.sourceforge.net/ | |
8 | ||
9 | Table of contents: | |
10 | ||
11 | [1] System requirements | |
2127e193 | 12 | [2] Installing from SVN |
832b75ed GG |
13 | [3] Installing from source tarball |
14 | [4] Guidelines for different Linux distributions | |
15 | [5] Guidelines for FreeBSD | |
16 | [6] Guidelines for Darwin | |
17 | [7] Guidelines for NetBSD | |
18 | [8] Guidelines for Solaris | |
19 | [9] Guidelines for Cygwin | |
20 | [10] Guidelines for Windows | |
21 | [11] Guidelines for OS/2, eComStation | |
22 | [12] Guidelines for OpenBSD | |
23 | [13] Comments | |
24 | [14] Detailed description of ./configure options | |
25 | ||
26 | [1] System requirements | |
27 | ======================= | |
28 | ||
29 | A) Linux | |
30 | ||
31 | Any Linux distribution will support smartmontools if it has a | |
32 | kernel version greater than or equal to 2.2.14. So any recent | |
33 | Linux distribution should support smartmontools. | |
34 | ||
35 | There are two parts of smartmontools that may require a patched or | |
36 | nonstandard kernel: | |
37 | ||
38 | (1) To get the ATA RETURN SMART STATUS command, the kernel needs | |
39 | to support the HDIO_DRIVE_TASK ioctl(). | |
40 | ||
41 | (2) To run Selective Self-tests, the kernel needs to support the | |
42 | HDIO_DRIVE_TASKFILE ioctl(). | |
43 | ||
44 | If your kernel does not support one or both of these ioctls, then | |
45 | smartmontools will "mostly" work. The things that don't work will | |
46 | give you harmless warning messages. | |
47 | ||
832b75ed GG |
48 | For item (1) above, any 2.4 or 2.6 series kernel will provide |
49 | HDIO_DRIVE_TASK support. Some 2.2.20 and later kernels also | |
50 | provide this support IF they're properly patched and | |
51 | configured. [Andre Hedrick's IDE patches may be found at | |
cfbba5b9 GI |
52 | http://www.nic.funet.fi/pub/linux/kernel/people/hedrick/ide-2.2.20/ |
53 | or are available from your local kernel.org mirror. They are not | |
832b75ed GG |
54 | updated for 2.2.21 or later, and may contain a few bugs.]. |
55 | If the configuration option CONFIG_IDE_TASK_IOCTL | |
56 | exists in your 2.2.X kernel source code tree, then your 2.2.X | |
57 | kernel will probably support this ioctl. [Note that this kernel | |
58 | configuration option does NOT need to be enabled. Its presence | |
59 | merely indicates that the required HDIO_DRIVE_TASK ioctl() is | |
60 | supported.] | |
61 | ||
62 | For item (2) above, your kernel must be configured with the kernel | |
63 | configuration option CONFIG_IDE_TASKFILE_IO enabled. This | |
64 | configuration option is present in all 2.4 and 2.6 series | |
65 | kernels. Some 2.2.20 and later kernels also provide this support | |
66 | IF they're properly patched and configured as described above. | |
67 | ||
68 | Please see FAQ section of the URL above for additional details. | |
69 | ||
70 | If you are using 3ware controllers, for full functionality you | |
71 | must either use version 1.02.00.037 or greater of the 3w-xxxx | |
72 | driver, or patch earlier 3ware 3w-xxxx drivers. See | |
73 | http://smartmontools.sourceforge.net/3w-xxxx.txt | |
74 | for the patch. The version 1.02.00.037 3w-xxxx.c driver was | |
75 | incorporated into kernel 2.4.23-bk2 on 3 December 2003 and into | |
76 | kernel 2.6.0-test5-bk11 on 23 September 2003. | |
77 | ||
78 | B) FreeBSD | |
79 | ||
80 | For FreeBSD support, a 5-current kernel that includes ATAng is | |
81 | required in order to support ATA drives. Even current versions of | |
82 | ATAng will not support 100% operation, as the SMART status can not | |
83 | be reliably retrieved. There is patch pending approval of the | |
84 | ATAng driver maintainer that will address this issue. | |
85 | ||
86 | C) Solaris | |
87 | ||
88 | The SCSI code has been tested on a variety of Solaris 8 and 9 | |
89 | systems. ATA/IDE code only works on SPARC platform. All tested | |
90 | kernels worked correctly. | |
91 | ||
92 | D) NetBSD/OpenBSD | |
93 | ||
94 | The code was tested on a 1.6ZG (i.e., 1.6-current) system. It should | |
95 | also function under 1.6.1 and later releases (unverified). Currently | |
96 | it doesn't support ATA devices on 3ware RAID controllers. | |
97 | ||
98 | E) Cygwin | |
99 | ||
cfbba5b9 GI |
100 | The code was tested on Cygwin 1.7.7-1. It should also work on other |
101 | recent releases. | |
832b75ed GG |
102 | |
103 | Both Cygwin and Windows versions of smartmontools share the same code | |
104 | to access the IDE/ATA or SCSI devices. The information in the "Windows" | |
105 | section below also applies to the Cygwin version. | |
106 | ||
107 | F) Windows | |
108 | ||
bed94269 | 109 | The code was tested on Windows 98SE, ME, NT4(SP5,SP6), 2000(SP4), |
cfbba5b9 | 110 | XP(up to SP3), 2003, Vista and Windows 7. |
bed94269 GI |
111 | |
112 | -- Windows 9x/ME | |
832b75ed GG |
113 | |
114 | On 9x/ME, only standard (legacy) IDE/ATA devices 0-3 are supported. | |
115 | The driver SMARTVSD.VXD must be present in WINDOWS\SYSTEM\IOSUBSYS | |
116 | to get loaded at Windows startup. The default location in a new | |
117 | installation of some versions of Windows is the WINDOWS\SYSTEM folder. | |
118 | In this case, move SMARTVSD.VXD to WINDOWS\SYSTEM\IOSUBSYS and reboot | |
4d59bff9 | 119 | (http://support.microsoft.com/kb/265854/en-us). |
832b75ed GG |
120 | |
121 | SMARTVSD.VXD relies on the standard IDE port driver ESDI_506.PDR. | |
122 | If the system uses a vendor specific driver, access of SMART data | |
bed94269 | 123 | is not possible. |
832b75ed | 124 | |
4d59bff9 GG |
125 | Some ATA controllers (e.g. Promise) provided a custom SMARTVSD.VXD |
126 | for their Win9x/ME driver. To access SMART data from both the legacy | |
127 | (/dev/h[a-d]) and this additional (/dev/hd[e-h]) controller, rename | |
128 | this file to SMARTVSE.VXD. Open the file with a hex editor and replace | |
129 | all occurrences of the string "SMARTVSD" with "SMARTVSE". Then reinstall | |
130 | the original Windows SMARTVSD.VXD. | |
131 | ||
bed94269 GI |
132 | To access SCSI and USB devices, an installed ASPI interface (WNASPI32.DLL) |
133 | is required. The code was tested with Adaptec Windows ASPI drivers 4.71.2. | |
134 | (http://www.adaptec.com/en-US/support/_eol/scsi_sw/ASPI-4.70/) | |
135 | Links to other ASPI drivers can be found at http://www.nu2.nu/aspi/. | |
136 | ||
cfbba5b9 | 137 | -- Windows NT4/2000/XP/2003/Vista/Win7 |
832b75ed | 138 | |
bed94269 GI |
139 | ATA or SATA devices are supported if the device driver implements |
140 | the SMART IOCTLs or IOCTL_IDE_PASS_THROUGH or IOCTL_ATA_PASS_THROUGH. | |
141 | The ATA SMART READ LOG command (smartctl -l, --log, -a, --all) is not | |
142 | supported if only the SMART IOCTLs are implemented. | |
832b75ed | 143 | |
bed94269 GI |
144 | SCSI and USB devices are accessed through SPTI. Special driver support |
145 | is not required. | |
4d59bff9 | 146 | |
bed94269 | 147 | 3ware 9000 RAID controllers are supported using features available |
ba59cff1 GG |
148 | in the Windows driver release 9.4.0 (3wareDrv.sys 3.0.2.70) or later. |
149 | Older drivers provide SMART access to the first physical drive (port) | |
9ebc753d GG |
150 | of each logical drive (unit). If driver support is not available |
151 | (7000/8000 series, 9000 on XP 64), smartctl can be used to parse SMART | |
152 | data output from CLI or 3DM. | |
832b75ed GG |
153 | |
154 | G) MacOS/Darwin | |
155 | ||
156 | The code was tested on MacOS 10.3.4. It should work from 10.3 | |
157 | forwards. It doesn't support 10.2. | |
158 | ||
4d59bff9 GG |
159 | It's important to know that on 10.3.x, some things don't work |
160 | (see WARNINGS): due to bugs in the libraries used, you cannot run | |
161 | a short test or switch SMART support off on a drive; if you try, | |
162 | you will just run an extended test or switch SMART support on. So | |
163 | don't panic when your "short" test seems to be taking hours. | |
832b75ed GG |
164 | |
165 | It's also not possible at present to control when the offline | |
166 | routine runs. If your drive doesn't have it running automatically by | |
167 | default, you can't run it at all. | |
168 | ||
169 | SCSI devices are not currently supported. Detecting the power | |
170 | status of a drive is also not currently supported. | |
171 | ||
172 | To summarize this, from another point of view, the things that | |
173 | are not supported fall into two categories: | |
174 | ||
175 | * Can't be implemented easily without more kernel-level support, | |
176 | so far as I know: | |
177 | - running immediate offline, conveyance, or selective tests | |
178 | - running any test in captive mode | |
179 | - aborting tests | |
180 | - switching automatic offline testing on or off | |
181 | - support for SCSI | |
182 | - checking the power mode [-n Directive of smartd] (this is not | |
183 | completely impossible, but not by using a documented API) | |
184 | ||
4d59bff9 | 185 | * Work on 10.4 and later, but not on 10.3: |
832b75ed GG |
186 | - switching off SMART (switching *on* works fine) |
187 | - switching off auto-save (but why would you want to?) | |
188 | - running the short test (that leaves you with only the extended test) | |
189 | ||
832b75ed GG |
190 | However, some things do work well. For ATA devices, all the |
191 | informational output is available, unless you want something that only | |
4d59bff9 GG |
192 | an offline test updates. On many newer Mac OS systems, the |
193 | hard drive comes with the offline test switched on by default, so | |
194 | even that works. | |
832b75ed | 195 | |
f4e463df GI |
196 | The OS X SAT SMART Driver provides access to SMART data for SAT capable |
197 | USB and Firewire devices: | |
198 | https://github.com/kasbert/OS-X-SAT-SMART-Driver | |
199 | https://github.com/RJVB/OS-X-SAT-SMART-Driver | |
200 | This does not require any smartctl -d TYPE option and should work also | |
201 | with older smartmontools releases. | |
202 | ||
832b75ed GG |
203 | H) OS/2, eComStation |
204 | ||
205 | The code was tested on eComStation 1.1, but it should work on all versions | |
206 | of OS/2. | |
207 | Innotek LibC 0.5 runtime is required. | |
208 | Currently only ATA disks are supported, SCSI support will be added. | |
209 | ||
2127e193 | 210 | [2] Installing from SVN |
832b75ed | 211 | ======================= |
2127e193 GI |
212 | |
213 | Get the sources from the SVN repository: | |
214 | svn co https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools smartmontools | |
832b75ed GG |
215 | |
216 | Then type: | |
217 | ./autogen.sh | |
218 | and continue with step [3] below, skipping the "unpack the tarball" step. | |
219 | ||
832b75ed | 220 | The autogen.sh command is ONLY required when installing from |
2127e193 GI |
221 | SVN. You need GNU Autoconf (version 2.50 or greater), GNU Automake |
222 | (version 1.7 or greater) and their dependencies installed in order | |
832b75ed | 223 | to run it. You can get these here: |
cfbba5b9 GI |
224 | http://directory.fsf.org/project/autoconf/ |
225 | http://directory.fsf.org/project/automake/ | |
832b75ed GG |
226 | |
227 | [3] Installing from the source tarball | |
228 | ====================================== | |
229 | ||
2127e193 | 230 | If you are NOT installing from SVN, then unpack the tarball: |
832b75ed GG |
231 | tar zxvf smartmontools-5.VERSION.tar.gz |
232 | ||
233 | Then: | |
234 | ./configure | |
235 | make | |
236 | make install (you may need to be root to do this) | |
237 | ||
238 | As shown (with no options to ./configure) this defaults to the | |
cfbba5b9 | 239 | following set of installation directories: |
832b75ed GG |
240 | --prefix=/usr/local |
241 | --sbindir=/usr/local/sbin | |
242 | --sysconfdir=/usr/local/etc | |
243 | --mandir=/usr/local/share/man | |
d008864d GI |
244 | --docdir=/usr/local/share/doc/smartmontools |
245 | --with-exampledir=/usr/local/share/doc/smartmontools/examplescripts | |
cfbba5b9 | 246 | --with-drivedbdir=/usr/local/share/smartmontools |
d008864d GI |
247 | --with-initscriptdir=auto |
248 | --with-systemdsystemunitdir=auto | |
cfbba5b9 GI |
249 | --enable-drivedb |
250 | --disable-attributelog | |
832b75ed | 251 | --disable-sample |
cfbba5b9 GI |
252 | --disable-savestates |
253 | --with-libcap-ng=auto | |
254 | --without-selinux | |
832b75ed GG |
255 | |
256 | These will usually not overwrite existing "distribution" installations on | |
257 | Linux Systems since the FHS reserves this area for use by the system | |
258 | administrator. | |
259 | ||
260 | For different installation locations or distributions, simply add | |
261 | arguments to ./configure as shown in [4] below. | |
262 | ||
cfbba5b9 GI |
263 | If you wish to alter the default C++ compiler flags, set an |
264 | environment variable CXXFLAGS='your options' before doing | |
832b75ed | 265 | ./configure, or else do: |
cfbba5b9 | 266 | make CXXFLAGS='your options' |
832b75ed | 267 | |
2127e193 GI |
268 | The first output line of smartctl and smartd provides information |
269 | about release number, last SVN checkin date and revison, platform, | |
270 | and package. The latter defaults to "(local build)" and can be | |
271 | changed by the variable BUILD_INFO, for example: | |
272 | make BUILD_INFO='"(Debian 5.39-2)"' | |
273 | ||
832b75ed GG |
274 | [4] Guidelines for different Linux distributions |
275 | ================================================ | |
276 | ||
277 | Note: Please send corrections/additions to: | |
278 | smartmontools-support@lists.sourceforge.net | |
279 | ||
280 | Debian: | |
281 | If you don't want to overwrite any distribution package, use: | |
282 | ./configure | |
283 | ||
284 | Filesystem Hierarchy Standard (FHS, http://www.pathname.com/fhs/): | |
285 | ./configure --sbindir=/usr/local/sbin \ | |
286 | --sysconfdir=/usr/local/etc \ | |
287 | --mandir=/usr/local/man \ | |
d008864d GI |
288 | --docdir=/usr/local/share/doc/smartmontools \ |
289 | --with-initscriptdir=/usr/local/etc/init.d | |
832b75ed GG |
290 | |
291 | Red Hat: | |
292 | ./configure --sbindir=/usr/sbin \ | |
cfbba5b9 GI |
293 | --sysconfdir=/etc \ |
294 | --mandir=/usr/share/man \ | |
d008864d GI |
295 | --docdir=/usr/share/doc/smartmontools \ |
296 | --with-initscriptdir=/etc/rc.d/init.d | |
832b75ed GG |
297 | |
298 | Slackware: | |
299 | If you don't want to overwrite any "distribution" package, use: | |
300 | ./configure | |
301 | ||
302 | Otherwise use: | |
303 | ./configure --sbindir=/usr/sbin \ | |
304 | --sysconfdir=/etc \ | |
305 | --mandir=/usr/share/man \ | |
d008864d GI |
306 | --docdir=/usr/share/doc/smartmontools \ |
307 | --with-initscriptdir=/etc/rc.d | |
832b75ed GG |
308 | |
309 | And | |
310 | removepkg smartmontools smartsuite (only root can do this) | |
311 | before make install | |
312 | ||
313 | The init script works on Slackware. You just have to add an entry like | |
314 | the following in /etc/rc.d/rc.M or /etc/rc.d/rc.local: | |
315 | ||
316 | if [ -x /etc/rc.d/smartd ]; then | |
317 | . /etc/rc.d/smartd start | |
318 | fi | |
319 | ||
320 | To disable it: | |
321 | chmod 644 /etc/rc.d/smartd | |
322 | ||
323 | For a list of options: | |
324 | /etc/rc.d/smartd | |
325 | ||
326 | SuSE: | |
327 | ./configure --sbindir=/usr/sbin \ | |
328 | --sysconfdir=/etc \ | |
329 | --mandir=/usr/share/man \ | |
d008864d | 330 | --docdir=/usr/share/doc/packages/smartmontools-VERSION \ |
832b75ed | 331 | --with-initscriptdir=/etc/init.d \ |
832b75ed GG |
332 | |
333 | [5] Guidelines for FreeBSD | |
334 | ========================== | |
335 | To match the way it will installed when it becomes available as a PORT, use | |
336 | the following: | |
337 | ||
338 | ./configure --prefix=/usr/local \ | |
d008864d | 339 | --docdir=/usr/local/share/doc/smartmontools-VERSION \ |
832b75ed | 340 | --with-initscriptdir=/usr/local/etc/rc.d/ \ |
cfbba5b9 | 341 | --enable-sample |
832b75ed | 342 | |
832b75ed GG |
343 | NOTE: --enable-sample will cause the smartd.conf and smartd RC files to |
344 | be installed with the string '.sample' append to the name, so you will end | |
345 | up with the following: | |
cfbba5b9 GI |
346 | /usr/local/etc/smartd.conf.sample |
347 | /usr/local/etc/rc.d/smartd.sample | |
832b75ed GG |
348 | |
349 | ||
350 | [6] Guidelines for Darwin | |
351 | ========================= | |
352 | ./configure --with-initscriptdir=/Library/StartupItems | |
353 | ||
4d59bff9 GG |
354 | If you'd like to build the i386 version on a powerpc machine, you can |
355 | use | |
356 | ||
a37e7145 | 357 | CXX='g++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386' \ |
4d59bff9 | 358 | ./configure --host=i386-apple-darwin \ |
cfbba5b9 | 359 | --with-initscriptdir=/Library/StartupItems |
832b75ed | 360 | |
d008864d GI |
361 | [7] Guidelines for NetBSD |
362 | ========================= | |
832b75ed | 363 | ./configure --prefix=/usr/pkg \ |
d008864d | 364 | --docdir=/usr/pkg/share/doc/smartmontools |
832b75ed GG |
365 | |
366 | [8] Guidelines for Solaris | |
367 | ========================== | |
368 | ||
369 | smartmontools has been partially but not completely ported to | |
370 | Solaris. It includes complete SCSI support but no ATA or 3ware | |
2127e193 GI |
371 | support. It can be compiled with either CC (Sun's C++ compiler) |
372 | or GNU g++. | |
373 | ||
374 | To compile with g++: | |
832b75ed GG |
375 | |
376 | ./configure [args] | |
377 | make | |
378 | ||
2127e193 | 379 | To compile with Sun CC: |
832b75ed | 380 | |
2127e193 | 381 | env CC=cc CXX=CC ./configure [args] |
832b75ed GG |
382 | make |
383 | ||
384 | The correct arguments [args] to configure are: | |
385 | --sbindir=/usr/sbin \ | |
386 | --sysconfdir=/etc \ | |
387 | --mandir=/usr/share/man \ | |
d008864d | 388 | --docdir=/usr/share/doc/smartmontools-VERSION \ |
832b75ed GG |
389 | --with-initscriptdir=/etc/init.d |
390 | ||
391 | To start the script automatically on bootup, create hardlinks that | |
392 | indicate when to start/stop in: | |
cfbba5b9 | 393 | /etc/rc[S0123].d/ |
832b75ed | 394 | pointing to /etc/init.d/smartd. Create: |
cfbba5b9 GI |
395 | K<knum>smartd in rcS.d, rc0.d, rc1.d, rc2.d |
396 | S<snum>smartd in rc3.d | |
832b75ed GG |
397 | where <knum> is related to <snum> such that the higher snum is the |
398 | lower knum must be. | |
399 | ||
400 | On usual configuration, '95' would be suitable for <snum> and '05' | |
401 | for <knum> respectively. If you choose these value, you can | |
402 | create hardlinks by: | |
403 | ||
404 | cd /etc | |
405 | sh -c 'for n in S 0 1 2; do ln init.d/smartd rc$n.d/K05smartd; done' | |
406 | sh -c 'for n in 3 ; do ln init.d/smartd rc$n.d/S95smartd; done' | |
407 | ||
408 | [9] Guidelines for Cygwin | |
409 | ========================= | |
410 | ||
411 | Same as Red Hat: | |
412 | ./configure --prefix=/usr \ | |
413 | --sysconfdir=/etc \ | |
414 | --mandir='${prefix}/share/man' | |
415 | ||
416 | OR EQUIVALENTLY | |
417 | ./configure --sbindir=/usr/sbin \ | |
418 | --sysconfdir=/etc \ | |
419 | --mandir=/usr/share/man \ | |
d008864d GI |
420 | --docdir=/usr/share/doc/smartmontools \ |
421 | --with-initscriptdir=/etc/rc.d/init.d | |
832b75ed GG |
422 | |
423 | Using DOS text file type as default for the working directories ("textmode" | |
424 | mount option) is not recommended. Building the binaries and man pages using | |
425 | "make" is possible, but "make dist" and related targets work only with UNIX | |
426 | file type ("binmode" mount option) set. The "autogen.sh" script prints a | |
427 | warning if DOS type is selected. | |
428 | ||
e165493d GI |
429 | Files may also be checked out with a non-Cygwin SVN client which uses CR/LF |
430 | for svn:eol-style=native. The "autogen.sh" script has svn:eol-style=LF. | |
431 | Bash option "-o igncr" is not required. | |
ba59cff1 | 432 | |
832b75ed | 433 | [10] Guidelines for Windows |
eb07ddf2 | 434 | =========================== |
832b75ed | 435 | |
eb07ddf2 | 436 | To compile the Windows release with MinGW gcc on MSYS, use: |
832b75ed | 437 | |
eb07ddf2 | 438 | ./configure |
832b75ed GG |
439 | make |
440 | ||
441 | Instead of using "make install", copy the .exe files into | |
442 | some directory in the PATH. | |
443 | ||
cfbba5b9 | 444 | Cross-compile statically linked 32-bit version with MinGW-w64: |
eb07ddf2 | 445 | |
7f0798ef | 446 | ./configure --build=$(./config.guess) \ |
cfbba5b9 GI |
447 | --host=i686-w64-mingw32 \ |
448 | LDFLAGS=-static | |
eb07ddf2 | 449 | |
cfbba5b9 | 450 | Tested on Cygwin and Debian Linux. |
eb07ddf2 | 451 | |
cfbba5b9 GI |
452 | Cross-compile statically linked 64-bit version with MinGW-w64: |
453 | ||
454 | ./configure --build=$(./config.guess) \ | |
455 | --host=x86_64-w64-mingw32 \ | |
7f0798ef GI |
456 | LDFLAGS=-static |
457 | ||
cfbba5b9 | 458 | Tested on Cygwin and Debian Linux with MinGW-w64 from |
7f0798ef | 459 | http://mingw-w64.sourceforge.net/. |
cfbba5b9 GI |
460 | |
461 | WARNING: The smartmontools version for 64-bit Windows is still EXPERIMENTAL. | |
462 | ||
463 | Cross-compile on Cygwin with old gcc-mingw 3.x: | |
464 | ||
465 | ./configure --build=$(./config.guess) \ | |
466 | --host=i686-pc-mingw32 \ | |
467 | CC='gcc-3 -mno-cygwin' \ | |
a7e8ffec GI |
468 | CXX='g++-3 -mno-cygwin' \ |
469 | CXXFLAGS='-g -O2 -Wall -W -Wno-format' | |
cfbba5b9 GI |
470 | |
471 | Cross-compile on Debian Linux with gcc-mingw32: | |
472 | ||
473 | ./configure --build=$(./config.guess) \ | |
474 | --host=i586-mingw32msvc | |
eb07ddf2 GI |
475 | |
476 | ||
832b75ed GG |
477 | To build the Windows binary distribution, use: |
478 | ||
479 | make dist-win32 | |
4d59bff9 | 480 | |
832b75ed GG |
481 | This builds the distribution in directory |
482 | ||
483 | ./smartmontools-VERSION.win32/ | |
484 | ||
485 | and packs it into | |
486 | ||
487 | ./smartmontools-VERSION.win32.zip | |
488 | ||
4d59bff9 GG |
489 | To create a Windows installer, use: |
490 | ||
491 | make installer-win32 | |
492 | ||
493 | This builds the distribution directory and packs it into the | |
494 | self-extracting install program | |
495 | ||
496 | ./smartmontools-VERSION.win32-setup.exe | |
497 | ||
498 | The installer is build using the command "makensis" from the NSIS | |
499 | package. See http://nsis.sourceforge.net/ for documentation and | |
2127e193 | 500 | download location. |
4d59bff9 | 501 | |
7f0798ef GI |
502 | It is also possible to (cross-)build the installer on Linux. |
503 | This was successfully tested on Debian with package "nsis". | |
504 | ||
f4e463df GI |
505 | To create a combined 32-/64-bit installer, use this in 32-bit build |
506 | directory if 64-build directory is at ../build64: | |
507 | ||
508 | make builddir_win64=../build64 installer_win32 | |
509 | ||
4d59bff9 GG |
510 | To both create and run the (interactive) installer, use: |
511 | ||
512 | make install-win32 | |
513 | ||
832b75ed GG |
514 | Additional make targets are distdir-win32 to build the directory |
515 | only and cleandist-win32 for cleanup. | |
516 | ||
517 | The binary distribution includes all documentation files converted | |
518 | to DOS text file format and *.html and *.txt preformatted man pages. | |
519 | The tools unix2dos.exe (package cygutils) and zip.exe (package zip | |
520 | or a native Win32 release of Info-ZIP, http://www.info-zip.org) are | |
521 | necessary but may be not installed by Cygwin's default settings. | |
522 | ||
cfbba5b9 GI |
523 | The event message file tool syslogevt.exe (see smartd man page) is |
524 | included in the binary distribution if message compiler (windmc) | |
525 | and resource compiler (windres) are available. This may be disabled | |
526 | by passing 'WINDMC=no' to configure. | |
527 | ||
d008864d GI |
528 | To prepare os_win32 directory for MS Visual Studio C++ 2010 [Express], |
529 | use the following on MSYS or Cygwin: | |
2127e193 GI |
530 | |
531 | mkdir vctmp && cd vctmp | |
cfbba5b9 | 532 | ../configure [... any MinGW option set from above ...] |
d008864d | 533 | make config-vc10 |
832b75ed | 534 | |
d008864d GI |
535 | The MSVC project files (os_win32/smartmontools_vc10.sln, |
536 | os_win32/smart{ctl,d}_vc10.vcxproj) are included in SVN (but not in | |
537 | source tarball). The target config-vc10 from a Makefile configured | |
538 | for MinGW creates os_win32/{config,svnversion}_vc10.h from | |
2127e193 GI |
539 | ./{config,svnversion}.h. The configure skript must be run outside |
540 | of the source directory to avoid inclusion of the original config.h. | |
832b75ed | 541 | |
832b75ed GG |
542 | |
543 | [11] Guidelines for OS/2, eComStation | |
544 | ===================================== | |
545 | ||
546 | To compile the OS/2 code, please run | |
547 | ||
548 | ./os_os2/configure.os2 | |
549 | make | |
550 | make install | |
551 | ||
552 | [12] Guidelines for OpenBSD | |
d008864d | 553 | =========================== |
832b75ed GG |
554 | To match the way it will installed when it becomes available as a PORT, use |
555 | the following: | |
556 | ||
557 | ./configure --prefix=/usr/local \ | |
d008864d GI |
558 | --sysconfdir=/etc \ |
559 | --docdir=/usr/local/share/doc/smartmontools-VERSION \ | |
560 | --without-initscriptdir \ | |
cfbba5b9 | 561 | --enable-sample |
832b75ed | 562 | |
d008864d | 563 | NOTE: --enable-sample will cause the smartd.conf and smartd RC files to |
832b75ed GG |
564 | be installed with the string '.sample' append to the name, so you will end |
565 | up with the following: | |
d008864d | 566 | /etc/smartd.conf.sample |
832b75ed GG |
567 | |
568 | [13] Comments | |
569 | ============ | |
570 | ||
571 | To compile from another directory, you can replace the step | |
572 | ./configure [options] | |
573 | by the following: | |
574 | mkdir objdir | |
575 | cd objdir | |
576 | ../configure [options] | |
577 | ||
d008864d GI |
578 | Man pages contents is platform-specific by default. Info specific to other |
579 | platforms may be not visible. To generate man pages with full contents use: | |
580 | ||
581 | make os_man_filter= | |
582 | ||
832b75ed GG |
583 | To install to another destination (used mainly by package maintainers, |
584 | or to examine the package contents without risk of modifying any | |
585 | system files) you can replace the step: | |
586 | make install | |
587 | with: | |
588 | make DESTDIR=/home/myself/smartmontools-package install | |
589 | ||
d008864d | 590 | Use a full path. Paths like ./smartmontools-package may not work. |
832b75ed GG |
591 | |
592 | After installing smartmontools, you can read the man pages, and try | |
593 | out the commands: | |
594 | ||
595 | man smartd.conf | |
596 | man smartctl | |
597 | man smartd | |
598 | ||
599 | /usr/sbin/smartctl -s on -o on -S on /dev/hda (only root can do this) | |
600 | /usr/sbin/smartctl -a /dev/hda (only root can do this) | |
601 | ||
602 | Note that the default location for the manual pages are | |
603 | /usr/share/man/man5 and /usr/share/man/man8. If "man" doesn't find | |
604 | them, you may need to add /usr/share/man to your MANPATH environment | |
605 | variable. | |
606 | ||
cfbba5b9 GI |
607 | Source and binary packages for Windows are available at |
608 | http://sourceforge.net/projects/smartmontools/files/ | |
832b75ed | 609 | |
cfbba5b9 | 610 | Refer to http://sourceforge.net/apps/trac/smartmontools/wiki/Download |
832b75ed GG |
611 | for any additional download and installation instructions. |
612 | ||
613 | The following files are installed if ./configure has no options: | |
614 | ||
832b75ed | 615 | /usr/local/sbin/smartctl [Executable command-line utility] |
cfbba5b9 GI |
616 | /usr/local/sbin/smartd [Executable daemon] |
617 | /usr/local/sbin/update-smart-drivedb [Drive database update script] | |
832b75ed GG |
618 | /usr/local/etc/smartd.conf [Configuration file for smartd daemon] |
619 | /usr/local/etc/rc.d/init.d/smartd [Init/Startup script for smartd] | |
620 | /usr/local/share/man/man5/smartd.conf.5 [Manual page] | |
621 | /usr/local/share/man/man8/smartctl.8 [Manual page] | |
622 | /usr/local/share/man/man8/smartd.8 [Manual page] | |
cfbba5b9 GI |
623 | /usr/local/share/doc/smartmontools/AUTHORS [Information about the authors and developers] |
624 | /usr/local/share/doc/smartmontools/CHANGELOG [A log of changes. Also see SVN] | |
625 | /usr/local/share/doc/smartmontools/COPYING [GNU General Public License Version 2] | |
626 | /usr/local/share/doc/smartmontools/INSTALL [Installation instructions: what you're reading!] | |
627 | /usr/local/share/doc/smartmontools/NEWS [Significant bugs discovered in old versions] | |
628 | /usr/local/share/doc/smartmontools/README [Overview] | |
629 | /usr/local/share/doc/smartmontools/TODO [Things that need to be done/fixed] | |
630 | /usr/local/share/doc/smartmontools/WARNINGS [Systems where lockups or other serious problems were reported] | |
631 | /usr/local/share/doc/smartmontools/smartd.conf [Example configuration file for smartd] | |
632 | /usr/local/share/doc/smartmontools/examplescripts/ [Executable scripts for -M exec of smartd.conf (4 files)] | |
633 | /usr/local/share/smartmontools/drivedb.h [Drive database] | |
634 | ||
635 | If /usr/local/etc/smartd.conf exists and differs from the | |
636 | default then the default configuration file is installed as | |
637 | /usr/local/etc/smartd.conf.sample instead. | |
832b75ed GG |
638 | |
639 | The commands: | |
640 | ||
641 | make htmlman | |
642 | make txtman | |
643 | ||
644 | may be used to build .html and .txt preformatted man pages. | |
645 | These are used by the dist-win32 make target to build the Windows | |
646 | distribution. | |
647 | The commands also work on other operating system configurations | |
648 | if suitable versions of man2html, groff and grotty are installed. | |
649 | On systems without man2html, the following command should work | |
650 | if groff is available: | |
651 | ||
652 | make MAN2HTML='groff -man -Thtml' htmlman | |
653 | ||
654 | ||
2127e193 GI |
655 | Some of the source files are prepared for the documentation |
656 | generator Doxygen (http://www.doxygen.org/). If Doxygen is installed, | |
657 | the command: | |
658 | ||
659 | doxygen | |
660 | ||
661 | creates HTML documentation in doc/html and LaTeX documentation | |
662 | in doc/latex. If TeX is installed, the following command creates | |
663 | a documentation file doc/latex/refman.pdf: | |
664 | ||
665 | ( cd doc/latex && make pdf ) | |
666 | ||
667 | ||
832b75ed GG |
668 | [14] Detailed description of arguments to configure command |
669 | =========================================================== | |
670 | ||
671 | When you type: | |
672 | ./configure [options] | |
673 | there are six particularly important variables that affect where the | |
674 | smartmontools software is installed. The variables are listed here, | |
675 | with their default values in square brackets, and the quantities that | |
676 | they affect described following that. This is a very wide table: please read | |
677 | it in a wide window. | |
678 | ||
679 | OPTIONS DEFAULT AFFECTS | |
680 | ------- ------- ------- | |
681 | --prefix /usr/local Please see below | |
682 | --sbindir ${prefix}/sbin Directory for smartd/smartctl executables; | |
683 | Contents of smartd/smartctl man pages | |
a23d5117 GI |
684 | --docdir ${prefix}/share/doc/smartmontools Location of the documentation |
685 | (autoconf >= 2.60 only, see also --with-docdir below) | |
832b75ed GG |
686 | --mandir ${prefix}/share/man Directory for smartctl/smartd/smartd.conf man pages |
687 | --sysconfdir ${prefix}/etc Directory for smartd.conf; | |
688 | Contents of smartd executable; | |
689 | Contents of smartd/smartd.conf man pages; | |
690 | Directory for rc.d/init.d/smartd init script | |
a7e8ffec GI |
691 | --with-initscriptdir auto Location of init scripts |
692 | --with-systemdsystemunitdir auto Location of systemd service files | |
a23d5117 | 693 | --with-docdir ${prefix}/share/doc/smartmontools Location of the documentation |
cfbba5b9 | 694 | --with-exampledir ${docdir}/examplescripts Location of example scripts |
2127e193 GI |
695 | --enable-sample --disable-sample Adds the string '.sample' to the names of the smartd.conf file and the smartd RC file |
696 | --with-os-deps os_<guessed>.o OS dependent module(s) | |
cfbba5b9 | 697 | --with-selinux --without-selinux Enables SELinux support. If smartmontools has to create the /dev/tw[ae] device |
2127e193 GI |
698 | nodes for 3ware/AMCC controllers, this option ensures that the nodes are created |
699 | with correct SELinux file contexts. | |
cfbba5b9 | 700 | --with-libcap-ng --with-libcap-ng=auto Enables/disables libcap-ng support. If enabled and libcap-ng is |
a23d5117 | 701 | available, option --capabilities is added to smartd. |
cfbba5b9 | 702 | --disable-drivedb --enable-drivedb Disables default drive database file '${drivedbdir}/drivedb.h' |
bed94269 | 703 | --with-drivedbdir ${prefix}/share/smartmontools Directory for 'drivedb.h' (implies --enable-drivedb) |
2127e193 | 704 | --enable-savestates --disable-savestates Enables default smartd state files '${savestates}MODEL-SERIAL.ata.state' |
bed94269 GI |
705 | --with-savestates ${prefix}/var/lib/smartmontools/smartd. Prefix for smartd state files (implies --enable-savestates) |
706 | --enable-attributelog --disable-attributelog Enables default smartd attribute log files | |
707 | --with-attributelog ${prefix}/var/lib/smartmontools/attrlog. Prefix for smartd attribute log files (implies --enable-attributelog) | |
832b75ed | 708 | |
a23d5117 GI |
709 | Please note that in previous versions of smartmontools (<= 5.39) the |
710 | default for --with-docdir was | |
711 | ${prefix}/share/doc/smartmontools-VERSION | |
712 | This was changed to make it consistent with the default of the | |
713 | new --docdir option added in autoconf 2.60. | |
714 | ||
a7e8ffec GI |
715 | The defaults for --with-initscriptdir and --with-systemdsystemunitdir are |
716 | guessed such that the following rules apply: | |
717 | - If --prefix=/usr --sysconfdir=/etc is specified, the guessed directories | |
718 | should be the defaults used by the current OS or distribution. | |
719 | - If --sysconfdir=/etc is NOT specified, the guessed directories should | |
720 | always be below ${prefix} or below ${sysconfdir}. | |
721 | ||
832b75ed GG |
722 | Here's an example: |
723 | If you set --prefix=/home/joe and none of the other four | |
724 | variables then the different directories that are used would be: | |
725 | --sbindir /home/joe/sbin | |
a7e8ffec | 726 | --docdir /home/joe/share/doc/smartmontools |
832b75ed GG |
727 | --mandir /home/joe/share/man |
728 | --sysconfdir /home/joe/etc | |
a7e8ffec GI |
729 | --with-exampledir /home/joe/share/doc/smartmontools/examplescripts |
730 | --with-drivedbdir /home/joe/share/smartmontools | |
731 | --with-initscriptdir [see below] | |
732 | --with-systemdsystemunitdir [see below] | |
733 | ||
734 | If systemd is present (and pkg-config reports /lib/systemd/system | |
735 | as the systemdsystemunitdir): | |
736 | ||
737 | --with-initscriptdir [disabled] | |
738 | --with-systemdsystemunitdir /home/joe/lib/systemd/system | |
739 | ||
740 | else if /etc/rc.d/init.d exists: | |
741 | ||
742 | --with-initscriptdir /home/joe/etc/rc.d/init.d | |
743 | --with-systemdsystemunitdir [disabled] | |
744 | ||
745 | else if /etc/init.d exists: | |
746 | ||
747 | --with-initscriptdir /home/joe/etc/init.d | |
748 | --with-systemdsystemunitdir [disabled] | |
749 | ||
750 | else if /etc/rc.d exists: | |
751 | ||
752 | --with-initscriptdir /home/joe/etc/rc.d | |
753 | --with-systemdsystemunitdir [disabled] | |
754 | ||
755 | else | |
756 | ||
757 | --with-initscriptdir [disabled] | |
758 | --with-systemdsystemunitdir [disabled] | |
832b75ed GG |
759 | |
760 | This is useful for test installs in a harmless subdirectory somewhere. | |
761 | ||
762 | Here are the four possible cases for the four variables above: | |
763 | ||
764 | Case 1: | |
765 | --prefix not set | |
766 | --variable not set | |
767 | ===> VARIABLE gets default value above | |
768 | ||
769 | Case 2: | |
770 | --prefix set | |
771 | --variable not set | |
772 | ===> VARIABLE gets PREFIX/ prepended to default value above | |
773 | ||
774 | Case 3: | |
775 | --prefix not set | |
776 | --variable set | |
777 | ===> VARIABLE gets value that is set | |
778 | ||
779 | Case 4: | |
780 | --prefix is set | |
781 | --variable is set | |
782 | ===> PREFIX is IGNORED, VARIABLE gets value that is set | |
783 | ||
784 | ||
785 | Here are the differences with and without --enable-sample, assuming | |
a7e8ffec GI |
786 | that initscript location is set and no other options specified |
787 | (see above for details) | |
832b75ed GG |
788 | |
789 | Case 1: | |
790 | --enable-sample provided | |
791 | ==> Files installed are: | |
cfbba5b9 GI |
792 | /usr/local/etc/smartd.conf.sample |
793 | /usr/local/etc/rc.d/init.d/smartd.sample | |
832b75ed GG |
794 | |
795 | Case 2: | |
796 | --disable-sample provided or parameter left out | |
797 | ==> Files installed are: | |
cfbba5b9 GI |
798 | /usr/local/etc/smartd.conf |
799 | /usr/local/etc/rc.d/init.d/smartd | |
832b75ed GG |
800 | |
801 | Additional information about using configure can be found here: | |
cfbba5b9 | 802 | http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts |