summaryrefslogtreecommitdiff
path: root/2_install.sh
blob: be8d5dd4cb6387f6840dc8a8438f9e3e27f9ecb1 (plain)
  1. #!/bin/sh
  2. set -e
  3. . ./common-settings || exit 1
  4. . ./common-functions || exit 1
  5. # Save specs for debugging later
  6. if [ -f "$baseworkdir/specs" ]; then
  7. echo 'ERROR: specs exists already - use virgin workingdir!' >&2
  8. echo ' (or duplicate the working dir and remove specs)' >&2
  9. exit 1
  10. else
  11. # echo "partition info for actual device:" > "$baseworkdir/specs"
  12. blkid "$rootdev_host" >> "$baseworkdir/specs"
  13. sfdisk -l "$usbdev_host" >> "$baseworkdir/specs"
  14. # echo "Possible devices:" >> "$baseworkdir/specs"
  15. echo >> "$baseworkdir/specs"
  16. find /proc/scsi -type f -name scsi -exec cat '{}' >> "$baseworkdir/specs" ';'
  17. echo >> "$baseworkdir/specs"
  18. # find /proc/scsi -type f -regex '.*/usb-storage-[0-9]+/.*' -exec grep -l 'Attached:.*Yes' '{}' ';' -exec cat '{}' ';' >> "$baseworkdir/specs"
  19. find /proc/scsi -type f -regex '.*/usb-storage.*/[0-9]+' -exec cat '{}' >> "$baseworkdir/specs" ';'
  20. fi
  21. # Finalize root filesystem
  22. if [ "$ROOTFS" = "iso" ]; then
  23. mkdir "$targettemp_isofs"
  24. # FIXME: not yet implemented!
  25. echo 'ARRGH - this is not possible (should have failed earlier)!'
  26. exit 1
  27. else
  28. mount "$rootdev_host" "$mountpoint"
  29. rsync -aH "$targettemp/" "${mountpoint%/}"
  30. for addon in $addons; do
  31. if [ -d "./addons/$addon/" ]; then
  32. rsync -aH --exclude=.svn "./addons/$addon/" "${mountpoint%/}"
  33. fi
  34. done
  35. umount "$mountpoint"
  36. # [ -n "$bootdev_host" ] && umount "$mountpoint/boot" || true
  37. fi
  38. echo 'Done installing rootfs!'