commit linuxrc for openSUSE:Factory
Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2014-04-14 06:43:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/linuxrc (Old) and /work/SRC/openSUSE:Factory/.linuxrc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "linuxrc" Changes: -------- --- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes 2014-04-09 18:17:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2014-04-14 06:43:28.000000000 +0200 @@ -1,0 +2,15 @@ +Fri Apr 11 14:25:12 CEST 2014 - snwint@suse.de + +- simplify s390x hypervisor detection code +- passing ssl_verify option to yast (bnc #807799) +- don't load edd.ko on efi systems (bnc #837747) +- fix nextmedia handling (bnc #813141) +- get ibft parsing code from sle11 branch +- try harder to resolve mac addresses to interface names (bnc #806593) + +------------------------------------------------------------------- +Fri Apr 11 10:07:45 CEST 2014 - snwint@suse.de + +- add withipoib option to trigger loading ip over infiniband modules (bnc #865852) + +------------------------------------------------------------------- Old: ---- linuxrc-4.2.16.tar.bz2 New: ---- linuxrc-4.2.18.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.BZBHda/_old 2014-04-14 06:43:28.000000000 +0200 +++ /var/tmp/diff_new_pack.BZBHda/_new 2014-04-14 06:43:28.000000000 +0200 @@ -25,9 +25,9 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 4.2.16 +Version: 4.2.18 Release: 0 -Source: linuxrc-4.2.16.tar.bz2 +Source: linuxrc-4.2.18.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ++++++ linuxrc-4.2.16.tar.bz2 -> linuxrc-4.2.18.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/VERSION new/linuxrc-4.2.18/VERSION --- old/linuxrc-4.2.16/VERSION 2014-04-08 09:08:35.000000000 +0200 +++ new/linuxrc-4.2.18/VERSION 2014-04-11 14:25:05.000000000 +0200 @@ -1 +1 @@ -4.2.16 +4.2.18 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/changelog new/linuxrc-4.2.18/changelog --- old/linuxrc-4.2.16/changelog 2014-04-08 09:08:36.000000000 +0200 +++ new/linuxrc-4.2.18/changelog 2014-04-11 14:25:07.000000000 +0200 @@ -1,4 +1,17 @@ -2014-04-08: HEAD +2014-04-11: HEAD + - simplify s390x hypervisor detection code + - fix include + - passing ssl_verify option to yast (bnc #807799) + - more fixes for nextmedia handling (bnc #813141) + - don't load edd.ko on efi systems (bnc #837747) + - fix nextmedia handling (bnc #813141) + - get ibft parsing code from sle11 branch + - try harder to resolve mac addresses to interface names (bnc #806593) + +2014-04-11: 4.2.17 + - add withipoib option to trigger loading ip over infiniband modules (bnc #865852) + +2014-04-08: 4.2.16 - Merge pull request #6 from openSUSE/iucvtest - Introduce detection of z/VM or LPAR hypervisors. - Added util_umount('/sys/hypervisor/s390'); to lxrc_end. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/file.c new/linuxrc-4.2.18/file.c --- old/linuxrc-4.2.16/file.c 2014-03-10 13:09:19.000000000 +0100 +++ new/linuxrc-4.2.18/file.c 2014-04-11 14:04:54.000000000 +0200 @@ -307,6 +307,7 @@ { key_restart, "Restart", kf_cfg }, { key_restarted, "Restarted", kf_cfg }, { key_wicked, "Wicked", kf_cfg + kf_cmd + kf_cmd_early }, + { key_withipoib, "WithIPoIB", kf_cfg + kf_cmd_early }, }; static struct { @@ -1638,6 +1639,10 @@ if(f->is.numeric) config.wicked = f->nvalue; break; + case key_withipoib: + if(f->is.numeric) config.withipoib = f->nvalue; + break; + default: break; } @@ -1815,6 +1820,7 @@ fprintf(f, "RepoURL: %s\n", url_print(url, 3)); fprintf(f, "InstsysURL: %s\n", url_print(config.url.instsys, 3)); fprintf(f, "ZyppRepoURL: %s\n", url_print(url, 4)); + if(!config.sslcerts) fprintf(f, "ssl_verify: no\n"); file_write_str(f, key_instmode, get_instmode_name(url->scheme)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/file.h new/linuxrc-4.2.18/file.h --- old/linuxrc-4.2.16/file.h 2014-03-10 13:09:19.000000000 +0100 +++ new/linuxrc-4.2.18/file.h 2014-04-11 09:50:20.000000000 +0200 @@ -52,7 +52,8 @@ key_ipv6, key_ipv6only, key_usesax2, key_efi, key_supporturl, key_portno, key_osahwaddr, key_zen, key_zenconfig, key_udevrule, key_dhcpfail, key_namescheme, key_ptoptions, key_is_ptoption, key_withfcoe, key_digests, - key_plymouth, key_sslcerts, key_restart, key_restarted, key_wicked, key_autoyast2 + key_plymouth, key_sslcerts, key_restart, key_restarted, key_wicked, key_autoyast2, + key_withipoib } file_key_t; typedef enum { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/global.h new/linuxrc-4.2.18/global.h --- old/linuxrc-4.2.16/global.h 2014-04-08 08:07:11.000000000 +0200 +++ new/linuxrc-4.2.18/global.h 2014-04-11 09:49:55.000000000 +0200 @@ -374,6 +374,7 @@ unsigned usesax2:1; /* just passed to yast */ unsigned withiscsi; /* iSCSI parameter */ unsigned withfcoe; /* FCoE parameter */ + unsigned withipoib; /* IPoIB */ unsigned restart_method; /* 0: start new root fs, 1: reboot, 2: halt, 3: kexec */ unsigned efi_vars:1; /* efi vars exist */ int efi; /* use efi; -1 = auto */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/linuxrc.c new/linuxrc-4.2.18/linuxrc.c --- old/linuxrc-4.2.16/linuxrc.c 2014-04-08 08:07:11.000000000 +0200 +++ new/linuxrc-4.2.18/linuxrc.c 2014-04-11 14:23:16.000000000 +0200 @@ -43,6 +43,7 @@ #include "auto2.h" #include "scsi_rename.h" #include "checkmedia.h" +#include "url.h" #if defined(__alpha__) || defined(__ia64__) #define SIGNAL_ARGS int signum, int x, struct sigcontext *scp @@ -695,32 +696,22 @@ #if defined(__s390__) || defined(__s390x__) if(util_check_exist("/sys/hypervisor/s390")) { - mount("s390_hypfs","/sys/hypervisor/s390","s390_hypfs", 0, 0); - if(util_check_exist("/sys/hypervisor/s390/hyp/type")) { + char *type; - FILE *hyp_type; - *buf = 0; + mount("s390_hypfs", "/sys/hypervisor/s390", "s390_hypfs", 0, 0); - hyp_type = fopen("/sys/hypervisor/s390/hyp/type", "r"); - if(hyp_type) { - fgets(buf, sizeof buf -1 , hyp_type); - if(*buf) { - if(strncmp(buf,"z/VM",4)==0) { - config.hwp.hypervisor="z/VM"; - } - else if(strncmp(buf,"LPAR",4)==0) { - config.hwp.hypervisor="LPAR"; - } - else { - config.hwp.hypervisor="Unknown"; - } - *buf = 0; - } - fclose(hyp_type); - } + type = util_get_attr("/sys/hypervisor/s390/hyp/type"); + + if(!strncmp(type, "z/VM", sizeof "z/VM" - 1)) { + config.hwp.hypervisor = "z/VM"; + } + else if(!strncmp(type, "LPAR", sizeof "LPAR" - 1)) { + config.hwp.hypervisor = "LPAR"; + } + else { + config.hwp.hypervisor = "Unknown"; } } - #endif /* add cmdline to info file */ @@ -804,7 +795,7 @@ if(!config.had_segv) { lxrc_add_parts(); // we need edd for udev - if(util_check_exist("/modules/edd.ko")) { + if(!config.udev_mods && util_check_exist("/modules/edd.ko")) { system("/sbin/insmod /modules/edd.ko"); } } @@ -943,7 +934,7 @@ info_init(); - read_iscsi_ibft(); + if(iscsi_check()) config.withiscsi = 1; config.withfcoe = fcoe_check(); printf("Loading basic drivers..."); @@ -975,6 +966,12 @@ /* get usb keyboard working */ if(config.manual == 1 && !config.had_segv) util_load_usb(); + /* load ip over infiniband modules */ + if(config.withipoib) { + mod_modprobe("ib_cm", NULL); + mod_modprobe("ib_ipoib", NULL); + } + #if defined(__s390__) || defined(__s390x__) /* activate boot FCP adapter */ { @@ -1096,7 +1093,7 @@ config.cd1texts = file_parse_xmllike("/nextmedia", "text"); } - if(config.url.install && config.url.install->is.cdrom) { + if(config.url.install && (config.url.install->is.cdrom || config.cd1texts)) { char *s = get_translation(config.cd1texts, current_language()->locale); char *buf = NULL; @@ -1105,7 +1102,14 @@ j = dia_okcancel(buf, YES) == YES ? 1 : 0; if(j) { config.manual = 0; + url_free(config.url.install); + config.url.install = url_set("cd:/"); i = auto2_find_repo(); + if(!i) { + url_free(config.url.install); + config.url.install = url_set("hd:/"); + i = auto2_find_repo(); + } } } while(!i && j); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/net.c new/linuxrc-4.2.18/net.c --- old/linuxrc-4.2.16/net.c 2014-04-08 08:07:11.000000000 +0200 +++ new/linuxrc-4.2.18/net.c 2014-04-11 13:49:26.000000000 +0200 @@ -568,9 +568,16 @@ int net_activate_ns() { int err4 = 1, err6 = 1; + char *s; if(config.net.keep) return 0; + /* make sure we get the interface name if a mac was passed */ + if((s = mac_to_interface(config.net.device, NULL))) { + free(config.net.device); + config.net.device = s; + } + if(config.net.ipv4) err4 = net_activate4(); if(config.net.ipv6) err6 = net_activate6(); @@ -1794,6 +1801,13 @@ int net_dhcp() { unsigned active4, active = config.net.dhcp_active; + char *s; + + /* make sure we get the interface name if a mac was passed */ + if((s = mac_to_interface(config.net.device, NULL))) { + free(config.net.device); + config.net.device = s; + } if(config.wicked) { net_wicked(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/util.c new/linuxrc-4.2.18/util.c --- old/linuxrc-4.2.16/util.c 2014-03-26 08:09:51.000000000 +0100 +++ new/linuxrc-4.2.18/util.c 2014-04-11 13:51:30.000000000 +0200 @@ -110,6 +110,8 @@ static int skip_spaces(unsigned char **str); static int word_size(unsigned char *str, int *width, int *enc_len); +static char *mac_to_interface_log(char *mac, int log); + static void util_extend_usr1(int signum); static int util_extend(char *extension, char task, int verbose); @@ -1193,6 +1195,9 @@ add_flag(&sl0, buf, config.digests.sha512, "sha512"); add_flag(&sl0, buf, config.devtmpfs, "devtmpfs"); add_flag(&sl0, buf, config.plymouth, "plymouth"); + add_flag(&sl0, buf, config.withiscsi, "iscsi"); + add_flag(&sl0, buf, config.withfcoe, "fcoe"); + add_flag(&sl0, buf, config.withipoib, "ipoib"); if(*buf) slist_append_str(&sl0, buf); sprintf(buf, "net_config_mask = 0x%x", net_config_mask()); @@ -3366,7 +3371,8 @@ hd_free_hd_data(hd_data); } -int util_set_sysfs_attr(char* attr, char* value) + +int util_set_attr(char* attr, char* value) { int i, fd; @@ -3379,12 +3385,15 @@ return i < 0 ? i : 0; } -int util_get_sysfs_int_attr(char* attr, int *retval) + +char *util_get_attr(char* attr) { int i, fd; - char buf[1024]; + static char buf[1024]; - if((fd = open(attr, O_RDONLY)) < 0) return -1; + *buf = 0; + + if((fd = open(attr, O_RDONLY)) < 0) return buf; i = read(fd, buf, sizeof buf - 1); @@ -3392,16 +3401,23 @@ if(i >= 0) { buf[i] = 0; - } - else { - return -1; + + while(i > 0 && isspace(buf[i - 1])) { + buf[--i] = 0; + } + } - *retval = strtol(buf, NULL, 0); + return buf; +} - return 0; + +int util_get_int_attr(char* attr) +{ + return strtol(util_get_attr(attr), NULL, 0); } + char *print_driverid(driver_t *drv, int with_0x) { static char buf[256], *s; @@ -3649,61 +3665,6 @@ } -void read_iscsi_ibft() -{ - file_t *f0, *f; - - if(!util_check_exist("/sbin/iscsiadm")) return; - - system("/sbin/iscsiadm -m fw >/var/log/ibft"); - - f0 = file_read_file("/var/log/ibft", kf_ibft); - - if(config.debug) { - if(f0) { - fprintf(stderr, "ibft values:\n"); - for(f = f0; f; f = f->next) { - fprintf(stderr, " %s=%s\n", f->key_str, f->value); - } - } - else { - fprintf(stderr, "no ibft\n"); - } - } - - for(f = f0; f; f = f->next) { - switch(f->key) { - case key_ibft_hwaddr: - str_copy(&config.netdevice, f->value); - break; - - case key_ibft_ipaddr: - name2inet(&config.net.hostname, f->value); - net_check_address(&config.net.hostname, 0); - break; - - case key_ibft_netmask: - name2inet(&config.net.netmask, f->value); - net_check_address(&config.net.netmask, 0); - break; - - case key_ibft_gateway: - name2inet(&config.net.gateway, f->value); - net_check_address(&config.net.gateway, 0); - break; - - case key_ibft_dns: - name2inet(&config.net.nameserver[0], f->value); - net_check_address(&config.net.nameserver[0], 0); - break; - - default: - break; - } - } -} - - char *blk_ident(char *dev) { char *type, *label, *size; @@ -4197,6 +4158,212 @@ } +int iscsi_check() +{ + int iscsi_ok = 0; + char *attr, *s, *t; + char *sysfs_ibft = "/sys/firmware/ibft/ethernet0"; + unsigned use_dhcp = 0; + int mac_ofs = 2; + + if(util_check_exist("/modules/iscsi_ibft.ko")) { + system("/sbin/modprobe iscsi_ibft"); + sleep(1); + } + + if(!util_check_exist(sysfs_ibft)) return iscsi_ok; + + asprintf(&attr, "%s/origin", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: origin = %s\n", s); + if(s[0] == '3') use_dhcp = 1; + fprintf(stderr, "ibft: dhcp = %d\n", use_dhcp); + free(attr); + + asprintf(&attr, "%s/mac", sysfs_ibft); + s = strdup(util_get_attr(attr)); + fprintf(stderr, "ibft: mac = %s\n", s); + if(*s) { + /* try to get the interface name, up to offset 2 */ + if((t = mac_to_interface(s, &mac_ofs))) { + free(s); + s = t; + } + str_copy(&config.netdevice, s); + iscsi_ok++; + } + free(s); + free(attr); + + if(use_dhcp) { + config.net.do_setup |= DS_SETUP; + config.net.setup = NS_DHCP; + } + else { + /* use ibft config only if mac matches */ + if(!mac_ofs) { + asprintf(&attr, "%s/ip-addr", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: ip-addr = %s\n", s); + if(*s) { + name2inet(&config.net.hostname, s); + net_check_address(&config.net.hostname, 0); + iscsi_ok++; + } + free(attr); + } + else { + iscsi_ok++; + } + + asprintf(&attr, "%s/subnet-mask", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: subnet-mask = %s\n", s); + if(*s) { + name2inet(&config.net.netmask, s); + net_check_address(&config.net.netmask, 0); + iscsi_ok++; + } + free(attr); + + if(iscsi_ok == 3) { + config.net.do_setup |= DS_SETUP; + config.net.setup = NS_HOSTIP | NS_NETMASK; + + asprintf(&attr, "%s/gateway", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: gateway = %s\n", s); + if(*s) { + name2inet(&config.net.gateway, s); + net_check_address(&config.net.gateway, 0); + config.net.setup |= NS_GATEWAY; + } + free(attr); + + asprintf(&attr, "%s/primary-dns", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: primary-dns = %s\n", s); + if(*s) { + name2inet(&config.net.nameserver[0], s); + net_check_address(&config.net.nameserver[0], 0); + config.net.nameservers = 1; + config.net.setup |= NS_NAMESERVER; + } + free(attr); + + asprintf(&attr, "%s/secondary-dns", sysfs_ibft); + s = util_get_attr(attr); + fprintf(stderr, "ibft: secondary-dns = %s\n", s); + if(*s) { + name2inet(&config.net.nameserver[1], s); + net_check_address(&config.net.nameserver[1], 0); + config.net.nameservers = 2; + } + free(attr); + } + } + + return use_dhcp || iscsi_ok == 3; +} + + +/* + * Interal function, use mac_to_interface(). + * + * return value must be freed + */ +char *mac_to_interface_log(char *mac, int log) +{ + struct dirent *de; + DIR *d; + char *sys = "/sys/class/net", *if_name = NULL, *attr, *if_mac; + + if(util_check_exist2(sys, mac)) return strdup(mac); + + if(log) fprintf(stderr, "%s = ?\n", mac); + + if(!(d = opendir(sys))) return NULL; + + while((de = readdir(d))) { + if(de->d_name[0] == '.') continue; + asprintf(&attr, "%s/%s/address", sys, de->d_name); + if_mac = util_get_attr(attr); + free(attr); + if(!*if_mac || !strcmp(if_mac, "00:00:00:00:00:00")) continue; + + if(!if_name && !fnmatch(mac, if_mac, FNM_CASEFOLD)) { + if_name = strdup(de->d_name); + } + + if(log) { + fprintf(stderr, "%s = %s%s\n", + if_mac, + de->d_name, + if_name && !strcmp(if_name, de->d_name) ? " *" : "" + ); + } + } + + closedir(d); + + return if_name; +} + + +/* + * Get network interface name from mac. If max_offset + * is set decrease mac and retry up to max_offset. + * + * If max_offset is not NULL, set to actual offset. + * + * Note: The max_offset param is there to help ibft parsing. Don't worry too + * much about it. + * + * return value must be freed + */ +char *mac_to_interface(char *mac, int *max_offset) +{ + char *if_name, *s, *t; + unsigned u; + int ofs = 0, max_ofs = 0; + + if(max_offset) max_ofs = *max_offset; + + if(!mac || mac[0] == 0 || mac[0] == '.') return NULL; + + if_name = mac_to_interface_log(mac, 1); + + if(!if_name) { + /* no direct match, retry with offset */ + + mac = strdup(mac); + + if((s = strrchr(mac, ':'))) { + if(strlen(s) == 3) { + u = strtoul(s + 1, &t, 16); + if(!*t) { + for(ofs = 1; ofs <= max_ofs; ofs++) { + sprintf(s + 1, "%02x", (u - ofs) & 0xff); + if_name = mac_to_interface_log(mac, 0); + if(if_name) break; + } + } + } + } + + free(mac); + } + + if(if_name && max_offset) *max_offset = ofs; + + fprintf(stderr, "if = %s", if_name); + if(if_name && ofs) fprintf(stderr, ", offset = %u", ofs); + fprintf(stderr, "\n"); + + return if_name; +} + + void util_run_script(char *name) { char *buf = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-4.2.16/util.h new/linuxrc-4.2.18/util.h --- old/linuxrc-4.2.16/util.h 2014-03-26 08:09:51.000000000 +0100 +++ new/linuxrc-4.2.18/util.h 2014-04-11 13:39:52.000000000 +0200 @@ -107,8 +107,9 @@ void util_get_ram_size(void); void util_load_usb(void); -int util_set_sysfs_attr(char* attr, char* value); -int util_get_sysfs_int_attr(char* attr, int *retval); +int util_set_attr(char* attr, char* value); +char *util_get_attr(char* attr); +int util_get_int_attr(char* attr); char *print_driverid(driver_t *drv, int with_0x); int apply_driverid(driver_t *drv); @@ -124,8 +125,6 @@ int system_log(char *cmd); -void read_iscsi_ibft(void); - char *blk_size_str(char *dev); uint64_t blk_size(char *dev); char *blk_ident(char *dev); @@ -142,6 +141,10 @@ hd_t *fix_device_names(hd_t *hd); int fcoe_check(void); +int iscsi_check(void); + +char *mac_to_interface(char *mac, int *max_offset); + void util_run_script(char *name); void util_plymouth_off(void); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de