hwclock

package: hwclock

title: hwclock(8)

summary: time clocks utility

text:
# hwclock(8)

## NAME
hwclock - time clocks utility

## SYNOPSIS
hwclock [function] [option...]

## DESCRIPTION
hwclock is an administration tool for the time clocks. It can: display the Hardware Clock time; set the Hardware Clock to a specified time; set the Hardware Clock from the System Clock; set the System Clock from the Hardware Clock; compensate for Hardware Clock drift; correct the System Clock timescale; set the kernel’s timezone, NTP timescale, and epoch (Alpha only); and predict future Hardware Clock values based on its drift rate.

Since v2.26 important changes were made to the --hctosys function and the --directisa option, and a new option --update-drift was added. See their respective descriptions below.

## FUNCTIONS
The following functions are mutually exclusive, only one can be given at a time. If none is given, the default is --show.

-a, --adjust

Add or subtract time from the Hardware Clock to account for systematic drift since the last time the clock was set or adjusted. See the discussion below, under The Adjust Function.

--getepoch; --setepoch

These functions are for Alpha machines only, and are only available through the Linux kernel RTC driver. They are used to read and set the kernel’s Hardware Clock epoch value. Epoch is the number of years into AD to which a zero year value in the Hardware Clock refers. For example, if the machine’s BIOS sets the year counter in the Hardware Clock to contain the number of full years since 1952, then the kernel’s Hardware Clock epoch value must be 1952.

The --setepoch function requires using the --epoch option to specify the year. For example:

hwclock --setepoch --epoch=1952

The RTC driver attempts to guess the correct epoch value, so setting it may not be required.

This epoch value is used whenever hwclock reads or sets the Hardware Clock on an Alpha machine. For ISA machines the kernel uses the fixed Hardware Clock epoch of 1900.

--param-get=parameter; --param-set=parameter=value

Read and set the RTC’s parameter. This is useful, for example, to retrieve the RTC’s feature or set the RTC’s Backup Switchover Mode. parameter is either a numeric RTC parameter value (see the Kernel’s include/uapi/linux/rtc.h) or an alias. See --help for a list of valid aliases. parameter and value, if prefixed with 0x, are interpreted as hexadecimal, otherwise decimal values.

--predict

Predict what the Hardware Clock will read in the future based upon the time given by the --date option and the information in /etc/adjtime. This is useful, for example, to account for drift when setting a Hardware Clock wakeup (aka alarm). See rtcwake(8). Do not use this function if the Hardware Clock is being modified by anything other than the current operating system’s hwclock command, such as '11 minute mode' or from dual-booting another OS.

-r, --show; --get

Read the Hardware Clock and print its time to standard output in the ISO 8601 format. The time shown is always in local time, even if you keep your Hardware Clock in UTC. See the --localtime option. Showing the Hardware Clock time is the default when no function is specified.

The --get function also applies drift correction to the time read, based upon the information in /etc/adjtime. Do not use this function if the Hardware Clock is being modified by anything other than the current operating system’s hwclock command, such as '11 minute mode' or from dual-booting another OS.

-s, --hctosys

Set the System Clock from the Hardware Clock. The time read from the Hardware Clock is compensated to account for systematic drift before using it to set the System Clock. See the discussion below, under The Adjust Function. The System Clock must be kept in the UTC timescale for date-time applications to work correctly in conjunction with the timezone configured for the system. If the Hardware Clock is kept in local time then the time read from it must be shifted to the UTC timescale before using it to set the System Clock. The --hctosys function does this based upon the information in the /etc/adjtime file or the command line arguments --localtime and --utc. Note: no daylight saving adjustment is made. See the discussion below, under LOCAL vs UTC.

The kernel also keeps a timezone value, the --hctosys function sets it to the timezone configured for the system. The system timezone is configured by the TZ environment variable or the /etc/localtime file, as tzset(3) would interpret them. The obsolete tz_dsttime field of the kernel’s timezone value is set to zero. (For details on what this field used to mean, see settimeofday(2).)

When used in a startup script, making the --hctosys function the first caller of settimeofday(2) from boot, it will set the NTP '11 minute mode' timescale via the persistent_clock_is_local kernel variable. If the Hardware Clock’s timescale configuration is changed then a reboot is required to inform the kernel. See the discussion below, under Automatic Hardware Clock Synchronization by the Kernel.

This is a good function to use in one of the system startup scripts before the file systems are mounted read/write.

This function should never be used on a running system. Jumping system time will cause problems, such as corrupted filesystem timestamps. Also, if something has changed the Hardware Clock, like NTP’s '11 minute mode', then --hctosys will set the time incorrectly by including drift compensation.

Drift compensation can be inhibited by setting the drift factor in /etc/adjtime to zero. This setting will be persistent as long as the --update-drift option is not used with --systohc at shutdown (or anywhere else). Another way to inhibit this is by using the --noadjfile option when calling the --hctosys function. A third method is to delete the /etc/adjtime file. Hwclock will then default to using the UTC timescale for the Hardware Clock. If the Hardware Clock is ticking local time it will need to be defined in the file. This can be done by calling hwclock --localtime --adjust; when the file is not present this command will not actually adjust the Clock, but it will create the file with local time configured, and a drift factor of zero.

A condition under which inhibiting hwclock's drift correction may be desired is when dual-booting multiple operating systems. If while this instance of Linux is stopped, another OS changes the Hardware Clock’s value, then when this instance is started again the drift correction applied will be incorrect.

For hwclock's drift correction to work properly it is imperative that nothing changes the Hardware Clock while its Linux instance is not running.

--set

Set the Hardware Clock to the time given by the --date option, and update the timestamps in /etc/adjtime. With the --update-drift option also (re)calculate the drift factor. Try it without the option if --set fails. See --update-drift below.

--systz

This is an alternate to the --hctosys function that does not read the Hardware Clock nor set the System Clock; consequently there is not any drift correction. It is intended to be used in a startup script on systems with kernels above version 2.6 where you know the System Clock has been set from the Hardware Clock by the kernel during boot. It does the following things that are detailed above in the --hctosys function:

•Corrects the System Clock timescale to UTC as needed. Only instead of accomplishing this by setting the System Clock, hwclock simply informs the kernel and it handles the change.

•Sets the kernel’s NTP '11 minute mode' timescale.

•Sets the kernel’s timezone.

The first two are only available on the first call of settimeofday(2) after boot. Consequently this option only makes sense when used in a startup script. If the Hardware Clocks timescale configuration is changed then a reboot would be required to inform the kernel.

-w, --systohc

Set the Hardware Clock from the System Clock, and update the timestamps in /etc/adjtime. With the --update-drift option also (re)calculate the drift factor. Try it without the option if --systohc fails. See --update-drift below.

-h, --help

Display help text and exit.

-V, --version

Print version and exit.

## OPTIONS
--adjfile=filename

Override the default /etc/adjtime file path.

--date=date_string

This option must be used with the --set or --predict functions, otherwise it is ignored. hwclock --set --date='16:45'

hwclock --predict --date='2525-08-14 07:11:05'

The argument must be in local time, even if you keep your Hardware Clock in UTC. See the --localtime option. Therefore, the argument should not include any timezone information. It also should not be a relative time like "+5 minutes", because hwclock's precision depends upon correlation between the argument’s value and when the enter key is pressed. Fractional seconds are silently dropped. This option is capable of understanding many time and date formats, but the previous parameters should be observed.

--delay=seconds

This option can be used to overwrite the internally used delay when setting the clock time. The default is 0.5 (500ms) for rtc_cmos, for another RTC types the delay is 0. If RTC type is impossible to determine (from sysfs) then it defaults also to 0.5 to be backwardly compatible. The 500ms default is based on commonly used MC146818A-compatible (x86) hardware clock. This Hardware Clock can only be set to any integer time plus one half second. The integer time is required because there is no interface to set or get a fractional second. The additional half second delay is because the Hardware Clock updates to the following second precisely 500 ms after setting the new time. Unfortunately, this behavior is hardware specific and in some cases another delay is required.

-D, --debug

Use --verbose. The --debug option has been deprecated and may be repurposed or removed in a future release.

--directisa

This option is meaningful for ISA compatible machines in the x86 and x86_64 family. For other machines, it has no effect. This option tells hwclock to use explicit I/O instructions to access the Hardware Clock. Without this option, hwclock will use the rtc device file, which it assumes to be driven by the Linux RTC device driver. As of v2.26 it will no longer automatically use directisa when the rtc driver is unavailable; this was causing an unsafe condition that could allow two processes to access the Hardware Clock at the same time. Direct hardware access from userspace should only be used for testing, troubleshooting, and as a last resort when all other methods fail. See the --rtc option.

--epoch=year

This option is required when using the --setepoch function. The minimum year value is 1900. The maximum is system dependent (ULONG_MAX - 1).

-f, --rtc=filename

Override hwclock's default rtc device file name. Otherwise it will use the first one found in this order: /dev/rtc0, /dev/rtc, /dev/misc/rtc. For IA-64: /dev/efirtc /dev/misc/efirtc

-l, --localtime; -u, --utc

Indicate which timescale the Hardware Clock is set to. The Hardware Clock may be configured to use either the UTC or the local timescale, but nothing in the clock itself says which alternative is being used. The --localtime or --utc options give this information to the hwclock command. If you specify the wrong one (or specify neither and take a wrong default), both setting and reading the Hardware Clock will be incorrect.

If you specify neither --utc nor --localtime then the one last given with a set function (--set, --systohc, or --adjust), as recorded in /etc/adjtime, will be used. If the adjtime file doesn’t exist, the default is UTC.

Note: daylight saving time changes may be inconsistent when the Hardware Clock is kept in local time. See the discussion below, under LOCAL vs UTC.

--noadjfile

Disable the facilities provided by /etc/adjtime. hwclock will not read nor write to that file with this option. Either --utc or --localtime must be specified when using this option.

--test

Do not actually change anything on the system, that is, the Clocks or /etc/adjtime (--verbose is implicit with this option).

--update-drift

Update the Hardware Clock’s drift factor in /etc/adjtime. It can only be used with --set or --systohc. A minimum four hour period between settings is required. This is to avoid invalid calculations. The longer the period, the more precise the resulting drift factor will be.

