Added initial version of some scripts for the boot process.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9776 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d0f68c485f
commit
1583190bd8
85
data/etc/profile
Normal file
85
data/etc/profile
Normal file
@ -0,0 +1,85 @@
|
||||
#
|
||||
# Administrative startup for /bin/sh
|
||||
# Place user customizations in /.profile
|
||||
#
|
||||
|
||||
echo -e "\nWelcome to the Haiku shell.\n"
|
||||
|
||||
export PS1="\w>"
|
||||
export HISTFILESIZE=50
|
||||
|
||||
bind '"\e[2~":paste-from-clipboard'
|
||||
bind '"\e[3~":delete-char'
|
||||
bind '"\e[4~":end-of-line'
|
||||
bind '"\e[5~":history-search-forward'
|
||||
bind '"\e[6~":history-search-backward'
|
||||
|
||||
#
|
||||
# and now we include a few useful things...
|
||||
#
|
||||
|
||||
#
|
||||
# An almost-ksh compatible `whence' command. This is as hairy as it is
|
||||
# because of the desire to exactly mimic ksh.
|
||||
#
|
||||
# This depends somewhat on knowing the format of the output of the bash
|
||||
# `builtin type' command.
|
||||
#
|
||||
# Chet Ramey
|
||||
# chet@ins.CWRU.Edu
|
||||
#
|
||||
whence()
|
||||
{
|
||||
local vflag= path=
|
||||
|
||||
if [ "$#" = "0" ] ; then
|
||||
echo "whence: argument expected"
|
||||
return 1
|
||||
fi
|
||||
case "$1" in
|
||||
-v) vflag=1
|
||||
shift 1
|
||||
;;
|
||||
-*) echo "whence: bad option: $1"
|
||||
return 1
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
if [ "$#" = "0" ] ; then
|
||||
echo "whence: bad argument count"
|
||||
return 1
|
||||
fi
|
||||
|
||||
for cmd
|
||||
do
|
||||
if [ "$vflag" ] ; then
|
||||
echo $(builtin type $cmd | sed 1q)
|
||||
else
|
||||
path=$(builtin type -path $cmd)
|
||||
if [ "$path" ] ; then
|
||||
echo $path
|
||||
else
|
||||
case "$cmd" in
|
||||
/*) if [ -x "$cmd" ]; then
|
||||
echo "$cmd"
|
||||
fi
|
||||
;;
|
||||
*) case "$(builtin type -type $cmd)" in
|
||||
"") ;;
|
||||
*) echo "$cmd"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
alias which='whence'
|
||||
|
||||
function dir {
|
||||
ls -lF "$@";
|
||||
}
|
46
data/system/boot/Bootscript
Normal file
46
data/system/boot/Bootscript
Normal file
@ -0,0 +1,46 @@
|
||||
## The system's main boot script.
|
||||
|
||||
##
|
||||
## Some functions used by the main script
|
||||
##
|
||||
|
||||
# launch <executable path> [thread to wait for]
|
||||
|
||||
launch () {
|
||||
if [ -f "/boot/$1" ]
|
||||
then
|
||||
"/boot/$1" &
|
||||
[ "$2" != "" ] && waitfor "$2"
|
||||
return 1
|
||||
else
|
||||
echo There is no "$1"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# launchscript <script path>
|
||||
|
||||
launchscript() {
|
||||
if [ -f "/boot/$1" ]
|
||||
then
|
||||
. "/boot/$1"
|
||||
fi
|
||||
}
|
||||
|
||||
##
|
||||
## Main script starts here
|
||||
##
|
||||
|
||||
# Set up stdin/out/err to nirvana
|
||||
|
||||
exec </dev/null
|
||||
exec >/dev/null 2>&1
|
||||
|
||||
# Set up the environment
|
||||
|
||||
SCRIPTS=beos/system/boot
|
||||
launchscript $SCRIPTS/SetupEnvironment
|
||||
|
||||
# Launch consoled
|
||||
|
||||
launch beos/bin/consoled
|
72
data/system/boot/SetupEnvironment
Normal file
72
data/system/boot/SetupEnvironment
Normal file
@ -0,0 +1,72 @@
|
||||
#
|
||||
# First we set up a bunch of environment variables that we want everyone
|
||||
# to inherit
|
||||
#
|
||||
|
||||
export HOME=/boot/home
|
||||
export SHELL=/bin/sh
|
||||
export USER=baron
|
||||
export GROUP=users
|
||||
|
||||
BUILDHOME=/boot/develop
|
||||
|
||||
case `uname -m` in
|
||||
BePC)
|
||||
BE_HOST_CPU=x86
|
||||
BETOOLS="$BUILDHOME/bin"
|
||||
BELIBRARIES="$BUILDHOME/lib/$BE_HOST_CPU"
|
||||
;;
|
||||
BeMac|BeBox)
|
||||
BE_HOST_CPU=ppc
|
||||
BETOOLS="$BUILDHOME/bin"
|
||||
BELIBRARIES="$BUILDHOME/lib/$BE_HOST_CPU"
|
||||
BELIBFILES="glue-noinit.a;init_term_dyn.o;start_dyn.o;libroot.so;libbe.so;libtracker.so;libmedia.so;libnet.so;libnetdev.so;libdevice.so;libmidi.so;libgame.so;libatalk.so;libmail.so"
|
||||
;;
|
||||
*)
|
||||
BE_HOST_CPU=unknown
|
||||
BETOOLS="$BUILDHOME/bin"
|
||||
esac
|
||||
|
||||
BH=$BUILDHOME/headers
|
||||
BEINCLUDES="$BH;$BH/be;$BH/be/precompiled;$BH/be/bone;$BH/posix;$BH/cpp;$BH/be/app;$BH/be/device;$BH/be/interface;$BH/be/media;$BH/be/midi;$BH/be/midi2;$BH/be/net;$BH/be/kernel;$BH/be/storage;$BH/be/support;$BH/be/game;$BH/be/opengl;$BH/be/drivers;$BH/gnu;$BH/be/mail;$BH/be/translation;$BH/be/devel;$BH/be/add-ons/graphics;$BH/be/be_apps/Deskbar;$BH/be/be_apps/NetPositive;$BH/be/be_apps/Tracker"
|
||||
|
||||
export BUILDHOME
|
||||
export BETOOLS
|
||||
export BELIBRARIES
|
||||
export BELIBFILES
|
||||
export BEINCLUDES
|
||||
export BE_HOST_CPU
|
||||
|
||||
# for the "cc" and "ld" shell scripts
|
||||
|
||||
export BE_C_COMPILER=gcc
|
||||
export BE_CPLUS_COMPILER="g++"
|
||||
export BE_LINKER=ld
|
||||
export BE_DEFAULT_C_FLAGS=""
|
||||
export BE_DEFAULT_CPLUS_FLAGS=""
|
||||
|
||||
export PATH=.:$HOME/config/bin:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:$BETOOLS
|
||||
|
||||
if [ "$SAFEMODE" != "yes" ]
|
||||
then
|
||||
export LIBRARY_PATH="%A/lib:$HOME/config/lib:/boot/beos/system/lib"
|
||||
export ADDON_PATH="%A/add-ons:$HOME/config/add-ons:/boot/beos/system/add-ons"
|
||||
else
|
||||
export LIBRARY_PATH="%A/lib:/boot/beos/system/lib"
|
||||
export ADDON_PATH="%A/add-ons:/boot/beos/system/add-ons"
|
||||
fi
|
||||
|
||||
# media kit
|
||||
if [ -f $HOME/config/settings/use_old_audio ]
|
||||
then
|
||||
export USE_OLD_AUDIO=true
|
||||
fi
|
||||
|
||||
if [ "$SAFEMODE" != "yes" ]
|
||||
then
|
||||
if [ -f $HOME/config/boot/UserSetupEnvironment ]
|
||||
then
|
||||
. $HOME/config/boot/UserSetupEnvironment
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user