1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/bootstrap/scripts/mage-bootstrap.sh,v 1.3 2006-02-23 16:46:03 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/bootstrap/scripts/mage-bootstrap.sh,v 1.6 2007-01-22 21:46:31 niro Exp $ |
3 |
|
|
4 |
TOOLCHAIN="" |
TOOLCHAIN="" |
5 |
BASESYSTEM="" |
BASESYSTEM="" |
109 |
|
|
110 |
print_usage() |
print_usage() |
111 |
{ |
{ |
112 |
echo "mage-bootstrap, version $Version$" |
echo "mage-bootstrap, version @VERSION@" |
113 |
echo "Usage: $(basename $0) --opt arg ..." |
echo "Usage: $(basename $0) --opt arg ..." |
114 |
echo |
echo |
115 |
echo "Options:" |
echo "Options:" |
192 |
# TOOLCHAIN="$(< /etc/mage-profile/${TOOLCHAIN})" |
# TOOLCHAIN="$(< /etc/mage-profile/${TOOLCHAIN})" |
193 |
# BASESYSTEM="$(< /etc/mage-profile/${BASESYSTEM})" |
# BASESYSTEM="$(< /etc/mage-profile/${BASESYSTEM})" |
194 |
|
|
195 |
# this way toolchain and basesytem can be packages; |
# this way toolchain and basesystem can be packages; |
196 |
# only if nothing set the layout files from the profile will be taken |
# only if nothing set the layout files from the profile will be taken |
197 |
[ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)" |
[ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)" |
198 |
[ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< /etc/mage-profile/basesystem.defaults)" |
[ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< /etc/mage-profile/basesystem.defaults)" |
199 |
|
|
200 |
# install toolchain |
# install toolchain |
201 |
CONFIG_PROTECT="-*" MROOT="${MROOT}" mage install ${TOOLCHAIN} || die "toolchain install" |
CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install" |
202 |
|
|
203 |
# umount dirs, they are not needed anymore |
# umount dirs, they are not needed anymore |
204 |
umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir" |
umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir" |
217 |
|
|
218 |
# now create an initrc for the installation of the basesystem |
# now create an initrc for the installation of the basesystem |
219 |
:> ${MROOT}/.installrc |
:> ${MROOT}/.installrc |
220 |
|
add_initrc "export MAGE_BOOTSTRAP=true" |
221 |
add_initrc "export HOME=/root" |
add_initrc "export HOME=/root" |
222 |
add_initrc "export PATH=/bin:/usr/bin:/sbin:/usr/sbin" |
add_initrc "export PATH=/bin:/usr/bin:/sbin:/usr/sbin" |
223 |
add_initrc "export BASESYSTEM=${BASESYSTEM}" |
add_initrc "export BASESYSTEM=${BASESYSTEM}" |
240 |
enter_chroot |
enter_chroot |
241 |
|
|
242 |
echo "System bootstrap to '${MROOT}' finished." |
echo "System bootstrap to '${MROOT}' finished." |
|
|
|
243 |
exit 0 |
exit 0 |
|
|
|