Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems using etherboot 3.1 - long



Hello,

Harold Baur <hb@hoyte.nl> wrote:
> Ad 1.
> 	The configure script generates errros. As a result of this
> I cannot do a "make bootrom" as suggested in the INSTALL file.
> Here's the output:
> [...]
> creating bootrom/make.defs
> sed: can't read /home/bo/etherboot-3.1/netboot-0.5.3/./bootrom/make.defs.in: No such file or directory
> mkdir: cannot make directory `bootrom/utils/utilsrc': No such file or directory
> creating bootrom/utils/utilsrc/Makefile
> ./config.status: bootrom/utils/utilsrc/Makefile: No such file or directory
> creating config.h

This looks like a mixup in the etherboot package. Please get the complete
netboot package from sunsite and try again. The configure script can only
run when you have the full netboot sources.

> Ad 2.
> [...]
> I figured this is a device problem, and indeed when I look at the device
> numbers on the NFS mounted system I see that all major numbers are 0.
> [...]
> cp them to server (HP-UX):
> crw-------   1 root     root      18 0x000004 Feb 19  1994 udp
> [...]
> Oops. Major number is 0.  This appears to be a problem with nfsd
> on the HP-UX, but I am not sure. The documentation doesn't mention
> it at all.

With the help of Jens-Uwe Mager (thanks to him) I think that I got a
solution to this. The problem is the different representation of major/
minor numbers on the filesystems. While HP-UX (and most other systems)
use 32 bit for encoding both major and minor, Linux just uses 16 bit.
However, the NFS protocol always transfers 32 bits. Now, the encoding
of device numbers on HP-UX looks like (with "a" being a bit of the major
number, and "b" being a bit of the minor number):

	major << 24 | minor	==>  aaaaaaaabbbbbbbbbbbbbbbbbbbbbbbb

while on Linux it looks like:

	major << 8 | minor	==>  0000000000000000aaaaaaaabbbbbbbb

As you can see, the full Linux definition fits into the minor number
space on HP-UX. So in order to produce devices which can be exported
via NFS correctly, you should go to your HP-UX system and issue a
mknod command with major number 0, and the minor number computed the
way Linux wants it. Let's say you want to create a device which looks
to Linux like major/minor = 18/4. Then you can calculate the minor
number to use on HP-UX as follows:

	18 << 8 | 4  =  4608 | 4  =  4612

So you should issue the following command on your HP-UX:

	mknod udp c 0 4612

A device created this way will then look correctly when exported to your
Linux system. Since HP-UX understands hex with the mknod command, you could
alternatively also issue the command

	mknod udp c 0 0x1204

For everybody having the same problem also with other servers, maybe the
following small program might be useful. It does not depend on the re-
presentation of the MKDEV system macro on each different platform, but
rather always uses the way, Linux wants device codes to be assembled.

=========================================================================
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>

void main(int argc, char **argv)
{
  char *fname;
  int major, minor;
  mode_t mode;
  dev_t dev;

  if (argc != 5) {
	fprintf(stderr, "Usage: mknod-linux <name> <type> <major> <minor>\n");
	exit(1);
  }
  fname = argv[1];
  major = atoi(argv[3]) & 0xff;
  minor = atoi(argv[4]) & 0xff;
  if (!strcmp(argv[2], "c"))
	mode = 0666 | S_IFCHR;
  else if (!strcmp(argv[2], "b"))
	mode = 0666 | S_IFBLK;
  else {
	fprintf(stderr, "Error: <type> has to be either <c> or <b>\n");
	exit(1);
  }
  dev = major << 8 | minor;
  if (mknod(fname, mode, dev) < 0) {
	perror("mknod");
	exit(1);
  }
  exit(0);
}
=========================================================================

This program is just a quick hack, and not very sensitive about errors
on command line options. You would also need to port it to different
platforms, as I didn't care about that. However, when you run this
program on your HP-UX (or AIX or Solaris or whatever), and give it
the major/minor numbers you want to see on your Linux box after NFS
export, it will create a device entry which looks like described above
on your server. For example, if you name the above sample program
mknod-linux, and call it on your HP box with

	mknod-linux udp c 4 18

you will (hopefully ;-)) get this output with ls -l:

crw-------   1 root     root       0 0x001204 Feb 19  1994 udp

just as in the example above. After mounting the directory via NFS, Linux
however will show you the same directory entry as:

crw-------   1 root     root      18,   4 Feb 19  1994 udp

which is what you wanted. But please note that so far this is all theory! Since
I don't have anything else but Linux available at the moment I can't tell you
whether this really works or not, but I think so.


> Ad 3.
> 	Since I can't do an NFS mount I'll do it with a ramdisk.
> After preparing a compressed filesystem image, I run

Try an uncompressed filesystem image. I don't think Linux can handle
compressed ones.

gero.

--
I hate quotations.  Tell me what you know.
  - Ralph Waldo Emerson
--
Gero Kuhlmann, Hannover     0511/6497525 (Voice)        gero@gkminix.han.de



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.