diff options
author | Richard Purdie <richard@openedhand.com> | 2007-09-01 23:47:58 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-09-01 23:47:58 +0000 |
commit | 8d342dc0569fb4274b8ac9dfe40b1ce8543799f4 (patch) | |
tree | 41b4d38869b180f06bc75e818e0ea2bfb557f0b6 /meta/packages | |
parent | bbbb9f5f08430bab30a284517a74e59c9a8ad477 (diff) | |
download | poky-8d342dc0569fb4274b8ac9dfe40b1ce8543799f4.tar.gz |
makedevs: Add file and diretory creation code (from OE)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2642 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages')
-rw-r--r-- | meta/packages/makedevs/makedevs-1.0.0/makedevs.c | 8 | ||||
-rw-r--r-- | meta/packages/makedevs/makedevs-native_1.0.0.bb | 2 | ||||
-rw-r--r-- | meta/packages/makedevs/makedevs_1.0.0.bb | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/meta/packages/makedevs/makedevs-1.0.0/makedevs.c b/meta/packages/makedevs/makedevs-1.0.0/makedevs.c index a9bf8e782a..14569c61a2 100644 --- a/meta/packages/makedevs/makedevs-1.0.0/makedevs.c +++ b/meta/packages/makedevs/makedevs-1.0.0/makedevs.c | |||
@@ -106,6 +106,7 @@ static char *xstrdup(const char *s) | |||
106 | static void add_new_directory(char *name, char *path, | 106 | static void add_new_directory(char *name, char *path, |
107 | unsigned long uid, unsigned long gid, unsigned long mode) | 107 | unsigned long uid, unsigned long gid, unsigned long mode) |
108 | { | 108 | { |
109 | mkdir(path,mode); | ||
109 | // printf("Directory: %s %s UID: %ld GID %ld MODE: %ld\n", path, name, uid, gid, mode); | 110 | // printf("Directory: %s %s UID: %ld GID %ld MODE: %ld\n", path, name, uid, gid, mode); |
110 | } | 111 | } |
111 | 112 | ||
@@ -136,6 +137,13 @@ static void add_new_device(char *name, char *path, unsigned long uid, | |||
136 | static void add_new_file(char *name, char *path, unsigned long uid, | 137 | static void add_new_file(char *name, char *path, unsigned long uid, |
137 | unsigned long gid, unsigned long mode) | 138 | unsigned long gid, unsigned long mode) |
138 | { | 139 | { |
140 | int fd = open(path,O_CREAT | O_WRONLY, mode); | ||
141 | if(fd<0) | ||
142 | { | ||
143 | error_msg_and_die("%s: file can not be created!", path); | ||
144 | } else { | ||
145 | close(fd); | ||
146 | } | ||
139 | // printf("File: %s %s UID: %ld GID: %ld MODE: %ld\n", | 147 | // printf("File: %s %s UID: %ld GID: %ld MODE: %ld\n", |
140 | // path, name, gid, uid, mode); | 148 | // path, name, gid, uid, mode); |
141 | } | 149 | } |
diff --git a/meta/packages/makedevs/makedevs-native_1.0.0.bb b/meta/packages/makedevs/makedevs-native_1.0.0.bb index 28544e12f2..004a71374d 100644 --- a/meta/packages/makedevs/makedevs-native_1.0.0.bb +++ b/meta/packages/makedevs/makedevs-native_1.0.0.bb | |||
@@ -1,6 +1,6 @@ | |||
1 | SECTION = "base" | 1 | SECTION = "base" |
2 | require makedevs_${PV}.bb | 2 | require makedevs_${PV}.bb |
3 | inherit native | 3 | inherit native |
4 | 4 | ||
5 | FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/makedevs-${PV}" | 5 | FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/makedevs-${PV}" |
6 | 6 | ||
diff --git a/meta/packages/makedevs/makedevs_1.0.0.bb b/meta/packages/makedevs/makedevs_1.0.0.bb index f6c1ffbfa1..422d911089 100644 --- a/meta/packages/makedevs/makedevs_1.0.0.bb +++ b/meta/packages/makedevs/makedevs_1.0.0.bb | |||
@@ -4,7 +4,7 @@ SECTION = "base" | |||
4 | PRIORITY = "required" | 4 | PRIORITY = "required" |
5 | SRC_URI = "file://makedevs.c" | 5 | SRC_URI = "file://makedevs.c" |
6 | S = "${WORKDIR}/makedevs-${PV}" | 6 | S = "${WORKDIR}/makedevs-${PV}" |
7 | PR = "r2" | 7 | PR = "r3" |
8 | 8 | ||
9 | do_configure() { | 9 | do_configure() { |
10 | install -m 0644 ${WORKDIR}/makedevs.c ${S}/ | 10 | install -m 0644 ${WORKDIR}/makedevs.c ${S}/ |