title: hping3(8)

text:
# hping3(8)

## NAME
hping3 - send (almost) arbitrary TCP/IP packets to network hosts

## SYNOPSIS
hping3 [ -hvnqVDzZ012WrfxykQbFSRPAUXYjJBuTG ] [ -c count ] [ -i wait ] [ --fast ] [ -I interface ] [ -9 signature ] [ -a host ] [ -t ttl ] [ -N ip id ] [ -H ip protocol ] [ -g fragoff ] [ -m mtu ] [ -o tos ] [ -C icmp type ] [ -K icmp code ] [ -s source port ] [ -p[+][+] dest port ] [ -w tcp window ] [ -O tcp offset ] [ -M tcp sequence number ] [ -L tcp ack ] [ -d data size ] [ -E filename ] [ -e signature ] [ --icmp-ipver version ] [ --icmp-iphlen length ] [ --icmp-iplen length ] [ --icmp-ipid id ] [ --icmp-ipproto protocol ] [ --icmp-cksum checksum ] [ --icmp-ts ] [ --icmp-addr ] [ --tcpexitcode ] [ --tcp-timestamp ] [ --tr-stop ] [ --tr-keep-ttl ] [ --tr-no-rtt ] [ --rand-dest ] [ --rand-source ] [ --beep ] hostname

## DESCRIPTION
hping3 is a network tool able to send custom TCP/IP packets and to display target replies like ping program does with ICMP replies. hping3 handle fragmentation, arbitrary packets body and size and can be used in order to transfer files encapsulated under supported protocols. Using hping3 you are able to perform at least the following stuff:

- Test firewall rules

- Advanced port scanning

- Test net performance using different protocols,

packet size, TOS (type of service) and fragmentation.

- Path MTU discovery

- Transferring files between even really fascist firewall

rules.

- Traceroute-like under different protocols.

- Firewalk-like usage.

- Remote OS fingerprinting.

- TCP/IP stack auditing.

- A lot of others.

It's also a good didactic tool to learn TCP/IP. hping3 is developed and maintained by antirez@invece.org and is licensed under GPL version 2. Development is open so you can send me patches, suggestion and affronts without inhibitions.

## HPING SITE
primary site at http://www.hping.org. You can found both the stable release and the instruction to download the latest source code at http://www.hping.org/download.html

## BASE OPTIONS
-h --help

Show an help screen on standard output, so you can pipe to less.

-v --version

Show version information and API used to access to data link layer, linux sock packet or libpcap.

-c --count count

Stop after sending (and receiving) count response packets. After last packet was send hping3 wait COUNTREACHED_TIMEOUT seconds target host replies. You are able to tune COUNTREACHED_TIMEOUT editing hping3.h

-i --interval

Wait the specified number of seconds or micro seconds between sending each packet. --interval X set wait to X seconds, --interval uX set wait to X micro seconds. The default is to wait one second between each packet. Using hping3 to transfer files tune this option is really important in order to increase transfer rate. Even using hping3 to perform idle/spoofing scanning you should tune this option, see HPING2-HOWTO for more information.

--fast

Alias for -i u10000. Hping will send 10 packets for second.

--faster

Alias for -i u1. Faster then --fast ;) (but not as fast as your computer can send packets due to the signal-driven design).

--flood

Sent packets as fast as possible, without taking care to show incoming replies. This is ways faster than to specify the -i u0 option.

-n --numeric

Numeric output only, No attempt will be made to lookup symbolic names for host addresses.

-q --quiet

Quiet output. Nothing is displayed except the summary lines at startup time and when finished.

-I --interface interface name

By default on linux and BSD systems hping3 uses default routing interface. In other systems or when there is no default route hping3 uses the first non-loopback interface. However you are able to force hping3 to use the interface you need using this option. Note: you don't need to specify the whole name, for example -I et will match eth0 ethernet0 myet1 et cetera. If no interfaces match hping3 will try to use lo.

-V --verbose

Enable verbose output. TCP replies will be shown as follows: len=46 ip=192.168.1.1 flags=RA DF seq=0 ttl=255 id=0 win=0 rtt=0.4 ms tos=0 iplen=40 seq=0 ack=1380893504 sum=2010 urp=0

-D --debug

Enable debug mode, it's useful when you experience some problem with hping3. When debug mode is enabled you will get more information about interface detection, data link layer access, interface settings, options parsing, fragmentation, HCMP protocol and other stuff.

-z --bind