This option was added in v2.26, because it is typical for systems to call hwclock --systohc at shutdown; with the old behavior this would automatically (re)calculate the drift factor which caused several problems:

•When using NTP with an '11 minute mode' kernel the drift factor would be clobbered to near zero.

•It would not allow the use of 'cold' drift correction. With most configurations using 'cold' drift will yield favorable results. Cold, means when the machine is turned off which can have a significant impact on the drift factor.

•(Re)calculating drift factor on every shutdown delivers suboptimal results. For example, if ephemeral conditions cause the machine to be abnormally hot the drift factor calculation would be out of range.

•Significantly increased system shutdown times (as of v2.31 when not using --update-drift the RTC is not read).

Having hwclock calculate the drift factor is a good starting point, but for optimal results it will likely need to be adjusted by directly editing the /etc/adjtime file. For most configurations once a machine’s optimal drift factor is crafted it should not need to be changed. Therefore, the old behavior to automatically (re)calculate drift was changed and now requires this option to be used. See the discussion below, under The Adjust Function.

This option requires reading the Hardware Clock before setting it. If it cannot be read, then this option will cause the set functions to fail. This can happen, for example, if the Hardware Clock is corrupted by a power failure. In that case, the clock must first be set without this option. Despite it not working, the resulting drift correction factor would be invalid anyway.

-v, --verbose

Display more details about what hwclock is doing internally.

## NOTES

### Clocks in a Linux System
There are two types of date-time clocks:

The Hardware Clock: This clock is an independent hardware device, with its own power domain (battery, capacitor, etc), that operates when the machine is powered off, or even unplugged.

On an ISA compatible system, this clock is specified as part of the ISA standard. A control program can read or set this clock only to a whole second, but it can also detect the edges of the 1 second clock ticks, so the clock actually has virtually infinite precision.

This clock is commonly called the hardware clock, the real time clock, the RTC, the BIOS clock, and the CMOS clock. Hardware Clock, in its capitalized form, was coined for use by hwclock. The Linux kernel also refers to it as the persistent clock.

Some non-ISA systems have a few real time clocks with only one of them having its own power domain. A very low power external I2C or SPI clock chip might be used with a backup battery as the hardware clock to initialize a more functional integrated real-time clock which is used for most other purposes.

The System Clock: This clock is part of the Linux kernel and is driven by a timer interrupt. (On an ISA machine, the timer interrupt is part of the ISA standard.) It has meaning only while Linux is running on the machine. The System Time is the number of seconds since 00:00:00 January 1, 1970 UTC (or more succinctly, the number of seconds since 1969 UTC). The System Time is not an integer, though. It has virtually infinite precision.

The System Time is the time that matters. The Hardware Clock’s basic purpose is to keep time when Linux is not running so that the System Clock can be initialized from it at boot. Note that in DOS, for which ISA was designed, the Hardware Clock is the only real time clock.

It is important that the System Time not have any discontinuities such as would happen if you used the date(1) program to set it while the system is running. You can, however, do whatever you want to the Hardware Clock while the system is running, and the next time Linux starts up, it will do so with the adjusted time from the Hardware Clock. Note: currently this is not possible on most systems because hwclock --systohc is called at shutdown.

The Linux kernel’s timezone is set by hwclock. But don’t be misled — almost nobody cares what timezone the kernel thinks it is in. Instead, programs that care about the timezone (perhaps because they want to display a local time for you) almost always use a more traditional method of determining the timezone: They use the TZ environment variable or the /etc/localtime file, as explained in the man page for tzset(3). However, some programs and fringe parts of the Linux kernel such as filesystems use the kernel’s timezone value. An example is the vfat filesystem. If the kernel timezone value is wrong, the vfat filesystem will report and set the wrong timestamps on files. Another example is the kernel’s NTP '11 minute mode'. If the kernel’s timezone value and/or the persistent_clock_is_local variable are wrong, then the Hardware Clock will be set incorrectly by '11 minute mode'. See the discussion below, under Automatic Hardware Clock Synchronization by the Kernel.

hwclock sets the kernel’s timezone to the value indicated by TZ or /etc/localtime with the --hctosys or --systz functions.

The kernel’s timezone value actually consists of two parts: 1) a field tz_minuteswest indicating how many minutes local time (not adjusted for DST) lags behind UTC, and 2) a field tz_dsttime indicating the type of Daylight Savings Time (DST) convention that is in effect in the locality at the present time. This second field is not used under Linux and is always zero. See also settimeofday(2).

### Hardware Clock Access Methods
hwclock uses many different ways to get and set Hardware Clock values. The most normal way is to do I/O to the rtc device special file, which is presumed to be driven by the rtc device driver. Also, Linux systems using the rtc framework with udev, are capable of supporting multiple Hardware Clocks. This may bring about the need to override the default rtc device by specifying one with the --rtc option.

However, this method is not always available as older systems do not have an rtc driver. On these systems, the method of accessing the Hardware Clock depends on the system hardware.

On an ISA compatible system, hwclock can directly access the "CMOS memory" registers that constitute the clock, by doing I/O to Ports 0x70 and 0x71. It does this with actual I/O instructions and consequently can only do it if running with superuser effective userid. This method may be used by specifying the --directisa option.

This is a really poor method of accessing the clock, for all the reasons that userspace programs are generally not supposed to do direct I/O and disable interrupts. hwclock provides it for testing, troubleshooting, and because it may be the only method available on ISA systems which do not have a working rtc device driver.

### The Adjust Function
The Hardware Clock is usually not very accurate. However, much of its inaccuracy is completely predictable - it gains or loses the same amount of time every day. This is called systematic drift. hwclock's --adjust function lets you apply systematic drift corrections to the Hardware Clock.

It works like this: hwclock keeps a file, /etc/adjtime, that keeps some historical information. This is called the adjtime file.

Suppose you start with no adjtime file. You issue a hwclock --set command to set the Hardware Clock to the true current time. hwclock creates the adjtime file and records in it the current time as the last time the clock was calibrated. Five days later, the clock has gained 10 seconds, so you issue a hwclock --set --update-drift command to set it back 10 seconds. hwclock updates the adjtime file to show the current time as the last time the clock was calibrated, and records 2 seconds per day as the systematic drift rate. 24 hours go by, and then you issue a hwclock --adjust command. hwclock consults the adjtime file and sees that the clock gains 2 seconds per day when left alone and that it has been left alone for exactly one day. So it subtracts 2 seconds from the Hardware Clock. It then records the current time as the last time the clock was adjusted. Another 24 hours go by and you issue another hwclock --adjust. hwclock does the same thing: subtracts 2 seconds and updates the adjtime file with the current time as the last time the clock was adjusted.

When you use the --update-drift option with --set or --systohc, the systematic drift rate is (re)calculated by comparing the fully drift corrected current Hardware Clock time with the new set time, from that it derives the 24 hour drift rate based on the last calibrated timestamp from the adjtime file. This updated drift factor is then saved in /etc/adjtime.

A small amount of error creeps in when the Hardware Clock is set, so --adjust refrains from making any adjustment that is less than 1 second. Later on, when you request an adjustment again, the accumulated drift will be more than 1 second and --adjust will make the adjustment including any fractional amount.

hwclock --hctosys also uses the adjtime file data to compensate the value read from the Hardware Clock before using it to set the System Clock. It does not share the 1 second limitation of --adjust, and will correct sub-second drift values immediately. It does not change the Hardware Clock time nor the adjtime file. This may eliminate the need to use --adjust, unless something else on the system needs the Hardware Clock to be compensated.

### The Adjtime File
While named for its historical purpose of controlling adjustments only, it actually contains other information used by hwclock from one invocation to the next.

The format of the adjtime file is, in ASCII:

Line 1: Three numbers, separated by blanks: 1) the systematic drift rate in seconds per day, floating point decimal; 2) the resulting number of seconds since 1969 UTC of most recent adjustment or calibration, decimal integer; 3) zero (for compatibility with clock(8)) as a floating point decimal.

Line 2: One number: the resulting number of seconds since 1969 UTC of most recent calibration. Zero if there has been no calibration yet or it is known that any previous calibration is moot (for example, because the Hardware Clock has been found, since that calibration, not to contain a valid time). This is a decimal integer.

Line 3: "UTC" or "LOCAL". Tells whether the Hardware Clock is set to Coordinated Universal Time or local time. You can always override this value with options on the hwclock command line.

You can use an adjtime file that was previously used with the clock(8) program with hwclock.

### Automatic Hardware Clock Synchronization by the Kernel
You should be aware of another way that the Hardware Clock is kept synchronized in some systems. The Linux kernel has a mode wherein it copies the System Time to the Hardware Clock every 11 minutes. This mode is a compile time option, so not all kernels will have this capability. This is a good mode to use when you are using something sophisticated like NTP to keep your System Clock synchronized. (NTP is a way to keep your System Time synchronized either to a time server somewhere on the network or to a radio clock hooked up to your system. See RFC 1305.)

If the kernel is compiled with the '11 minute mode' option it will be active when the kernel’s clock discipline is in a synchronized state. When in this state, bit 6 (the bit that is set in the mask 0x0040) of the kernel’s time_status variable is unset. This value is output as the 'status' line of the adjtimex --print or ntptime commands.

It takes an outside influence, like the NTP daemon to put the kernel’s clock discipline into a synchronized state, and therefore turn on '11 minute mode'. It can be turned off by running anything that sets the System Clock the old fashioned way, including hwclock --hctosys. However, if the NTP daemon is still running, it will turn '11 minute mode' back on again the next time it synchronizes the System Clock.

If your system runs with '11 minute mode' on, it may need to use either --hctosys or --systz in a startup script, especially if the Hardware Clock is configured to use the local timescale. Unless the kernel is informed of what timescale the Hardware Clock is using, it may clobber it with the wrong one. The kernel uses UTC by default.

The first userspace command to set the System Clock informs the kernel what timescale the Hardware Clock is using. This happens via the persistent_clock_is_local kernel variable. If --hctosys or --systz is the first, it will set this variable according to the adjtime file or the appropriate command-line argument. Note that when using this capability and the Hardware Clock timescale configuration is changed, then a reboot is required to notify the kernel.

hwclock --adjust should not be used with NTP '11 minute mode'.

