Error extras/ata_id/ata_id.c:42:23: fatal error: linux/bsg.h: No such file or directory when compile LFS udev-166
For “Linux From Scratch – Version 6.8″, on part “6.60. Udev-166″, after configuration on udev, we need compile the package using make, but later, I met the error message like this:
“extras/ata_id/ata_id.c:42:23: fatal error: linux/bsg.h: No such file or directory”
After checking line 42 of ata_id.c under extras/ata_id of udev-166′s source file, I can see that:
As there’s no bsg.h under $LFS/usr/include/linux, so I was sure that this error was caused by C header file loss. Checking with:
I can see that Glibc was 2.13, and GCC was 4.5.2:
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.22 system on 2011-09-04.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
After some searching work on google, I can conclude that this was caused by GCC version. I was not going to rebuilt gcc for this, so I tried get this header file and put it under $LFS/usr/include/linux/bsg.h. You can go to http://lxr.free-electrons.com/source/include/linux/bsg.h?v=2.6.25 to download the header file.
After copy & paster & chmod, I ran make again, and it succeeded.