ZFS requires a stable hostid to recognize foreign pool imports,
but the hostid of a Linux system can change if the /etc/hostid
file is missing, particularly during DHCP lease updates.
Ensure that the system hostid is stable by creating the
/etc/hostid file from the output of the /usr/bin/hostid utility.
The /sbin/genhostid utility that is provided by the initscripts
package is not used because it creates a random hostid, which
breaks upgrades on systems that already have the SPL module
installed.
The external `printf` is used because the dash builtin lacks
the byte format. Conveniences like a ${HOSTID:$ii:2} substring
range or a `sed` one-liner are similarly avoided.
When rebuilding the source RPM under el5 you need to append the
target_cpu. However, under el6/ch5 things are packaged correctly
and the arch is already part of kver. For this reason it also
needs to be stripped from kver when setting kverpkg.
The CHAOS 5 kernels are now packaged identially to the RHEL6 kernels.
Therefore we can simply use the RHEL6 rules in the spec file when
building packages.
Ensure kdevpkg is defined is srpm case before using it to define
the devel_requires macro. Interestingly this is not an issue for
rpm-4.7.1-4 but it is for rpm-4.4.2.3-18.
If the distro/installation really is unsupported (i.e. unknown) we should
not make it look like a known distribution (i.e. RHEL) complete with
dependencies on other RPMs and trying to find kenrel source in the RH
standard location.
Additionally add 'k' prefix for kernel requires for consistency.
This macro was removed from the default RPM macro file. Interestly,
some of the arch specific macro's add it back it based on your distro
but it should not be counted on. However, __id still exists and its
command line args have historically been fairly stable so we will
directly use %{__id} -un to get the user name.
Supported and tested distros now include SLES10, SLES11, Chaos 4.x,
RHEL5, and Fedora 11. This update was mainly to address rebuildable
kernel module rpms, and correct rpm dependencies for each distro.