### ISA Hardware Clock Century value
There is some sort of standard that defines CMOS memory Byte 50 on an ISA machine as an indicator of what century it is. hwclock does not use or set that byte because there are some machines that don’t define the byte that way, and it really isn’t necessary anyway, since the year-of-century does a good job of implying which century it is.

If you have a bona fide use for a CMOS century byte, contact the hwclock maintainer; an option may be appropriate.

Note that this section is only relevant when you are using the "direct ISA" method of accessing the Hardware Clock. ACPI provides a standard way to access century values, when they are supported by the hardware.

## DATE-TIME CONFIGURATION

### Keeping Time without External Synchronization
This discussion is based on the following conditions:

•Nothing is running that alters the date-time clocks, such as NTP daemon or a cron job."

•The system timezone is configured for the correct local time. See below, under POSIX vs 'RIGHT'.

•Early during startup the following are called, in this order: adjtimex --tick value --frequency value hwclock --hctosys

•During shutdown the following is called: hwclock --systohc

•Systems without adjtimex may use ntptime.

Whether maintaining precision time with NTP daemon or not, it makes sense to configure the system to keep reasonably good date-time on its own.

The first step in making that happen is having a clear understanding of the big picture. There are two completely separate hardware devices running at their own speed and drifting away from the 'correct' time at their own rates. The methods and software for drift correction are different for each of them. However, most systems are configured to exchange values between these two clocks at startup and shutdown. Now the individual device’s time keeping errors are transferred back and forth between each other. Attempt to configure drift correction for only one of them, and the other’s drift will be overlaid upon it.

This problem can be avoided when configuring drift correction for the System Clock by simply not shutting down the machine. This, plus the fact that all of hwclock's precision (including calculating drift factors) depends upon the System Clock’s rate being correct, means that configuration of the System Clock should be done first.

The System Clock drift is corrected with the adjtimex(8) command’s --tick and --frequency options. These two work together: tick is the coarse adjustment and frequency is the fine adjustment. (For systems that do not have an adjtimex package, ntptime -f ppm may be used instead.)

Some Linux distributions attempt to automatically calculate the System Clock drift with adjtimex's compare operation. Trying to correct one drifting clock by using another drifting clock as a reference is akin to a dog trying to catch its own tail. Success may happen eventually, but great effort and frustration will likely precede it. This automation may yield an improvement over no configuration, but expecting optimum results would be in error. A better choice for manual configuration would be adjtimex's --log options.

It may be more effective to simply track the System Clock drift with sntp, or date -Ins and a precision timepiece, and then calculate the correction manually.

After setting the tick and frequency values, continue to test and refine the adjustments until the System Clock keeps good time. See adjtimex(2) for more information and the example demonstrating manual drift calculations.

Once the System Clock is ticking smoothly, move on to the Hardware Clock.

As a rule, cold drift will work best for most use cases. This should be true even for 24/7 machines whose normal downtime consists of a reboot. In that case the drift factor value makes little difference. But on the rare occasion that the machine is shut down for an extended period, then cold drift should yield better results.

Steps to calculate cold drift:

1

Ensure that NTP daemon will not be launched at startup.

2

The System Clock time must be correct at shutdown!

3

Shut down the system.

4

Let an extended period pass without changing the Hardware Clock.

5

Start the system.

6

Immediately use hwclock to set the correct time, adding the --update-drift option.

Note: if step 6 uses --systohc, then the System Clock must be set correctly (step 6a) just before doing so.

Having hwclock calculate the drift factor is a good starting point, but for optimal results it will likely need to be adjusted by directly editing the /etc/adjtime file. Continue to test and refine the drift factor until the Hardware Clock is corrected properly at startup. To check this, first make sure that the System Time is correct before shutdown and then use sntp, or date -Ins and a precision timepiece, immediately after startup.

### LOCAL vs UTC
Keeping the Hardware Clock in a local timescale causes inconsistent daylight saving time results:

•If Linux is running during a daylight saving time change, the time written to the Hardware Clock will be adjusted for the change.

•If Linux is NOT running during a daylight saving time change, the time read from the Hardware Clock will NOT be adjusted for the change.

The Hardware Clock on an ISA compatible system keeps only a date and time, it has no concept of timezone nor daylight saving. Therefore, when hwclock is told that it is in local time, it assumes it is in the 'correct' local time and makes no adjustments to the time read from it.

Linux handles daylight saving time changes transparently only when the Hardware Clock is kept in the UTC timescale. Doing so is made easy for system administrators as hwclock uses local time for its output and as the argument to the --date option.

POSIX systems, like Linux, are designed to have the System Clock operate in the UTC timescale. The Hardware Clock’s purpose is to initialize the System Clock, so also keeping it in UTC makes sense.

Linux does, however, attempt to accommodate the Hardware Clock being in the local timescale. This is primarily for dual-booting with older versions of MS Windows. From Windows 7 on, the RealTimeIsUniversal registry key is supposed to be working properly so that its Hardware Clock can be kept in UTC.

### POSIX vs 'RIGHT'
A discussion on date-time configuration would be incomplete without addressing timezones, this is mostly well covered by tzset(3). One area that seems to have no documentation is the 'right' directory of the Time Zone Database, sometimes called tz or zoneinfo.

There are two separate databases in the zoneinfo system, posix and 'right'. 'Right' (now named zoneinfo-leaps) includes leap seconds and posix does not. To use the 'right' database the System Clock must be set to (UTC + leap seconds), which is equivalent to (TAI - 10). This allows calculating the exact number of seconds between two dates that cross a leap second epoch. The System Clock is then converted to the correct civil time, including UTC, by using the 'right' timezone files which subtract the leap seconds. Note: this configuration is considered experimental and is known to have issues.

To configure a system to use a particular database all of the files located in its directory must be copied to the root of /usr/share/zoneinfo. Files are never used directly from the posix or 'right' subdirectories, e.g., TZ='right/Europe/Dublin'. This habit was becoming so common that the upstream zoneinfo project restructured the system’s file tree by moving the posix and 'right' subdirectories out of the zoneinfo directory and into sibling directories:

/usr/share/zoneinfo, /usr/share/zoneinfo-posix, /usr/share/zoneinfo-leaps

Unfortunately, some Linux distributions are changing it back to the old tree structure in their packages. So the problem of system administrators reaching into the 'right' subdirectory persists. This causes the system timezone to be configured to include leap seconds while the zoneinfo database is still configured to exclude them. Then when an application such as a World Clock needs the South_Pole timezone file; or an email MTA, or hwclock needs the UTC timezone file; they fetch it from the root of /usr/share/zoneinfo , because that is what they are supposed to do. Those files exclude leap seconds, but the System Clock now includes them, causing an incorrect time conversion.

Attempting to mix and match files from these separate databases will not work, because they each require the System Clock to use a different timescale. The zoneinfo database must be configured to use either posix or 'right', as described above, or by assigning a database path to the TZDIR environment variable.

## EXIT STATUS
One of the following exit values will be returned:

EXIT_SUCCESS ('0' on POSIX systems)

Successful program execution.

EXIT_FAILURE ('1' on POSIX systems)

The operation failed or the command syntax was not valid.

## ENVIRONMENT
TZ

If this variable is set its value takes precedence over the system configured timezone.

TZDIR

If this variable is set its value takes precedence over the system configured timezone database directory path.

## FILES
/etc/adjtime

The configuration and state file for hwclock. See also adjtime_config(5).

/etc/localtime

The system timezone file.

/usr/share/zoneinfo/

The system timezone database directory.

Device files hwclock may try for Hardware Clock access: /dev/rtc0 /dev/rtc /dev/misc/rtc /dev/efirtc /dev/misc/efirtc

## SEE ALSO
date(1), adjtime_config(5), adjtimex(8), gettimeofday(2), settimeofday(2), crontab(1p), tzset(3)

## AUTHORS
Written by Bryan Henderson <bryanh@giraffe-data.com>, September 1996, based on work done on the clock(8) program by Charles Hedrick, Rob Hooft, and Harald Koenig. See the source code for complete history and credits.

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The hwclock command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


hwinfo

package: hwinfo

title: hwinfo(8)

summary: probe for hardware

text:
# hwinfo(8)

## NAME
hwinfo - probe for hardware

## SYNOPSIS
hwinfo [ OPTIONS ]

## DESCRIPTION
hwinfo is used to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support.

## OPTIONS
Note that running hwinfo without any options is roughly equivalent to 'hwinfo --all --log=-'.

--<HARDWARE_ITEM>

This option can be given more than once. Probe for a particular HARDWARE_ITEM. Available hardware items are: all, arch, bios, block, bluetooth, braille, bridge, camera, cdrom, chipcard, cpu, disk, dsl, dvb, fingerprint, floppy, framebuffer, gfxcard, hub, ide, isapnp, isdn, joystick, keyboard, memory, mmc-ctrl, modem, monitor, mouse, netcard, network, partition, pci, pcmcia, pcmcia-ctrl, pppoe, printer, redasd, reallyall, scanner, scsi, smp, sound, storage-ctrl, sys, tape, tv, uml, usb, usb-ctrl, vbe, wlan, xen, zip

Note that if this option is missing, no hardware probing will be done!

--short

Show only a summary. Use this option in addition to a hardware probing option.

--listmd

Normally hwinfo does not report RAID devices. Add this option to see them.

--only DEVNAME

This option can be given more than once. If you add this option only entries in the device list matching DEVNAME will be shown. Note that you also have to specify --<HARDWARE_ITEM> to trigger any device probing.

--save-config SPEC

Store config for a particular device below /var/lib/hardware. SPEC can be a device name, an UDI, or 'all'. This option must be given in addition to a hardware probing option.

--show-config UDI

Show saved config data for a particular device.

--map

If disk names have changed (e.g. after a kernel update) this prints a list of disk name mappings. Note that you must have used --save-config at some point before for this can work.

--debug N

Set debug level to N. The debug info is shown only in the log file. If you specify a log file, the debug level is implicitly set to a reasonable value (N is a bitmask of individual flags).

--verbose

Increase verbosity. Only together with --map.

--log FILE

Write log info to FILE. Don't forget to also specify --<HARDWARE_ITEM> to trigger any device probing.

--dump-db N

Dump hardware data base. N is either 0 for the external data base in /var/lib/hardware, or 1 for the internal data base.

--version

Print libhd version.

--help

