summaryrefslogtreecommitdiff
path: root/2_install.sh
blob: 879e1718015f251ef3594d5bfbd819afdfe44997 (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. rsync -aH "./addons/$addon/" "${mountpoint%/}"
  34. done
  35. umount "$mountpoint"
  36. # [ -n "$bootdev_host" ] && umount "$mountpoint/boot" || true
  37. fi
  38. echo 'Done installing rootfs!'