Unified · Split
| @@ -110,6 +110,17 @@ elif [ ! -r "$ROOTFS_TARBALL" ]; then · 109 unmodified lines | ||
| 110 | 110 | die "Cannot read rootfs tarball: $ROOTFS_TARBALL" |
| 111 | 111 | fi |
| 112 | 112 | |
| 113 | +# Setup the platform variable. Here we want just the name and | |
| 114 | +# optionally -musl if this is the musl variant. | |
| 115 | +PLATFORM="${ROOTFS_TARBALL#void-}" | |
| 116 | +PLATFORM="${PLATFORM%-PLATFORMFS*}" | |
| 117 | + | |
| 118 | +# Be absolutely certain the platform is supported before continuing | |
| 119 | +case "$PLATFORM" in | |
| 120 | + bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|*-musl);; | |
| 121 | + *) die "The $PLATFORM is not supported, exiting..." | |
| 122 | +esac | |
| 123 | + | |
| 113 | 124 | # By default we build all platform images with a 64MiB boot partition |
| 114 | 125 | # formated FAT16, and an approximately 1.9GiB root partition formated |
| 115 | 126 | # ext4. More exotic combinations are of course possible, but this |
| @@ -123,11 +134,6 @@ fi · 7 unmodified lines | ||
| 123 | 134 | readonly REQTOOLS="sfdisk partx losetup mount truncate mkfs.${BOOT_FSTYPE} mkfs.${ROOT_FSTYPE}" |
| 124 | 135 | check_tools |
| 125 | 136 | |
| 126 | −# Setup the platform variable. Here we want just the name and | |
| 127 | −# optionally -musl if this is the musl variant. | |
| 128 | −PLATFORM="${ROOTFS_TARBALL#void-}" | |
| 129 | −PLATFORM="${PLATFORM%-PLATFORMFS*}" | |
| 130 | − | |
| 131 | 137 | # This is an awful hack since the script isn't using privesc |
| 132 | 138 | # mechanisms selectively. This is a TODO item. |
| 133 | 139 | if [ "$(id -u)" -ne 0 ]; then |
| @@ -141,12 +147,6 @@ if [ -z "$FILENAME" ]; then · 7 unmodified lines | ||
| 141 | 147 | FILENAME="void-${PLATFORM}-$(date +%Y%m%d).img" |
| 142 | 148 | fi |
| 143 | 149 | |
| 144 | −# Be absolutely certain the platform is supported before continuing | |
| 145 | −case "$PLATFORM" in | |
| 146 | − bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|*-musl);; | |
| 147 | − *) die "The $PLATFORM is not supported, exiting..." | |
| 148 | −esac | |
| 149 | − | |
| 150 | 150 | # Create the base image. This was previously accomplished with dd, |
| 151 | 151 | # but truncate is markedly faster. |
| 152 | 152 | info_msg "Creating disk image ($IMGSIZE) ..." |