Bind CTRL+Z to time to live (TTL) so you will able to increment/decrement ttl of outgoing packets pressing CTRL+Z once or twice.

-Z --unbind

Unbind CTRL+Z so you will able to stop hping3.

--beep

Beep for every matching received packet (but not for ICMP errors).

## PROTOCOL SELECTION
Default protocol is TCP, by default hping3 will send tcp headers to target host's port 0 with a winsize of 64 without any tcp flag on. Often this is the best way to do an 'hide ping', useful when target is behind a firewall that drop ICMP. Moreover a tcp null-flag to port 0 has a good probability of not being logged.

-0 --rawip

RAW IP mode, in this mode hping3 will send IP header with data appended with --signature and/or --file, see also --ipproto that allows you to set the ip protocol field.

-1 --icmp

ICMP mode, by default hping3 will send ICMP echo-request, you can set other ICMP type/code using --icmptype --icmpcode options.

-2 --udp

UDP mode, by default hping3 will send udp to target host's port 0. UDP header tunable options are the following: --baseport, --destport, --keep.

-8 --scan

Scan mode, the option expects an argument that describes groups of ports to scan. port groups are comma separated: a number describes just a single port, so 1,2,3 means port 1, 2 and 3. ranges are specified using a start-end notation, like 1-1000, that tell hping to scan ports between 1 and 1000 (included). the special word all is an alias for 0-65535, while the special word known includes all the ports listed in /etc/services.

Groups can be combined, so the following command line will scan ports between 1 and 1000 AND port 8888 AND ports listed in /etc/services: hping --scan 1-1000,8888,known -S target.host.com

Groups can be negated (subtracted) using a ! character as prefix, so the following command line will scan all the ports NOT listed in /etc/services in the range 1-1024: hping --scan '1-1024,!known' -S target.host.com

Keep in mind that while hping seems much more like a port scanner in this mode, most of the hping switches are still honored, so for example to perform a SYN scan you need to specify the -S option, you can change the TCP windows size, TTL, control the IP fragmentation as usually, and so on. The only real difference is that the standard hping behaviors are encapsulated into a scanning algorithm.

Tech note: The scan mode uses a two-processes design, with shared memory for synchronization. The scanning algorithm is still not optimal, but already quite fast.

Hint: unlike most scanners, hping shows some interesting info about received packets, the IP ID, TCP win, TTL, and so on, don't forget to look at this additional information when you perform a scan! Sometimes they shows interesting details.

-9 --listen signature

HPING3 listen mode, using this option hping3 waits for packet that contain signature and dump from signature end to packet's end. For example if hping3 --listen TEST reads a packet that contain 234-09sdflkjs45-TESThello_world it will display hello_world.

## IP RELATED OPTIONS
-a --spoof hostname

Use this option in order to set a fake IP source address, this option ensures that target will not gain your real address. However replies will be sent to spoofed address, so you will can't see them. In order to see how it's possible to perform spoofed/idle scanning see the HPING2-HOWTO.

--rand-source

This option enables the random source mode. hping will send packets with random source address. It is interesting to use this option to stress firewall state tables, and other per-ip basis dynamic tables inside the TCP/IP stacks and firewall software.

--rand-dest

This option enables the random destination mode. hping will send the packets to random addresses obtained following the rule you specify as the target host. You need to specify a numerical IP address as target host like 10.0.0.x. All the occurrences of x will be replaced with a random number in the range 0-255. So to obtain Internet IP addresses in the whole IPv4 space use something like hping x.x.x.x --rand-dest. If you are not sure about what kind of addresses your rule is generating try to use the --debug switch to display every new destination address generated. When this option is turned on, matching packets will be accept from all the destinations.

Warning: when this option is enabled hping can't detect the right outgoing interface for the packets, so you should use the --interface option to select the desired outgoing interface.

-t --ttl time to live

Using this option you can set TTL (time to live) of outgoing packets, it's likely that you will use this with --traceroute or --bind options. If in doubt try `hping3 some.host.com -t 1 --traceroute'.

-N --id

Set ip->id field. Default id is random but if fragmentation is turned on and id isn't specified it will be getpid() & 0xFF, to implement a better solution is in TODO list.

-H --ipproto

Set the ip protocol in RAW IP mode.

-W --winid

id from Windows* systems before Win2k has different byte ordering, if this option is enable hping3 will properly display id replies from those Windows.

-r --rel

