|
2 | 2 |
|
3 | 3 | #Usage function to print how to use
|
4 | 4 | usage() {
|
5 |
| - echo "armmanager [-m=<file>] [-u[=<destination>]] [-o=<destination>]" |
| 5 | + echo "Usage : armmanager [OPTIONS] ... [FILE]" |
| 6 | + echo "Mount, modify and chroot into an ISO image of a Raspberry pi" |
| 7 | + echo "" |
| 8 | + echo -e "Best use example : \e[1m./armmanager -m -r -c /path/to/image\e[0m" |
| 9 | + echo "" |
| 10 | + echo "Available options are :" |
| 11 | + echo " -m, --mountfile Option to mount a given ISO file. Be sure to give a raspberry system file." |
| 12 | + echo " -mo, --mount-only Option to specify, when mounting, that we only want to mount." |
| 13 | + echo " If not given, it will proceed everything to prepare chroot with qemu (copying qemu files...)." |
| 14 | + echo " -u, --umount" |
| 15 | + echo " -u=[DEST], --umount=[DEST]" |
| 16 | + echo " Option to umount a mounted Raspberry pi filesystem. If no directory is precised," |
| 17 | + echo " it will automatically umount last mounted one. Prefer using this script to unmount filesystems mounted" |
| 18 | + echo " with this script." |
| 19 | + echo " -o=[DEST], --output=[DEST] " |
| 20 | + echo " If precised it will output the image filesystem to this destination. If not, image will be mounted" |
| 21 | + echo " to ./.armmanager directory in the same directory as the script." |
| 22 | + echo " -c, --chroot" |
| 23 | + echo " -c=[DEST], --chroot=[DEST]" |
| 24 | + echo " Permits to chroot in a Raspberry filesystem. If no destination is given, it will chroot into the last" |
| 25 | + echo " mounted filesystem." |
| 26 | + echo " -co=[OPTIONS], --chroot-options=[OPTIONS]" |
| 27 | + echo " When chrooting into a filesystem, the script launches a second script which aims to prepare to raspberry" |
| 28 | + echo " system. You can pass options to this script through this option" |
| 29 | + echo " Options are : chroot-only, install-only, upgrade-clean, no-update, no-daemon, no-kernel-recompile" |
| 30 | + echo " -r, --resize-image" |
| 31 | + echo -e " -r=[SIZE], --resize-image=[SIZE] \e[1m[DO NOT USE (not tested)]\e[0m" |
| 32 | + echo " Option to extend the partition of an image. By default adds 1Go to the main partition." |
| 33 | + echo " -h, --help Print this help menu." |
| 34 | + echo -e " --pidora Option to precise that the Raspberry image is a PIDORA system. \e[1m/!\ Not fully tested /!\\e[0m" |
| 35 | + echo "" |
| 36 | + echo "Do not hesitate to report bugs to <[email protected]>" |
| 37 | + echo "Full project available on GitHub at <https://github.com/Pravez/GrapeCluster>" |
| 38 | + echo "Thank you for using this script !" |
6 | 39 | }
|
7 | 40 |
|
8 | 41 | realpath() {
|
@@ -60,7 +93,7 @@ resize_image() {
|
60 | 93 | part=$(fdisk -l -o Start $FILE | cut -d' ' -f1,3 | tail -n1)
|
61 | 94 | offset=$((512 * $part))
|
62 | 95 |
|
63 |
| - truncate -s +1G $FILE |
| 96 | + truncate -s +$RESIZE_VALUE $FILE |
64 | 97 | rootasked "Losetup"
|
65 | 98 | sudo losetup /dev/loop0 $FILE
|
66 | 99 |
|
|
0 commit comments