diff --git a/README.md b/README.md index d3003ca..86a329e 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ To **revert** all changes, run * `--hold` Don't reboot or power off after installation * `--power-off` Power off after installation rather than reboot * `--architecture ` e.g. `amd64`, `i386`, `arm64`, `armhf`, etc. - * `--boot-partition` Should be used if `/boot` directory is mounted from a dedicated partition like a LVM setup + * `--boot-directory ` * `--firmware` Load additional [non-free firmwares](https://wiki.debian.org/Firmware#Firmware_during_the_installation) * `--force-efi-extra-removable` [See](https://wiki.debian.org/UEFI#Force_grub-efi_installation_to_the_removable_media_path). **Useful on Oracle Cloud** * `--grub-timeout 5` How many seconds the GRUB menu shows before entering the installer diff --git a/debi.sh b/debi.sh index 1281cfd..4c1b6e5 100755 --- a/debi.sh +++ b/debi.sh @@ -84,7 +84,7 @@ bbr=false hold=false power_off=false architecture= -boot_directory=/boot/ +boot_directory= firmware=false force_efi_extra_removable=false grub_timeout=5 @@ -235,8 +235,9 @@ while [ $# -gt 0 ]; do architecture=$2 shift ;; - --boot-partition) - boot_directory=/ + --boot-directory) + boot_directory=$2 + shift ;; --firmware) firmware=true @@ -598,6 +599,14 @@ EOF save_grub_cfg="tee -a $grub_cfg" fi +if [ -z "$boot_directory" ]; then + if grep -q '\s/boot\s' /proc/mounts; then + boot_directory=/ + else + boot_directory=/boot/ + fi +fi + installer_directory="$boot_directory$installer" # shellcheck disable=SC2034