Skip to contentSkip to conversation

Some basic questions

DISCUSSION Frank W. Miller 4 participants 9 messages Aug 12, 2011 – Aug 14, 2011

lore
Share & tools
lore
#0 lore raw

Greetings,

I apologize if these questions seem trivial or are document somewhere that I haven't searched as yet.

I'm essentially trying to build a new distro type. I currently have kernel 2.6.39.2 booting from a USB stick. The kernel comes up using the Intel framebuffer kms in its proper resolution and I have some basic graphics routines that allow me to output as desired to the screen, and NOTHING ELSE.

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared (first use in this function)
extras/input_id/input_id.c:173: error: (Each undeclared identifier is reported only once
extras/input_id/input_id.c:173: error: for each function it appears in.) make[2]: *** [extras/input_id/input_id.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I did a search and came up with some results about kernel and udev version mismatches but being the newbie to udev I am, I'm not sure I understand what to do. So thats the first question?

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct? I get this output from the configure script:

	udev 172
	====

	prefix:			/usr
	sysconfdir:		${prefix}/etc
	sbindir:		${exec_prefix}/sbin
	libdir:			${exec_prefix}/lib
	rootlibdir:		${exec_prefix}/lib
	libexecdir:		${exec_prefix}/libexec

	datarootdir:		${prefix}/share
	mandir:			${datarootdir}/man
	includedir:		${prefix}/include

	include_prefix:		/usr/include

	systemdsystemunitdir:	

	logging:		yes
	debug:			no
	selinux:		no

	compiler:		gcc
	cflags:			-g -O2
	ldflags:		

	rule_generator:		yes
	hwdb:			yes
	udev_acl:		yes
	gudev:			yes
	gintrospection:		yes
	keymap:			yes
	floppy:			no
	edd:			no

	usb.ids:		/usr/share/hwdata/usb.ids
	pci.ids:		/usr/share/hwdata/pci.ids
	firmware path:		\"/lib/firmware/updates/\", \"/lib/firmware/\"

	xsltproc:		/usr/bin/xsltproc
	gperf:			/usr/bin/gperf

I'm assuming I'll need to install the binaries in /usr/sbin? And the config files in /usr/share/hwdata?

I then need to start udevd on bootup correct?

OK, maybe I should see what the answers to these questions are before I ask more silly things ;)

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

Thanks,
FM

#1 lore raw
Quoted 11 lines · Frank W. Miller

Greetings,

I apologize if these questions seem trivial or are document somewhere that I haven't searched as yet.

I'm essentially trying to build a new distro type. I currently have kernel 2.6.39.2 booting from a USB stick. The kernel comes up using the Intel framebuffer kms in its proper resolution and I have some basic graphics routines that allow me to output as desired to the screen, and NOTHING ELSE.

As you are "building from scratch", why not take a look at the description of udev in the Linux From Scratch distro? It should answer all of these questions for you already.

Have you tried that?

greg k-h

#2 lore raw
In reply to Frank W. Miller

Thanks for the reply. I did look at the LFS documentation. It really just talks about installing their tarball and doesn't say much about what's happening under the hood. I just looked at the LFS book, is there some other LFS documentation that I should look at? I am working "from scratch" but I think even more from scratch than LFS.

Thanks!
FM

Quoted 20 lines · Greg KH
Quoted 11 lines · Frank W. Miller

Greetings,

I apologize if these questions seem trivial or are document somewhere that I haven't searched as yet.

I'm essentially trying to build a new distro type. I currently have kernel 2.6.39.2 booting from a USB stick. The kernel comes up using the Intel framebuffer kms in its proper resolution and I have some basic graphics routines that allow me to output as desired to the screen, and NOTHING ELSE.

As you are "building from scratch", why not take a look at the description of udev in the Linux From Scratch distro? It should answer all of these questions for you already.

Have you tried that?

greg k-h

#3 lore raw
In reply to Frank W. Miller
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

