summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-05-26 07:16:13 -0600
committerTimo Teräs <timo.teras@iki.fi>2020-05-27 08:29:01 +0300
commitf4c3f0ad2ad5f16c345f77840f548e2a36fc3d6c (patch)
treee8c3623addd294a923b27d06112c35a109298309
parent4d69d123f595994380c3ed4a5906982b022ecde8 (diff)
downloadapk-tools-f4c3f0ad2ad5f16c345f77840f548e2a36fc3d6c.tar.gz
apk-tools-f4c3f0ad2ad5f16c345f77840f548e2a36fc3d6c.tar.bz2
apk-tools-f4c3f0ad2ad5f16c345f77840f548e2a36fc3d6c.tar.xz
apk-tools-f4c3f0ad2ad5f16c345f77840f548e2a36fc3d6c.zip
database: create additional device nodes when initializing root fs
Some triggers and maintainer scripts depend on /dev/random, /dev/urandom, /dev/zero and /dev/console.
-rw-r--r--src/database.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c
index d113d6a..29fd6dd 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1330,6 +1330,10 @@ static int apk_db_create(struct apk_database *db)
mkdirat(db->root_fd, "tmp", 01777);
mkdirat(db->root_fd, "dev", 0755);
mknodat(db->root_fd, "dev/null", S_IFCHR | 0666, makedev(1, 3));
+ mknodat(db->root_fd, "dev/zero", S_IFCHR | 0666, makedev(1, 5));
+ mknodat(db->root_fd, "dev/random", S_IFCHR | 0666, makedev(1, 8));
+ mknodat(db->root_fd, "dev/urandom", S_IFCHR | 0666, makedev(1, 9));
+ mknodat(db->root_fd, "dev/console", S_IFCHR | 0600, makedev(5, 1));
mkdirat(db->root_fd, "etc", 0755);
mkdirat(db->root_fd, "etc/apk", 0755);
mkdirat(db->root_fd, "lib", 0755);