Summary: | genkernel and 2.6.25* with busybox makes all device nodes as unbootable character devices | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Robin Johnson <robbat2> |
Component: | genkernel | Assignee: | Gentoo Genkernel Maintainers <genkernel> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | dschridde+gentoobugs, mail, sping, virdiq |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 218127 | ||
Attachments: |
busybox-1.1.3+gentoo-mdev-1.9.0.patch
busybox-1.1.3+gentoo-mdev-block.patch Proposed patch using strstr function to check for block devices |
Description
Robin Johnson
2008-03-02 00:13:49 UTC
Ok, the trivial change of strncmp -> strcmp doesn't help it. I'm trying a few other bits, incl moving the entire busybox forward to 1.9.0, or back-porting the 1.9.0 mdev. Created attachment 145057 [details, diff]
busybox-1.1.3+gentoo-mdev-1.9.0.patch
This patch is the clones the code used to set the devnode type from 1.9.0 to the 1.1.3 branch. It relies on the fact that the char devnodes 'dev' under /sys/class. This is NOT foolproof, as ttyXX and a lot of other devices are under the /sys/device hierarchy instead of /sys/class or /sys/block.
It does work, but I don't trust it.
Created attachment 145058 [details, diff]
busybox-1.1.3+gentoo-mdev-block.patch
Here's another patch that I came up with, it uses the detection of the string "block/" using strstr(path,"block/").
The trailing slash is important because there are some items in sysfs that have block as part of the name. This seems to work better than the check from 1.9.0 for now, and while it's not fool-proof, I'd call it good enough to use.
Is this bug still valid with the new busybox in genkernel? this bug can go away with the new busybox (which is where I borrowed the code for the first patch on here anyway). Just if we have crazy devices in the initramfs in the future, remember the second patch maybe. I guess this is INVALID now, since the busybox with the problem is no longer used :P Actually, this was FIXED... We'll RESOLVED-FIXED it once 3.4.10 final is out. I've tried both busybox 1.10.1-r2 (which includes current patches from upstream) and my own vanilla busybox 1.10.1 with all upstream patches applied directly from http://busybox.net/downloads/fixes-1.10.1/ The kernel I'm testing against is vanilla-sources-2.6.25.2 (with the deprecated sysfs structures switched off). I'm using a static build of busybox in an initrd script with mdev being used with kernel hotplug (and also being used manually with mdev -s). It seems that mdev is still populating /dev with character devices regardless of what type of device it should actually be. Can anyone please confirm if busybox-1.10.1-r2 actually fixes this mdev bug (from experience/testing)? Or is it just me that is still having problems? Thanks Created attachment 153091 [details, diff] Proposed patch using strstr function to check for block devices Also suggested upstream via the mailing list (see http://busybox.net/lists/busybox/2008-May/031408.html) i have reportet this bug alredy: https://bugs.gentoo.org/show_bug.cgi?id=220993 1.10.1-r3 still has the same issue... But fixed in 1.10.3 (vanilla), see bug #226101. So this is *not* fixed using genkernel 3.4.9 or 3.4.10-r1 (without modifying the busybox version used) correct? Friendly reminder: we'll probably push for 2.6.25 stable in the next week or so, so it would be great to see this fixed If this is going to get fixed soon, someone will need to provide a patch against mdev in busybox-1.7.4, since that's what we're currently using in genkernel-3.4.10. We just went through an upgrade of busybox from 1.1.3 to 1.7.4, and I'm not doing that again any time soon. (In reply to comment #10) > Created an attachment (id=153091) [edit] > Proposed patch using strstr function to check for block devices Will this patch work properly with mdev from 1.7.4 as well? This appears to have finally been fixed upstream in revision 22814. See: http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/util-linux/mdev.c?rev=22814&r1=22813&r2=22814&diff_format=h I haven't tried this upstream version yet. However it essentially the same as the patch I posted here a few months ago, with a change to the if/else branch to allow better CPU branch prediction (I think). The patch I submitted here for revision 21977 will not work with 1.7.4 because the block/char determination at that time was: /* Determine device name, type, major and minor */ device_name = bb_basename(path); type = path[5]=='c' ? S_IFCHR : S_IFBLK; (see http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/util-linux/mdev.c?rev=19676&view=markup ) It should however be fairly easy to backport revision 22814 to use strstr to determine the value of 'type', rather than the old school method of checking the 5th character in the device path name. This one looks oh-so-fun... We probably want to try to get this done for 3.4.11's release. Could any of you help us with the 1.7.4 patches? If not, it'll likely take much longer to get done, since the genkernel team has very limited manpower and developer time. Was there a change in newer kernels that fixed this? I've built a CD based of 2.6.26 and 2.6.27 without problems. I'm going to call this one fixed, because I haven't seen this one myself with the newer busybox and 2.6.2[67] kernels. Due to the date of the last comment on this bug I assume that feature to be included in 3.4.10.907 or an earlier release of genkernel. Therefore, I remove this bug from tracker bug #245389 "Features for inclusion by 3.4.11". |