#!/bin/bash
|
|
|
|
disksdir="$root/ROCK/target-finish"
|
|
# datadir is relative to $base.
|
|
datadir="build/${ROCKCFG_ID}/ROCK/target-finish"
|
|
|
|
mainfunction="bootloader_mainfunction"
|
|
|
|
bootloader_mainfunction ()
|
|
{
|
|
|
|
if [ "$ROCK_BUILD_TARGET" != 1 ] ; then
|
|
echo "$xpkg can only be built with ./scripts/Build-Target!"
|
|
false
|
|
fi
|
|
|
|
tmpdir="$( mktemp -d )" ; mkdir -p "$tmpdir"
|
|
pkg_suffix=.no_binpkg
|
|
if [ "$ROCKCFG_CREATE_TARBZ2" == 1 ] ; then
|
|
pkg_suffix='.tar.bz2'
|
|
install_pkg() { eval tar $taropt $1 || true ; }
|
|
elif [ "$ROCKCFG_CREATE_GEM" == 1 ] ; then
|
|
pkg_suffix='.gem'
|
|
install_pkg() { eval mine -if -R . $1 || true ; }
|
|
fi
|
|
|
|
if [ "$ROCKCFG_PKGFILE_VER" == 1 ] ; then
|
|
pkg_suffix='-$pkg_ver-$pkg_extraver'$pkg_suffix
|
|
fi
|
|
|
|
cd $disksdir
|
|
rm -rf boot/ ; mkdir -p boot
|
|
# Provide at least the kernel and initrd image in the boot/ directory of the
|
|
# ISO image, useful for direct booting with qemu.
|
|
cp -a $root/boot/* boot/
|
|
rm -f boot/{initrd.img,kconfig,System.map}*
|
|
ln $ROCKCFG_PKG_1ST_STAGE_INITRD.gz boot/
|
|
|
|
if [ -f $confdir/$arch/build.sh ]; then
|
|
. $confdir/$arch/build.sh
|
|
fi
|
|
|
|
echo "Creating isofs_bootdisk.txt file .."
|
|
cat > $root/ROCK/isofs_bootdisk.txt <<- EOT
|
|
DISK1 $datadir/boot/ boot/
|
|
EOT
|
|
rm -rf "$tmpdir"
|
|
}
|