commit linuxrc for openSUSE:Factory
Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at Mon Jan 24 22:25:00 CET 2011. -------- --- linuxrc/linuxrc.changes 2010-12-06 14:49:21.000000000 +0100 +++ linuxrc/linuxrc.changes 2011-01-20 13:52:07.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Jan 20 13:51:03 CET 2011 - snwint@suse.de + +- allow for user defined options (those options are ignored by + linuxrc but added unchanged to /etc/install.inf) +- brokenmodules accepts '+' and '-' now +- add status info also to log + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- linuxrc-3.5.7.tar.bz2 New: ---- linuxrc-3.5.8.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.xhXex4/_old 2011-01-24 22:17:29.000000000 +0100 +++ /var/tmp/diff_new_pack.xhXex4/_new 2011-01-24 22:17:29.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package linuxrc (Version 3.5.7) +# spec file for package linuxrc # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,9 +24,9 @@ Group: System/Boot AutoReqProv: on Summary: SUSE Installation Program -Version: 3.5.7 +Version: 3.5.8 Release: 1 -Source: linuxrc-3.5.7.tar.bz2 +Source: linuxrc-3.5.8.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ++++++ linuxrc-3.5.7.tar.bz2 -> linuxrc-3.5.8.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/VERSION new/linuxrc-3.5.8/VERSION --- old/linuxrc-3.5.7/VERSION 2010-12-06 14:45:26.000000000 +0100 +++ new/linuxrc-3.5.8/VERSION 2011-01-20 13:50:56.000000000 +0100 @@ -1 +1 @@ -3.5.7 +3.5.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/changelog new/linuxrc-3.5.8/changelog --- old/linuxrc-3.5.7/changelog 2010-12-06 14:45:28.000000000 +0100 +++ new/linuxrc-3.5.8/changelog 2011-01-20 13:50:58.000000000 +0100 @@ -1,4 +1,12 @@ -2010-12-06: HEAD +2011-01-19: HEAD + - more user option fixes + - brokenmodules accepts '+' and '-' now + - add status info also to log + - fix user option parsing + - allow for user defined options + - those options are ignored by linuxrc but added unchanged to /etc/install.inf + +2010-12-06: 3.5.7 - don't check keyboard status too often to speed up media check 2010-12-03: 3.5.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/dialog.c new/linuxrc-3.5.8/dialog.c --- old/linuxrc-3.5.7/dialog.c 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/dialog.c 2011-01-19 14:52:17.000000000 +0100 @@ -1519,7 +1519,7 @@ *((unsigned char *) NULL) = 7; } else if(i == -71) { - util_status_info(); + util_status_info(0); } else if(i == -73) { i = dia_input(txt_get(TXT_CHANGE_CONFIG), s, sizeof s - 1, 35, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/file.c new/linuxrc-3.5.8/file.c --- old/linuxrc-3.5.7/file.c 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/file.c 2011-01-19 16:55:32.000000000 +0100 @@ -305,6 +305,7 @@ { key_udevrule, "udev.rule", kf_cfg + kf_cmd_early }, { key_dhcpfail, "DHCPFail", kf_cfg + kf_cmd }, { key_namescheme, "NameScheme", kf_cfg + kf_cmd + kf_cmd_early }, + { key_ptoptions, "PTOptions", kf_cfg + kf_cmd_early }, }; static struct { @@ -393,11 +394,11 @@ * Compare strings, ignoring '-', '_', and '.' characters in strings not * starting with '_'. */ -static int strcasecmpignorestrich(const char* s1, const char* s2) +static int strcasecmpignorestrich(const char *s1, const char *s2) { - char* str1 = strdup(s1); - char* str2 = strdup(s2); - char* s; + char *str1 = strdup(s1); + char *str2 = strdup(s2); + char *s; int i; /* remove all '-' and '_' */ @@ -421,25 +422,35 @@ } i = strcasecmp(str1, str2); - free(str1); free(str2); + + free(str1); + free(str2); + return i; } -/* !!! str is overwritten !!! */ + file_key_t file_str2key(char *str, file_key_flag_t flags) { int i; + slist_t *sl; if(!str || !*str || flags == kf_none) return key_none; if(!*str) return key_none; - for(i = 0; (unsigned) i < sizeof keywords / sizeof *keywords; i++) { + for(i = 0; i < sizeof keywords / sizeof *keywords; i++) { if((keywords[i].flags & flags) && !strcasecmpignorestrich(keywords[i].value, str)) { return keywords[i].key; } } + if(flags & (kf_cmd + kf_cfg)) { + for(sl = config.ptoptions; sl; sl = sl->next) { + if(!strcasecmpignorestrich(sl->key, str)) return key_is_ptoption; + } + } + return key_none; } @@ -537,7 +548,7 @@ *ft = calloc(1, sizeof **ft); (*ft)->key_str = strdup(s); - (*ft)->key = file_str2key(s, flags); /* destroys s!!! */ + (*ft)->key = file_str2key(s, flags); (*ft)->value = strdup(t); parse_value(*ft); @@ -598,6 +609,9 @@ } +/* + * Note: may modify f->key if f->key is key_none. + */ void file_do_info(file_t *f0, file_key_flag_t flags) { file_t *f; @@ -976,8 +990,7 @@ break; case key_brokenmodules: - slist_free(config.module.broken); - config.module.broken = slist_split(',', f->value); + slist_assign_values(&config.module.broken, f->value); if(config.module.broken && !config.test) { if((w = fopen("/etc/modprobe.d/blacklist", "w"))) { for(sl = config.module.broken; sl; sl = sl->next) { @@ -1241,6 +1254,20 @@ break; case key_none: + case key_is_ptoption: + if((flags & (kf_cmd + kf_cfg))) { + for(sl = config.ptoptions; sl; sl = sl->next) { + if(!strcasecmpignorestrich(sl->key, f->key_str)) { + str_copy(&sl->value, f->value); + f->key = key_is_ptoption; + break; + } + } + } + + /* was user defined option */ + if(f->key == key_is_ptoption) break; + /* assume kernel module option if it can be parsed as 'module.option' */ /* Note: f->unparsed is only set when we read from cmdline/argv *NOT* from files. */ @@ -1587,6 +1614,10 @@ str_copy(&config.namescheme, f->value); break; + case key_ptoptions: + slist_assign_values(&config.ptoptions, f->value); + break; + default: break; } @@ -1916,6 +1947,10 @@ fprintf(f, "Brailledevice: %s\n", config.braille.dev); } + for(sl = config.ptoptions; sl; sl = sl->next) { + if(sl->value) fprintf(f, "%s: %s\n", sl->key, sl->value); + } + ft0 = file_read_cmdline(kf_cmd + kf_cmd_early + kf_boot); for(i = 0, ft = ft0; ft; ft = ft->next) { @@ -2104,7 +2139,7 @@ (*ft)->unparsed = t1; (*ft)->key_str = strdup(t); - (*ft)->key = file_str2key(t, flags); /* destroys t!!! */ + (*ft)->key = file_str2key(t, flags); (*ft)->value = strdup(s1 ?: ""); parse_value(*ft); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/file.h new/linuxrc-3.5.8/file.h --- old/linuxrc-3.5.7/file.h 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/file.h 2011-01-18 17:57:02.000000000 +0100 @@ -51,7 +51,7 @@ key_kexec_reboot, key_devbyid, key_braille, key_nfsopts, key_ipv4, key_ipv4only, 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_namescheme, key_ptoptions, key_is_ptoption } file_key_t; typedef enum { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/global.h new/linuxrc-3.5.8/global.h --- old/linuxrc-3.5.7/global.h 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/global.h 2011-01-18 13:58:49.000000000 +0100 @@ -413,6 +413,7 @@ slist_t *extend_list; /* list of loaded instsys extensions */ slist_t *udevrules; /* udev rules */ char *namescheme; /* device name scheme (e.g.: by-id, by-label, by-path) */ + slist_t *ptoptions; /* pass-through options: options that just need to be added /etc/install.inf */ struct { char *instsys_default; /* default instsys url */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/install.c new/linuxrc-3.5.8/install.c --- old/linuxrc-3.5.7/install.c 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/install.c 2011-01-19 14:51:25.000000000 +0100 @@ -960,6 +960,8 @@ inst_choose_display() ) err = 1; #endif + + if(config.debug >= 2) util_status_info(1); if(!err) err = inst_execute_yast(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/settings.c new/linuxrc-3.5.8/settings.c --- old/linuxrc-3.5.7/settings.c 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/settings.c 2011-01-19 14:52:09.000000000 +0100 @@ -678,7 +678,7 @@ break; case di_extras_info: - util_status_info(); + util_status_info(0); break; case di_extras_change: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/util.c new/linuxrc-3.5.8/util.c --- old/linuxrc-3.5.7/util.c 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/util.c 2011-01-19 15:01:23.000000000 +0100 @@ -1107,7 +1107,7 @@ } -void util_status_info() +void util_status_info(int log_it) { int i, j; char *s, *t; @@ -1472,6 +1472,15 @@ } } + if(config.ptoptions) { + strcpy(buf, "user defined options:"); + slist_append_str(&sl0, buf); + for(sl = config.ptoptions; sl; sl = sl->next) { + sprintf(buf, " %s: %s", sl->key, sl->value ?: "<unset>"); + slist_append_str(&sl0, buf); + } + } + if(config.module.options) { strcpy(buf, "module options:"); slist_append_str(&sl0, buf); @@ -1481,7 +1490,17 @@ } } - dia_show_lines2("Linuxrc v" LXRC_FULL_VERSION " (" __DATE__ ", " __TIME__ ")", sl0, 76); + if(log_it || config.debug >= 1) { + fprintf(stderr, "------ Linuxrc v" LXRC_FULL_VERSION " (" __DATE__ ", " __TIME__ ") ------\n"); + for(sl = sl0; sl; sl = sl->next) { + fprintf(stderr, " %s\n", sl->key); + } + fprintf(stderr, "------ ------\n"); + } + + if(!log_it) { + dia_show_lines2("Linuxrc v" LXRC_FULL_VERSION " (" __DATE__ ", " __TIME__ ")", sl0, 76); + } slist_free(sl0); @@ -2744,6 +2763,31 @@ } +slist_t *slist_free_entry(slist_t **sl0, char *str) +{ + slist_t *sl, *sl_prev, sl_tmp = { }; + + if(!str) return *sl0; + + sl_tmp.next = *sl0; + + for(sl_prev = &sl_tmp, sl = sl_prev->next; sl; sl = sl->next) { + if(sl->key && !strcmp(sl->key, str)) { + free(sl->key); + if(sl->value) free(sl->value); + sl_prev->next = sl->next; + free(sl); + sl = sl_prev; + } + else { + sl_prev = sl; + } + } + + return *sl0 = sl_tmp.next; +} + + slist_t *slist_append(slist_t **sl0, slist_t *sl) { for(; *sl0; sl0 = &(*sl0)->next); @@ -2769,6 +2813,51 @@ } +slist_t *slist_assign_values(slist_t **sl0, char *str) +{ + int todo = 0; + slist_t *sl, *sl1; + + if(!sl0) return NULL; + + if(!str) str = ""; + + switch(*str) { + case '+': + todo = 1; + str++; + break; + + case '-': + todo = -1; + str++; + break; + } + + sl1 = slist_split(',', str); + + if(todo) { + for(sl = sl1; sl; sl = sl->next) { + if(todo > 0) { + if(!slist_getentry(*sl0, sl->key)) slist_append_str(sl0, sl->key); + } + else { + slist_free_entry(sl0, sl->key); + } + } + } + else { + slist_free(*sl0); + *sl0 = sl1; + sl1 = NULL; + } + + slist_free(sl1); + + return *sl0; +} + + slist_t *slist_getentry(slist_t *sl, char *key) { if(key) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-3.5.7/util.h new/linuxrc-3.5.8/util.h --- old/linuxrc-3.5.7/util.h 2010-12-03 15:11:52.000000000 +0100 +++ new/linuxrc-3.5.8/util.h 2011-01-19 14:49:30.000000000 +0100 @@ -38,7 +38,7 @@ int util_chk_driver_update(char *dir, char *loc); extern void util_do_driver_updates (void); extern int show_driver_updates(void); -extern void util_status_info (void); +extern void util_status_info (int log_it); extern int util_mount_main (int argc, char **argv); extern int util_umount_main (int argc, char **argv); extern int util_cat_main (int argc, char **argv); @@ -76,9 +76,11 @@ slist_t *slist_new(void); slist_t *slist_free(slist_t *sl); +slist_t *slist_free_entry(slist_t **sl0, char *str); slist_t *slist_append(slist_t **sl0, slist_t *sl); slist_t *slist_append_str(slist_t **sl0, char *str); slist_t *slist_add(slist_t **sl0, slist_t *sl); +slist_t *slist_assign_values(slist_t **sl0, char *str); slist_t *slist_getentry(slist_t *sl, char *key); slist_t *slist_reverse(slist_t *sl0); slist_t *slist_sort(slist_t *sl0, int (*cmp_func)(const void *, const void *)); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- 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