From 7b8a4a697936a614b094a53534ebdbd2ea4b63a9 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 15 Feb 2022 11:05:56 +0330 Subject: adding device files manually now and working for void chroots --- chroot/debian11.sh | 2 +- chroot/make_devices.sh | 19 +++++++++++++++++++ chroot/voidglibc.sh | 2 +- chroot/voidmusl.sh | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 chroot/make_devices.sh diff --git a/chroot/debian11.sh b/chroot/debian11.sh index 3fe88da..2fbfd83 100755 --- a/chroot/debian11.sh +++ b/chroot/debian11.sh @@ -1,6 +1,6 @@ #!/bin/sh -CHROOT_DIR=/home/devi/rootfs/debian11 +CHROOT_DIR=/home/devi/chroots/debian11 sudo mount -t proc proc $CHROOT_DIR/proc/ sudo mount -t sysfs sys $CHROOT_DIR/sys/ # sudo mount -o bind /tmp $CHROOT_DIR/tmp/ diff --git a/chroot/make_devices.sh b/chroot/make_devices.sh new file mode 100755 index 0000000..d333615 --- /dev/null +++ b/chroot/make_devices.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +make_devices() { + env mknod -m 0666 $1/dev/tty c 5 0 + chown root:tty $1/dev/tty + for i in 0 1 2 3 4 5 6 7; do + env mknod -m 0600 $1/dev/tty$i c 4 $i + chown root:tty $1/dev/tty$i + chmod 0620 $1/dev/tty$i + done + env mknod -m 0666 $1/dev/null c 1 3 + env mknod -m 0666 $1/dev/random c 1 8 + env mknod -m 0666 $1/dev/urandom c 1 9 + env mknod -m 0666 $1/dev/ptmx c 5 2 + chown root:tty $1/dev/ptmx +} +make_devices /home/devi/chroots/voidmusl +make_devices /home/devi/chroots/voidglibc +# debootstrap stable /home/devi/chroots/debian11 http://deb.debian.org/debian diff --git a/chroot/voidglibc.sh b/chroot/voidglibc.sh index bc2c47b..fb38e35 100755 --- a/chroot/voidglibc.sh +++ b/chroot/voidglibc.sh @@ -1,6 +1,6 @@ #!/bin/sh -CHROOT_DIR=/home/devi/rootfs/voidglibc +CHROOT_DIR=/home/devi/chroots/voidglibc sudo mount -t proc proc $CHROOT_DIR/proc/ sudo mount -t sysfs sys $CHROOT_DIR/sys/ # sudo mount -o bind /tmp $CHROOT_DIR/tmp/ diff --git a/chroot/voidmusl.sh b/chroot/voidmusl.sh index 9d98ae6..57f89d1 100755 --- a/chroot/voidmusl.sh +++ b/chroot/voidmusl.sh @@ -1,6 +1,6 @@ #!/bin/sh -CHROOT_DIR=/home/devi/rootfs/voidmusl +CHROOT_DIR=/home/devi/chroots/voidmusl sudo mount -t proc proc $CHROOT_DIR/proc/ sudo mount -t sysfs sys $CHROOT_DIR/sys/ # sudo mount -o bind /tmp $CHROOT_DIR/tmp/ -- cgit v1.2.3