lxc-busybox.in revision e62fa3f9cea8c97fbfa3a3c8e6acc00c420c8363
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# lxc: linux Container library
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# Daniel Lezcano <daniel.lezcano@free.fr>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# This library is free software; you can redistribute it and/or
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# modify it under the terms of the GNU Lesser General Public
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# License as published by the Free Software Foundation; either
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# version 2.1 of the License, or (at your option) any later version.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# This library is distributed in the hope that it will be useful,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# but WITHOUT ANY WARRANTY; without even the implied warranty of
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# Lesser General Public License for more details.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# You should have received a copy of the GNU Lesser General Public
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# License along with this library; if not, write to the Free Software
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano mkdir -p $tree || return 1
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano chmod 755 $tree || return 1
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoroot:x:0:0:root:/root:/bin/sh
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoroot:x:0:root
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano/bin/syslogd
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano/bin/mount -a
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoproc /proc proc defaults 0 0
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoshm /dev/shm tmpfs defaults 0 0
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano::sysinit:/etc/init.d/rcS
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanotty1::respawn:/bin/getty -L tty1 115200 vt100
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoconsole::askfirst:/bin/sh
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano cat <<EOF >> $rootfs/usr/share/udhcpc/default.script
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanocase "\$1" in
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ip addr flush dev \$interface
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano renew|bound)
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # flush all the routes
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if [ -n "\$router" ]; then
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ip route del default 2> /dev/null
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # check broadcast
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if [ -n "\$broadcast" ]; then
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano broadcast="broadcast \$broadcast"
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano # add a new ip address
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ip addr add \$ip/\$mask \$broadcast dev \$interface
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if [ -n "\$router" ]; then
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ip route add default via \$router dev \$interface
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano [ -n "\$domain" ] && echo search \$domain > /etc/resolv.conf
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano for i in \$dns ; do
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano echo nameserver \$i >> /etc/resolv.conf
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand chmod 744 $rootfs/usr/share/udhcpc/default.script
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano [ [[ addgroup adduser adjtimex ar arp arping ash awk basename \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano brctl bunzip2 bzcat bzip2 cal cat catv chattr chgrp chmod \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano chown chpasswd chpst chroot chrt chvt cksum clear cmp comm \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano cp cpio crond crontab cryptpw cut date dc dd deallocvt \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano delgroup deluser df dhcprelay diff dirname dmesg dnsd dos2unix \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano du dumpkmap dumpleases echo ed egrep eject env envdir envuidgid \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ether-wake expand expr fakeidentd false fbset fdformat fdisk \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano fetchmail fgrep find findfs fold free freeramdisk fsck \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano fsck.minix ftpget ftpput fuser getopt getty grep gunzip gzip \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano halt hdparm head hexdump hostid hostname httpd hwclock id \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ifconfig ifdown ifenslave ifup inetd init insmod install ip \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano ipaddr ipcalc ipcrm ipcs iplink iproute iprule iptunnel \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano kbd_mode kill killall killall5 klogd last length less linux32 \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano linux64 linuxrc ln loadfont loadkmap logger login logname \
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano logread losetup lpd lpq lpr ls lsattr lsmod lzmacat makedevs \
md5sum mdev mesg microcom mkdir mkfifo mkfs.minix mknod mkswap \
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
path=$1
rootfs=$2
name=$3
cat <<EOF
eval set -- "$options"
if [ -z "$path" ]; then