X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=20b7f9a67adb41f0683872ed625ac30be7973f65;hp=a710bcfd62e1a3d124fa3f2a5d1a137065761379;hb=36c28682d60241e5f36136983cb3ce09dbe9f668;hpb=f9b3683b3fc6373e72fefdf438c669691a4e2f74 diff --git a/grml-live b/grml-live index a710bcf..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" @@ -683,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" @@ -763,16 +789,30 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then 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 @@ -831,6 +871,8 @@ else rm -f "${SQUASHFS_OUTPUT}" bailout fi + + FORCE_ISO_REBUILD=true fi # create md5sum file: @@ -848,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'