Display id increments instead of id. See the HPING2-HOWTO for more information. Increments aren't computed as id[N]-id[N-1] but using packet loss compensation. See relid.c for more information.

-f --frag

Split packets in more fragments, this may be useful in order to test IP stacks fragmentation performance and to test if some packet filter is so weak that can be passed using tiny fragments (anachronistic). Default 'virtual mtu' is 16 bytes. see also --mtu option.

-x --morefrag

Set more fragments IP flag, use this option if you want that target host send an ICMP time-exceeded during reassembly.

-y --dontfrag

Set don't fragment IP flag, this can be used to perform MTU path discovery.

-g --fragoff fragment offset value

Set the fragment offset.

-m --mtu mtu value

Set different 'virtual mtu' than 16 when fragmentation is enabled. If packets size is greater that 'virtual mtu' fragmentation is automatically turned on.

-o --tos hex_tos

Set Type Of Service (TOS), for more information try --tos help.

-G --rroute

Record route. Includes the RECORD_ROUTE option in each packet sent and displays the route buffer of returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option. Also note that using hping you are able to use record route even if target host filter ICMP. Record route is an IP option, not an ICMP option, so you can use record route option even in TCP and UDP mode.

## ICMP RELATED OPTIONS
-C --icmptype type

Set icmp type, default is ICMP echo request (implies --icmp).

-K --icmpcode code

Set icmp code, default is 0 (implies --icmp).

--icmp-ipver

Set IP version of IP header contained into ICMP data, default is 4.

--icmp-iphlen

Set IP header length of IP header contained into ICMP data, default is 5 (5 words of 32 bits).

--icmp-iplen

Set IP packet length of IP header contained into ICMP data, default is the real length.

--icmp-ipid

Set IP id of IP header contained into ICMP data, default is random.

--icmp-ipproto

Set IP protocol of IP header contained into ICMP data, default is TCP.

--icmp-cksum

Set ICMP checksum, for default is the valid checksum.

--icmp-ts

Alias for --icmptype 13 (to send ICMP timestamp requests).

--icmp-addr

Alias for --icmptype 17 (to send ICMP address mask requests).

## TCP/UDP RELATED OPTIONS
-s --baseport source port

hping3 uses source port in order to guess replies sequence number. It starts with a base source port number, and increase this number for each packet sent. When packet is received sequence number can be computed as replies.dest.port - base.source.port. Default base source port is random, using this option you are able to set different number. If you need that source port not be increased for each sent packet use the -k --keep option.

-p --destport [+][+]dest port

Set destination port, default is 0. If '+' character precedes dest port number (i.e. +1024) destination port will be increased for each reply received. If double '+' precedes dest port number (i.e. ++1024), destination port will be increased for each packet sent. By default destination port can be modified interactively using CTRL+z.

--keep

keep still source port, see --baseport for more information.

-w --win

Set TCP window size. Default is 64.

-O --tcpoff

Set fake tcp data offset. Normal data offset is tcphdrlen / 4.

-M --tcpseq

Set the TCP sequence number.

-L --tcpack

Set the TCP ack.

-Q --seqnum

This option can be used in order to collect sequence numbers generated by target host. This can be useful when you need to analyze whether TCP sequence number is predictable. Output example: #hping3 win98 --seqnum -p 139 -S -i u1 -I eth0

```
HPING uaz (eth0 192.168.4.41): S set, 40 headers + 0 data bytes
2361294848 +2361294848
2411626496 +50331648
2545844224 +134217728
2713616384 +167772160
2881388544 +167772160
3049160704 +167772160
3216932864 +167772160
3384705024 +167772160
3552477184 +167772160
3720249344 +167772160
3888021504 +167772160
4055793664 +167772160
4223565824 +167772160
```

The first column reports the sequence number, the second difference between current and last sequence number. As you can see target host's sequence numbers are predictable.

-b --badcksum

Send packets with a bad UDP/TCP checksum.

--tcp-timestamp

Enable the TCP timestamp option, and try to guess the timestamp update frequency and the remote system uptime.

-F --fin

Set FIN tcp flag.

-S --syn

Set SYN tcp flag.

-R --rst

Set RST tcp flag.

-P --push

Set PUSH tcp flag.

-A --ack

Set ACK tcp flag.

-U --urg

Set URG tcp flag.

-X --xmas

Set Xmas tcp flag.

-Y --ymas

Set Ymas tcp flag.

## COMMON OPTIONS
-d --data data size