Print usage.

## ENVIRONMENT
hwprobe can hold a comma-separated list of probing flags preceded by '+' or '-' to be turned on or off. To get a complete list of supported flags, run 'hwinfo -all' (note: not '--all') and look at the top of the output.

hwinfo also looks at /proc/cmdline for a hwprobe option.

## EXAMPLES
- show all disks

hwinfo --disk

- just an overview

hwinfo --short --block

- show a particular disk

hwinfo --disk --only /dev/sdb

- save disk config state

hwinfo --disk --save-config=all

- try 4 graphics card ports for monitor data (default: 3)

hwprobe=bios.ddc.ports=4 hwinfo --monitor

- monitor detection runs the Video BIOS to get the monitor data; dump a complete BIOS code execution trace to the log

hwprobe=bios.ddc.ports=1,x86emu=trace:dump:trace.only=0:dump.only=0 hwinfo --monitor --log=foo

## FILES
/var/lib/hardware/hd.ids

External hardware data base (in readable text form). Try the --dump-db option to see the format.

/var/lib/hardware/udi

Directory where persistent config data are stored (see --save-config option).

## BUGS
Not all hardware can be detected.

## SEE ALSO
More documentation in /usr/share/doc/packages/hwinfo.

Source repository: git://git.opensuse.org/projects/hwinfo.git.

branch: sisyphus


eeprog

title: eeprog(8)

text:
# eeprog(8)

## NAME
eeprog - reads and writes 24Cxx EEPROMs connected to I2C serial bus

## SYNOPSIS
eeprog [-fqxdh] [-16|-8] [-r addr[:count]|-w addr] <device> <i2c-addr>

## DESCRIPTION
eeprog uses the SMBus protocol used by most of the recent chipsets.

## NOTE
Don't forget to load your i2c chipset and the i2c-dev drivers.

The following environment variables could be set instead of the command line arguments:

EEPROG_DEV device

EEPROG_I2C_ADDR i2c-addr

## PARAMETERS
Address modes

-8

Use 8bit address mode for 24c0x...24C16 [default]

-16

Use 16bit address mode for 24c32...24C256

Actions

-r addr[:count]

Read count (1 if omitted) bytes from addr and print them to the standard output

-w addr

Write input (stdin) at address addr of the EEPROM

-h

Print this help

Options

-x

Set hex output mode

-d

Dummy mode, display what *would* have been done

-f

Disable warnings and don't ask confirmation

-q

Quiet mode

Bus

device

Device file representing the I2C bus (eg. /dev/i2c-0)

i2c-addr

I2C bus address of the EEPROM (eg. 0x3A)

## EXAMPLES
Read 64 bytes from the EEPROM at address 0x54 on bus 0 starting at address 123 (decimal)

eeprog /dev/i2c-0 0x54 -r 123:64

Print the hex codes of the first 32 bytes read from bus 1 at address 0x22

eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20

Write the current timestamp at address 0x200 of the EEPROM on bus 0 at address 0x33

date | eeprog -f /dev/i2c-0 0x33 -w 0x200

## AUTHOR
Stefano Barbato


title: i2c-stub-from-dump(8)

summary: feed i2c-stub with dump files

text:
# i2c-stub-from-dump(8)

## NAME
i2c-stub-from-dump - feed i2c-stub with dump files

## SYNOPSIS
i2c-stub-from-dump address[,address,...] dump-file [dump-file ...]

## DESCRIPTION
i2c-stub-from-dump is a small helper script for the i2c-stub kernel driver. It lets you setup one or more fake I2C chips on the i2c-stub bus based on dumps of the chips you want to emulate.

i2c-stub-from-dump requires i2cdetect and i2cset to be installed and reachable through the user's PATH. The former is used to find out the i2c-stub bus number, while the latter is used to write to the fake I2C chips.

## EXAMPLE
You have an I2C chip on system A. You would like to do some development on its driver on system B. Here are the few steps you have to follow.

On system A, use i2cdump to capture a dump from the chip. Assuming that the chip in question lives at address 0x4c on I2C bus 0, you would run:

i2cdump -y 0 0x4c b > chip.dump

Adjust the bus number and chip address for your case. i2cdetect can help you find out their values. If the device uses word (16-bit) register access instead of the traditional byte (8-bit) access, use mode w instead of b.

Copy the dump file to system B.

On system B, run:

i2c-stub-from-dump 0x4c chip.dump

This will load the required i2c-dev and i2c-stub kernel drivers if needed, then write all the register values to the emulated I2C chip at address 0x4c. Again, adjust the address as needed.

## LIMITATIONS
There are some limitations to the kind of devices that can be handled:

•

Device must not have banks (as most Winbond devices do).

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

## SEE ALSO
i2cdump(8), i2cdetect(8), i2cset(8)

## AUTHOR
Jean Delvare


title: i2cdetect(8)

summary: detect I2C chips

text:
# i2cdetect(8)

## NAME
i2cdetect - detect I2C chips

## SYNOPSIS
i2cdetect [-y] [-a] [-q|-r] i2cbus [first last]

i2cdetect -F i2cbus

i2cdetect -V

i2cdetect -h

i2cdetect -l

## DESCRIPTION
i2cdetect is a userspace program to scan an I2C bus for devices. It outputs a table with the list of detected devices on the specified bus. i2cbus indicates the number or name of the I2C bus to be scanned, and should correspond to one of the busses listed by i2cdetect -l. The optional parameters first and last restrict the scanning range (default: from 0x08 to 0x77).

As there is no standard I2C detection command, i2cdetect uses arbitrary SMBus commands (namely SMBus quick write and SMBus receive byte) to probe for devices. By default, the command used is the one believed to be the safest for each address. See options -q and -r to change this behavior.

i2cdetect can also be used to query the functionalities of an I2C bus (see option -F.)

## WARNING
This program can confuse your I2C bus, cause data loss and worse!

## INTERPRETING THE OUTPUT
Each cell in the output table will contain one of the following symbols:

- "--". The address was probed but no chip answered.

- "UU". Probing was skipped, because this address is currently in use by a driver. This strongly suggests that there is a chip at this address.

- An address number in hexadecimal, e.g. "2d" or "4e". A chip was found at this address.

## OPTIONS
-y

Disable interactive mode. By default, i2cdetect will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the operation directly. This is mainly meant to be used in scripts.

-a

Force scanning of non-regular addresses. Not recommended.

-q

Use SMBus "quick write" command for probing. Not recommended. This is known to corrupt the Atmel AT24RF08 EEPROM found on many IBM Thinkpad laptops.

-r

Use SMBus "receive byte" command for probing. Not recommended. This is known to lock SMBus on various write-only chips (most notably clock chips at address 0x69).

-F

Display the list of functionalities implemented by the adapter and exit.

-V

Display the version and exit.

-h

Display the help and exit.

-l

Output a list of installed busses.

## EXAMPLES
List all available I2C busses:

```
# i2cdetect -l
```

```

```

Immediately scan the standard addresses on I2C bus 9 (i2c-9), using the default method for each address (no user confirmation):

```
# i2cdetect -y 9
```

```

```

Query the functionalities of I2C bus 1 (i2c-1):

```
# i2cdetect -F 1
```

```

```

Scan addresses 0x10 to 0x17 on the I2C bus named "SMBus I801 adapter at efa0", using the "receive byte" method, after user confirmation:

```
# i2cdetect -r "SMBus I801 adapter at efa0" 0x10 0x17
```

```

```

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

## SEE ALSO
i2cdump(8), i2cget(8), i2cset(8), i2ctransfer(8), sensors-detect(8)

## AUTHOR
Frodo Looijaard, Mark D. Studebaker and Jean Delvare

This manual page was originally written by Aurelien Jarno <aurel32@debian.org>, for the Debian GNU/Linux system.


title: i2cdump(8)

summary: examine I2C registers

text:
# i2cdump(8)

## NAME
i2cdump - examine I2C registers

## SYNOPSIS
i2cdump [-f] [-r first-last] [-y] [-a] i2cbus address [mode [bank [bankreg]]]

i2cdump -V

i2cdump -h

## DESCRIPTION
i2cdump is a small helper program to examine registers visible through the I2C bus.

## OPTIONS
-V

Display the version and exit.

-h

Display the help and exit.

-f

Force access to the device even if it is already busy. By default, i2cdump will refuse to access a device which is already under the control of a kernel driver. Using this flag is dangerous, it can seriously confuse the kernel driver in question. It can also cause i2cdump to return invalid results. So use at your own risk and only if you know what you're doing.

-r first-last

Limit the range of registers being accessed. This option is not available with mode s. For mode W, first must be even and last must be odd.

-y

Disable interactive mode. By default, i2cdump will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the operation directly. This is mainly meant to be used in scripts.

-a

Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.

At least two options must be provided to i2cdump. i2cbus indicates the number or name of the I2C bus to be scanned. This number should correspond to one of the busses listed by i2cdetect -l. address indicates the address to be scanned on that bus, and is an integer between 0x08 and 0x77.

The mode parameter, if specified, is one of the letters b, w, or i, corresponding to a read size of a single byte, a 16-bit word, an I2C block, respectively. The c mode is a little different, it reads all bytes consecutively, and is useful for chips that have an address auto-increment feature, such as EEPROMs. The W mode is also special, it is similar to w except that a read command will only be issued on even register addresses; this is again mainly useful for EEPROMs.

A p can also be appended to the mode parameter (except for i and W) to enable PEC. If the mode parameter is omitted, i2cdump defaults to byte access without PEC.

The bank and bankreg parameters are useful on the W83781D and similar chips (at the time of writing, all Winbond and Asus chips). bank is an integer between 0 and 7, and bankreg is an integer between 0x00 and 0xFF (default value: 0x4E). The W83781D data sheet has more information on bank selection.

## WARNING
i2cdump can be dangerous if used improperly. Most notably, the c mode starts with WRITING a byte to the chip. On most chips it will be stored in the address pointer register, which is OK, but some chips with a single register or no (visible) register at all will most likely see this as a real WRITE, resulting in possible misbehavior or corruption. Do not use i2cdump on random addresses. Anyway, it is of little use unless you have good knowledge of the chip you're working with and an idea of what you are looking for.

## EXAMPLES
Dump the whole contents of I2C device at 7-bit address 0x50 on bus 9 (i2c-9), using the default read method (byte mode), after user confirmation:

