[Clfs-dev] Weirdness.

Bryan Kadzban bryan at kadzban.is-a-geek.net
Wed Dec 26 14:26:51 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Ken Moffat wrote:
> On Wed, Dec 26, 2007 at 01:04:27PM -0500, Bryan Kadzban wrote:
>> It looks like something may be going wrong higher up the NFS stack?
>> 
>> 
> Possible, but no obvious issues when I copied the kernel and modules
> to an older system.

Hmm.  If NFS is done completely inside the kernel, then I'm not sure
what the deal would be there.  (If it's done with a user-mode helper,
like smbfs / cifs, though, then that may be part of the issue too.)

>> Without a keyboard, it's hard to do much -- can this box use a
>> serial console?  It'd be interesting to see whether there are any
>> NFS related errors in the kernel logs after the mount fails.
> 
> So far, I've avoided serial consoles.  Looking round the back (it's a
> G4 mac mini) the only practical option might be a net console - I'll
> need to read up about that, and I think it might need a reconfigured
> kernel.

A netconsole (at least on x86, but I wouldn't expect many differences on
PPC) will basically just spew each message to a remote IP and UDP port.
I don't think it will let you input anything (but maybe that doesn't
matter, either).

I have a listener here somewhere that just logs each received datagram's
contents to a file along with the IP it received the datagram from;
running this on the remote machine should make it work.  The source is
attached.  To actually log to this, you have to add this to the kernel
command line:

netconsole=4444 at local-ip/eth0,6666 at remote-ip/remote-mac

Replace "local-ip" with the local machine's IP, "eth0" with the local
machine's device (this device's driver must support netpoll on x86; I
don't know if it has to support it on PPC or not, but I think it does),
"remote-ip" with the remote machine's IP, and "remote-mac" with the
remote machine's MAC address (colon-separated).  If you don't include
the remote-mac parameter, the packets will be sent to the broadcast MAC
address (all-ones).

>> Alternately, does it work any differently if you use init=/bin/bash
>> and run the bootscripts manually, one at a time?
> 
> Would you believe still no keyboard

Actually, that would make more sense, now that I think about it.  ;-)

Losing the keyboard after trying to load NFS makes less sense than never
having it in the first place.

> - even on the original host system running its earlier 2.6.23 kernel.
> 
Missing initramfs on the new system perhaps, where the old one had one?
Or possibly a module that drives the keyboard that isn't getting loaded
in the initramfs (or there isn't one), and also isn't getting loaded by
udev automatically anymore for some reason?

If you know the module name for the keyboard driver, see if it has any
aliases that would map to something that's in one of the modalias sysfs
attributes.  Actually, see if the modalias is present on the old kernel
(it probably is), and then see if it got removed in the new kernel.

> I've avoided touching that part because the PS/2->usb keyboard works
> fine

Is the keyboard USB?  If so, you'll need the USB controller driver
(obviously), and also the hid driver.  (But once you load the USB
controller, it should discover the keyboard and load the hid driver via
udevd and a modalias.  Assuming udevd is running...)

If it's USB, does it make any difference if you try a PS/2 adapter?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHctUqS5vET1Wea5wRAwXVAKCj8ek9Dz8A6W5D0t+KV0dGVc+0ZQCgkbH1
AXUyljseKai9A/7okao+LDg=
=NCuV
-----END PGP SIGNATURE-----
-------------- next part --------------
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <unistd.h>

int main()
{
	int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
	int reuse = 1;
	struct sockaddr_in sa, sa_msg;
	socklen_t len;
	char buf[4096];
	ssize_t rv;

	char fname[1024];
	FILE *fp;

	if(sock < 0) {
		perror("socket");

		return 1;
	}

	if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) < 0) {
		perror("setsockopt");

		goto err_close;
	}

	sa.sin_family = AF_INET;
	sa.sin_addr.s_addr = htonl(INADDR_ANY);
	sa.sin_port = htons(6666);

	if(bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
		perror("bind");

		goto err_close;
	}

	snprintf(fname, sizeof(fname), "%s/kernlog.txt", getenv("HOME"));
	fp = fopen(fname, "w");

	if(!fp) {
		perror("fopen");

		goto err_close;
	}

	while(1) {
		len = sizeof(sa_msg);

		if((rv = recvfrom(sock, buf, sizeof(buf) - 1, 0, (struct sockaddr *)&sa_msg, &len)) < 0) {
			perror("recv");

			goto err_fclose;
		}

		buf[rv] = '\0';

		fprintf(fp, "%s: %s", inet_ntoa(sa_msg.sin_addr), buf);
		fflush(fp);
	}

	return 0;

err_fclose:
	fclose(fp);

err_close:
	close(sock);
	return 1;
}


More information about the Clfs-dev mailing list