Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46941 - genkernel freezes ptys !
Summary: genkernel freezes ptys !
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-06 03:58 UTC by Sébastien HOUZE
Modified: 2004-04-11 07:50 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 Sébastien HOUZE 2004-04-06 03:58:12 UTC
genkernel3.0.2 freezes ptys when I launch genkernell all

Reproducible: Always
Steps to Reproduce:
1. emerge the las genkernel (3.0.2)
2. launch it : genekernel all
3. then ptys are frozen, no way to get a new X term within a login prompt




no infos in dmesg nor /var/log/messages.
Haven't perform a strace genkernel yet
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-04-06 03:59:17 UTC
Can you please perform an strace since we can't solve this otherwise as we don't know what's freezing where. Thanks!
Comment 2 Sébastien HOUZE 2004-04-07 23:31:05 UTC
OK, I Have found the problem after a strace !
It was freezing on stat64("/dev/loop0", ...), so it seems that genkernel don't check if loop module is inserted.
I don't know why that freezes ptys either vcs !

So when I insert the loop modules, genkernel works well.

An issue to this problem : genkernel must check if the loop module is present. If not it performs a modprobe. Prior versions was already doing that if I remember.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-04-08 04:03:38 UTC
Ah, can you see if this patch solves it?

-- << Snip >> --
Index: gen_funcs.sh
===================================================================
RCS file: /home/cvsroot/gentoo/src/genkernel_bradmssw/gen_funcs.sh,v
retrieving revision 1.4
diff -u -r1.4 gen_funcs.sh
--- gen_funcs.sh	21 Mar 2004 16:20:26 -0000	1.4
+++ gen_funcs.sh	8 Apr 2004 11:01:39 -0000
@@ -207,7 +207,8 @@
 }
 
 has_loop() {
-	if [ -e "/dev/loop0" -o -e "/dev/loop/0" ]
+	dmesg | egrep -q '^loop:'
+	if [ -e "/dev/loop0" -o -e "/dev/loop/0" -a $? ]
 	then
 		# We found devfs or standard dev loop device, assume
 		# loop is compiled into the kernel or the module is loaded

-- << Snip >> --
Comment 4 Sébastien HOUZE 2004-04-08 08:08:19 UTC
Yes it's good !
But you need to patch also /usr/bin/genkernel :

--- genkernel   2004-04-08 16:52:33.217681752 +0200
+++ genkernel.new       2004-04-08 16:52:33.844586448 +0200
@@ -59,8 +59,8 @@
 if ! has_loop
 then
 
-       print_error print_info 1 "Your kernel does not appear to have loop device support. "
-       print_error print_info 1 "Please 'modprobe loop' if it is a module before running genkernel"
+       print_error 1 "Your kernel does not appear to have loop device support. "
+       print_error 1 "Please 'modprobe loop' if it is a module before running genkernel"
        gen_die "Load loop support!"
 fi


so why don't genkernel loads itself the loop module if it exists ? For example if a find /lib/modules/`uname -r`/ -name 'loop.ko' command returns a result and loop isn't in lsmod, we can do a modprobe on it.
then if loop is compiled in the kernel, i haven't tested yet, but I imagine there's a way to know it whith a grep in dmesg or better with a find/grep in /proc or /sys.
What do you think about that ?
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2004-04-08 08:25:08 UTC
There's no need to search for it - let other things do that for you. So, one should be able to just use:

-- << Snip >> --
Index: genkernel
===================================================================
RCS file: /home/cvsroot/gentoo/src/genkernel_bradmssw/genkernel,v
retrieving revision 1.21
diff -u -r1.21 genkernel
--- genkernel	2 Apr 2004 20:27:42 -0000	1.21
+++ genkernel	8 Apr 2004 15:22:46 -0000
@@ -58,9 +58,15 @@
 
 if ! has_loop
 then
-	print_error print_info 1 "Your kernel does not appear to have loop device support. "
-	print_error print_info 1 "Please 'modprobe loop' if it is a module before running genkernel"
-	gen_die "Load loop support!"
+	modprobe loop 2>/dev/null
+	if ! has_loop
+	then
+		print_error 1 "Your kernel does not appear to have loop device support. "
+		print_error 1 "Please load loop support before running genkernel!"
+		gen_die "Load loop support!"
+	else
+		print_info 1 'loop: "loop" module loaded successfully...'
+	fi
 fi
 
 # Check /boot is mounted
-- << Snip >> --
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2004-04-11 07:50:54 UTC
Patch in Genkernel 3.0.2a. If there any more issues, feel free to reopen this bug. Thanks!