rootfs build updated
This commit is contained in:
@@ -0,0 +1 @@
|
||||
# disk mountpoint filesystem options 0 0/1
|
||||
@@ -0,0 +1 @@
|
||||
root:x:0:root
|
||||
@@ -0,0 +1 @@
|
||||
simple
|
||||
@@ -0,0 +1,3 @@
|
||||
127.0.0.1 localhost
|
||||
::1 localhost
|
||||
127.0.1.1 simple.localdomain simple
|
||||
@@ -0,0 +1,82 @@
|
||||
#!/bin/sh
|
||||
|
||||
#--- reset colors ---
|
||||
RESET="\033[0m"
|
||||
#--------------------
|
||||
|
||||
#--------- regularcolrs ---------
|
||||
GREEN="\033[0;32m" #GREEN
|
||||
BLUE="\033[0;34m" #BLUE
|
||||
YELLOW="\033[1;33m" #YELLOW
|
||||
RED="\033[0;31m" #RED
|
||||
BLACK="\033[0;30m" #BLACK
|
||||
PURPLE="\033[0;35m" #PURPLE
|
||||
CYAN="\033[0;36m" #CYAN
|
||||
WHITE="\033[0;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#-------- bold ------------------
|
||||
BBLACK="\033[1;30m" #BLACK
|
||||
BRED="\033[1;31m" #RED
|
||||
BGREEN="\033[1;32m" #GREEN
|
||||
BYELLOW="\033[1;33m" #YELLOW
|
||||
BBLUE="\033[1;34m" #BLUE
|
||||
BPURPLE="\033[1;35m" #PURPLE
|
||||
BCYAN="\033[1;36m" #CYAN
|
||||
BWHITE="\033[1;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#-------- Underline -------------
|
||||
UBLACK="\033[4;30m" #BLACK
|
||||
URED="\033[4;31m" #RED
|
||||
UGREEN="\033[4;32m" #GREEN
|
||||
UYELLOW="\033[4;33m" #YELLOW
|
||||
UBLUE="\033[4;34m" #BLUE
|
||||
UPURPLE="\033[4;35m" #PURPLE
|
||||
UCYAN="\033[4;36m" #CYAN
|
||||
UWHITE="\033[4;37m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#--------- Background -----------
|
||||
ON_BLACK="\033[40m" #BLACK
|
||||
ON_RED="\033[41m" #RED
|
||||
ON_GREEN="\033[42m" #GREEN
|
||||
ON_YELLOW="\033[43m" #YELLOW
|
||||
ON_BLUE="\033[44m" #BLUE
|
||||
ON_PURPLE="\033[45m" #PURPLE
|
||||
ON_CYAN="\033[46m" #CYAN
|
||||
ON_WHITE="\033[47m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#------ HighIntensity -----------
|
||||
IBLACK="\033[0;90m" #BLACK
|
||||
IRED="\033[0;91m" #RED
|
||||
IGREEN="\033[0;92m" #GREEN
|
||||
IYELLOW="\033[0;93m" #YELLOW
|
||||
IBLUE="\033[0;94m" #BLUE
|
||||
IPURPLE="\033[0;95m" #PURPLE
|
||||
ICYAN="\033[0;96m" #CYAN
|
||||
IWHITE="\033[0;97m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#------ BoldHighIntensity -------
|
||||
BIBLACK="\033[1;90m" #BLACK
|
||||
BIRED="\033[1;91m" #RED
|
||||
BIGREEN="\033[1;92m" #GREEN
|
||||
BIYELLOW="\033[1;93m" #YELLOW
|
||||
BIBLUE="\033[1;94m" #BLUE
|
||||
BIPURPLE="\033[1;95m" #PURPLE
|
||||
BICYAN="\033[1;96m" #CYAN
|
||||
BIWHITE="\033[1;97m" #WHITE
|
||||
#--------------------------------
|
||||
|
||||
#--- HighIntensitybackgrounds ---
|
||||
ON_IBLACK="\033[0;100m" #BLACK
|
||||
ON_IRED="\033[0;101m" #RED
|
||||
ON_IGREEN="\033[0;102m" #GREEN
|
||||
ON_IYELLOW="\033[0;103m" #YELLOW
|
||||
ON_IBLUE="\033[0;104m" #BLUE
|
||||
ON_IPURPLE="\033[0;105m" #PURPLE
|
||||
ON_ICYAN="\033[0;106m" #CYAN
|
||||
ON_IWHITE="\033[0;107m" #WHITE
|
||||
#--------------------------------
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
#--- import colors ---
|
||||
. /etc/init.d/colors.sh
|
||||
#---------------------
|
||||
|
||||
#---------------------- rc function to poweron or poweroff ------------
|
||||
rc() {
|
||||
if [ -d /etc/rc.d ] && [ $0 == "/etc/init.d/rcK" ]; then
|
||||
for i in $(ls -r /etc/rc.d); do
|
||||
/etc/rc.d/$i stop
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
for i in /etc/rc.d/??*; do
|
||||
[ ! -f "$i" ] && continue
|
||||
case "$i" in
|
||||
*.sh)
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
sleep 1
|
||||
# clear
|
||||
return 1
|
||||
}
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
#---------- check status function -----------
|
||||
check() {
|
||||
if [ $1 -ne 0 ]; then
|
||||
printf "$URED** ERROR: $2\n$RESET"
|
||||
return
|
||||
fi
|
||||
printf "$UGREEN** SUCCESS: $2\n$RESET"
|
||||
}
|
||||
#--------------------------------------------
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/colors.sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "$UYELLOW Starting networking\n$RESET"
|
||||
/sbin/ifup -a &> /dev/null
|
||||
check $? "networking"
|
||||
echo $! > /var/run/networking.pid
|
||||
;;
|
||||
stop)
|
||||
printf "$UYELLOW Stopping netowrking\n$RESET"
|
||||
/sbin/ifdown -a
|
||||
check $? "Stop networking"
|
||||
rm /var/run/networking.pid
|
||||
;;
|
||||
restart|reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "$0 init script usage: $0 {start|stop|restart|reload}"
|
||||
return 1
|
||||
esac
|
||||
return $?
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
rcS
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
. /etc/init.d/init-funcs
|
||||
rc
|
||||
@@ -0,0 +1,9 @@
|
||||
::sysinit:/etc/init.d/rcS
|
||||
|
||||
::ctrlaltdel:/sbin/reboot
|
||||
::shutdown:/etc/init.d/rcK
|
||||
|
||||
tty1::respawn:/sbin/getty 38400 tty1
|
||||
tty2::askfirst:/sbin/getty 38400 tty2
|
||||
tty3::askfirst:/sbin/getty 38400 tty3
|
||||
tty4::askfirst:/sbin/getty 38400 tty4
|
||||
@@ -0,0 +1 @@
|
||||
\h \r (\l)
|
||||
@@ -0,0 +1,4 @@
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
auto eth0
|
||||
iface eth0 inet dhcp
|
||||
@@ -0,0 +1 @@
|
||||
root:x:0:0:root:/root:/bin/sh
|
||||
@@ -0,0 +1 @@
|
||||
root:F.fHA5x2Q.xNY:19797::::::
|
||||
@@ -0,0 +1,2 @@
|
||||
/bin/sh
|
||||
/bin/ash
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/colors.sh
|
||||
|
||||
[ -z "$1" ] && printf "$URED** ERROR: should be called from udhcpc\n$RESET" && exit 1
|
||||
RESOLF_CONF="/etc/resolv.conf"
|
||||
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
|
||||
[ -n "$subnet" ] && NETMASK="netmask $subnet"
|
||||
# return 0 if root is mounted on a network filesystem
|
||||
root_if_nfs() {
|
||||
grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
|
||||
}
|
||||
have_bin_ip=0
|
||||
if [ -x /bin/ip ]; then
|
||||
have_bin_ip=1
|
||||
fi
|
||||
case "$1" in
|
||||
deconfig)
|
||||
if ! rootfs_is_nfs; then
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
ip a flush dev $interface
|
||||
ip l set dev $interface up
|
||||
else
|
||||
/sbin/ifconfig $interface 0.0.0.0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
renew|bound)
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
ip a add dev $interface local $ip/$mask $BROADCAST
|
||||
else
|
||||
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
|
||||
fi
|
||||
|
||||
if [ -n "$router" ]; then
|
||||
if ! root_if_nfs; then
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
while ip r del default 2>/dev/null; do
|
||||
:
|
||||
done
|
||||
else
|
||||
while route del default gw 0.0.0.0 dev $interface 2>/dev/null; do
|
||||
:
|
||||
done
|
||||
fi
|
||||
fi
|
||||
metric=0
|
||||
for i in $router; do
|
||||
if [ $have_bin_ip -eq 1 ]; then
|
||||
ip r add default via $i metric $((metric++))
|
||||
else
|
||||
route add default gw $i dev $interface metric $((metric++)) 2>/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo -n > $RESOLF_CONF
|
||||
[ -n "$domain" ] && echo search $domain >> $RESOLF_CONF
|
||||
for i in $dns; do
|
||||
echo adding dns $i
|
||||
echo nameserver $i >> $RESOLF_CONF
|
||||
done
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
Reference in New Issue
Block a user