```
# i2cdump 9 0x50
```

```

```

Immediately dump the whole contents of I2C device at 7-bit address 0x50 on bus 9 (i2c-9), using I2C block read transactions (no user confirmation):

```
# i2cdump -y 9 0x50 i
```

```

```

If the device is an EEPROM, the output would typically be the same as output of the previous example.

Dump registers 0x00 to 0x3f of the I2C device at 7-bit address 0x2d on bus 1 (i2c-1), using the default read method (byte mode), after user confirmation:

```
# i2cdump -r 0x00-0x3f 1 0x2d
```

```

```

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

SMBus block mode used to be supported by this tool. Please use i2cget instead.

## SEE ALSO
i2cdetect(8), i2cget(8), i2cset(8), i2ctransfer(8), isadump(8)

## AUTHOR
Frodo Looijaard, Mark D. Studebaker and Jean Delvare

This manual page was originally written by David Z Maze <dmaze@debian.org> for the Debian GNU/Linux system.


title: i2cget(8)

summary: read from I2C/SMBus chip registers

text:
# i2cget(8)

## NAME
i2cget - read from I2C/SMBus chip registers

## SYNOPSIS
i2cget [-f] [-y] [-a] i2cbus chip-address [data-address [mode [length]]]

i2cget -V

i2cget -h

## DESCRIPTION
i2cget is a small helper program to read registers visible through the I2C bus (or SMBus).

## OPTIONS
-V

Display the version and exit.

-h

Display the help and exit.

-f

Force access to the device even if it is already busy. By default, i2cget will refuse to access a device which is already under the control of a kernel driver. Using this flag is dangerous, it can seriously confuse the kernel driver in question. It can also cause i2cget to return an invalid value. So use at your own risk and only if you know what you're doing.

-y

Disable interactive mode. By default, i2cget will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the operation directly. This is mainly meant to be used in scripts. Use with caution.

-a

Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.

There are two required options to i2cget. i2cbus indicates the number or name of the I2C bus to be scanned. This number should correspond to one of the busses listed by i2cdetect -l. chip-address specifies the address of the chip on that bus, and is an integer between 0x08 and 0x77.

data-address specifies the address on that chip to read from, and is an integer between 0x00 and 0xFF. If omitted, the currently active register will be read (if that makes sense for the considered chip).

The mode parameter, if specified, is one of the letters b, w, c, s, or i, corresponding to a read byte data, a read word data, a write byte/read byte, an SMBus block read, or an I2C block read transaction, respectively. A p can also be appended to the mode parameter to enable PEC, except for I2C block transactions. If the mode parameter is omitted, i2cget defaults to a read byte data transaction, unless data-address is also omitted, in which case the default (and only valid) transaction is a single read byte.

The length parameter, if applicable and specified, sets the length of the block transaction. Valid values are between 1 and 32. Default value is 32.

## WARNING
i2cget can be extremely dangerous if used improperly. I2C and SMBus are designed in such a way that an SMBus read transaction can be seen as a write transaction by certain chips. This is particularly true if setting mode to cp (write byte/read byte with PEC). Be extremely careful using this program.

## EXAMPLES
Get the value of 8-bit register 0x11 of the I2C device at 7-bit address 0x2d on bus 1 (i2c-1), after user confirmation:

```
# i2cget 1 0x2d 0x11
```

```

```

Get the value of 16-bit register 0x00 of the I2C device at 7-bit address 0x48 on bus 1 (i2c-1), after user confirmation:

```
# i2cget 1 0x48 0x00 w
```

```

```

Set the internal pointer register of a 24C02 EEPROM at 7-bit address 0x50 on bus 9 (i2c-9) to 0x00, then read the first 2 bytes from that EEPROM:

```
# i2cset -y 9 0x50 0x00 ; i2cget -y 9 0x50 ; i2cget -y 9 0x50
```

```

```

This assumes that the device automatically increments its internal pointer register on every read, and supports read byte transactions (read without specifying the register address, "Receive Byte" in SMBus terminology.) Most EEPROM devices behave that way. Note that this is only safe as long as nobody else is accessing the I2C device at the same time. A safer approach would be to use a "Read Word" SMBus transaction instead, or an I2C Block Read transaction to read more than 2 bytes.

Set the internal pointer register of a 24C32 EEPROM at 7-bit address 0x53 on bus 9 (i2c-9) to 0x0000, then read the first 2 bytes from that EEPROM:

```
# i2cset -y 9 0x53 0x00 0x00 ; i2cget -y 9 0x53 ; i2cget -y 9 0x53
```

```

```

This again assumes that the device automatically increments its internal pointer register on every read, and supports read byte transactions. While the previous example was for a small EEPROM using 8-bit internal addressing, this example is for a larger EEPROM using 16-bit internal addressing. Beware that running this command on a small EEPROM using 8-bit internal addressing would actually write 0x00 to the first byte of that EEPROM. The safety concerns raised above still stand, however in this case there is no SMBus equivalent, so this is the only way to read data from a large EEPROM if your master isn't fully I2C capable. With a fully I2C capable master, you would use i2ctransfer to achieve the same in a safe and faster way. Read the first 8 bytes of an EEPROM device at 7-bit address 0x50 on bus 4 (i2c-4):

```
# i2cget -y 4 0x50 0x00 i 8
```

```

```

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

## SEE ALSO
i2cdetect(8), i2cdump(8), i2cset(8), i2ctransfer(8)

## AUTHOR
Jean Delvare

This manual page was strongly inspired from those written by David Z Maze for i2cset.


title: i2cset(8)

summary: set I2C registers

text:
# i2cset(8)

## NAME
i2cset - set I2C registers

## SYNOPSIS
i2cset [-f] [-y] [-m mask] [-r] [-a] i2cbus chip-address data-address [value] ... [mode]

i2cset -V

i2cset -h

## DESCRIPTION
i2cset is a small helper program to set registers visible through the I2C bus.

## OPTIONS
-V

Display the version and exit.

-h

Display the help and exit.

-f

Force access to the device even if it is already busy. By default, i2cset will refuse to access a device which is already under the control of a kernel driver. Using this flag is dangerous, it can seriously confuse the kernel driver in question. It can also cause i2cset to silently write to the wrong register. So use at your own risk and only if you know what you're doing.

-y

Disable interactive mode. By default, i2cset will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the operation directly. This is mainly meant to be used in scripts.

-m mask

The mask parameter, if specified, describes which bits of value will be actually written to data-address. Bits set to 1 in the mask are taken from value, while bits set to 0 will be read from data-address and thus preserved by the operation. Please note that this parameter assumes that the read and write operations for the specified mode are symmetrical for the device you are accessing. This may or may not be the case, as neither I2C nor SMBus guarantees this.

-r

Read back the value right after writing it, and compare the result with the value written. This used to be the default behavior. The same limitations apply as those of option -m.

-a

Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.

There are three required options to i2cset. i2cbus indicates the number or name of the I2C bus to be scanned. This number should correspond to one of the busses listed by i2cdetect -l. chip-address specifies the address of the chip on that bus, and is an integer between 0x08 and 0x77. data-address specifies the address on that chip to write to, and is an integer between 0x00 and 0xFF.

The value parameter, if specified, is the value to write to that location on the chip. If this parameter is omitted, then a short write is issued. For most chips, it simply sets an internal pointer to the target location, but doesn't actually write to that location. For a few chips though, in particular simple ones with a single register, this short write is an actual write. If the mode parameter is s or i, multiple values can be specified.

The mode parameter, if specified, is one of the letters b, w, s, or i, corresponding to a write size of a single byte, a 16-bit word, a SMBus block write, or an I2C block write, respectively. For SMBus and I2C block writes, the write size is determined by the number of value parameters. Except for I2C block writes, a p can also be appended to the mode parameter to enable PEC. If the mode parameter is omitted, i2cset defaults to byte mode without PEC. The value provided must be within range for the specified data type (0x00-0xFF for byte and block writes, 0x0000-0xFFFF for words). Another possible mode is c, which doesn't write any value (so-called short write). You usually don't have to specify this mode, as it is the default when no value is provided, unless you also want to enable PEC.

## WARNING
i2cset can be extremely dangerous if used improperly. It can confuse your I2C bus, cause data loss, or have more serious side effects. Writing to a serial EEPROM on a memory DIMM (chip addresses between 0x50 and 0x57) may DESTROY your memory, leaving your system unbootable! Be extremely careful using this program.

## EXAMPLES
Write value 0x42 to 8-bit register 0x11 of the I2C device at 7-bit address 0x2d on bus 1 (i2c-1), after user confirmation:

```
# i2cset 1 0x2d 0x11 0x42
```

```

```

Immediately clear the 3 least significant bits of 8-bit register 0x11 of the I2C device at 7-bit address 0x2d on bus 1 (i2c-1) (no user confirmation):

```
# i2cset -y -m 0x07 1 0x2d 0x11 0x00
```

```

```

Write value 0x5000 to 16-bit register 0x02 of the I2C device at 7-bit address 0x48 on bus 1 (i2c-1), after user confirmation:

```
# i2cset 1 0x48 0x02 0x5000 w
```

```

```

Also see i2cget(8) for examples of combined usage of i2cset and i2cget.

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

## SEE ALSO
i2cdetect(8), i2cdump(8), i2cget(8), i2ctransfer(8), isaset(8)

## AUTHOR
Frodo Looijaard, Mark D. Studebaker and Jean Delvare

This manual page was originally written by David Z Maze <dmaze@debian.org> for the Debian GNU/Linux system.


title: i2ctransfer(8)

text:
# i2ctransfer(8)

## NAME
i2ctransfer - send user-defined I2C messages in one transfer

## SYNOPSIS
i2ctransfer [-a] [-b] [-f] [-v] [-y] i2cbus desc [data] [desc [data]] ...

i2ctransfer -h

i2ctransfer -V

## DESCRIPTION
i2ctransfer is a program to create I2C messages and send them combined as one transfer. For read messages, the contents of the received buffers are printed to stdout, one line per read message.