Set packet body size. Warning, using --data 40 hping3 will not generate 0 byte packets but protocol_header+40 bytes. hping3 will display packet size information as first line output, like this: HPING www.yahoo.com (ppp0 204.71.200.67): NO FLAGS are set, 40 headers + 40 data bytes

-E --file filename

Use filename contents to fill packet's data.

-e --sign signature

Fill first signature length bytes of data with signature. If the signature length is bigger than data size an error message will be displayed. If you don't specify the data size hping will use the signature size as data size. This option can be used safely with --file filename option, remainder data space will be filled using filename.

-j --dump

Dump received packets in hex.

-J --print

Dump received packets' printable characters.

-B --safe

Enable safe protocol, using this option lost packets in file transfers will be resent. For example in order to send file /etc/passwd from host A to host B you may use the following:

```
[host_a]
# hping3 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd
[host_b]
# hping3 host_a --listen signature --safe --icmp
```

-u --end

If you are using --file filename option, tell you when EOF has been reached. Moreover prevent that other end accept more packets. Please, for more information see the HPING2-HOWTO.

-T --traceroute

Traceroute mode. Using this option hping3 will increase ttl for each ICMP time to live 0 during transit received. Try hping3 host --traceroute. This option implies --bind and --ttl 1. You can override the ttl of 1 using the --ttl option. Since 2.0.0 stable it prints RTT information.

--tr-keep-ttl

Keep the TTL fixed in traceroute mode, so you can monitor just one hop in the route. For example, to monitor how the 5th hop changes or how its RTT changes you can try hping3 host --traceroute --ttl 5 --tr-keep-ttl.

--tr-stop

If this option is specified hping will exit once the first packet that isn't an ICMP time exceeded is received. This better emulates the traceroute behavior.

--tr-no-rtt

Don't show RTT information in traceroute mode. The ICMP time exceeded RTT information aren't even calculated if this option is set.

--tcpexitcode

Exit with last received packet tcp->th_flag as exit code. Useful for scripts that need, for example, to known if the port 999 of some host reply with SYN/ACK or with RST in response to SYN, i.e. the service is up or down.

## TCP OUTPUT FORMAT
The standard TCP output format is the following:

len=46 ip=192.168.1.1 flags=RA DF seq=0 ttl=255 id=0 win=0 rtt=0.4 ms

len is the size, in bytes, of the data captured from the data link layer excluding the data link header size. This may not match the IP datagram size due to low level transport layer padding.

ip is the source ip address.

flags are the TCP flags, R for RESET, S for SYN, A for ACK, F for FIN, P for PUSH, U for URGENT, X for not standard 0x40, Y for not standard 0x80.

If the reply contains DF the IP header has the don't fragment bit set.

seq is the sequence number of the packet, obtained using the source port for TCP/UDP packets, the sequence field for ICMP packets.

id is the IP ID field.

win is the TCP window size.

rtt is the round trip time in milliseconds.

If you run hping using the -V command line switch it will display additional information about the packet, example:

len=46 ip=192.168.1.1 flags=RA DF seq=0 ttl=255 id=0 win=0 rtt=0.4 ms tos=0 iplen=40 seq=0 ack=1223672061 sum=e61d urp=0

tos is the type of service field of the IP header.

iplen is the IP total len field.

seq and ack are the sequence and acknowledge 32bit numbers in the TCP header.

sum is the TCP header checksum value.

urp is the TCP urgent pointer value.

## UDP OUTPUT FORMAT
The standard output format is:

len=46 ip=192.168.1.1 seq=0 ttl=64 id=0 rtt=6.0 ms

The field meaning is just the same as the TCP output meaning of the same fields.

## ICMP OUTPUT FORMAT
An example of ICMP output is:

ICMP Port Unreachable from ip=192.168.1.1 name=nano.marmoc.net

It is very simple to understand. It starts with the string "ICMP" followed by the description of the ICMP error, Port Unreachable in the example. The ip field is the IP source address of the IP datagram containing the ICMP error, the name field is just the numerical address resolved to a name (a dns PTR request) or UNKNOWN if the resolution failed.

The ICMP Time exceeded during transit or reassembly format is a bit different:

TTL 0 during transit from ip=192.168.1.1 name=nano.marmoc.net

TTL 0 during reassembly from ip=192.70.106.25 name=UNKNOWN

The only difference is the description of the error, it starts with TTL 0.

## AUTHOR
Salvatore Sanfilippo <antirez@invece.org>, with the help of the people mentioned in AUTHORS file and at http://www.hping.org/authors.html

