X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=6198546dd256aabdbf93b2a33e52f956d2d5dedc;hp=ce61ca7338a54cf1a3fbca02e3481198ab01fc9e;hb=0692f4ab3b17a14234e76b5463ee74a5e89ba826;hpb=e265e3093a98d723d40b36dde1aba26146aa301f diff --git a/grml-live b/grml-live index ce61ca7..6198546 100755 --- a/grml-live +++ b/grml-live @@ -47,6 +47,8 @@ Usage: $PN [options, see as follows] -g ] set the grml flavour name -h display short usage information and exit -i name of ISO + -I directory which provides files that should become + part of the chroot/ISO -o main output directory of the build process -q skip mksquashfs -r "${BUILD_OUTPUT}/boot/isolinux/distri.cfg" [ -n "$NO_ADDONS" ] || echo "include addons.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/distri.cfg" @@ -671,7 +709,9 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then einfo "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it." if grep -q "^include ${DISTRI_NAME}.cfg" "${BUILD_OUTPUT}/boot/isolinux/distri.cfg" ; then log "include for ${DISTRI_NAME}.cfg already present, nothing to do." + eindent einfo "include for ${DISTRI_NAME}.cfg already present, nothing to do." + eoutdent eend $? else log "including ${DISTRI_NAME}.cfg in ${BUILD_OUTPUT}/boot/isolinux/distri.cfg" @@ -704,17 +744,17 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then fi # jump back to grub from bsd4grml: + if [ -e "$BUILD_OUTPUT"/boot/grub/stage2 ]; then + GRUB_LEGACY=stage2 + else + GRUB_LEGACY=stage2_eltorito + fi if [ -e "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 ]; then if [ -e "$BUILD_OUTPUT"/boot/grub/core.img ]; then GRUB_VERSION=2 else GRUB_VERSION=1 fi - if [ -e "$BUILD_OUTPUT"/boot/grub/stage2 ]; then - GRUB_LEGACY=stage2 - else - GRUB_LEGACY=stage2_eltorito - fi # why not ed(1)? for file in "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 \ @@ -722,6 +762,15 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then sed -i -e "s!%GRUB_VERSION%!$GRUB_VERSION!g" \ -e "s!%GRUB_LEGACY%!$GRUB_LEGACY!g" "$file" done + + sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 + fi + if [ -e "$BUILD_OUTPUT"/boot/grub/$GRUB_LEGACY ]; then + sed -i "s/%GRUB_LEGACY%/$GRUB_LEGACY/g" "$BUILD_OUTPUT"/boot/grub/menu.lst + sed -i "s/%GRUB_LEGACY%/$GRUB_LEGACY/g" "$BUILD_OUTPUT"/boot/grub/grub.cfg + else + sed -i "/%GRUB_LEGACY%/d" "$BUILD_OUTPUT"/boot/grub/menu.lst + sed -i "/%GRUB_LEGACY%/d" "$BUILD_OUTPUT"/boot/grub/grub.cfg fi # autostart for Windows: @@ -730,7 +779,11 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then fi # windows-binaries: - if [ -n "$WINDOWS_BINARIES" ] ; then + if [ -n "$NO_WINDOWS_BINARIES" ] ; then + log "Skipping download of windows binaries as requested via \$NO_WINDOWS_BINARIES." + einfo "Skipping download of windows binaries as requested via \$NO_WINDOWS_BINARIES." + eend 0 + else if [ -f "$BUILD_OUTPUT"/windows/putty.exe ] ; then log "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'" ewarn "$BUILD_OUTPUT/windows exists already, skipping stage 'WINDOWS_BINARIES'" ; eend 0 @@ -744,19 +797,33 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then done ) fi fi - log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]" - einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0 + log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]" + einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0 fi + + FORCE_ISO_REBUILD=true einfo "Finished execution of stage 'boot'" ; eend 0 fi -# ppc: -elif [ "$ARCH" = powerpc ] ; then - ewarn 'Warning: formorer, it is your turn. :)'>&2 -# unsuported: else + log 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1 fi +# support installation of local files into the chroot/ISO +if [ -n "$CHROOT_INSTALL" ] ; then + if ! [ -d "$CHROOT_INSTALL" ] ; then + log "Configuration variable \$CHROOT_INSTALL is set but not a directory; ignoring" + ewarn "Configuration variable \$CHROOT_INSTALL is set but not a directory; ignoring" + else + log "Copying local files to chroot as requested via \$CHROOT_INSTALL" + einfo "Copying local files to chroot as requested via \$CHROOT_INSTALL" + rsync -avz --inplace "$CHROOT_INSTALL"/ "$CHROOT_OUTPUT/" + eend $? + einfo "Make sure to run squashfs stage, otherwise your local files won't be part of the ISO." + FORCE_ISO_REBUILD=true + fi +fi + if [ -f "$BUILD_OUTPUT"/live/${GRML_NAME}.squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then log "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ewarn "$BUILD_OUTPUT/live exists already, skipping stage 'squashfs'" ; eend 0 @@ -815,6 +882,8 @@ else rm -f "${SQUASHFS_OUTPUT}" bailout fi + + FORCE_ISO_REBUILD=true fi # create md5sum file: @@ -832,12 +901,17 @@ elif [ "$BOOT_METHOD" = "grub" ] ; then BOOT_FILE="boot/grub/stage2_eltorito" fi -if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then - log "$ISO_OUTPUT exists already, skipping stage 'iso build'" - ewarn "$ISO_OUTPUT exists already, skipping stage 'iso build'" ; eend 0 +if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then + log "$ISO_OUTPUT/${ISO_NAME} exists already, skipping stage 'iso build'" + ewarn "$ISO_OUTPUT/${ISO_NAME} exists already, skipping stage 'iso build'" ; eend 0 else mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'" + if $FORCE_ISO_REBUILD ; then + log "Forcing rebuild of ISO because files on ISO have been modified." + einfo "Forcing rebuild of ISO because files on ISO have been modified." + fi + # support mkisofs as well as genisoimage if which mkisofs >/dev/null 2>&1; then MKISOFS='mkisofs'