#!/bin/bash mainfunction="bootloader_mainfunction" bootloader_mainfunction () { if [ "$ROCK_BUILD_TARGET" != 1 ] ; then echo "$xpkg can only be built with ./scripts/Build-Target!" false fi rootdir="$root" build_rock="$root/ROCK" disksdir="$build_rock/target-finish" 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 $rootdir/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 ISO filesystem description." rm -rf isofs; mkdir -p isofs echo "Creating isofs directory.." ln 2nd_stage.tar.gz 2nd_stage_small.tar.gz isofs/ echo "Creating isofs.txt file .." cat > $build_rock/isofs_bootdisk.txt <<- EOT DISK1 $disksdir/boot/ boot/ DISK1 $disksdir/isofs/ ${ROCKCFG_SHORTID}/ EOT rm -rf "$tmpdir" }