Please note the difference between a transfer and a message here. A transfer may consist of multiple messages and is started with a START condition and ends with a STOP condition as described in the I2C specification. Messages within the transfer are concatenated using the REPEATED START condition which is described there as well. There are some advantages of having multiple messages in one transfer. First, some devices keep their internal states for REPEATED START but reset them after a STOP. Second, you cannot get interrupted during one transfer, but it might happen between multiple transfers. Interruption could happen on hardware level by another I2C master on the bus, or at software level by another I2C user who got its transfer scheduled between yours. This program helps you to create proper transfers for your needs.

## OPTIONS
-a

Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. Not recommended.

-b

Print data from read messages as binary data. Disables -v (verbose). Useful for piping into a pretty printing tool like hexdump or for redirecting into a file to be analyzed later.

-f

Force access to the device even if it is already busy. By default, i2ctransfer will refuse to access a device which is already under the control of a kernel driver. Using this flag is dangerous, it can seriously confuse the kernel driver in question. It can also cause i2ctransfer to silently write to the wrong register. So use at your own risk and only if you know what you're doing.

-h

Display the help and exit.

-v

Enable verbose output. It will print infos about all messages sent, i.e. not only for read messages but also for write messages.

-V

Display the version and exit.

-y

Disable interactive mode. By default, i2ctransfer will wait for a confirmation from the user before messing with the I2C bus. When this flag is used, it will perform the operation directly. This is mainly meant to be used in scripts.

## ARGUMENTS
The first parameter i2cbus indicates the number or name of the I2C bus to be used. This number should correspond to one of the busses listed by i2cdetect -l.

The next parameter is one or multiple desc blocks. The number of blocks is limited by the Linux Kernel and defined by I2C_RDWR_IOCTL_MAX_MSGS (42 as of v4.10). desc blocks are composed like this:

{r|w}<length_of_message>[@address]

{r|w}

specifies if the message is read or write

<length_of_message>

specifies the number of bytes read or written in this message. It is parsed as an unsigned 16 bit integer, but note that the Linux Kernel applies an additional upper limit (8192 as of v4.10). For read messages to targets which support SMBus Block transactions, it can also be '?', then the target will determine the length.

[@address]

specifies the 7-bit address of the chip to be accessed for this message, and is an integer. If omitted, reuse the previous address. Normally, addresses outside the range of 0x08-0x77 and addresses with a kernel driver attached to them will be blocked. This can be overridden with -a (all) or -f (force). Be very careful when using these! 10-bit addresses are currently not supported at all.

If the I2C message is a write, then a data block with the data to be written follows. It consists of <length_of_message> bytes which can be marked with the usual prefixes for hexadecimal, octal, etc. To make it easier to create larger data blocks easily, the data byte can have a suffix.

=

keep value constant until end of message (i.e. 0= means 0, 0, 0, ...)

+

increase value by 1 until end of message (i.e. 0+ means 0, 1, 2, ...)

-

decrease value by 1 until end of message (i.e. 0xff- means 0xff, 0xfe, 0xfd, ...)

p

use value as seed for an 8 bit pseudo random sequence (i.e. 0p means 0x00, 0x50, 0xb0, ...)

## EXAMPLES
On bus 0, from an EEPROM at address 0x50, read 8 byte from offset 0x64 (first message writes one byte to set the memory pointer to 0x64, second message reads from the same chip):

```
# i2ctransfer 0 w1@0x50 0x64 r8
```

```

```

For the same EEPROM, at offset 0x42 write 0xff 0xfe ... 0xf0 (one write message; first byte sets the memory pointer to 0x42, 0xff is the first data byte, all following data bytes are decreased by one):

```
# i2ctransfer 0 w17@0x50 0x42 0xff-
```

```

```

## WARNING
i2ctransfer can be extremely dangerous if used improperly. It can confuse your I2C bus, cause data loss, or have more serious side effects. Writing to a serial EEPROM on a memory DIMM (chip addresses between 0x50 and 0x57) may DESTROY your memory, leaving your system unbootable! Be extremely careful using this program.

## BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de>.

## AUTHORS
Wolfram Sang, based on i2cget by Jean Delvare

This manual page was originally written by Wolfram Sang based on the manual for i2cset by David Z Maze <dmaze@debian.org>.

## SEE ALSO
i2cdetect(8),i2cdump(8),i2cget(8),i2cset(8)


ibacm

package: ibacm

title: ibacm(8)

text:
# ibacm(8)

## NAME
ibacm - address and route resolution services for InfiniBand.

## SYNOPSIS

```
ibacm [-D] [-P] [-A addr_file] [-O option_file]
```

## DESCRIPTION
The IB ACM implements and provides a framework for name, address, and route (path) resolution services over InfiniBand. It is intended to address connection setup scalability issues running MPI applications on large clusters. The IB ACM provides information needed to establish a connection, but does not implement the CM protocol.

A primary user of the ibacm service is the librdmacm library. This enables applications to make use of the ibacm service without code changes or needing to be aware that the service is in use. librdmacm versions 1.0.12 - 1.0.15 can invoke IB ACM services when built using the --with-ib_acm option. Version 1.0.16 and newer of librdmacm will automatically use the IB ACM if it is installed. The IB ACM services tie in under the rdma_resolve_addr, rdma_resolve_route, and rdma_getaddrinfo routines. For maximum benefit, the rdma_getaddrinfo routine should be used, however existing applications should still see significant connection scaling benefits using the calls available in librdmacm 1.0.11 and previous releases.

The IB ACM is focused on being scalable, efficient, and extensible. It implements a plugin architecture that allows a vendor to supply its proprietary provider in addition to the default provider. The current default provider implementation ibacmp limits network traffic, SA interactions, and centralized services. Ibacmp supports multiple resolution protocols in order to handle different fabric topologies.

The IB ACM package is comprised of three components: the ibacm core service, the default provider ibacmp shared library, and a test/configuration utility - ib_acme. All three are userspace components and are available for Linux. Additional details are given below.

## OPTIONS
-D

run in daemon mode (default)

-P

run as standard process

-A addr_file

address configuration file

-O option_file

option configuration file

--systemd

Enable systemd integration. This includes optional socket activation of the daemon's listening socket.

## QUICK START GUIDE
1. Prerequisites: libibverbs and libibumad must be installed. The IB stack should be running with IPoIB configured. These steps assume that the user has administrative privileges.

2. Install the IB ACM package. This installs ibacm, ibacmp, ib_acme, and init.d scripts.

3. Run 'ibacm' as administrator to start the ibacm daemon.

4. Optionally, run 'ib_acme -d <dest_ip> -v' to verify that the ibacm service is running.

5. Install librdmacm, using the build option --with-ib_acm if needed. This build option is not needed with librdmacm 1.0.17 or newer. The librdmacm will automatically use the ibacm service. On failures, the librdmacm will fall back to normal resolution.

6. You can use ib_acme -P to gather performance statistics from the local ibacm daemon to see if the service is working correctly. Similarly, the command ib_acme -e could be used to enumerate all endpoints created by the local ibacm service.

## NOTES
ib_acme:

The ib_acme program serves a dual role. It acts as a utility to test ibacm operation and help verify if the ibacm service and selected protocol is usable for a given cluster configuration. Additionally, it automatically generates ibacm configuration files to assist with or eliminate manual setup.

ibacm configuration files:

The ibacm service relies on two configuration files.

The ibacm_addr.cfg file contains name and address mappings for each IB <device, port, pkey> endpoint. Although the names in the ibacm_addr.cfg file can be anything, ib_acme maps the host name to the IB endpoints. IP addresses, on the other hand, are assigned dynamically. If the address file cannot be found, the ibacm service will attempt to create one using default values.

The ibacm_opts.cfg file provides a set of configurable options for the ibacm core service and default provider, such as timeout, number of retries, logging level, etc. ib_acme generates the ibacm_opts.cfg file using static information. If an option file cannot be found, ibacm will use default values.

ibacm:

The ibacm service is responsible for resolving names and addresses to InfiniBand path information and caching such data. It should execute with administrative privileges.

The ibacm implements a client interface over TCP sockets, which is abstracted by the librdmacm library. One or more providers can be loaded by the core service, depending on the configuration. In the default provider ibacmp, one or more back-end protocols are used to satisfy user requests. Although ibacmp supports standard SA path record queries on the back-end, it also supports a resolution protocol based on multicast traffic. The latter is not usable on all fabric topologies, specifically ones that may not have reversible paths or fabrics using torus routing. Users should use the ib_acme utility to verify that multicast protocol is usable before running other applications.

Conceptually, the default provider ibacmp implements an ARP like protocol and either uses IB multicast records to construct path record data or queries the SA directly, depending on the selected route protocol. By default, the ibacmp provider uses and caches SA path record queries.

Specifically, all IB endpoints join a number of multicast groups. Multicast groups differ based on rates, mtu, sl, etc., and are prioritized. All participating endpoints must be able to communicate on the lowest priority multicast group. The ibacmp assigns one or more names/addresses to each IB endpoint using the ibacm_addr.cfg file. Clients provide source and destination names or addresses as input to the service, and receive as output path record data.

The service maps a client's source name/address to a local IB endpoint. If the destination name/address is not cached locally in the default provider, it sends a multicast request out on the lowest priority multicast group on the local endpoint. The request carries a list of multicast groups that the sender can use. The recipient of the request selects the highest priority multicast group that it can use as well and returns that information directly to the sender. The request data is cached by all endpoints that receive the multicast request message. The source endpoint also caches the response and uses the multicast group that was selected to construct or obtain path record data, which is returned to the client.

The current implementation of the provider ibacmp has several additional restrictions:

- The ibacmp is limited in its handling of dynamic changes. ibacm must be stopped and restarted if a cluster is reconfigured.

- Support for IPv6 has not been verified.

- The number of multicast groups that an endpoint can support is limited to 2.

The ibacmp contains several internal caches. These include caches for GID and LID destination addresses. These caches can be optionally preloaded. ibacm supports the OpenSM dump_pr plugin "full" PathRecord format which is used to preload these caches. The file format is specified in the ibacm_opts.cfg file via the route_preload setting which should be set to full_opensm_v1 for this file format. Default format is none which does not preload these caches. See dump_pr.notes.txt in dump_pr for more information on the full_opensm_v1 file format and how to configure OpenSM to generate this file.

Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using the addr_preload option. The default is none which does not preload these caches. To preload these caches, set this option to acm_hosts and configure the addr_data_file appropriately.

