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