Unified · Split
| @@ -81,6 +81,7 @@ directory if unset). · 80 unmodified lines | ||
| 81 | 81 | |
| 82 | 82 | -C "cmdline args" Add additional kernel command line arguments. |
| 83 | 83 | -T "title" Modify the bootloader title. |
| 84 | + -v linux<version> Install a custom Linux version on ISO image (linux meta-package if unset). | |
| 84 | 85 | -K Do not remove builddir. |
| 85 | 86 | |
| 86 | 87 | The $PROGNAME script generates a live image of the Void Linux distribution. |
| @@ -293,7 +294,7 @@ generate_iso_image() { · 206 unmodified lines | ||
| 293 | 294 | # |
| 294 | 295 | # main() |
| 295 | 296 | # |
| 296 | −while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do | |
| 297 | +while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:v:h" opt; do | |
| 297 | 298 | case $opt in |
| 298 | 299 | a) BASE_ARCH="$OPTARG";; |
| 299 | 300 | b) BASE_SYSTEM_PKG="$OPTARG";; |
| @@ -310,6 +311,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do · 10 unmodified lines | ||
| 310 | 311 | p) PACKAGE_LIST="$OPTARG";; |
| 311 | 312 | C) BOOT_CMDLINE="$OPTARG";; |
| 312 | 313 | T) BOOT_TITLE="$OPTARG";; |
| 314 | + v) LINUX_VERSION="$OPTARG";; | |
| 313 | 315 | h) usage;; |
| 314 | 316 | *) usage;; |
| 315 | 317 | esac |
| @@ -378,10 +380,26 @@ copy_void_keys "$VOIDHOSTDIR" · 62 unmodified lines | ||
| 378 | 380 | XBPS_ARCH=$BASE_ARCH $XBPS_INSTALL_CMD -r "$ROOTFS" ${XBPS_REPOSITORY} -S |
| 379 | 381 | XBPS_ARCH=$ARCH $XBPS_INSTALL_CMD -r "$VOIDHOSTDIR" ${XBPS_REPOSITORY} -S |
| 380 | 382 | |
| 381 | −_linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux|head -1) | |
| 383 | +# Get linux version for ISO | |
| 384 | +# If linux version option specified use | |
| 385 | +if [ -n "$LINUX_VERSION" ]; then | |
| 386 | + if ! echo "$LINUX_VERSION" | grep "linux[0-9._]*"; then | |
| 387 | + die "-v option must be in format linux<version>" | |
| 388 | + fi | |
| 389 | + | |
| 390 | + _linux_series="$LINUX_VERSION" | |
| 391 | + PACKAGE_LIST="$PACKAGE_LIST $LINUX_VERSION" | |
| 392 | +else # Otherwise find latest stable version from linux meta-package | |
| 393 | + _linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux|head -1) | |
| 394 | +fi | |
| 395 | + | |
| 382 | 396 | _kver=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -p pkgver ${_linux_series}) |
| 383 | 397 | KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver}) |
| 384 | 398 | |
| 399 | +if [ "$?" -ne "0" ]; then | |
| 400 | + die "Failed to find kernel package version" | |
| 401 | +fi | |
| 402 | + | |
| 385 | 403 | : ${OUTPUT_FILE="void-live-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"} |
| 386 | 404 | |
| 387 | 405 | print_step "Installing software to generate the image: ${REQUIRED_PKGS} ..." |