## BUGS
Even using the --end and --safe options to transfer files the final packet will be padded with 0x00 bytes.

Data is read without care about alignment, but alignment is enforced in the data structures. This will not be a problem under i386 but, while usually the TCP/IP headers are naturally aligned, may create problems with different processors and bogus packets if there is some unaligned access around the code (hopefully none).

On solaris hping does not work on the loopback interface. This seems a solaris problem, as stated in the tcpdump-workers mailing list, so the libpcap can't do nothing to handle it properly.

## SEE ALSO
ping(8), traceroute(8), ifconfig(8), nmap(1)


hpsahba

package: hpsahba

title: hpsahba(8)

text:
# hpsahba(8)

## NAME
hpsahba - tool to enable/disable HBA mode on some HP Smart Array controllers.

## SYNOPSIS
•

hpsahba -h

•

hpsahba -v

•

hpsahba -i /dev/sgN

•

hpsahba -E /dev/sgN

•

hpsahba -d /dev/sgN

## DESCRIPTION
CAUTION: This tool will destroy your data and may damage your hardware!

hpsahba is able to enable or disable HBA mode on some HP Smart Array controllers on which regular tools, like `ssacli', reports HBA mode as not supported.

When enabling or disabling HBA mode, RAID controller changes its internal configuration immediately, without requiring reboot. Any existing data may be lost after changing the HBA mode, so be extremely careful.

Some servers may not be able to boot from disks attached to controller in HBA mode. Move the /boot partition and the bootloader out of disks attached to controller onto USB flash driver or SD card to circumvent this limitation.

When HBA mode is enabled, controller usually prints some diagnostic message during boot, like “Hardware RAID support is disabled via controller NVRAM configuration settings” (example from P410i). Attempts to configure RAID arrays in this mode are expected to fail.

### Options
•

hpsahba -h

Show help message and exit.

•

hpsahba -v

Show version and exit.

•

hpsahba -i DEVICE_PATH

Show some information about device. This Includes HBA mode support bit (supported/not supported) and current state of HBA mode (enabled/disabled). It is recommended to run this before trying to enable or disable HBA mode.

•

hpsahba -E DEVICE_PATH

Enable HBA mode.

•

hpsahba -d DEVICE_PATH

Disable HBA mode.

### Kernel driver support
hpsahba itself is able to work on any modern Linux system.

However, to get system actually see and use disks in HBA mode, few kernel patches required: <https://github.com/im-0/hpsahba/tree/master/kernel>.

This functionality is disabled by default. To enable, load module hpsa with parameter hpsa_use_nvram_hba_flag set to “1”. Or set it in the kernel command line: “hpsa.hpsa_use_nvram_hba_flag=1”.

Patchset changelog:

•

V1 -> V2:

•

Device visibility change properly detected if device is both updated and masked/unmasked in the same time.

This will never be upstreamed and officially supported (for P410), see the email from Don Brace: <https://lkml.org/lkml/2018/12/17/618>. So use at your own risk.

You can use DKMS package in <https://github.com/im-0/hpsahba/tree/master/contrib/dkms> to patch hpsa driver in a compiled kernel.

### Supported hardware
Tested on following hardware so far:

•

HP Smart Array P410i (PCI ID: 103c:3245, board ID: 0x3245103c, firmware: 6.64)

•

HP Smart Array P812 (PCI ID: 103c:3249, board ID: 0x3249103c, firmware: 6.64)

•

Hewlett-Packard Company Smart Array G6 controllers / P410 (PCI ID: 103c:323a, board ID: 0x3243103c, firmware: 6.64)

•

Hewlett-Packard Company Smart Array G6 controllers / P212 (PCI ID: 103c:323a, board ID: 0x3241103c, firmware: 6.64)

(open an issue or a pull request if you successfully used this tool on other controllers)

### Additional links
•

<https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_0b76aec489764aea9802a6d27b>

Archive containing saupdate.efi - EFI binary for ia64 architecture which implements the same functionality for P410i. Seems not usable anywhere except of old HP Integrity servers.

## BUGS
See issues on GitHub: <https://github.com/im-0/hpsahba/issues>.

## AUTHOR
hpsahba was written by Ivan Mironov <mironov.ivan@gmail.com>


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, 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

--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 data about devices with DEVNAME will be shown.

--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.

--verbose

Increase verbosity. Only together with --map.

--log FILE

Write log info to FILE.

--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.


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 GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl2.html>

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