- just chdir to the basedir (-30b).
This commit is contained in:
parent
beac1bd58e
commit
d42816763f
@ -31,7 +31,6 @@ typedef struct dep_lst_t {
|
|||||||
|
|
||||||
struct globals {
|
struct globals {
|
||||||
dep_lst_t *lst; /* modules without their corresponding extension */
|
dep_lst_t *lst; /* modules without their corresponding extension */
|
||||||
size_t moddir_base_len; /* length of the "-b basedir" */
|
|
||||||
};
|
};
|
||||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
/* We have to zero it out because of NOEXEC */
|
/* We have to zero it out because of NOEXEC */
|
||||||
@ -46,7 +45,7 @@ static int fill_lst(const char *modulename, struct stat ATTRIBUTE_UNUSED *sb,
|
|||||||
*/
|
*/
|
||||||
if (strrstr(modulename, ".ko") != NULL) {
|
if (strrstr(modulename, ".ko") != NULL) {
|
||||||
dep_lst_t *new = xzalloc(sizeof(dep_lst_t));
|
dep_lst_t *new = xzalloc(sizeof(dep_lst_t));
|
||||||
new->name = xstrdup(modulename + G.moddir_base_len);
|
new->name = xstrdup(modulename);
|
||||||
new->next = G.lst;
|
new->next = G.lst;
|
||||||
G.lst = new;
|
G.lst = new;
|
||||||
}
|
}
|
||||||
@ -82,12 +81,12 @@ static int fileAction(const char *fname, struct stat *sb,
|
|||||||
ptr = the_module;
|
ptr = the_module;
|
||||||
this = G.lst;
|
this = G.lst;
|
||||||
do {
|
do {
|
||||||
if (!strcmp(fname + G.moddir_base_len, this->name))
|
if (!strcmp(fname, this->name))
|
||||||
break;
|
break;
|
||||||
this = this->next;
|
this = this->next;
|
||||||
} while (this);
|
} while (this);
|
||||||
dbg_assert (this);
|
dbg_assert (this);
|
||||||
//bb_info_msg("fname='%s'", fname + G.moddir_base_len);
|
//bb_info_msg("fname='%s'", fname);
|
||||||
do {
|
do {
|
||||||
/* search for a 'd' */
|
/* search for a 'd' */
|
||||||
ptr = memchr(ptr, 'd', len - (ptr - (char*)the_module));
|
ptr = memchr(ptr, 'd', len - (ptr - (char*)the_module));
|
||||||
@ -157,13 +156,7 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
|
|||||||
option_mask32 |= *argv == NULL;
|
option_mask32 |= *argv == NULL;
|
||||||
|
|
||||||
if (option_mask32 & ARG_b) {
|
if (option_mask32 & ARG_b) {
|
||||||
G.moddir_base_len = strlen(moddir_base);
|
xchdir(moddir_base);
|
||||||
if (ENABLE_FEATURE_CLEAN_UP) {
|
|
||||||
chp = moddir;
|
|
||||||
moddir = concat_path_file(moddir_base, moddir);
|
|
||||||
free (chp);
|
|
||||||
} else
|
|
||||||
moddir = concat_path_file(moddir_base, moddir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(option_mask32 & ARG_n)) { /* --dry-run */
|
if (!(option_mask32 & ARG_n)) { /* --dry-run */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user