X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=20b7f9a67adb41f0683872ed625ac30be7973f65;hp=ce61ca7338a54cf1a3fbca02e3481198ab01fc9e;hb=36c28682d60241e5f36136983cb3ce09dbe9f668;hpb=e265e3093a98d723d40b36dde1aba26146aa301f diff --git a/grml-live b/grml-live index ce61ca7..20b7f9a 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 +707,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" @@ -730,7 +768,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 +786,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 +871,8 @@ else rm -f "${SQUASHFS_OUTPUT}" bailout fi + + FORCE_ISO_REBUILD=true fi # create md5sum file: @@ -832,12 +890,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'