From: Harald Hoyer Date: Mon, 18 May 2009 13:33:37 +0000 (+0200) Subject: add minimal dnsmasq dhcp/dns server X-Git-Tag: 0.1~254 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02948d09056f7624af3c247cec08662a8e05db70;p=thirdparty%2Fdracut.git add minimal dnsmasq dhcp/dns server --- diff --git a/.gitignore b/.gitignore index 797ff74a5..a17c5ca7f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ test*.img modules.d/99base/switch_root test/initramfs.testing test/root.ext2 +test/server.ext2 diff --git a/test/make-server-root b/test/make-server-root new file mode 100755 index 000000000..22ab83a59 --- /dev/null +++ b/test/make-server-root @@ -0,0 +1,47 @@ +#!/bin/bash + +dd if=/dev/zero of=test/server.ext2 bs=1M count=20 +mke2fs -F test/server.ext2 +mkdir test/mnt +mount -o loop test/server.ext2 test/mnt + +initdir=test/mnt +kernel=$(uname -r) +( + . ./dracut-functions + dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \ + /lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient + inst "modules.d/40network/dhclient-script" "/sbin/dhclient-script" + inst "modules.d/40network/ifup" "/sbin/ifup" + dracut_install grep dnsmasq agetty strace tcpdump + inst test/server-init /sbin/init + (cd "$initdir"; + mkdir -p dev sys proc etc var/run tmp var/lib/dnsmasq + + cat > etc/hosts < etc/dnsmasq.conf </proc/sys/vm/drop_caches +free +if [ -x /usr/sbin/dnsmasq ]; then + ifconfig eth0 192.168.1.1 + route add -net 192.168.1.0/24 dev eth0 + /usr/sbin/dnsmasq +fi +/bin/sh -i +mount -n -o remount,ro / +poweroff -f +