#4 lore raw
In reply to Frank W. Miller

Thanks Allin! Very helpful, or at least, I'll let you know... ;)

One question, I have the 2.6.39.2 kernel tree that I'm building for my little project. How do I point the udev build at the kernel headers in that tree, e.g.:

/home/fwmiller/roadrunner/build/linux/include

where "linux" in this path is actually a sym link to a directory called linux-2.6.29.2 in the same build/ directory?

Also, can I just do all the --disable-* options to configure? Is that the base implementation?

Thanks,
FM

Quoted 42 lines · Allin Cottrell
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

#5 lore raw
In reply to Frank W. Miller

To install kernel headers from your own kernel tree:

. first build them -
# assuming current working dir is the top of your kernel build
INSTALL_HDR_PATH=$PWD/usr make headers_install
should create a subdirectory path usr/include containing directories
such as linux video sound asm asm-generic and others

. then cd to /usr/include and, for each directory in
<kernel>/usr/include, first rename the one in /usr/include, then copy (or symlink it if it will always be accessible) the one under the kernel tree.

Quoted 65 lines · Frank W. Miller

Thanks Allin! Very helpful, or at least, I'll let you know... ;)

One question, I have the 2.6.39.2 kernel tree that I'm building for my little project. How do I point the udev build at the kernel headers in that tree, e.g.:

/home/fwmiller/roadrunner/build/linux/include

where "linux" in this path is actually a sym link to a directory called linux-2.6.29.2 in the same build/ directory?

Also, can I just do all the --disable-* options to configure? Is that the base implementation?

Thanks,
FM

Quoted 32 lines · Allin Cottrell
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

Quoted 7 lines

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Frank W. Miller

Thanks for the reply.

Correct me if I'm wrong but doesn't this essentially replace the kernel header files in usr/include/ for the build machine with pointers to the kernel headers for my target kernel? I'm not sure this is a good way to go about this. Am I missing something? It would be better if there was some compile option for udev that pointed it at the desired kernel header files, wherever they might be?

Thanks,
FM

Quoted 80 lines · John Lumby

To install kernel headers from your own kernel tree:

. first build them -
# assuming current working dir is the top of your kernel build
INSTALL_HDR_PATH=$PWD/usr make headers_install
should create a subdirectory path usr/include containing directories
such as linux video sound asm asm-generic and others

. then cd to /usr/include and, for each directory in
<kernel>/usr/include, first rename the one in /usr/include, then copy (or symlink it if it will always be accessible) the one under the kernel tree.

Quoted 65 lines · Frank W. Miller

Thanks Allin! Very helpful, or at least, I'll let you know... ;)

One question, I have the 2.6.39.2 kernel tree that I'm building for my little project. How do I point the udev build at the kernel headers in that tree, e.g.:

/home/fwmiller/roadrunner/build/linux/include

where "linux" in this path is actually a sym link to a directory called linux-2.6.29.2 in the same build/ directory?

Also, can I just do all the --disable-* options to configure? Is that the base implementation?

Thanks,
FM

Quoted 32 lines · Allin Cottrell
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

Quoted 7 lines

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Frank W. Miller

OK, I got the -145 version to build with pretty much everything disabled, so I think just the base implementation. The only binaries that are showing up in the udev-145/udev directory are:

test-udev udevadm udevd

Now I'm going to copy these binaries to the /bin directory of my USB filesystem and try to start udevd.

I don't want to use install, just cp, which means I'm not going to use make install from the distro. I'll need to copy some rules I suppose, and there are a number of files in the rules directory. I'm guessing I don't need the rules from the distro directories. If I copy the rules from the rules.d directory only, will that be enough?

Thanks,
FM

Quoted 80 lines · John Lumby

To install kernel headers from your own kernel tree:

. first build them -
# assuming current working dir is the top of your kernel build
INSTALL_HDR_PATH=$PWD/usr make headers_install
should create a subdirectory path usr/include containing directories
such as linux video sound asm asm-generic and others

