summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert "ar" Gerus <ar@bash.org.pl>2013-04-30 12:00:35 +0200
committerRobert "ar" Gerus <ar@bash.org.pl>2013-04-30 12:00:35 +0200
commitdc5c20ba1f0dc5305e65f925bae1ddb8f1b697af (patch)
tree25ac02ef9344f597780c1e97bf50cd7f92ed5e44
parent5f77c40004b2481bfeab9cc811d55d5c106d4aa7 (diff)
downloadtar-xz-loading-initramfs-dc5c20ba1f0dc5305e65f925bae1ddb8f1b697af.tar.gz
tar-xz-loading-initramfs-dc5c20ba1f0dc5305e65f925bae1ddb8f1b697af.tar.bz2
tar-xz-loading-initramfs-dc5c20ba1f0dc5305e65f925bae1ddb8f1b697af.zip
v0.5 - Now with extra colours!
-rwxr-xr-xinitramfs/init17
1 files changed, 11 insertions, 6 deletions
diff --git a/initramfs/init b/initramfs/init
index 8286f69..67cddc1 100755
--- a/initramfs/init
+++ b/initramfs/init
@@ -1,23 +1,27 @@
#!/busybox sh
+NORMAL="\\033[0m"
+FAIL="\\033[1;31m"
+OK="\\033[1;32m"
+INFO="\\033[1;34m"
+
die() {
echo ""
- echo "Shit broke! Panic shell!"
+ echo -e "${FAIL}Shit broke! Panic shell!${NORMAL}"
echo ""
/busybox --install -s
exec /bin/sh
}
-
info() {
- echo -n "-|-" ${@} "... "
+ echo -en "-${INFO}|${NORMAL}-" ${@} "... "
}
isok() {
if [[ $1 -eq 0 ]]; then
- echo "[ OK ]"
+ echo -e "${INFO}[ ${OK}OK${INFO} ]${NORMAL}"
else
- echo "[ FUCK ]"
+ echo -e "${INFO}[ ${FAIL}FUCK${INFO} ]${NORMAL}"
die
fi
}
@@ -90,6 +94,7 @@ info "checking if ${filename} exists"
isok $?
info "unpacking; will take some time"
+echo ""
/pv /mnt/${filename} | /busybox tar -C /roottmpfs -xJf -
info "unmounting rootfs package location"
@@ -108,7 +113,7 @@ info "trying to switch root"
exec /busybox switch_root /roottmpfs /sbin/init
echo ""
-echo "we should not reach this place! here be dragons!"
+echo -e "${FAIL}we should not reach this place! here be dragons!${NORMAL}"
echo ""
die