## SEE ALSO
ibacm(7), ib_acme(1), rdma_cm(7)


title: icinga2(8)

summary: The Icinga 2 network monitoring daemon

text:
# icinga2(8)

## NAME
icinga2 - The Icinga 2 network monitoring daemon

## SYNOPSIS
icinga2 command [ command options ][ global options ]

command := [ api | ca | console | daemon | feature | node | object | pki | variable ] --help

## DESCRIPTION
Icinga 2 is an open source monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting.

Scalable and extensible, Icinga 2 can monitor large, complex environments across multiple locations.

## OPTIONS
Details for specific command options can be viewed by invoking the command name with --help parameter.

### Global options
-h,--help

Show this help message.

-V,--version

Show version information.

--color

Use VT100 color codes even when stdout is not a terminal.

-D, --define arg

Define a constant.

-l, --library arg

Load a library.

-I, --include arg

Add include search directory.

-x, --log-level [ debug | notice | information | warning | critical ]

Specify the log level for the console log, default is information.

-X, --script-debugger

Enables the script debugger. When an exception occurs or the 'debugger' keyword is encountered in a user script Icinga 2 launches the script debugger that allows the user to debug the script.

### daemon options
The CLI command daemon provides the functionality to start/stop Icinga 2. Furthermore it provides the configuration validation.

-c, --config arg

Using this option you can specify one or more configuration files. Config files are processed in the order they are specified on the command-line. When no configuration file is specified and the --no-config is not used, Icinga 2 automatically falls back to using the configuration file ConfigDir + /icinga2.conf (where ConfigDir is usually /etc/icinga2).

-z, --noconfig

Start without a configuration file.

-C, --validate

This option can be used to check if your configuration files contain errors. If any errors are found the exit status is 1, otherwise 0 is returned.

-e, --errorlog arg

Log fatal errors to the specified log file (only works in combination with --daemonize).

-d, --daemonize

Detach from the controlling terminal.

## REPORTING BUGS
Report bugs at <https://github.com/Icinga/icinga2>

Icinga home page: <https://icinga.com/>

## COPYRIGHT
Copyright © 2012 Icinga GmbH License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl-3.0.html>

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


genccode

package: icu-utils

title: genccode(8)

text:
# genccode(8)

## NAME
genccode - generate C or platform specific assembly code from an ICU data file.

## SYNOPSIS
genccode [ -h, -?, --help ] [ -a, --assembly name ] [ -d, --destdir destination ] [ -n, --name name ] [ -e, --entrypoint name ] [ -f, --filename name ] [ filename ... ]

## DESCRIPTION
genccode reads each of the supplied filename and writes out a C file containing a compilable definition of the data in the data file. The C file name is made by taking the base name of the data filename, replacing dots by underscores, and adding a .c file extension.

If the -a option is used, platform specific assembly code is generated instead of C code. Most C compilers will accept both C and assembly files. Instead of writing a filename with a .c file extension, a filename with a .s will be written instead.

If genccode is called with no filename it terminates gracefully.

## OPTIONS
-h, -?, --help

Print help about usage and exit.

-a, --assembly name

Output assembly code instead of C code. Use -h to see the list of available types of assembly to generate and to specify for this option.

-d, --destdir destination

Set the destination directory to destination. The default destination directory is the current directory.

-n, --name name

Set the data name to name instead of the default. This name is also used as the base name of the output. The default name is made of the icudt prefix, followed by a two-digit version number corresponding to the current version of the ICU release, and a single letter indicating the endianness of the data (the letter b indicated big endian data, and the letter l indicates little endian ones).

-f, --filename name

Normally, an ICU data file such as mydata.icu will be turned into mydata_icu.c and mydata_icu.o. However, if this parameter was set to "somedata", the output files will be somedata.o and somedata.c, respectively.

-e, --entrypoint name

Set the data entry point (used for linking against the data in a shared library form) to name. The default entry point name is made of the data (set by the -n, --name option) followed by an underscore and the type of the data (set by the -t, --type option).

## VERSION
76.1

## COPYRIGHT
Copyright (C) 2000-2004 IBM, Inc. and others.


gencmn

title: gencmn(8)

text:
# gencmn(8)

## NAME
gencmn - generate an ICU memory-mappable data file

## SYNOPSIS
gencmn [ -h, -?, --help ] [ -v, --verbose ] [ -c, --copyright | -C, --comment comment ] [ -d, --destdir destination ] [ -n, --name name ] [ -t, --type fileext ] [ -S, --source ] [ -e, --entrypoint name ] maxsize [ listfilename ]

## DESCRIPTION
gencmn takes a set of files and packages them as an ICU memory-mappable data file. The resulting data file can then be used directly by ICU.

gencmn reads a list of files to be packaged from either the supplied listfilename file, or from its standard output. It packages all the files from the list that are not bigger than maxsize bytes, except if maxsize is 0, which indicates that there is no size limit on files.

## OPTIONS
-h, -?, --help

Print help about usage and exit.

-v, --verbose

Display extra informative messages during execution.

-c,--copyright

Include the ICU copyright notice in the resulting data.

-C, --comment comment

Include the specified comment in the resulting data instead of the ICU copyright notice.

-d, --destdir destination

Set the destination directory to destination. The default destination directory is specified by the environment variable ICU_DATA.

-n, --name name

Set the data name to name instead of the default. This name is also used as the base name of the output. The default name is made of the icudt prefix, followed by a two-digit version number corresponding to the current version of the ICU release, and a single letter indicating the endianness of the data (the letter b indicated big endian data, and the letter l indicates little endian ones).

-t, --type type

Use type as the type of the data. This type is also used as the extension of the generated data file. The default type ie dat.

-S, --source

Write a C source file with the table of contents of the data.

-e, --entrypoint name

Set the data entry point (used for linking against the data in a shared library form) to name. The default entry point name is made of the data (set by the -n, --name option) followed by an underscore and the type of the data (set by the -t, --type option).

## ENVIRONMENT
ICU_DATA

Specifies the directory containing ICU data. Defaults to /usr/share/icu/76.1/. Some tools in ICU depend on the presence of the trailing slash. It is thus important to make sure that it is present if ICU_DATA is set.

## VERSION
76.1

## COPYRIGHT
Copyright (C) 2000-2001 IBM, Inc. and others.

## SEE ALSO
decmn(8)


gensprep

title: gensprep(8)

text:
# gensprep(8)

## NAME
gensprep - compile StringPrep data from files filtered by filterRFC3454.pl

## SYNOPSIS
gensprep [ -h, -?, --help ] [ -v, --verbose ] [ -c, --copyright ] [ -s, --sourcedir source ] [ -d, --destdir destination ]

## DESCRIPTION
gensprep reads filtered RFC 3454 files and compiles their information into a binary form. The resulting file, <name>.icu, can then be read directly by ICU, or used by pkgdata(8) for incorporation into a larger archive or library.

The files read by gensprep are described in the FILES section.

## OPTIONS
-h, -?, --help

Print help about usage and exit.

-v, --verbose

Display extra informative messages during execution.

-c, --copyright

Include a copyright notice into the binary data.

-s, --sourcedir source

Set the source directory to source. The default source directory is specified by the environment variable ICU_DATA.

-d, --destdir destination

Set the destination directory to destination. The default destination directory is specified by the environment variable ICU_DATA.

## ENVIRONMENT
ICU_DATA

Specifies the directory containing ICU data. Defaults to /usr/share/icu/76.1/. Some tools in ICU depend on the presence of the trailing slash. It is thus important to make sure that it is present if ICU_DATA is set.

## FILES
The following files are read by gensprep and are looked for in the source /misc for rfc3454_*.txt files and in source /unidata for NormalizationCorrections.txt.

rfc3453_A_1.txt

Contains the list of unassigned codepoints in Unicode version 3.2.0....

rfc3454_B_1.txt

Contains the list of code points that are commonly mapped to nothing....

rfc3454_B_2.txt

Contains the list of mappings for casefolding of code points when Normalization form NFKC is specified....

rfc3454_C_X.txt

Contains the list of code points that are prohibited for IDNA.

NormalizationCorrections.txt

Contains the list of code points whose normalization has changed since Unicode Version 3.2.0.

## VERSION
76.1

## COPYRIGHT
Copyright (C) 2000-2002 IBM, Inc. and others.

## SEE ALSO
pkgdata(8)


icupkg

title: icupkg(8)

summary: extract or modify an ICU

text:
# icupkg(8)

## NAME
icupkg - extract or modify an ICU .dat archive

## SYNOPSIS
icupkg [ -h, -?, --help ] [ -tl, --type l | -tb, --type b | -te, --type e ] [ -c, --copyright | -C, --comment comment ] [ -a, --add list ] [ -r, --remove list ] [ -x, --extract list ] [ -l, --list ] [ -s, --sourcedir source ] [ -d, --destdir destination ] [ -w, --writepkg ] [ -m, --matchmode mode ] infilename [ outfilename ]

## DESCRIPTION
icupkg reads the input ICU .dat package file, modify it according to the options, swap it to the desired platform properties (charset & endianness), and optionally write the resulting ICU .dat package to the output file. Items are removed, then added, then extracted and listed. An ICU .dat package is written if items are removed or added, or if the input and output filenames differ, or if the -w, --writepkg option is set.

If the input filename is "new" then an empty package is created. If the output filename is missing, then it is automatically generated from the input filename. If the input filename ends with an l, b, or e matching its platform properties, then the output filename will contain the letter from the -t, --type option.

This tool can also be used to just swap a single ICU data file, replacing the former icuswap tool. For this mode, provide the infilename (and optional outfilename) for a non-package ICU data file. Allowed options include -t, -w, -s and -d The filenames can be absolute, or relative to the source/dest dir paths. Other options are not allowed in this mode.

## OPTIONS
-h, -?, --help

Print help about usage and exit.

-tl, --type l

Output for little-endian/ASCII charset family. The output type defaults to the input type.

-tb, --type b

Output for big-endian/ASCII charset family. The output type defaults to the input type.

-te, --type e

Output for big-endian/EBCDIC charset family. The output type defaults to the input type.

-c,--copyright

Include the ICU copyright notice in the resulting data.

-C, --comment comment

Include the specified comment in the resulting data instead of the ICU copyright notice.

-a, --add list

