Hello community, here is the log from the commit of package linuxrc checked in at Sun Mar 30 12:05:32 CEST 2008. -------- --- linuxrc/linuxrc.changes 2008-03-26 14:41:11.000000000 +0100 +++ /mounts/work_src_done/STABLE/linuxrc/linuxrc.changes 2008-03-28 19:01:33.000000000 +0100 @@ -1,0 +2,7 @@ +Fri Mar 28 19:01:31 CET 2008 - snwint@suse.de + +- fix loading of modules without config +- can unpack only parts of cpio/rpm archives + (add '?list=pattern1,pattern2,...' to url) + +------------------------------------------------------------------- Old: ---- linuxrc-3.1.11.tar.bz2 New: ---- linuxrc-3.1.12.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.R12148/_old 2008-03-30 12:05:16.000000000 +0200 +++ /var/tmp/diff_new_pack.R12148/_new 2008-03-30 12:05:16.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package linuxrc (Version 3.1.11) +# spec file for package linuxrc (Version 3.1.12) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -17,9 +17,9 @@ Group: System/Boot AutoReqProv: on Summary: SUSE Installation Program -Version: 3.1.11 +Version: 3.1.12 Release: 1 -Source: linuxrc-3.1.11.tar.bz2 +Source: linuxrc-3.1.12.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -54,6 +54,10 @@ %doc linuxrc.html %changelog +* Fri Mar 28 2008 snwint@suse.de +- fix loading of modules without config +- can unpack only parts of cpio/rpm archives + (add '?list=pattern1,pattern2,...' to url) * Wed Mar 26 2008 snwint@suse.de - support rpms as image files - added option 'squash=1': convert downloaded files to squashfs images ++++++ linuxrc-3.1.11.tar.bz2 -> linuxrc-3.1.12.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/auto2.c new/linuxrc-3.1.12/auto2.c --- old/linuxrc-3.1.11/auto2.c 2008-03-14 10:51:22.000000000 +0100 +++ new/linuxrc-3.1.12/auto2.c 2008-03-28 15:59:36.000000000 +0100 @@ -941,7 +941,7 @@ URL_FLAG_UNZIP + URL_FLAG_NOSHA1 + URL_FLAG_KEEP_MOUNTED ); - if(!err) err = util_mount_ro(file_name, config.mountpoint.update); + if(!err) err = util_mount_ro(file_name, config.mountpoint.update, NULL); if(!err) util_chk_driver_update(config.mountpoint.update, get_instmode_name(url->scheme)); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/Changelog new/linuxrc-3.1.12/Changelog --- old/linuxrc-3.1.11/Changelog 2008-03-26 14:40:33.000000000 +0100 +++ new/linuxrc-3.1.12/Changelog 2008-03-28 19:00:31.000000000 +0100 @@ -1,3 +1,8 @@ +28/3/2008: v3.1.12 + - fix loading of modules without config + - can unpack only parts of cpio/rpm archives + (add '?list=pattern1,pattern2,...' to url) + 26/3/2008: v3.1.11 - support rpms as image files - added option 'squash=1': convert downloaded files to squashfs images diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/global.h new/linuxrc-3.1.12/global.h --- old/linuxrc-3.1.11/global.h 2008-03-26 14:17:23.000000000 +0100 +++ new/linuxrc-3.1.12/global.h 2008-03-28 16:09:39.000000000 +0100 @@ -213,6 +213,7 @@ char *tmp_mount; unsigned port; slist_t *query; + slist_t *file_list; unsigned download:1; /* force download */ struct { unsigned network:1; /* scheme needs network */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/install.c new/linuxrc-3.1.12/install.c --- old/linuxrc-3.1.11/install.c 2008-01-29 18:14:17.000000000 +0100 +++ new/linuxrc-3.1.12/install.c 2008-03-28 15:59:09.000000000 +0100 @@ -512,7 +512,7 @@ dev = long_dev(values3[i - 1]); util_fstype(dev, &module); if(module) mod_modprobe(module, NULL); - j = util_mount_rw(dev, config.mountpoint.swap); + j = util_mount_rw(dev, config.mountpoint.swap, NULL); if(j) { dia_message("mount failed", MSGTYPE_ERROR); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/linuxrc.c new/linuxrc-3.1.12/linuxrc.c --- old/linuxrc-3.1.11/linuxrc.c 2008-02-27 11:22:51.000000000 +0100 +++ new/linuxrc-3.1.12/linuxrc.c 2008-03-28 15:59:45.000000000 +0100 @@ -388,7 +388,7 @@ else if(config.new_root) { fprintf(stderr, "starting %s\n", config.new_root); - util_mount_ro(config.new_root, mp); + util_mount_ro(config.new_root, mp, NULL); } chdir(mp); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/module.c new/linuxrc-3.1.12/module.c --- old/linuxrc-3.1.11/module.c 2008-03-14 11:14:17.000000000 +0100 +++ new/linuxrc-3.1.12/module.c 2008-03-28 12:53:06.000000000 +0100 @@ -601,7 +601,11 @@ window_t win; int i; - if(!(ml = mod_get_entry(module))) return; + if(!(ml = mod_get_entry(module))) { + mod_insmod(module, NULL); + + return; + } if(!config.win) show = 0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/rootimage.c new/linuxrc-3.1.12/rootimage.c --- old/linuxrc-3.1.11/rootimage.c 2007-09-07 16:36:22.000000000 +0200 +++ new/linuxrc-3.1.12/rootimage.c 2008-03-28 15:59:23.000000000 +0100 @@ -97,7 +97,7 @@ sprintf(buf, "/dev/%s", root_string_tv); - if(util_mount_ro(buf, config.mountpoint.instdata)) return -1; + if(util_mount_ro(buf, config.mountpoint.instdata, NULL)) return -1; sprintf(buf, "%s/etc/passwd", config.mountpoint.instdata); rc = util_check_exist(buf); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/url.c new/linuxrc-3.1.12/url.c --- old/linuxrc-3.1.11/url.c 2008-01-30 12:04:30.000000000 +0100 +++ new/linuxrc-3.1.12/url.c 2008-03-28 18:18:03.000000000 +0100 @@ -60,6 +60,8 @@ static void url_build_instsys_list(char *instsys); static char *url_instsys_config(char *path); static char *url_instsys_base(char *path); +static char *url_config_get_path(char *entry); +static slist_t *url_config_get_file_list(char *entry); void url_read(url_data_t *url_data) @@ -93,6 +95,8 @@ url_data->err = curl_easy_setopt(c_handle, CURLOPT_URL, url_data->url->str); // fprintf(stderr, "curl opt url = %d\n", url_data->err); + if(config.debug >= 2) fprintf(stderr, "url_read(%s)\n", url_data->url->str); + str_copy(&proxy_url, url_print(config.url.proxy, 1)); if(proxy_url) { if(config.debug >= 2) fprintf(stderr, "using proxy %s\n", proxy_url); @@ -518,6 +522,10 @@ str_copy(&url->instsys, sl->value); } + if((sl = slist_getentry(url->query, "list"))) { + url->file_list = slist_split(',', sl->value); + } + if( url->scheme == inst_file || url->scheme == inst_nfs || @@ -664,6 +672,10 @@ if((s = url->used.device) || (s = url->device)) { strprintf(&buf, "%s%cdevice=%s", buf, q++ ? '&' : '?', short_dev(s)); } + if(url->file_list) { + strprintf(&buf, "%s%clist=%s", buf, q++ ? '&' : '?', s = slist_join(",", url->file_list)); + free(s); + } } if(format == 0) { @@ -704,6 +716,7 @@ free(url->used.server.name); slist_free(url->query); + slist_free(url->file_list); free(url); } @@ -968,7 +981,7 @@ /* we might need an extra mountpoint */ if(url->scheme != inst_file && strcmp(url->path, "/")) { str_copy(&url->tmp_mount, new_mountpoint()); - ok = util_mount_ro(url->used.device, url->tmp_mount) ? 0 : 1; + ok = util_mount_ro(url->used.device, url->tmp_mount, url->file_list) ? 0 : 1; if(!ok) { fprintf(stderr, "disk: %s: mount failed\n", url->used.device); @@ -1092,7 +1105,7 @@ URL_FLAG_PROGRESS + URL_FLAG_UNZIP ) ? 0 : 1; - if(ok) ok = util_mount_ro(s, url->mount) ? 0 : 1; + if(ok) ok = util_mount_ro(s, url->mount, url->file_list) ? 0 : 1; if(!ok) unlink(s); free(s); @@ -1101,7 +1114,7 @@ else { if(!url->mount) { str_copy(&url->mount, dir ?: new_mountpoint()); - ok = util_mount_ro(path, url->mount) ? 0 : 1; + ok = util_mount_ro(path, url->mount, url->file_list) ? 0 : 1; } else { ok = 1; @@ -1460,9 +1473,9 @@ int test_is_repo(url_t *url) { int ok = 0, i, opt, parts, part; - char *buf = NULL, *buf2 = NULL, *file_name, *s; + char *buf = NULL, *buf2 = NULL, *file_name, *s, *t; char *instsys_config; - slist_t *sl; + slist_t *sl, *file_list, *old_file_list; if( !url || @@ -1524,15 +1537,19 @@ if(url->is.mountable) { for(sl = config.url.instsys_list; sl; sl = sl->next) { opt = *(s = sl->key) == '?' && s++; - if(!util_check_exist2(url->mount, s)) { + t = url_config_get_path(s); + + if(!util_check_exist2(url->mount, t)) { if(opt) { - fprintf(stderr, "instsys missing: %s (optional)\n", s); + fprintf(stderr, "instsys missing: %s (optional)\n", t); } else { - fprintf(stderr, "instsys missing: %s\n", s); + fprintf(stderr, "instsys missing: %s\n", t); + free(t); return 0; } } + free(t); } } @@ -1540,8 +1557,13 @@ for(ok = 1, part = 1, sl = config.url.instsys_list; ok && sl; sl = sl->next, part++) { opt = *(s = sl->key) == '?' && s++; + t = url_config_get_path(s); + file_list = url_config_get_file_list(s); - if(url->is.mountable) strprintf(&buf, "%s/%s", url->mount, s); + old_file_list = url->file_list; + url->file_list = file_list; + + if(url->is.mountable) strprintf(&buf, "%s/%s", url->mount, t); // sl->value = strdup(parts > 1 ? new_mountpoint() : config.mountpoint.instsys); sl->value = strdup(new_mountpoint()); @@ -1558,7 +1580,7 @@ else { fprintf(stderr, "mount %s -> %s\n", buf, sl->value); - i = util_mount_ro(buf, sl->value) ? 0 : 1; + i = util_mount_ro(buf, sl->value, url->file_list) ? 0 : 1; ok &= i; if(!i) fprintf(stderr, "instsys mount failed: %s\n", sl->value); } @@ -1575,14 +1597,14 @@ if(!url_read_file(url, NULL, - s, + t, file_name = strdup(new_download()), buf2, URL_FLAG_PROGRESS + URL_FLAG_UNZIP + opt * URL_FLAG_OPTIONAL )) { fprintf(stderr, "mount %s -> %s\n", file_name, sl->value); - i = util_mount_ro(file_name, sl->value) ? 0 : 1; + i = util_mount_ro(file_name, sl->value, url->file_list) ? 0 : 1; ok &= i; if(!i) fprintf(stderr, "instsys mount failed: %s\n", sl->value); } @@ -1593,6 +1615,10 @@ free(file_name); } + + url->file_list = old_file_list; + slist_free(file_list); + free(t); } if(ok) { @@ -1633,9 +1659,9 @@ int url_find_instsys(url_t *url, char *dir) { int opt, part, parts, ok, i; - char *s; + char *s, *t; char *file_name = NULL, *buf = NULL, *buf2 = NULL, *url_path = NULL; - slist_t *sl; + slist_t *sl, *file_list, *old_file_list; if( !url || @@ -1680,17 +1706,21 @@ if(url->is.mountable && url->mount) { for(sl = config.url.instsys_list; sl; sl = sl->next) { opt = *(s = sl->key) == '?' && s++; - if(!util_check_exist2(url->mount, s)) { + t = url_config_get_path(s); + + if(!util_check_exist2(url->mount, t)) { if(opt) { - fprintf(stderr, "instsys missing: %s (optional)\n", s); + fprintf(stderr, "instsys missing: %s (optional)\n", t); } else { - fprintf(stderr, "instsys missing: %s\n", s); + fprintf(stderr, "instsys missing: %s\n", t); ok = 0; break; } } + + free(t); } } @@ -1699,8 +1729,13 @@ for(part = 1, sl = config.url.instsys_list; ok && sl; sl = sl->next, part++) { opt = *(s = sl->key) == '?' && s++; + t = url_config_get_path(s); + file_list = url_config_get_file_list(s); - if(url->is.mountable) strprintf(&buf, "%s/%s", url->mount, s); + old_file_list = url->file_list; + url->file_list = file_list; + + if(url->is.mountable) strprintf(&buf, "%s/%s", url->mount, t); // sl->value = strdup(parts > 1 ? new_mountpoint() : config.mountpoint.instsys); sl->value = strdup(new_mountpoint()); @@ -1717,7 +1752,7 @@ else { fprintf(stderr, "mount %s -> %s\n", buf, sl->value); - i = util_mount_ro(buf, sl->value) ? 0 : 1; + i = util_mount_ro(buf, sl->value, url->file_list) ? 0 : 1; ok &= i; if(!i) fprintf(stderr, "instsys mount failed: %s\n", sl->value); } @@ -1734,14 +1769,14 @@ if(!url_read_file(url, NULL, - *s ? s : NULL, + *t ? t : NULL, file_name = strdup(new_download()), buf2, URL_FLAG_PROGRESS + URL_FLAG_UNZIP + opt * URL_FLAG_OPTIONAL )) { fprintf(stderr, "mount %s -> %s\n", file_name, sl->value); - i = util_mount_ro(file_name, sl->value) ? 0 : 1; + i = util_mount_ro(file_name, sl->value, url->file_list) ? 0 : 1; ok &= i; if(!i) fprintf(stderr, "instsys mount failed: %s\n", sl->value); } @@ -1752,6 +1787,10 @@ str_copy(&file_name, NULL); } + + url->file_list = old_file_list; + slist_free(file_list); + free(t); } } @@ -2131,3 +2170,31 @@ } +char *url_config_get_path(char *entry) +{ + char *s = NULL, *t; + + if(!entry) return NULL; + + str_copy(&s, entry); + + if((t = strchr(s, '?'))) *t = 0; + + return s; +} + + +slist_t *url_config_get_file_list(char *entry) +{ + slist_t *sl = NULL; + + if(!entry) return NULL; + + if(entry && (entry = strstr(entry, "?list="))) { + sl = slist_split(',', entry + sizeof "?list=" - 1); + } + + return sl; +} + + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/util.c new/linuxrc-3.1.12/util.c --- old/linuxrc-3.1.11/util.c 2008-03-26 14:39:23.000000000 +0100 +++ new/linuxrc-3.1.12/util.c 2008-03-28 16:24:41.000000000 +0100 @@ -2010,7 +2010,7 @@ } if(notype) { - if(!util_mount(dev, dir, flags)) return 0; + if(!util_mount(dev, dir, flags, NULL)) return 0; if(errno) perror("mount"); return 1; } @@ -2854,7 +2854,7 @@ len++; - s = calloc(len,1); + s = calloc(len, 1); for(; str; str = str->next) { if(str->key) strcat(s, str->key); @@ -3156,9 +3156,9 @@ } -int util_mount(char *dev, char *dir, unsigned long flags) +int util_mount(char *dev, char *dir, unsigned long flags, slist_t *file_list) { - char *type, *loop_dev, *cmd = NULL, *module; + char *type, *loop_dev, *cmd = NULL, *module, *tmp_dev, *cpio_opts = NULL, *s; int err = -1; struct stat64 sbuf; @@ -3206,15 +3206,26 @@ return err; } + str_copy(&cpio_opts, "--quiet --sparse -dimu --no-absolute-filenames"); + + if(file_list) { + s = slist_join("' '", file_list); + strprintf(&cpio_opts, "%s '%s'", cpio_opts, s); + free(s); + } + if(!strcmp(type, "cpio")) { - strprintf(&buf, "cd %s ; cpio -i --quiet < %s", dir, dev); + strprintf(&buf, "cd %s ; cpio %s < %s", dir, cpio_opts, dev); msg = "cpio"; } else { - strprintf(&buf, "cd %s ; rpm2cpio %s | cpio --quiet --sparse -dimu --no-absolute-filenames", dir, dev); + strprintf(&buf, "cd %s ; rpm2cpio %s | cpio %s", dir, dev, cpio_opts); msg = "rpm unpacking"; } + str_copy(&cpio_opts, NULL); + + if(config.debug) fprintf(stderr, "%s\n", buf); err = system(buf); free(buf); buf = NULL; @@ -3225,13 +3236,21 @@ return err; } else if(config.squash) { - fprintf(stderr, "%s: converting to squashfs\n", dev); - strprintf(&buf, "mksquashfs %s %s -noappend >%s", dir, dev, config.debug ? "&2" : "/dev/null"); + tmp_dev = new_download(); + fprintf(stderr, "%s -> %s: converting to squashfs\n", dev, tmp_dev); + // if we downloaded the file, overwrite it; else make a new copy + if(strncmp(dev, config.download.base, strlen(config.download.base))) { + tmp_dev = new_download(); + } + else { + tmp_dev = dev; + } + strprintf(&buf, "mksquashfs %s %s -noappend >%s", dir, tmp_dev, config.debug ? "&2" : "/dev/null"); err = system(buf); if(err && config.run_as_linuxrc) fprintf(stderr, "mount: mksquashfs failed\n"); if(!err) { umount(dir); - err = util_mount(dev, dir, flags); + err = util_mount(tmp_dev, dir, flags, NULL); } } @@ -3274,15 +3293,15 @@ } -int util_mount_ro(char *dev, char *dir) +int util_mount_ro(char *dev, char *dir, slist_t *file_list) { - return util_mount(dev, dir, MS_MGC_VAL | MS_RDONLY); + return util_mount(dev, dir, MS_MGC_VAL | MS_RDONLY, file_list); } -int util_mount_rw(char *dev, char *dir) +int util_mount_rw(char *dev, char *dir, slist_t *file_list) { - return util_mount(dev, dir, 0); + return util_mount(dev, dir, 0, file_list); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/util.h new/linuxrc-3.1.12/util.h --- old/linuxrc-3.1.11/util.h 2008-02-27 11:22:51.000000000 +0100 +++ new/linuxrc-3.1.12/util.h 2008-03-28 15:58:36.000000000 +0100 @@ -100,9 +100,9 @@ void util_update_meminfo(void); char *util_fstype(char *dev, char **module); -int util_mount(char *dev, char *dir, unsigned long flags); -int util_mount_ro(char *dev, char *dir); -int util_mount_rw(char *dev, char *dir); +int util_mount(char *dev, char *dir, unsigned long flags, slist_t *file_list); +int util_mount_ro(char *dev, char *dir, slist_t *file_list); +int util_mount_rw(char *dev, char *dir, slist_t *file_list); void util_update_netdevice_list(char *module, int add); int util_update_disk_list(char *module, int add); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/linuxrc-3.1.11/VERSION new/linuxrc-3.1.12/VERSION --- old/linuxrc-3.1.11/VERSION 2008-03-26 14:13:17.000000000 +0100 +++ new/linuxrc-3.1.12/VERSION 2008-03-28 12:53:22.000000000 +0100 @@ -1 +1 @@ -3.1.11 +3.1.12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org