Commit a56802d8 authored by Luca Giambonini's avatar Luca Giambonini

udev doesnt work in containers, rebuild /dev

Taken from https://raw.githubusercontent.com/dotcloud/docker/master/contrib/mkimage-arch.sh
parent 27723c44
Pipeline #89 failed with stages
in 1 minute and 20 seconds
......@@ -103,10 +103,37 @@ configure_minimal_system() {
touch "$DEST/etc/group"
echo "bootstrap" > "$DEST/etc/hostname"
test -e "$DEST/etc/mtab" || echo "rootfs / rootfs rw 0 0" > "$DEST/etc/mtab"
test -e "$DEST/dev/null" || mknod "$DEST/dev/null" c 1 3
test -e "$DEST/dev/random" || mknod -m 0644 "$DEST/dev/random" c 1 8
test -e "$DEST/dev/urandom" || mknod -m 0644 "$DEST/dev/urandom" c 1 9
# udev doesn't work in containers, rebuild /dev
DEV="$DEST/dev"
rm -rf $DEV
mkdir -p $DEV
mknod -m 666 $DEV/null c 1 3
mknod -m 666 $DEV/zero c 1 5
mknod -m 666 $DEV/random c 1 8
mknod -m 666 $DEV/urandom c 1 9
mkdir -m 755 $DEV/pts
mkdir -m 1777 $DEV/shm
mknod -m 666 $DEV/tty c 5 0
mknod -m 600 $DEV/console c 5 1
mknod -m 666 $DEV/tty0 c 4 0
mknod -m 666 $DEV/full c 1 7
mknod -m 600 $DEV/initctl p
mknod -m 666 $DEV/ptmx c 5 2
ln -sf /proc/self/fd $DEV/fd
#test -e "$DEST/etc/mtab" || echo "rootfs / rootfs rw 0 0" > "$DEST/etc/mtab"
#test -e "$DEST/dev/null" || mknod "$DEST/dev/null" c 1 3
#test -e "$DEST/dev/zero" || mknod "$DEST/dev/zero" c 1 5
#test -e "$DEST/dev/random" || mknod -m 0644 "$DEST/dev/random" c 1 8
#test -e "$DEST/dev/urandom" || mknod -m 0644 "$DEST/dev/urandom" c 1 9
#test -e "$DEST/dev/pts" || mkdir -m 0755 "$DEST/pts"
#test -e "$DEST/dev/shm" || mkdir -m 1777 "$DEST/shm"
#test -e "$DEST/dev/tty" || mknod -m 0644 "$DEST/dev/tty" c 5 0
#test -e "$DEST/dev/console" || mknod -m 0600 "$DEST/dev/console" c 5 1
#test -e "$DEST/dev/tty0" || mknod -m 0644 "$DEST/dev/tty0" c 4 0
#test -e "$DEST/dev/full" || mknod -m 0644 "$DEST/dev/full" c 1 7
#test -e "$DEST/dev/initctl" || mknod -m 0600 "$DEST/dev/initctl" p
#test -e "$DEST/dev/ptmx" || mknod -m 0644 "$DEST/dev/ptmx" c 5 2
sed -i "s/^[[:space:]]*\(CheckSpace\)/# \1/" "$DEST/etc/pacman.conf"
sed -i "s/^[[:space:]]*SigLevel[[:space:]]*=.*$/SigLevel = Never/" "$DEST/etc/pacman.conf"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment