summaryrefslogtreecommitdiff
path: root/2_install.sh
blob: 830a294d5c976374f0a1ce662aec6d60dac2d51d (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. sfdisk -l "$usbdev_host" >> "$baseworkdir/specs"
  13. # echo "Possible devices:" >> "$baseworkdir/specs"
  14. echo >> "$baseworkdir/specs"
  15. find /proc/scsi -type f -name scsi -exec cat '{}' >> "$baseworkdir/specs" ';'
  16. echo >> "$baseworkdir/specs"
  17. # find /proc/scsi -type f -regex '.*/usb-storage-[0-9]+/.*' -exec grep -l 'Attached:.*Yes' '{}' ';' -exec cat '{}' ';' >> "$baseworkdir/specs"
  18. find /proc/scsi -type f -regex '.*/usb-storage.*/[0-9]+' -exec cat '{}' >> "$baseworkdir/specs" ';'
  19. fi
  20. # Finalize root filesystem
  21. if [ "$ROOTFS" = "isofs" ]; then
  22. mkdir "$targettemp_isofs"
  23. # FIXME: not yet implemented!
  24. echo 'ARRGH - this is not possible (should have failed earlier)!'
  25. exit 1
  26. else
  27. mount "$rootdev_host" "$mountpoint"
  28. rsync -aH "$targettemp/" "${mountpoint%/}"
  29. for addon in $addons; do
  30. if [ -d "./addons/$addon/" ]; then
  31. rsync -aH --exclude=.svn "./addons/$addon/" "${mountpoint%/}"
  32. fi
  33. done
  34. umount "$mountpoint"
  35. # [ -n "$bootdev_host" ] && umount "$mountpoint/boot" || true
  36. fi
  37. echo 'Done installing rootfs!'