Browse Source

Introduced lib/boot/boot.in as a wrapper to the boot code of the active bootloaders, handling extensions from the architecture and overloads from the target.

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
d45906bc1a
1 changed files with 49 additions and 0 deletions
  1. +49
    -0
      lib/boot/boot.in

+ 49
- 0
lib/boot/boot.in

@ -0,0 +1,49 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/boot/boot.in
# Copyright (C) 2008 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
# by default we will peek the first suitable bootloader found
#
boot_choose_bootloader() { head -n 1; }
# variables
#
bootloader=
# load stuff from the architecture, if anything to load.
[ ! -s "architecture/$arch/boot.in" ] || . "architecture/$arch/boot.in"
# and allow targets to overload these functions and variables
[ ! -s "target/$target/boot.in" ] || . "target/$target/boot.in"
# if the target didn't choose one already, find the suitables and choose one
if [ -z "$bootloader" ]; then
bootloader="$(
ls -1d `sed -n -e 's,^X [^ ]\+ [^ ]\+ \([^ ]\+\) \([^ ]\+\) .* BOOT .*,package/\1/\2/boot/boot.in,p' \
"config/$config/packages"` 2> /dev/null |
cut -d/ -f'2,3' | boot_choose_bootloader )"
fi
# validate the module, and source.
#
if [ -z "$bootloader" ]; then
echo_error "boot: couldn't find any suitable bootloader."
exit 1
elif [ ! -e "package/$bootloader/boot/boot.in" ]; then
echo_error "boot: '$bootloader' is not suitable."
else
echo_status "boot: using $bootloader."
fi
. "package/$bootloader/boot/boot.in"

Loading…
Cancel
Save