/* * Parse NFS server and directory information passed on the kernel * command line. */ static int __init nfs_root_setup(char *line) { ROOT_DEV = Root_NFS; if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) { strlcpy(nfs_root_name, line, sizeof(nfs_root_name)); } else { int n = strlen(line) + sizeof(NFS_ROOT) - 1; if (n >= sizeof(nfs_root_name)) line[sizeof(nfs_root_name) - sizeof(NFS_ROOT) - 2] = '\0'; sprintf(nfs_root_name, NFS_ROOT, line); } root_server_addr = root_nfs_parse_addr(nfs_root_name); return 1; }
/* * Parse NFS server and directory information passed on the kernel * command line. */ int __init nfs_root_setup(char *line) { ROOT_DEV = MKDEV(UNNAMED_MAJOR, 255); 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'; } else { int n = strlen(line) + strlen(NFS_ROOT); if (n >= sizeof(nfs_root_name)) line[sizeof(nfs_root_name) - strlen(NFS_ROOT) - 1] = '\0'; sprintf(nfs_root_name, NFS_ROOT, line); } root_server_addr = root_nfs_parse_addr(nfs_root_name); return 1; }
/* * Parse NFS server and directory information passed on the kernel * command line. * * nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] * * If there is a "%s" token in the <root-dir> string, it is replaced * by the ASCII-representation of the client's IP address. */ static int __init nfs_root_setup(char *line) { ROOT_DEV = Root_NFS; if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) { strlcpy(nfs_root_parms, line, sizeof(nfs_root_parms)); } else { size_t n = strlen(line) + sizeof(NFS_ROOT) - 1; if (n >= sizeof(nfs_root_parms)) line[sizeof(nfs_root_parms) - sizeof(NFS_ROOT) - 2] = '\0'; sprintf(nfs_root_parms, NFS_ROOT, line); } /* * Extract the IP address of the NFS server containing our * root file system, if one was specified. * * Note: root_nfs_parse_addr() removes the server-ip from * nfs_root_parms, if it exists. */ root_server_addr = root_nfs_parse_addr(nfs_root_parms); return 1; }