Messages in this thread Patch in this message | | | Date | Mon, 15 Apr 1996 18:09:59 +0200 (MET DST) | From | Swen Thuemmler <> | Subject | Some enhancements for nfsroot |
| |
-----BEGIN PGP SIGNED MESSAGE-----
Hi,
I've made some enhancements for nfsroot. The attached patches allow a commandline like nfsroot=,rsize=8192,wsize=8192 nfsaddrs=bootp
i.E. setting the root directory from bootp, but still allowing setting the mount options. Additionally, setting the NIS domainname via bootp is fixed (it was falsely assumed that dommainname is the DNS domain), and the dummy device is skipped for bootp requests.
Hope you find this useful, master
Greetings, Swen
- --- linux/init/main.c.orig Mon Apr 15 18:01:27 1996 +++ linux/init/main.c Mon Apr 15 18:02:21 1996 @@ -521,7 +521,7 @@ int n; line += 8; ROOT_DEV = MKDEV(UNNAMED_MAJOR, 255); - - if (line[0] == '/' || (line[0] >= '0' && line[0] <= '9')) { + if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) { strncpy(nfs_root_name, line, sizeof(nfs_root_name)); nfs_root_name[sizeof(nfs_root_name)-1] = '\0'; continue; - --- linux/fs/nfs/nfsroot.c.orig Mon Apr 15 17:58:39 1996 +++ linux/fs/nfs/nfsroot.c Mon Apr 15 18:01:02 1996 @@ -47,6 +47,10 @@ * from being used (thanks to Leo Spiekman) * Andy Walker : Allow to specify the NFS server in nfs_root * without giving a path name + * Swen Thümmler : Allow to specify the NFS options in nfs_root + * without giving a path name. Fix BOOTP request + * for domainname (domainname is NIS domain, not + * DNS domain!). Skip dummy devices for BOOTP. * */
@@ -168,6 +172,7 @@ if (dev->type < ARPHRD_SLIP && dev->family == AF_INET && !(dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) && + (0 != strncmp(dev->name, "dummy", 5)) && (!user_dev_name[0] || !strcmp(dev->name, user_dev_name))) { /* First up the interface */ old_flags = dev->flags; @@ -622,7 +627,7 @@ *e++ = 12; /* Host name request */ *e++ = 32; e += 32; - - *e++ = 15; /* Domain name request */ + *e++ = 40; /* NIS Domain name request */ *e++ = 32; e += 32; *e++ = 17; /* Boot path */ @@ -756,7 +761,6 @@ static void root_do_bootp_ext(u8 *ext) { u8 *c; - - static int got_bootp_domain = 0;
#ifdef NFSROOT_BOOTP_DEBUG printk("BOOTP: Got extension %02x",*ext); @@ -775,20 +779,9 @@ memcpy(&gateway.sin_addr.s_addr, ext+1, 4); break; case 12: /* Host name */ - - if (root_bootp_string(system_utsname.nodename, ext+1, *ext, __NEW_UTS_LEN)) { - - c = strchr(system_utsname.nodename, '.'); - - if (c) { - - *c++ = 0; - - if (!system_utsname.domainname[0]) { - - strcpy(system_utsname.domainname, c); - - got_bootp_domain = 1; - - } - - } - - } + root_bootp_string(system_utsname.nodename, ext+1, *ext, __NEW_UTS_LEN); break; - - case 15: /* Domain name */ - - if (got_bootp_domain && *ext && ext[1]) - - system_utsname.domainname[0] = '\0'; + case 40: /* NIS Domain name */ root_bootp_string(system_utsname.domainname, ext+1, *ext, __NEW_UTS_LEN); break; case 17: /* Root path */ @@ -1094,7 +1087,9 @@ printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n"); return -1; } - - sprintf(nfs_path, buf, cp); + /* update nfs_path with path from nfsroot=... command line parameter */ + if (*buf) + sprintf(nfs_path, buf, cp);
/* Set some default values */ nfs_port = -1;
-----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMXJ04UTyQF8U8wFLAQGfXwP/RITXXscjz/qtuTz0nbOR/IXTORGE0PvC XSgss+jPB6dSmMaUTaJ5+y2qv7xr0X4bhLESWSXI03/esnNNgVbTwDF5VXIzAFoP E86DtKHL29JxLhGLzuQjsDKIwTM8JgU5pGiuGDU84WK211OmJ1SMiAXQZU0X0MnG Nse/W1HJBGc= =sBZE -----END PGP SIGNATURE-----
| |