diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-06-19 13:09:23 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-06-19 13:27:56 -0300 |
commit | 33202e84f344794b1ae261874883874a2c15dc80 (patch) | |
tree | c178abcf592bcc2a63858634cc0740a37dd4e217 | |
parent | 3f376cd87742246f00fe552596975a00ec5d60b1 (diff) | |
download | kmod-33202e84f344794b1ae261874883874a2c15dc80.tar.gz kmod-33202e84f344794b1ae261874883874a2c15dc80.tar.bz2 kmod-33202e84f344794b1ae261874883874a2c15dc80.zip |
build-sys: Make dirs writable on rootfs creation
Autofoo make the dist dir as readonly. If we copy it, tools needing to
create sysfs entries will not be able to do so, because they can't
create the needed directories/files.
It would be much better if autofoo allowed to let the files as is
instead of converting them to read-only.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | testsuite/init_module.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index 7bfa8f1..d681118 100644 --- a/Makefile.am +++ b/Makefile.am @@ -127,7 +127,8 @@ ROOTFS = testsuite/rootfs ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \ cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \ - touch testsuite/stamp-rootfs ) + touch testsuite/stamp-rootfs && \ + find $(ROOTFS) -type d -exec chmod +w {} \; ) rootfs: $(CREATE_ROOTFS) @@ -193,7 +194,6 @@ testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD) testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS) testsuite-distclean: - -find $(ROOTFS) -type d -exec chmod +w {} \; -$(RM) -rf $(ROOTFS) -$(RM) testsuite/stamp-rootfs diff --git a/testsuite/init_module.c b/testsuite/init_module.c index 6db0d17..814998a 100644 --- a/testsuite/init_module.c +++ b/testsuite/init_module.c @@ -147,7 +147,7 @@ static int create_sysfs_files(const char *modname) strcpy(buf + len, modname); len += strlen(modname); - mkdir_p(buf, 0755); + assert(mkdir_p(buf, 0755) >= 0); strcpy(buf + len, "/initstate"); return write_one_line_file(buf, "live\n", strlen("live\n")); |