Files
linuxkit/alpine/mkinitrd.sh
Justin Cormack 6bd1df1675 Do not create default devices
They are created anyway at runtime, and this set is not very complete.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-06 23:08:12 +01:00

39 lines
704 B
Bash
Executable File

#!/bin/sh
set -e
rm -rf /tmp/*
for f in $(ls | grep -vE 'dev|sys|proc|tmp|export|mnt')
do
cp -a $f /tmp
done
mkdir -m 555 /tmp/dev /tmp/proc /tmp/sys /tmp/mnt
mkdir -m 1777 /tmp/tmp
# these three files are bind mounted in by docker so they are not what we want
cat << EOF > /tmp/etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
cat << EOF > /tmp/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
EOF
printf 'moby' > /tmp/etc/hostname
rm /tmp/bin/mkinitrd.sh
cd /tmp
find . | cpio -H newc -o > /mnt/initrd.img