Add items from the list to the package. The list can be a single filename with a .txt file extension containing a list of item filenames, or an ICU .dat package filename.

-r, --remove list

Remove items from the list from the package. The list can be a single filename with a .txt file extension containing a list of item filenames, or an ICU .dat package filename.

-x, --extract list

Extract items from the list from the package. The list can be a single filename with a .txt file extension containing a list of item filenames, or an ICU .dat package filename.

-m, --matchmode mode

Set the matching mode for item names with wildcards.

-s, --sourcedir source

Set the source directory to source. The default source directory is the current directory.

-d, --destdir destination

Set the destination directory to destination. The default destination directory is the current directory.

-l, --list

List the package items to stdout (after modifying the package).

## LIST FILE SYNTAX
Items are listed on one or more lines and separated by whitespace (space+tab). Comments begin with # and are ignored. Empty lines are ignored. Lines where the first non-whitespace character is one of "%&'()*+,-./:;<=>?_ are also ignored to reserve for future syntax.

Items for removal or extraction may contain a single * wildcard character. The * matches zero or more characters. If -m, --matchmode noslash is set, then the * character does not match the / character.

Items must be listed relative to the package, and the --sourcedir or the --destdir path will be prepended. The paths are only prepended to item filenames while adding or extracting items, not to ICU .dat package or list filenames.

Paths may contain / instead of the platform's file separator character and are converted as appropriate.

## AUTHORS
Markus Scherer

George Rhoten

## VERSION
1.0

## COPYRIGHT
Copyright (C) 2006 IBM, Inc. and others.

## SEE ALSO
pkgdata(1) genrb(1)


title: idle3ctl(8)

text:
# idle3ctl(8)

## NAME
idle3ctl - disable, get or set the idle3 timer on Western Digital HDD

## SYNOPSIS
idle3ctl [ flags ] [device] ..

## DESCRIPTION
idle3ctl can disable, get and set the value of the infamous idle3 timer found on recent Western Digital Hard Disk Drives. Idle3ctl can be used as an alternative to the official wdidle3.exe proprietary utility, without the need to reboot in a DOS environement. Idle3ctl is an independant project, unrelated in any way to Western Digital Corp.

THIS SOFTWARE IS EXPERIMENTAL, NOT WELL TESTED AND ACCESSES LOW LEVEL INFORMATION OF YOUR HARDDRIVE. USE AT YOUR OWN RISK.

## OPTIONS
When no flags are given, -g is assumed.

-h

Display help

-V

Show version and exit

-v

activate verbose output, mainly useful for debugging.

--force

force execution even if no Western Digital HDD are detected

-g

get raw idle3 timer value

-g100

get idle3 timer value as wdidle3 v1.00 would display it

-g103

get idle3 timer value as wdidle3 v1.03 would display it

-d

disable idle3 timer

-s<value>

set idle3 timer raw value. Value must be an integer between 1 and 255. The idle3 timer is set in 0.1s for the 1-128 range, and in 30s for the 129-255 range.

## BUGS
Please report any bugs on the sourceforge tracker at https://sourceforge.net/tracker/?group_id=329372&atid=1381968

## EXIT STATUS
idle3ctl will return zero on success and non zero on failure.

## AUTHOR
idle3ctl has been written by Christophe Bothamy <cbothamy at users.sf.net>.

## SEE ALSO
http://idle3-tools.sourceforce.net Idle3-tools website

http://www.wdc.com/

Western Digital website


ifplugd

package: ifplugd

title: ifplugd(8)

text:
# ifplugd(8)

## NAME
ifplugd - A link detection daemon for ethernet devices

## SYNOPSIS
ifplugd [options]

## DESCRIPTION
ifplugd is a daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with on-board network adapters, since it will only configure the interface when a cable is really connected.

It uses your distribution's native ifup/ifdown programs, but can be configured to do anything you wish when the state of the interface changes. It may ignore short unplugged whiles (-d option) or plugged whiles (-u option).

ifplugd may be used in "compatibility mode" by specifying -F on the command line. Than ifplugd will treat network drivers which do not support link beat querying as always online.

## OPTIONS
-a | --no-auto

Do not enable interface automatically (default: off)

-n | --no-daemon

Do not daemonize (for debugging) (default: off)

-s | --no-syslog

Do not use syslog, use stdout instead (for debugging) (default: off).

-b | --no-beep

Do not beep (off)

-f | --ignore-fail

Ignore detection failure, retry instead. Failure is treated as "no link". (default: off)

-F | --ignore-fail-positive

Ignore detection failure, retry instead. Failure is treated as "link detected". (default: off)

-i | --iface= IFACE

Specify ethernet interface (default: eth0)

-r | --run= EXEC

Specify program to execute when link status changes (default: /etc/ifplugd/ifplugd.action)

-I | --ignore-retval

Don't exit on nonzero return value of program executed on link change. (default: off)

-t | --poll-time= SECS

Specify poll time in seconds (default: 1)

-u | --delay-up= SECS

Specify delay for configuring interface (default: 0)

-d | --delay-down= SECS

Specify delay for deconfiguring interface (default: 5)

-m | --api-mode= MODE

Force a specific link beat detection ioctl() API. Possible values are auto, iff, wlan, ethtool, mii, and priv for automatic detection, interface flag (IFF_RUNNING), wireless extension, SIOCETHTOOL, SIOCGMIIREG resp. SIOCPRIV. Only the first character of the argument is relevant, case insensitive. (default: auto)

-p | --no-startup

Don't call the script to bring up network on deamon start (default: off)

-q | --no-shutdown

Don't call the script for network shutdown on deamon quit (default: off)

-w | --wait-on-fork

When daemonizing, wait until the background process finished with the initial link beat detection. When this is enabled, the parent process will return the link status on exit. 1 means link beat detected, 2 stands for link beat not detected, everything else is an error.

-W | --wait-on-kill

When killing a running daemon (with -k) wait until the daemon died.

-x | --extra-arg= ARG

Specify an extra argument to be passed to the action script.

-M | --monitor

Don't fail when the network interface is not available, instead use NETLINK to monitor device avaibility. The is useful for PCMCIA devices and similar.

-h | --help

Show help

-k | --kill

Kill a running daemon (Specify -i to select the daemon instance to kill)

-c | --check-running

Check if a daemon is running for a given network interface. Sets the return value to 0 if a daemon is already running or to 255 if not.

-v | --version

Show version

-S | --supend

Suspend a running daemon. The daemon will no longer check the link status until it is resumed (-R) again. (Specify -i to select the daemon instance to suspend.)

-R | --resume

Resume a suspended daemon. (Specify -i to select the daemon instance to resume.)

-z | --info

Request that a running daemon shall write its status information to syslog. (Specify -i to select the daemon instance to send the request to.)

## FILES
/etc/ifplugd/ifplugd.conf: this file is sourced by the init script /etc/init.d/ifplugd and contains the interface to be monitored and the options to be used.

/etc/ifplugd/ifplugd.action: this is the script which will be called by the daemon whenever the state of the interface changes. It takes two areguments: the first is the interface name (eg. eth0), the second either "up" or "down".

/var/run/ifplugd.<iface>.pid: the pid file for ifplugd.

## ENVIRONMENT
The action script will be called with two environment variables set:

IFPLUGD_PREVIOUS The previous link status. Either "up", "down", "error" or "disabled". The former values should be obvious, the latter is set on daemon startup.

IFPLUGD_CURRENT The current link status. See above for possible values.

## SIGNALS
SIGINT, SIGTERM ifplugd will quit, possibly running the shutdown script. This is issued by passing -k to ifplugd.

SIGQUIT ifplugd will quit, the shutdown script is never run.

SIGHUP ifplugd will write its status information to syslog. This is issued by -z.

SIGUSR1 ifplugd will go to suspend mode. (-S)

SIGUSR2 ifplugd will resume from suspend mode. (-R)

## AUTHOR
ifplugd was written by Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>. ifplugd is available at http://0pointer.de/lennart/projects/ifplugd/

## SEE ALSO
ifplugd.conf(5), ifup(8), interfaces(5), ifconfig(8), ifplugstatus(8)

## COMMENTS
This man page was written using xmltoman(1) by Oliver Kurth.


ifplugstatus

title: ifplugstatus(8)

summary: A link beat detection tool

text:
# ifplugstatus(8)

## NAME
ifplugstatus - A link beat detection tool

## SYNOPSIS
ifplugstatus [options] [INTERFACE]

## DESCRIPTION
ifplugstatus is an utility which may be used to detect the link status of a local Linux ethernet device, much in the same way mii-diag, mii-tool and ethtool work. In fact it supports all three different APIs these three tools use. In addition it supports link checking with the IFF_RUNNING interface flag, which most modern drivers (not only ethernet) support, and association status checking with the wireless extension API for WLAN devices.

The APIs are tried in the following order:

First the newest API: SIOCETHTOOL (aka ethtool API)

Second the next older API: SIOCGMIIREG (aka mii-diag API)

Than the WLAN API: wireless extension (aka iwconfig API)

Followed by the cleanest API: IFF_RUNNING (aka ifconfig API)

The oldest API (SIOCPRIV aka mii-tool API) is not tested since it is obsolete.

ifplugstatus may be used in shell script since it returns the current status as return value. It is especially useful to detect the available APIs on the used network driver. (Option -v)

## OPTIONS
You may specify an ethernet device on the command line. Otherwise ifplugstatus will check all available network interfaces.

-a | --auto

Enable interface automatically before querying (default: off)

-h | --help

Show help

-q | --quiet

Decrease verbosity by one. If the verbosity is < 0, no text will be shown, only the return value is relevant; if the verbosity is = 0, a terse status will be shown; If the verbosity is > 0, detailed information about the used API is returned. (By default the verbosity is 0)

-v | --verbose

Increase verbosity by one. See option -q.

-V | --version

Show version

## RETURN VALUES
0 Success

1 Failure

2 Link beat detected (only available when an interface is specified)

3 Unplugged (same here)

## AUTHOR
ifplugd was written by Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>. ifplugd is available at http://0pointer.de/lennart/projects/ifplugd/

## SEE ALSO
mii-diag(8), mii-tool(8), ethtool(8), ifplugd(8)

## COMMENTS
This man page was written using xml2man(1) by Oliver Kurth.