source: clfs-embedded/patches/busybox-1.13.2-branch_update-1.patch @ 0e9e889

Last change on this file since 0e9e889 was 0e9e889, checked in by Jim Gifford <clfs@…>, 15 years ago

Starting Busybox Updates

  • Property mode set to 100644
File size: 5.9 KB
  • archival/tar.c

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 01-25-2009
    Initial Package Version: 1.13.2
    Origin: Upstream
    Upstream Status: Applied
    Description: This is a branch update for busybox-1.13.2, and should be
                 rechecked periodically.
    
    diff -Naur busybox-1.13.2.orig/archival/tar.c busybox-1.13.2/archival/tar.c
    old new  
    591591        struct TarBallInfo tbInfo;
    592592
    593593        tbInfo.hlInfoHead = NULL;
    594 
    595         fchmod(tar_fd, 0644);
    596594        tbInfo.tarFd = tar_fd;
    597595        tbInfo.verboseFlag = verboseFlag;
    598596
  • modutils/depmod.c

    diff -Naur busybox-1.13.2.orig/modutils/depmod.c busybox-1.13.2/modutils/depmod.c
    old new  
    3333enum {
    3434        ARG_a = (1<<0), /* All modules, ignore mods in argv */
    3535        ARG_A = (1<<1), /* Only emit .ko that are newer than modules.dep file */
    36         ARG_b = (1<<2), /* not /lib/modules/$(uname -r)/ but this base-dir */
     36        ARG_b = (1<<2), /* base directory when modules are in staging area */
    3737        ARG_e = (1<<3), /* with -F, print unresolved symbols */
    3838        ARG_F = (1<<4), /* System.map that contains the symbols */
    3939        ARG_n = (1<<5)  /* dry-run, print to stdout only */
     
    5757        *first = info;
    5858
    5959        info->dnext = info->dprev = info;
    60         info->name = xstrdup(fname);
     60        info->name = xasprintf("/%s", fname);
    6161        info->modname = filename2modname(fname, NULL);
    6262        for (ptr = image; ptr < image + len - 10; ptr++) {
    6363                if (strncmp(ptr, "depends=", 8) == 0) {
     
    123123        }
    124124}
    125125
     126static void xfreopen_write(const char *file, FILE *f)
     127{
     128        if (freopen(file, "w", f) == NULL)
     129                bb_perror_msg_and_die("can't open '%s'", file);
     130}
     131
    126132int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
    127133int depmod_main(int argc UNUSED_PARAM, char **argv)
    128134{
    129135        module_info *modules = NULL, *m, *dep;
    130         char *moddir_base = (char *)CONFIG_DEFAULT_MODULES_DIR;
     136        const char *moddir_base = "/";
     137        char *moddir, *version;
     138        struct utsname uts;
    131139        int tmp;
    132140
    133141        getopt32(argv, "aAb:eF:n", &moddir_base, NULL);
    134142        argv += optind;
    135143
    136144        /* goto modules location */
     145        xchdir(moddir_base);
    137146
    138147        /* If a version is provided, then that kernel version's module directory
    139148         * is used, rather than the current kernel version (as returned by
    140149         * "uname -r").  */
    141         xchdir(moddir_base);
    142         if (*argv && (sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3)) {
    143                 xchdir(*argv++);
     150        if (*argv && sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3) {
     151                version = *argv++;
    144152        } else {
    145                 struct utsname uts;
    146153                uname(&uts);
    147                 xchdir(uts.release);
     154                version = uts.release;
    148155        }
    149         /* If no modules are given on the command-line, -a is on per default.  */
    150         option_mask32 |= *argv == NULL;
     156        moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version);
    151157
    152158        /* Scan modules */
    153         moddir_base = xrealloc_getcwd_or_warn(NULL);
    154         do {
    155                 recursive_action((option_mask32 & ARG_a) ? moddir_base : *argv,
    156                                 ACTION_RECURSE, parse_module, NULL,  &modules, 0);
    157         } while (!(option_mask32 & ARG_a) && *(++argv));
     159        if (*argv) {
     160                char *modfile;
     161                struct stat sb;
     162                do {
     163                        modfile = concat_path_file(moddir, *argv);
     164                        xstat(modfile, &sb);
     165                        parse_module(modfile, &sb, &modules, 0);
     166                        free(modfile);
     167                } while (*(++argv));
     168        } else {
     169                recursive_action(moddir, ACTION_RECURSE,
     170                                 parse_module, NULL, &modules, 0);
     171        }
     172
     173        /* Prepare for writing out the dep files */
     174        xchdir(moddir);
    158175        if (ENABLE_FEATURE_CLEAN_UP)
    159                 free(moddir_base);
     176                free(moddir);
    160177
    161178        /* Generate dependency and alias files */
    162179        if (!(option_mask32 & ARG_n))
    163                 freopen(CONFIG_DEFAULT_DEPMOD_FILE, "w", stdout);
     180                xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout);
    164181        for (m = modules; m != NULL; m = m->next) {
    165182                printf("%s:", m->name);
    166183
     
    174191                        dep->dprev->dnext = dep->dnext;
    175192                        dep->dnext = dep->dprev = dep;
    176193                }
    177                 puts("");
     194                bb_putchar('\n');
    178195        }
    179196
    180197#if ENABLE_FEATURE_MODUTILS_ALIAS
    181198        if (!(option_mask32 & ARG_n))
    182                 freopen("modules.alias", "w", stdout);
     199                xfreopen_write("modules.alias", stdout);
    183200        for (m = modules; m != NULL; m = m->next) {
    184201                while (m->aliases) {
    185202                        printf("alias %s %s\n",
     
    190207#endif
    191208#if ENABLE_FEATURE_MODUTILS_SYMBOLS
    192209        if (!(option_mask32 & ARG_n))
    193                 freopen("modules.symbols", "w", stdout);
     210                xfreopen_write("modules.symbols", stdout);
    194211        for (m = modules; m != NULL; m = m->next) {
    195212                while (m->symbols) {
    196213                        printf("alias symbol:%s %s\n",
  • testsuite/mdev.tests

    diff -Naur busybox-1.13.2.orig/testsuite/mdev.tests busybox-1.13.2/testsuite/mdev.tests
    old new  
    111111
    112112# continuing to use directory structure from prev test
    113113rm -rf mdev.testdir/dev/*
     114echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf
     115testing "mdev move and command" \
     116        "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
     117        ls -lnR mdev.testdir/dev | $FILTER_LS2" \
     118"\
     119@echo TEST
     120mdev.testdir/dev:
     121drwxr-xr-x 2 0 0 block
     122
     123mdev.testdir/dev/block:
     124brw-r--r-- 1 0 0 sda
     125" \
     126        "" ""
     127
     128# continuing to use directory structure from prev test
     129rm -rf mdev.testdir/dev/*
    114130echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf
    115131testing "mdev #maj,min and no explicit uid" \
    116132        "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
  • util-linux/mdev.c

    diff -Naur busybox-1.13.2.orig/util-linux/mdev.c busybox-1.13.2/util-linux/mdev.c
    old new  
    179179                        unsigned i, n;
    180180#endif
    181181                        char *a = val;
    182                         s = strchr(val, ' ');
    183                         val = (s && s[1]) ? s+1 : NULL;
     182                        s = strchrnul(val, ' ');
     183                        val = (s[0] && s[1]) ? s+1 : NULL;
     184                        s[0] = '\0';
    184185#if ENABLE_FEATURE_MDEV_RENAME_REGEXP
    185186                        /* substitute %1..9 with off[1..9], if any */
    186187                        n = 0;
Note: See TracBrowser for help on using the repository browser.