. then cd to /usr/include and, for each directory in
<kernel>/usr/include, first rename the one in /usr/include, then copy (or symlink it if it will always be accessible) the one under the kernel tree.

Quoted 65 lines · Frank W. Miller

Thanks Allin! Very helpful, or at least, I'll let you know... ;)

One question, I have the 2.6.39.2 kernel tree that I'm building for my little project. How do I point the udev build at the kernel headers in that tree, e.g.:

/home/fwmiller/roadrunner/build/linux/include

where "linux" in this path is actually a sym link to a directory called linux-2.6.29.2 in the same build/ directory?

Also, can I just do all the --disable-* options to configure? Is that the base implementation?

Thanks,
FM

Quoted 32 lines · Allin Cottrell
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

Quoted 7 lines

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Frank W. Miller
Quoted 4 lines · Frank W. Miller

Correct me if I'm wrong but doesn't this essentially replace the kernel header files in usr/include/ for the build machine with pointers to the kernel headers for my target kernel? I'm not sure this is a good way to go about this.

I think this thread is wearing out its welcome, since it's not particularly related to udev. But briefly: Yes, John Lumby's suggestion involves (temporarily) replacing the content of /usr/include/linux and friends on your build host with updated kernel headers. That's the option that occurred to me too. If you have a better idea, fine, but don't expect to find a simple ./configure option in udev to do something as non-standard as what you're attempting.

Allin Cottrell

Quoted 84 lines · John Lumby
Quoted 80 lines

To install kernel headers from your own kernel tree:

. first build them -
# assuming current working dir is the top of your kernel build
INSTALL_HDR_PATH=$PWD/usr make headers_install
should create a subdirectory path usr/include containing directories
such as linux video sound asm asm-generic and others

. then cd to /usr/include and, for each directory in
<kernel>/usr/include, first rename the one in /usr/include, then copy (or symlink it if it will always be accessible) the one under the kernel tree.

Quoted 65 lines · Frank W. Miller

Thanks Allin! Very helpful, or at least, I'll let you know... ;)

One question, I have the 2.6.39.2 kernel tree that I'm building for my little project. How do I point the udev build at the kernel headers in that tree, e.g.:

/home/fwmiller/roadrunner/build/linux/include

where "linux" in this path is actually a sym link to a directory called linux-2.6.29.2 in the same build/ directory?

Also, can I just do all the --disable-* options to configure? Is that the base implementation?

Thanks,
FM

Quoted 32 lines · Allin Cottrell
Quoted 12 lines · Frank W. Miller

My next step is to get udev going. To that end, I've downloaded and studied to some extent release 172. I'm using FC12 as my build machine (e.g. gcc 4.4.2). This is what I think is supposed to happen, please correct me if I'm wrong on any of this.

When I build udev, I do this:

configure --enable-static

This is to get the udev binaries to build without needing libraries. Then:

Quoted 7 lines

make

I get this:

CC extras/input_id/input_id.o
extras/input_id/input_id.c: In function ‘test_key’:
extras/input_id/input_id.c:173: error: ‘BTN_TRIGGER_HAPPY’ undeclared

Your FC12 kernel headers are too old for building udev 172. I believe you'll need at least 2.6.34.

Quoted 2 lines

Once I get the binaries built, I'll need to install them and the config files in the proper places in my USB filesystem correct?

Naturally. Though you can reorganize the directory structure if you wish via options to ./configure.

Quoted 3 lines

Thanks in advance for any assistance on this. I'd really like to keep this as simple as possible. For example, its not clear to me what "extras" are and how to turn them off if they are not needed.

Quoted 7 lines

./configure --disable-hwdb --disable-introspection \
--disable-keymap

(and so on). See ./configure --help and
http://www.linuxfromscratch.org/lfs/view/development/chapter06/udev.html

Allin Cottrell

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Allin Cottrell
Department of Economics
Wake Forest University