--- /usr/bin/spt 2007-04-23 02:35:29 +0400 +++ /usr/bin/my-spt 2007-04-12 14:45:42 +0400 @@ -37,8 +37,10 @@ create_image() { Verbose "Creating image for \`$IDENT'." + [ -n "$IMAGE_TYPE" ] || IMAGE_TYPE="$image_type" + Verbose "image type: \`$IMAGE_TYPE'." - case "$image_type" in + case "$IMAGE_TYPE" in squashfs) init_chroot_progs "squashfsprogs" cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" @@ -57,6 +59,20 @@ mkiso= cat "$tmpdir/.archive.tar" | gzip -f9 > "$workdir/$OUT.tar.gz" ;; + cpio) + init_chroot_progs "cpio findutils" + cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" +cat >"$tmpdir/script" <<'__EOF__' +mkdir -p /tmp/.archive +tar -C /tmp/.archive -xf /tmp/.archive.tar +cd /tmp/.archive +find . | cpio -o -H newc > /.image +__EOF__ + chroot_exec "$tmpdir/script" + mv -f -- "$chroot/.image" "$outdir/$OUT" + gzip "$outdir/$OUT" + mv "$outdir/$OUT.gz" "$outdir/$OUT" + ;; *) Fatal 'Unsupported image type.' ;; @@ -149,14 +166,22 @@ chroot_run rm -rf -- "$imgdir" } +to_isolinux() { + [ -n "$TO_ISOLINUX" ] || return 0 + + Verbose "Move image for $IDENT to isolinux/alt0" + + chroot_run mv $isodir/$OUT $isodir/isolinux/alt0/ +} + runto_components() { local cmd comp - local IDENT VENDOR COPYONLY INSTALLDIR NOIMAGE EXTRAOPTS FILES OUT + local IDENT VENDOR COPYONLY INSTALLDIR NOIMAGE EXTRAOPTS FILES OUT IMAGE_TYPE TO_ISOLINUX cmd="$1" && shift for comp in $COMPONENTS; do - IDENT="packages" VENDOR="ALTLinux" COPYONLY= INSTALLDIR= NOIMAGE= EXTRAOPTS= FILES= OUT= + IDENT="packages" VENDOR="ALTLinux" COPYONLY= INSTALLDIR= NOIMAGE= EXTRAOPTS= FILES= OUT= IMAGE_TYPE= TO_ISOLINUX= . "$profile_dir/$comp/config" || Fatal "File \`$profile_dir/$comp/config' not found." @@ -312,6 +337,9 @@ # COPYONLY handle runto_components copyonly +# TO_ISOLINUX handle +runto_components to_isolinux + # syslinux stuff addisolinux= if [ -f "$profile_dir/isolinux.cfg.in" ]; then