Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 460396 - sys-kernel/genkernel - zfs module should include /etc/hostid if exists
Summary: sys-kernel/genkernel - zfs module should include /etc/hostid if exists
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 10:33 UTC by Alexander Zubkov
Modified: 2013-06-06 07:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zubkov 2013-03-05 10:33:27 UTC
hostid utility in busybox in initramfs and hostid from coreutils gets id by calling function gethostid() from glibc. But this function is generating hostid based on gethostname->gethostbyname_r->IP-address. And during initramfs it returns 0. So using autogenerated hostid value can cause problems in some cases. Because when spl module is loading it finds hostid and remember it.
This problem can be solved by making custom hostid and saving it into /etc/hostid, then hostid utilities and spl module will get it from this file. So it needs to be copied into initramfs image be genkernel too.
Comment 1 Richard Yao (RETIRED) gentoo-dev 2013-06-06 06:45:41 UTC
I modified sys-kernel/spl to adopt FreeBSD's behavior where it will treat the hostid as zero if /etc/hostid does not exist. It will also no longer invoke the system's hostid, which should solve the problem that you encountered.
Comment 2 Alexander Zubkov 2013-06-06 07:53:07 UTC
Can you also add /etc/hostid into the list of files to be included into initramfs if it exists?