Merge pull request #78 from bauen1/dhcp-overlay2
DHCP/DNS overlay bundle
This commit is contained in:
commit
29e3f3049f
@ -171,12 +171,13 @@ COPY_SOURCE_ISO=true
|
|||||||
# static_get - portable binaries for Linux (http://s.minos.io)
|
# static_get - portable binaries for Linux (http://s.minos.io)
|
||||||
# cf_cli - CLoud Foundry CLI (command line interface)
|
# cf_cli - CLoud Foundry CLI (command line interface)
|
||||||
# nweb - simple mini http server
|
# nweb - simple mini http server
|
||||||
|
# dhcp - DHCP and DNS functionality
|
||||||
#
|
#
|
||||||
# Refer to the README file for more information.
|
# Refer to the README file for more information.
|
||||||
#
|
#
|
||||||
#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,lua,static_get,cf_cli
|
#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,lua,static_get,cf_cli
|
||||||
#OVERLAY_BUNDLES=cf_cli
|
#OVERLAY_BUNDLES=cf_cli
|
||||||
OVERLAY_BUNDLES=nweb
|
OVERLAY_BUNDLES=nweb,dhcp
|
||||||
|
|
||||||
# This property enables the standard penguin boot logo in the upper left corner
|
# This property enables the standard penguin boot logo in the upper left corner
|
||||||
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value
|
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value
|
||||||
|
@ -57,10 +57,6 @@ fi
|
|||||||
cp $SYSROOT/lib/libm.so.6 lib
|
cp $SYSROOT/lib/libm.so.6 lib
|
||||||
cp $SYSROOT/lib/libc.so.6 lib
|
cp $SYSROOT/lib/libc.so.6 lib
|
||||||
|
|
||||||
# These libraries are necessary for the DNS resolving.
|
|
||||||
cp $SYSROOT/lib/libresolv.so.2 lib
|
|
||||||
cp $SYSROOT/lib/libnss_dns.so.2 lib
|
|
||||||
|
|
||||||
# Copy all necessary 'glibc' libraries to '/lib' END.
|
# Copy all necessary 'glibc' libraries to '/lib' END.
|
||||||
|
|
||||||
strip -g \
|
strip -g \
|
||||||
|
@ -69,6 +69,8 @@ Currently available overlay bundles:
|
|||||||
add '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to the cmd in
|
add '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to the cmd in
|
||||||
qemu64.sh and qemu32.sh
|
qemu64.sh and qemu32.sh
|
||||||
|
|
||||||
|
* dhcp - DHCP and DNS functionality
|
||||||
|
|
||||||
### ### ###
|
### ### ###
|
||||||
|
|
||||||
I only provide the build scripts. It's entirely up to you to configure and
|
I only provide the build scripts. It's entirely up to you to configure and
|
||||||
|
17
src/minimal_overlay/bundles/dhcp/05_rc.dhcp
Executable file
17
src/minimal_overlay/bundles/dhcp/05_rc.dhcp
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# This script gets called by udhcpc to setup the network interfaces
|
||||||
|
|
||||||
|
ip addr add $ip/$mask dev $interface
|
||||||
|
|
||||||
|
if [ "$router" ]; then
|
||||||
|
ip route add default via $router dev $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$ip" ]; then
|
||||||
|
echo -e "DHCP configuration for device $interface"
|
||||||
|
echo -e "IP: \\e[1m$ip\\e[0m"
|
||||||
|
echo -e "mask: \\e[1m$mask\\e[0m"
|
||||||
|
echo -e "router: \\e[1m$router\\e[0m"
|
||||||
|
fi
|
||||||
|
|
27
src/minimal_overlay/bundles/dhcp/bundle.sh
Executable file
27
src/minimal_overlay/bundles/dhcp/bundle.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
|
echo "removing previous work area"
|
||||||
|
rm -rf $WORK_DIR/overlay/dhcp
|
||||||
|
mkdir -p $WORK_DIR/overlay/dhcp
|
||||||
|
cd $WORK_DIR/overlay/dhcp
|
||||||
|
|
||||||
|
DESTDIR="$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs"
|
||||||
|
mkdir -p "$DESTDIR"
|
||||||
|
|
||||||
|
install -d -m755 "$DESTDIR/etc"
|
||||||
|
install -m644 "$SRC_DIR/resolv.conf" "$DESTDIR/etc/resolv.conf"
|
||||||
|
install -d -m755 "$DESTDIR/etc/autorun"
|
||||||
|
install -m755 "$SRC_DIR/01_network.sh" "$DESTDIR/etc/autorun/01_network.sh"
|
||||||
|
install -m755 "$SRC_DIR/05_rc.dhcp" "$DESTDIR/etc/05_rc.dhcp"
|
||||||
|
|
||||||
|
# These libraries are necessary for the DNS resolving.
|
||||||
|
install -d -m755 "$DESTDIR/lib"
|
||||||
|
install -m755 "$SYSROOT/lib/libresolv.so.2" "$DESTDIR/lib/libresolv.so.2"
|
||||||
|
install -m755 "$SYSROOT/lib/libnss_dns.so.2" "$DESTDIR/lib/libnss_dns.so.2"
|
||||||
|
strip -g "$DESTDIR/lib/*" 2>/dev/null
|
||||||
|
|
||||||
|
echo "dhcp scripts and libraries have been installed"
|
@ -14,9 +14,7 @@
|
|||||||
# |
|
# |
|
||||||
# +--(1) /etc/04_bootscript.sh
|
# +--(1) /etc/04_bootscript.sh
|
||||||
# | |
|
# | |
|
||||||
# | +-- udhcpc
|
# | +-- /etc/autorun/* (all scripts)
|
||||||
# | |
|
|
||||||
# | +-- /etc/05_rc.udhcp
|
|
||||||
# |
|
# |
|
||||||
# +--(2) /bin/sh (Alt + F1, main console)
|
# +--(2) /bin/sh (Alt + F1, main console)
|
||||||
# |
|
# |
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
# |
|
# |
|
||||||
# +--(1) /etc/04_bootscript.sh
|
# +--(1) /etc/04_bootscript.sh
|
||||||
# | |
|
# | |
|
||||||
# | +-- udhcpc
|
# | +-- /etc/autorun/* (all scripts)
|
||||||
# | |
|
|
||||||
# | +-- /etc/05_rc.udhcp
|
|
||||||
# |
|
# |
|
||||||
# +--(2) /bin/sh (Alt + F1, main console)
|
# +--(2) /bin/sh (Alt + F1, main console)
|
||||||
# |
|
# |
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
# |
|
# |
|
||||||
# +--(1) /etc/04_bootscript.sh
|
# +--(1) /etc/04_bootscript.sh
|
||||||
# | |
|
# | |
|
||||||
# | +-- udhcpc
|
# | +-- /etc/autorun/* (all scripts)
|
||||||
# | |
|
|
||||||
# | +-- /etc/05_rc.udhcp
|
|
||||||
# |
|
# |
|
||||||
# +--(2) /bin/sh (Alt + F1, main console)
|
# +--(2) /bin/sh (Alt + F1, main console)
|
||||||
# |
|
# |
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# System initialization sequence:
|
|
||||||
#
|
|
||||||
# /init
|
|
||||||
# |
|
|
||||||
# +--(1) /etc/01_prepare.sh
|
|
||||||
# |
|
|
||||||
# +--(2) /etc/02_overlay.sh
|
|
||||||
# |
|
|
||||||
# +-- /etc/03_init.sh
|
|
||||||
# |
|
|
||||||
# +-- /sbin/init
|
|
||||||
# |
|
|
||||||
# +--(1) /etc/04_bootscript.sh
|
|
||||||
# | |
|
|
||||||
# | +-- udhcpc
|
|
||||||
# | |
|
|
||||||
# | +-- /etc/05_rc.udhcp (this file)
|
|
||||||
# |
|
|
||||||
# +--(2) /bin/sh (Alt + F1, main console)
|
|
||||||
# |
|
|
||||||
# +--(2) /bin/sh (Alt + F2)
|
|
||||||
# |
|
|
||||||
# +--(2) /bin/sh (Alt + F3)
|
|
||||||
# |
|
|
||||||
# +--(2) /bin/sh (Alt + F4)
|
|
||||||
|
|
||||||
ip addr add $ip/$mask dev $interface
|
|
||||||
|
|
||||||
if [ "$router" ]; then
|
|
||||||
ip route add default via $router dev $interface
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ip" ]; then
|
|
||||||
echo -e "DHCP configuration for device $interface"
|
|
||||||
echo -e "IP: \\e[1m$ip\\e[0m"
|
|
||||||
echo -e "mask: \\e[1m$mask\\e[0m"
|
|
||||||
echo -e "router: \\e[1m$router\\e[0m"
|
|
||||||
fi
|
|
||||||
|
|
@ -14,9 +14,7 @@
|
|||||||
# |
|
# |
|
||||||
# +--(1) /etc/04_bootscript.sh
|
# +--(1) /etc/04_bootscript.sh
|
||||||
# | |
|
# | |
|
||||||
# | +-- udhcpc
|
# | +-- /etc/autorun/* (all scripts)
|
||||||
# | |
|
|
||||||
# | +-- /etc/05_rc.udhcp
|
|
||||||
# |
|
# |
|
||||||
# +--(2) /bin/sh (Alt + F1, main console)
|
# +--(2) /bin/sh (Alt + F1, main console)
|
||||||
# |
|
# |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user