diff --git a/recipes/zquick_core/initcpio/install/zquick_core b/recipes/zquick_core/initcpio/install/zquick_core index 3742123..c728b20 100644 --- a/recipes/zquick_core/initcpio/install/zquick_core +++ b/recipes/zquick_core/initcpio/install/zquick_core @@ -1,6 +1,7 @@ #!/bin/bash build() { + add_file "${zquickinit_root}/zquickinit.sh" /zquick/zquickinit.sh zquick_add_fs add_binary clear diff --git a/recipes/zquick_installer/fs/zquick/libexec/installer/installer.sh b/recipes/zquick_installer/fs/zquick/libexec/installer/installer.sh index 5b834b5..783ce68 100755 --- a/recipes/zquick_installer/fs/zquick/libexec/installer/installer.sh +++ b/recipes/zquick_installer/fs/zquick/libexec/installer/installer.sh @@ -13,7 +13,7 @@ export GUM_INPUT_PROMPT_FOREGROUND="#ff9770" export FOREGROUND="#70D6FF" export GUM_CHOOSE_ITEM_FOREGROUND="#e9ff70" -INJECT_SCRIPT=${INSTALLER_DIR}/zquickinit.sh +INJECT_SCRIPT=/zquick/zquickinit.sh INSTALL_SCRIPT=${INSTALLER_DIR}/stage1_proxmox.sh CHROOT_SCRIPT=${INSTALLER_DIR}/stage2_proxmox.sh POSTINSTALL_SCRIPT=${INSTALLER_DIR}/stage3_proxmox.sh @@ -60,6 +60,7 @@ zpool_export() { } cleanup() { + ret=$? set +u if [ -n "${CHROOT_MNT}" ]; then echo "Cleaning up chroot mount '${CHROOT_MNT}'" @@ -75,7 +76,7 @@ cleanup() { fi zpool import -a - exit + exit $ret } confirm() { @@ -172,15 +173,18 @@ install_esp() { gum style "Copying QuickInitZFS to /efi" gum style "" mount_esp "$ESP" + efi='' # start QEMU envs - if [[ -d /mnt/qemu-host ]]; then + if [[ -d /mnt/qemu-host/output ]]; then efi=$(find /mnt/qemu-host/output -type f -name '*.efi' -printf '%f\t%p\n' | sort -k1 | cut -d$'\t' -f2 | tail -n1) - [[ ! -x "${INJECT_SCRIPT}" ]] && INJECT_SCRIPT=$(find /mnt/qemu-host -type f -name 'zquickinit.sh' -print -quit) + fi + if [[ -d /mnt/qemu-host ]]; then + INJECT_SCRIPT=$(find /mnt/qemu-host -type f -name 'zquickinit.sh' -print -quit) fi # end QEMU envs ( export INSTALLER_MODE=1 - xspin "$INJECT_SCRIPT" inject /efi/EFI/zquickinit.efi "$efi" + "$INJECT_SCRIPT" inject /efi/EFI/zquickinit.efi "$efi" ) echo "title zquickinit" > /efi/loader/entries/zquickinit.conf echo "options zfsbootmenu ro loglevel=6 zbm.autosize=0" >> /efi/loader/entries/zquickinit.conf @@ -203,7 +207,7 @@ partition_drive() { if (( ${#choices[@]} == 1 )); then gum style "No disks found!" - exit 1 + return 1 fi echo " $(lsblk -p -d | head -n1)" DEV=$(choose "${choices[@]}" | awk '{print $1}') @@ -235,8 +239,10 @@ partition_drive() { xspin sgdisk -v "$DEV" gum style "" scan_parts "$DEV" + return 0 fi fi + return 1 } scan_parts() { @@ -291,19 +297,23 @@ create_pool() { -o cachefile=none \ -o compatibility=openzfs-2.0-linux \ "${POOLNAME}" "${DEV}"; - log "Trying zpool secure trim" - if xspin zpool trim -d -w "${POOLNAME}"; then - log "Secure trim success" - else - log "Trying zpool trim (not secure)" - if xspin zpool trim -w "${POOLNAME}"; then - log "Zpool trim success" - else - log "Zpool trim did not return successfully: continuing" + if confirm "Perform zpool secure trim, falling back to non-secure trim if not supported?"; then + log "Trying zpool secure trim" + if xspin zpool trim -d -w "${POOLNAME}"; then + log "Secure trim success" + else + log "Could not perform secure trim, trying regular trim" + if xspin zpool trim -w "${POOLNAME}"; then + log "Zpool trim success" + else + log "Zpool trim did not return successfully: continuing" + fi fi fi - log "Initializing zpool..." - xspin zpool initialize -w "${POOLNAME}" || true + if confirm "Perform zpool initialize? This may take a long time. "; then + log "Initializing zpool..." + xspin zpool initialize -w "${POOLNAME}" || true + fi else exit 1 fi @@ -331,7 +341,7 @@ pick_or_create_pool() { defaultEsp=yes else gum style "* Existing Pool" - select_poolz + select_pool fi install_esp $defaultEsp } @@ -481,7 +491,7 @@ import_tmproot_pool_dataset() { choose_dataset() { gum style "* Boot Environment Selection" local datasets - datasets=$(zfs list | grep ^"$POOLNAME"/ROOT/ | awk '{print $1}') + datasets=$(zfs list -H | grep ${1:-^"$POOLNAME"/ROOT/} | awk '{print $1}') readarray -t choices <<<"$datasets" DATASET=$(choose "${choices[@]}" | awk '{print $1}') POOLNAME="${DATASET%%/*}" @@ -640,51 +650,56 @@ convertLVM() { if ! confirm "Ready to start converting LVM boot to ZFS boot?"; then exit 1 fi - gum style "1) First, select a temporary ZFS pool - DO NOT select one on the boot drive" - select_pool - - gum style "2) Create a new ecrypted dataset: In a later step, you can keep this" \ - "encryption key or replace it with one inherited from the parent" \ - "ROOT dataset." \ - "" - set=$(input --value=pve-1 --prompt="Enter name for dataset (on ${POOLNAME}) > ") - create_encrypted_dataset "${POOLNAME}/${set}" "${STDOPTS[*]}" - - xspin mkdir -p "/mnt/${set}" - xspin mount -t zfs -o zfsutil "${POOLNAME}/${set}" "/mnt/${set}" - dataset_mnt="/mnt/${set}" - - # save the pool name for later use - tmppool="${POOLNAME}" - gum style "Select the LVM partition to copy:" - readarray -t choices <<<"$(mount -t ext4 | awk '{print $3}')" - if (( ${#choices[@]} == 0 )); then - gum style "No ext4 filesystems found!" - exit 1 + if confirm "Do you need to copy LVM to temporary ZFS pool?"; then + gum style "1) First, select a temporary ZFS pool - DO NOT select one on the boot drive" + select_pool + + gum style "2) Create a new ecrypted dataset: In a later step, you can keep this" \ + "encryption key or replace it with one inherited from the parent" \ + "ROOT dataset." \ + "" + set=$(input --value=pve-1 --prompt="Enter name for dataset (on ${POOLNAME}) > ") + create_encrypted_dataset "${POOLNAME}/${set}" "${STDOPTS[*]}" + + xspin mkdir -p "/mnt/${set}" + xspin mount -t zfs -o zfsutil "${POOLNAME}/${set}" "/mnt/${set}" + dataset_mnt="/mnt/${set}" + + # save the pool name for later use + tmppool="${POOLNAME}" + gum style "Select the LVM partition to copy:" + readarray -t choices <<<"$(mount -t ext4 | awk '{print $3}')" + if (( ${#choices[@]} == 0 )); then + gum style "No ext4 filesystems found!" + exit 1 + fi + filesystem=$(choose "${choices[@]}") + files=$(find "${filesystem}" | wc -l) + gum style "3) Copying ${filesystem} to ${dataset_mnt}" + gum style --faint -- "rsync -avxHAX ${filesystem}/ ${dataset_mnt}" + rsync -avxHAX "${filesystem}/" "${dataset_mnt}" | pv -lep -s "${files}" > /dev/null + + gum style "Commenting out LVM mounts in /etc/fstab" + xspin "sed -i 's|^/dev/pve|# Removed by zquickinit: &|' ${dataset_mnt}/etc/fstab" + gum style "Commenting out /boot/efi mounts in /etc/fstab" + xspin "sed -i 's|.*/boot/efi|# Removed by zquickinit: &|' ${dataset_mnt}/etc/fstab" + + gum style "Unmounting ${POOLNAME}/${set}" + xspin zfs unmount "${POOLNAME}/${set}" + xspin zfs set mountpoint=/ canmount=noauto "${POOLNAME}/${set}" + + gum style "Unmounting and deactiving all LVM volumes" + xspin umount "${filesystem}" + xspin lvm vgchange -an + else + gum style "1) First, select the temporary LVM dataset to be copied back to boot drive" + select_pool + tmppool="${POOLNAME}" + choose_dataset . + set="${DATASET#*/}" fi - filesystem=$(choose "${choices[@]}") - files=$(find "${filesystem}" | wc -l) - gum style "3) Copying ${filesystem} to ${dataset_mnt}" - gum style --faint -- "rsync -avxHAX ${filesystem}/ ${dataset_mnt}" - rsync -avxHAX "${filesystem}/" "${dataset_mnt}" | pv -lep -s "${files}" > /dev/null - - gum style "Commenting out LVM mounts in /etc/fstab" - xspin "sed -i 's|^/dev/pve|# Removed by zquickinit: &|' ${dataset_mnt}/etc/fstab" - gum style "Commenting out /boot/efi mounts in /etc/fstab" - xspin "sed -i 's|.*/boot/efi|# Removed by zquickinit: &|' ${dataset_mnt}/etc/fstab" - - gum style "Unmounting ${POOLNAME}/${set}" - xspin zfs unmount "${POOLNAME}/${set}" - xspin zfs set mountpoint=/ canmount=noauto "${POOLNAME}/${set}" - - gum style "Unmounting and deactiving all LVM volumes" - xspin umount "${filesystem}" - xspin lvm vgchange -an - partition_drive - create_pool - defaultEsp=yes - install_esp $defaultEsp + pick_or_create_pool if ! has_roots; then ensure_ROOT @@ -717,7 +732,7 @@ convertLVM() { log kpartx -u "$dev" kpartx -u "$dev" || true done - xspin zpool import -a + xspin zpool import -a || true for dev in ${devs}; do # dmsetup will try to map these drives, so remove them if command -v dmsetup >/dev/null 2>&1; then @@ -726,7 +741,7 @@ convertLVM() { dmsetup remove /dev/mapper/"${dev}"* >/dev/null 2>&1 || true fi done - gum style "Finished!" + gum style "Finished! Manually remove ${tmppool}/${set} and ${tmppool}/${set}@snapshot after you verified successful boot." } gum style --bold --border double --align center \ @@ -748,7 +763,7 @@ if [[ "$choice" =~ ^Install.* ]]; then fi if [[ "$choice" =~ ^Chroot.* ]]; then gum style "* Chroot" - zpool import -a + zpool import -a || true select_pool choose_dataset import_tmproot_pool_dataset @@ -756,16 +771,16 @@ if [[ "$choice" =~ ^Chroot.* ]]; then fi if [[ "$choice" =~ ^Encrypt.* ]]; then gum style "* Encrypt Existing Dataset" - zpool import -a + zpool import -a || true select_pool zpool_export "${POOLNAME}" zpool import "$POOLNAME" encrypt_ROOT fi if [[ "$choice" =~ ^Convert.* ]]; then - gum style "* Encrypt Existing Dataset" + gum style "* Convert LVM root" zpool_export -a - zpool import -a + zpool import -a || true convertLVM fi if [[ "$choice" =~ ^Rollback.* ]]; then diff --git a/recipes/zquick_installer/fs/zquick/libexec/installer/stage1_proxmox.sh b/recipes/zquick_installer/fs/zquick/libexec/installer/stage1_proxmox.sh index 8008446..3e04880 100755 --- a/recipes/zquick_installer/fs/zquick/libexec/installer/stage1_proxmox.sh +++ b/recipes/zquick_installer/fs/zquick/libexec/installer/stage1_proxmox.sh @@ -27,12 +27,13 @@ debootstrap() { export DEBROOT cleanup() { + ret=$? if [ -n "${DEBROOT:-}" ]; then rm -rf "${DEBROOT:-}" unset DEBROOT fi - exit + exit $ret } trap cleanup EXIT INT TERM diff --git a/recipes/zquick_qemu/fs/zquick/hooks/ifup.d/qemu_up.sh b/recipes/zquick_qemu/fs/zquick/hooks/ifup.d/qemu_up.sh index 9536d6b..907b828 100755 --- a/recipes/zquick_qemu/fs/zquick/hooks/ifup.d/qemu_up.sh +++ b/recipes/zquick_qemu/fs/zquick/hooks/ifup.d/qemu_up.sh @@ -6,7 +6,7 @@ log() { log "QEMU Loading shared directories" -mount -m -t 9p -o trans=virtio qemuhost /mnt/qemu-host -oversion=9p2000.L,posixacl,msize=104857600 >/dev/null 2>&1 -mount -m -t 9p -o trans=virtio qemucache /mnt/cache -oversion=9p2000.L,posixacl,msize=104857600 >/dev/null 2>&1 +mount -m -t 9p -o trans=virtio qemuhost /mnt/qemu-host -oversion=9p2000.L,posixacl,msize=104857600 >/dev/null 2>&1 || rmdir /mnt/qemu-host +mount -m -t 9p -o trans=virtio qemucache /mnt/cache -oversion=9p2000.L,posixacl,msize=104857600 >/dev/null 2>&1 || rmdir /mnt/cache log "QEMU OK" \ No newline at end of file diff --git a/recipes/zquick_sshd/initcpio/install/zquick_sshd b/recipes/zquick_sshd/initcpio/install/zquick_sshd index 4bb39fe..dc2d409 100755 --- a/recipes/zquick_sshd/initcpio/install/zquick_sshd +++ b/recipes/zquick_sshd/initcpio/install/zquick_sshd @@ -29,6 +29,7 @@ build() { Port 22 PermitRootLogin yes IgnoreUserKnownHosts yes + MaxAuthTries 10 EOF fi diff --git a/zquickinit.sh b/zquickinit.sh index d755398..fd6167b 100755 --- a/zquickinit.sh +++ b/zquickinit.sh @@ -27,7 +27,9 @@ RECIPES_ROOT=${RECIPES_ROOT:-${SRC_ROOT}/recipes} RECIPE_BUILDER="ghcr.io/midzelis/zquickinit" ZQUICKEFI_URL="https://github.com/midzelis/zquickinit/releases/latest" # if empty, use latest release tag -ZBM_TAG=v2.2.1 +ZBM_TAG= +# if specified, takes precedence over ZBM_TAG +ZBM_COMMIT_HASH=f23fc698c42220593a011cf6b58a0220452225f0 KERNEL_BOOT= ENGINE= OBJCOPY= @@ -39,15 +41,23 @@ ENTER=0 RELEASE=0 GITHUBACTION=0 SSHONLY= +NOQEMU= +DRIVE1=1 +DRIVE1_GB=8 +DRIVE2=0 +DRIVE2_GB=3 + CLEANUP=() # shellcheck disable=SC2317 cleanup() { + ret=$? for c in "${CLEANUP[@]}"; do if [[ -e "${c}" ]]; then rm -rf "${c}" fi done + exit $ret } trap cleanup EXIT INT TERM @@ -135,10 +145,12 @@ builder() { # shellcheck disable=SC2016 mapfile -t -O "${#packages[@]}" packages < <($YG eval-all '. as $item ireduce ({}; . *+ $item) | (... | select(type == "!!seq")) |= unique | .xbps-packages[] | .. style=""' "$RECIPES_ROOT"/*/recipe.yaml) - if [[ -z "$ZBM_TAG" ]]; then - ZBM_TAG=$(curl --silent https://api.github.com/repos/zbm-dev/zfsbootmenu/releases/latest | $YG .tag_name) + if [[ -z "${ZBM_COMMIT_HASH}" ]]; then + if [[ -z "$ZBM_TAG" ]]; then + ZBM_TAG=$(curl --silent https://api.github.com/repos/zbm-dev/zfsbootmenu/releases/latest | $YG .tag_name) + fi + ZBM_COMMIT_HASH=$(curl --silent "https://api.github.com/repos/zbm-dev/zfsbootmenu/git/ref/tags/${ZBM_TAG}" | $YG .object.sha) fi - ZBM_COMMIT_HASH=$(curl --silent "https://api.github.com/repos/zbm-dev/zfsbootmenu/git/ref/tags/${ZBM_TAG}" | $YG .object.sha) ZQUICKINIT_COMMIT_HASH=$(git rev-parse HEAD) echo "ZQUICKINIT_COMMIT_HASH: $ZQUICKINIT_COMMIT_HASH" echo "ZBM_TAG: $ZBM_TAG" @@ -208,7 +220,14 @@ make_zquick_initramfs() { hook_dirs+=("${dir#"/recipes"}") recipes+=("$(basename "$(dirname "$dir")")") done + # zquick_core must always happen at the begining, so remove it and add it back later + # shellcheck disable=SC2206 + recipes=( ${recipes[@]/zquick_core} ) + # zquick_end must always happen at the end, so remove it and add it back later + # shellcheck disable=SC2206 + recipes=( ${recipes[@]/zquick_end} ) + strip_sel= if ((NOASK==0)); then check yq @@ -217,15 +236,10 @@ make_zquick_initramfs() { for recipe in /input/recipes/*/recipe.yaml; do [[ ! -r $recipe ]] && continue name=$(basename "$(dirname "$recipe")") - [[ $name == "zquick_core" ]] && continue help+=" - \`$name\` - $(yq-go e '.help ' "$recipe")\n" done sorted=("$(sort <<<"${recipes[*]}")") - # shellcheck disable=SC2206 - sorted=( ${sorted[@]/zquick_core} ) - # shellcheck disable=SC2206 - sorted=( ${sorted[@]/zquick_end} ) gum style --bold --border double --align center \ --width 50 --margin "1 2" --padding "0 2" "Welcome to zquickinit" "(interactive mode)" @@ -242,8 +256,6 @@ make_zquick_initramfs() { selected=("${selected[@]}") ((RELEASE==1)) && selected=("${selected[@]/zquick_qemu}") - # always include core - recipes=(zquick_core) # shellcheck disable=SC2207,SC2048,SC2086 recipes+=($(gum choose ${sorted[*]} --height=20 --no-limit --selected="${selected[*]}")) @@ -282,9 +294,8 @@ make_zquick_initramfs() { echo "zquickinit" > /etc/hostname fi - # need to reorder strip/zfsbootmenu + # need to reorder strip [[ -n $strip_sel ]] && system_hooks=( ${system_hooks[@]/strip} ) - system_hooks=( ${system_hooks[@]/zfsbootmenu} ) # zquick_core is first recipe, and always added recipes=( zquick_core ${recipes[@]/zquick_core} ) @@ -421,15 +432,16 @@ initramfs() { } getefi() { - source=$(${FIND} . -type f -name '*.efi' -printf '%f\t%p\n' | sort -k1 | cut -d$'\t' -f2 | tail -n1) + source=$(${FIND} . -type f -name 'zquickinit*.efi' -printf '%f\t%p\n' | sort -k1 | cut -d$'\t' -f2 | tail -n1) if [[ -r "$source" ]]; then echo "Found EFI: ${source}" else source="${tmp}/zquickinit.efi" - echo "No image found, downloading image to ${source}..." + echo "No image found, finding latest release..." local version='' download='' version=$(curl --silent -qI "${ZQUICKEFI_URL}" | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}') download="https://github.com/midzelis/zquickinit/releases/download/$version/zquickinit.efi" + echo "Downloading from ${download} to ${source}..." curl -o "$source" --progress-bar -L "${download}" fi } @@ -582,15 +594,15 @@ playground() { check objcopy binutils getefi if [[ ! "${source}" -ef "zquickinit.efi" ]]; then - echo "Copying EFI from $source to zquickinit.efi" - cp "$source" zquickinit.efi + echo "Moving $source to zquickinit.efi" + mv "$source" zquickinit.efi source=zquickinit.efi fi initrd=${tmp}/zquickinit.img - echo "Extracting initramfs to ${initrd} from EFI ${source}" + echo "Extracting initramfs from ${source} to ${initrd}" $OBJCOPY -O binary --only-section=.initrd "${source}" "${initrd}" kernel=${tmp}/vmlinuz - echo "Extracting kernel to ${kernel} from EFI ${source}" + echo "Extracting kernel rom EFI ${source} to ${kernel}" $OBJCOPY -O binary --only-section=.linux "${source}" "${kernel}" fi fi @@ -603,19 +615,23 @@ playground() { echo "Found initrd: ${initrd}" fi - if [[ ! -e /tmp/disk.raw ]]; then - echo "NOTE! Creating 8GiB file at /tmp/disk.raw as a disk image" - truncate -s 8GiB /tmp/disk.raw - else - echo "NOTE! Using file /tmp/disk.raw as a disk image" + if ((DRIVE1==1)); then + if [[ ! -e /tmp/disk.raw ]]; then + echo "Drive1: Creating ${DRIVE1_GB}GiB file at /tmp/disk.raw as a disk image" + truncate -s ${DRIVE1_GB}GiB /tmp/disk.raw + else + echo "Drive1: Using file /tmp/disk.raw as a disk image" + fi fi - # if [[ ! -e /tmp/disk2.raw ]]; then - # echo "NOTE! Creating 3GiB file at /tmp/disk2.raw as a disk image" - # truncate -s 3GiB /tmp/disk2.raw - # else - # echo "NOTE! Using file /tmp/disk2.raw as a disk image" - # fi + if ((DRIVE2==1)); then + if [[ ! -e /tmp/disk2.raw ]]; then + echo "Drive2: Creating ${DRIVE2_GB}GiB file at /tmp/disk2.raw as a disk image" + truncate -s ${DRIVE2_GB}GiB /tmp/disk2.raw + else + echo "Drive2: Using file /tmp/disk2.raw as a disk image" + fi + fi APPEND=("loglevel=6 zbm.show") SSH_PORT=2222 @@ -634,12 +650,16 @@ playground() { -netdev user,id=n1,hostfwd=tcp::"${SSH_PORT}"-:22,hostfwd=tcp::8006-:8006 -device virtio-net-pci,netdev=n1 -device virtio-scsi-pci,id=scsi0,iothread=iothread0 -device scsi-hd,drive=drive1,bus=scsi0.0,bootindex=1,rotation_rate=1 - # -device scsi-hd,drive=drive2,bus=scsi0.0,bootindex=2,rotation_rate=1 - -fsdev local,id=f1,path=.,security_model=none -device virtio-9p-pci,fsdev=f1,mount_tag=qemuhost + -device scsi-hd,drive=drive2,bus=scsi0.0,bootindex=2,rotation_rate=1 -drive file=/tmp/disk.raw,format=raw,if=none,discard=unmap${aoi},cache=writeback,id=drive1,unit=0 - # -drive file=/tmp/disk2.raw,format=raw,if=none,discard=unmap${aoi},cache=writeback,id=drive2,unit=1 + -drive file=/tmp/disk2.raw,format=raw,if=none,discard=unmap${aoi},cache=writeback,id=drive2,unit=1 -serial "mon:stdio" ) + if [[ -z "${NOQEMU}" ]]; then + args+=(-fsdev local,id=f1,path=.,security_model=none -device virtio-9p-pci,fsdev=f1,mount_tag=qemuhost) + cachedir=$(find . -name cache -type d) + [[ -n "$cachedir" ]] && args+=(-fsdev "local,id=f2,path=${cachedir},security_model=none" -device virtio-9p-pci,fsdev=f2,mount_tag=qemucache) + fi if [[ "$OSTYPE" == "darwin"* ]]; then args+=(-cpu host,-pdpe1gb -machine q35,accel=hvf) else @@ -653,7 +673,6 @@ playground() { fi fi - [[ -e cache ]] && args+=(-fsdev local,id=f2,path=cache,security_model=none -device virtio-9p-pci,fsdev=f2,mount_tag=qemucache) if [[ -n "${SSHONLY}" ]]; then if [[ -n "$iso" ]]; then echo "zquickinit ISO images may not be configured for serial console, not setting -display none" @@ -709,7 +728,10 @@ playground() { echo "Hint: to quit QEMU, press ctrl-a, x" [[ -n "${SSHONLY}" ]] && echo Running in SSH only mode, to enter SSH use command: ssh root@localhost -p 2222 echo + echo "${args[@]}" read -n 1 -s -r -p "Press any key to launch QEMU" + echo + echo "Starting..." "${args[@]}" } @@ -736,12 +758,22 @@ if [[ $(type -t "$command") == function ]]; then --ssh-only) SSHONLY=1 ;; + --no-qemu) + NOQEMU=1 + ;; --githubaction) GITHUBACTION=1 ;; --no-kernel) KERNEL_BOOT=0 ;; + --drive2) + DRIVE2=1 + if [[ ${2:-} =~ ^[0-9]+$ ]]; then + DRIVE2_GB=$2 + shift + fi + ;; *) ARGS+=("$1") ;; @@ -798,7 +830,7 @@ else echo " zquickinit.sh initramfs [--no-ask]" echo " zquickinit.sh inject [target_efi] [source_efi]" echo " zquickinit.sh iso [target_iso] [source_efi] " - echo " zquickinit.sh playground [--ssh-only] [--no-kernel]" + echo " zquickinit.sh playground [--ssh-only] [--no-kernel] [--drive2]" echo echo " Advanced Usage" echo " zquickinit.sh builder" @@ -825,6 +857,7 @@ else echo " be stored. Default is zquickinit.efi in the current folder" echo " --ssh-only Will launch playground without console output on ttyS0, you" echo " must connect to playground using ssh on localhost:2222" - echo " --no-kernel Do not launch playground with kerenel image, boot from" + echo " --no-kernel Do not launch playground with kernel image, boot from" echo " configured drives instead" + echo " --drive2 Configure with an additional drive of size . (3 GiB default) " fi