# fss-0002

main:
  umount /proc/bus/usb || true
  umount /proc || true
  umount /sys || true
  umount /dev/pts || true

  tkis_local_push absolute /
  mkdir -vp ${WO}tkis_archive{1,2}/ ${WO}live{,-mini}/ ${WO}/mini-files ${WO}tkis
  rm -Rf /tmp/*
  tkis_local_push absolute /
  for i in bin boot dev etc home lib sbin share toolchain var checksum firmware documentation ; do mksquashfs $i $i.sfs -comp $cdrom_squash_format && mv -v $i.sfs ${WO}live/ ; done
  for i in bin boot dev etc home lib sbin share var checksum firmware ; do mksquashfs $i $i.sfs -comp $cdrom_mini_squash_format && mv -v $i.sfs ${WO}live-mini/ ; done
  tkis_local_pop

  tkis_local_push absolute  /modules/
  tkis_local_get_version linux
  find -maxdepth 1 -name "${LOCAL_VERSION}*-*" -type d -exec mksquashfs {}{,.modules} -comp $cdrom_squash_format ';'
  find -maxdepth 1 -name "${LOCAL_VERSION}*-*.modules" -type f -exec mv -v '{}' ${WO}live/ ';'
  find -maxdepth 1 -name "${LOCAL_VERSION}*-*" -type d -exec mksquashfs {}{,.modules} -comp $cdrom_mini_squash_format ';'
  find -maxdepth 1 -name "${LOCAL_VERSION}*-*.modules" -type f -exec mv -v '{}' ${WO}live-mini/ ';'
  unset LOCAL_VERSION
  tkis_local_pop

  tkis_local_push work tkis_archive1/ 
  for i in build cdrom compression encryption filesystems games gcc graphics kernel locale network perl python servers standard tcl uClibc core ; do ln -vs ${AR}$i $i ; done
  tkis_local_push work tkis_archive2/ 
  for i in applications multimedia xorg xfce; do ln -vs ${AR}$i $i; done
  tkis_local_pop

  tkis_local_push absolute ${WO}mini-files
  cp -v /boot/turtle-simple-$kernel_build_architecture.initrd .
  tkis_local_pop

  tkis_local_push absolute $tkis_path
  for i in scripts patches premade tools distributions systems rules settings documentation ; do mksquashfs ${i}{,.sfs} -comp $cdrom_squash_format; done
  mv -v *.sfs ${WO}tkis/
  tkis_local_pop
