Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2013-02-25 20:38:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/linuxrc (Old) and /work/SRC/openSUSE:Factory/.linuxrc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "linuxrc", Maintainer is "snw...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes 2013-01-17 09:48:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2013-02-25 20:38:32.000000000 +0100 @@ -1,0 +2,6 @@ +Mon Feb 25 14:09:56 CET 2013 - snw...@suse.de + +- nfs: use mount(8) and mount.nfs(8) to mount nfs exports (bnc #799496) +- if no install url given, try dvds, then hds + +------------------------------------------------------------------- Old: ---- linuxrc-4.1.4.tar.bz2 New: ---- linuxrc-4.1.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.iH16Fw/_old 2013-02-25 20:38:33.000000000 +0100 +++ /var/tmp/diff_new_pack.iH16Fw/_new 2013-02-25 20:38:33.000000000 +0100 @@ -24,9 +24,9 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 4.1.4 +Version: 4.1.5 Release: 0 -Source: linuxrc-4.1.4.tar.bz2 +Source: linuxrc-4.1.5.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ++++++ linuxrc-4.1.4.tar.bz2 -> linuxrc-4.1.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.1.4/VERSION new/linuxrc-4.1.5/VERSION --- old/linuxrc-4.1.4/VERSION 2013-01-16 14:42:31.000000000 +0100 +++ new/linuxrc-4.1.5/VERSION 2013-02-25 15:55:40.000000000 +0100 @@ -1 +1 @@ -4.1.4 +4.1.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.1.4/auto2.c new/linuxrc-4.1.5/auto2.c --- old/linuxrc-4.1.4/auto2.c 2012-11-26 13:43:57.000000000 +0100 +++ new/linuxrc-4.1.5/auto2.c 2013-02-25 15:54:14.000000000 +0100 @@ -56,10 +56,19 @@ */ int auto2_init() { - int ok, win_old; + int ok, win_old, install_unset = 0; auto2_scan_hardware(); + /* set default repository: try dvd drives */ + if(!config.url.install) { + install_unset = 1; + config.url.install = url_set("cd:/"); + } + if(!config.url.instsys) { + config.url.instsys = url_set(config.url.instsys_default ?: config.rescue ? config.rescueimage : config.rootimage); + } + if(config.sig_failed) return 0; util_splash_bar(40, SPLASH_40); @@ -83,6 +92,12 @@ ok = auto2_find_repo(); + /* try again, hard disks */ + if(!ok && install_unset) { + config.url.install = url_set("hd:/"); + ok = auto2_find_repo(); + } + if(config.debug) fprintf(stderr, "ZyppRepoURL: %s\n", url_print(config.url.install, 4)); LXRC_WAIT @@ -414,12 +429,6 @@ } } } - - /* set default repository */ - if(!config.url.install) config.url.install = url_set("cd:/"); - if(!config.url.instsys) { - config.url.instsys = url_set(config.url.instsys_default ?: config.rescue ? config.rescueimage : config.rootimage); - } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.1.4/changelog new/linuxrc-4.1.5/changelog --- old/linuxrc-4.1.4/changelog 2013-01-16 14:42:32.000000000 +0100 +++ new/linuxrc-4.1.5/changelog 2013-02-25 15:55:41.000000000 +0100 @@ -1,4 +1,8 @@ -2013-01-16: HEAD +2013-02-25: sl_12.3-4.1.5 + - nfs: use mount(8) and mount.nfs(8) to mount nfs exports (bnc #799496) + - if no install url given, try dvds, then hds + +2013-01-16: sl_12.3-4.1.4 - drop /etc/nothing 2013-01-15: 4.1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.1.4/net.c new/linuxrc-4.1.5/net.c --- old/linuxrc-4.1.4/net.c 2012-11-26 13:43:57.000000000 +0100 +++ new/linuxrc-4.1.5/net.c 2013-02-25 15:54:14.000000000 +0100 @@ -6,6 +6,7 @@ * */ +#define _GNU_SOURCE 1 #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -34,6 +35,7 @@ #include <netinet/in.h> #include <netinet/ether.h> #include <nfs/nfs.h> +#include <sys/wait.h> #include "nfs_mount4.h" /* this is probably the wrong solution... */ @@ -78,7 +80,6 @@ static int net_choose_device(void); static int net_input_data(void); #endif -static void net_show_error(enum nfs_stat status_rv); static int _net_mount_nfs(char *mountpoint, inet_t *server, char *hostdir, unsigned port, int flags); static void if_down(char *dev); @@ -1209,117 +1210,67 @@ */ int _net_mount_nfs(char *mountpoint, inet_t *server, char *hostdir, unsigned port, int flags) { - struct sockaddr_in server_in, mount_server_in; - struct nfs_mount_data mount_data; - CLIENT *client; - int sock, fsock, err, i; - struct timeval tv; - struct fhstatus fhs; - char *buf = NULL; + int i = 0; + char addr[INET6_ADDRSTRLEN]; + char *args[6]; + char *path; + char options[4096]; + int err, len = 0; + pid_t mount_pid; if(net_check_address(server, 1)) return -2; if(!hostdir) hostdir = "/"; if(!mountpoint || !*mountpoint) mountpoint = "/"; - memset(&server_in, 0, sizeof server_in); - server_in.sin_family = AF_INET; - server_in.sin_addr.s_addr = server->ip.s_addr; - memcpy(&mount_server_in, &server_in, sizeof mount_server_in); - memset(&mount_data, 0, sizeof mount_data); - mount_data.flags = flags; - mount_data.rsize = config.net.nfs.rsize; - mount_data.wsize = config.net.nfs.wsize; - mount_data.retrans = 3; - mount_data.acregmin = 3; - mount_data.acregmax = 60; - mount_data.acdirmin = 30; - mount_data.acdirmax = 60; - mount_data.namlen = NAME_MAX; - mount_data.version = NFS_MOUNT_VERSION; - - /* two tries */ - for(i = 0, client = NULL; i < 2 && !client; i++) { - if(i) sleep(2); - mount_data.timeo = 7; - mount_server_in.sin_port = htons(0); - sock = RPC_ANYSOCK; - tv.tv_sec = 3; - tv.tv_usec = 0; - client = clntudp_create(&mount_server_in, MOUNTPROG, MOUNTVERS, tv, &sock); - } - - if(!client) { - net_show_error(-1); - - return -1; - } - - client->cl_auth = authunix_create_default(); - tv.tv_sec = 20; - tv.tv_usec = 0; - - err = clnt_call(client, MOUNTPROC_MNT, - (xdrproc_t) xdr_dirpath, (caddr_t) &hostdir, - (xdrproc_t) xdr_fhstatus, (caddr_t) &fhs, - tv - ); - - if(err) { - net_show_error(-1); - return -1; - } - - if(fhs.fhs_status) { - net_show_error(fhs.fhs_status); - - return -1; - } - - memcpy(&mount_data.root.data, fhs.fhstatus_u.fhs_fhandle, NFS_FHSIZE); - mount_data.root.size = NFS_FHSIZE; - - memcpy(&mount_data.old_root.data, fhs.fhstatus_u.fhs_fhandle, NFS_FHSIZE); - - fsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if(fsock < 0) { - net_show_error(-1); - - return -1; - } - - if(bindresvport(fsock, 0) < 0) { - net_show_error(-1); - - return -1; - } - - if(!port) { - server_in.sin_port = PMAPPORT; - port = pmap_getport(&server_in, NFS_PROGRAM, NFS_VERSION, IPPROTO_UDP); - if(!port) port = NFS_PORT; - } - - server_in.sin_port = htons(port); - - mount_data.fd = fsock; - memcpy(&mount_data.addr, &server_in, sizeof mount_data.addr); - - strncpy(mount_data.hostname, inet_ntoa(server->ip), sizeof mount_data.hostname); - - auth_destroy(client->cl_auth); - clnt_destroy(client); - close(sock); - - strprintf(&buf, "%s:%s", inet_ntoa(server->ip), hostdir); - - err = mount(buf, mountpoint, "nfs", MS_RDONLY | MS_MGC_VAL, &mount_data); - - free(buf); - - if(err == -1) return errno; - - return err; + mount_pid = fork(); + if (mount_pid < 0) { + perror("fork"); + return mount_pid; + } else if (mount_pid > 0) { + int err; + pid_t pid; + while((pid = waitpid(-1, &err, 0)) && pid != mount_pid); + return WEXITSTATUS(err); + } + + if (server->ipv4) + err = asprintf(&path, "%s:%s", + inet_ntop(AF_INET, &server->ip.s_addr, addr, + INET_ADDRSTRLEN), hostdir); + else + err = asprintf(&path, "[%s]:%s", + inet_ntop(AF_INET6, &server->ip6.s6_addr, addr, + INET6_ADDRSTRLEN), hostdir); + if (err < 0) { + perror("asprintf"); + return err; + } + + len = snprintf(options, sizeof(options), "%s%s%sretrans=%d,timeo=%d", + flags & NFS_MOUNT_TCP ? "tcp," : "", + flags & NFS_MOUNT_VER3 ? "vers=3," : "", + flags & NFS_MOUNT_NONLM ? "nolock," : "", + 3, 7); + + if (config.net.nfs.rsize && len < sizeof(options)) + len += snprintf(options, sizeof(options) - len, + ",rsize=%d", config.net.nfs.rsize); + if (config.net.nfs.wsize && len < sizeof(options)) + len += snprintf(options, sizeof(options) - len, + ",wsize=%d", config.net.nfs.wsize); + + args[i++] = "mount"; + args[i++] = "-o"; + args[i++] = options; + args[i++] = path; + args[i++] = mountpoint; + args[i++] = NULL; + + signal(SIGUSR1, SIG_IGN); + execvp("mount", args); + perror("execvp(\"mount\")"); + exit(EXIT_FAILURE); } @@ -1540,71 +1491,6 @@ } #endif - -/* - * Show NFS error messages. - * - * Helper for net_mount_nfs(). - * - * nfs_stat: NFS status - */ -static void net_show_error(enum nfs_stat status_rv) -{ - int i; - char *s, tmp[1024], tmp2[64]; - - struct { - enum nfs_stat stat; - int errnumber; - } nfs_err[] = { - { NFS_OK, 0 }, - { NFSERR_PERM, EPERM }, - { NFSERR_NOENT, ENOENT }, - { NFSERR_IO, EIO }, - { NFSERR_NXIO, ENXIO }, - { NFSERR_ACCES, EACCES }, - { NFSERR_EXIST, EEXIST }, - { NFSERR_NODEV, ENODEV }, - { NFSERR_NOTDIR, ENOTDIR }, - { NFSERR_ISDIR, EISDIR }, - { NFSERR_INVAL, EINVAL }, - { NFSERR_FBIG, EFBIG }, - { NFSERR_NOSPC, ENOSPC }, - { NFSERR_ROFS, EROFS }, - { NFSERR_NAMETOOLONG, ENAMETOOLONG }, - { NFSERR_NOTEMPTY, ENOTEMPTY }, - { NFSERR_DQUOT, EDQUOT }, - { NFSERR_STALE, ESTALE } - }; - - s = NULL; - - for(i = 0; (unsigned) i < sizeof nfs_err / sizeof *nfs_err; i++) { - if(nfs_err[i].stat == status_rv) { - s = strerror(nfs_err[i].errnumber); - break; - } - } - - if(!s) { - sprintf(tmp2, "unknown error %d\n", status_rv); - s = tmp2; - } - - sprintf(tmp, - config.win ? txt_get(TXT_ERROR_NFSMOUNT) : "mount: nfs mount failed, server says: %s\n", - s - ); - - if(config.win) { - dia_message(tmp, MSGTYPE_ERROR); - } - else { - fprintf(stderr, "%s\n", tmp); - } -} - - /* * Let user enter nameservers. * -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org