2012-05-07 | Paul Boddie | raw annotate files changeset graph | Removed superfluous and non-functioning mount-related commands from the postsetup script, along with an attempt at copying sources lists from special distribution-specific directories. Attempted to tidy up device directory handling for user-do-root, making an empty dev directory where one is missing in --dev mode, and exiting if no dev directory is present in normal mode. Added some comments to the scripts and updated the "to do" items. |
1 #!/bin/sh 2 3 # Configuration: 4 if [ -e userinstall-defaults-uml ]; then 5 . "$PWD/userinstall-defaults-uml" 6 elif [ -e /etc/default/userinstall-uml ]; then 7 . /etc/default/userinstall-uml 8 else 9 echo "No defaults found for userinstall (UML)." 1>&2 10 exit 1 11 fi 12 13 if [ ! "$1" ]; then 14 echo "A program needs to be given as an argument to this script." 1>&2 15 exit 1 16 fi 17 18 COMMAND="$1" 19 shift 1 20 21 echo "Accessing the image..." 1>&2 22 if [ ! -e "$IMAGEDIR" ]; then 23 mkdir "$IMAGEDIR" 24 fi 25 sudo mount -o loop "$IMAGE" "$IMAGEDIR" 26 27 echo "Performing the requested activity..." 1>&2 28 "$COMMAND" $* 29 30 echo "Unmounting the image..." 1>&2 31 sudo umount "$IMAGEDIR" 32 rmdir "$IMAGEDIR"