From b925f639cd122372314e8f3a9bf30365294d6800 Mon Sep 17 00:00:00 2001 From: Antynea Date: Sun, 30 Aug 2015 01:19:25 +0200 Subject: [PATCH] fixme : detect snapshot name with spaces fixme : detect snapshot name with spaces --- 41_snapshots-btrfs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index b78fbf8..3875f52 100644 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -119,13 +119,13 @@ snapshots_entry() else search --no-floppy --fs-uuid --set=root ${boot_uuid} fi - echo 'Loading Snapshot: "${snap_dir_name}" "${snap_date_time}"' + echo 'Loading Snapshot: "${2}" "${3}"' echo 'Loading Kernel: "${k}" ...' linux \"${boot_dir_real_path}/"${k}"\" root=UUID=${root_uuid} rw rootflags=subvol=\""${snap_dir_name}"\" ${kernel_parameters} echo 'Loading Initramfs: "${i}" ...'" if [ -f "$(boot_dir)/${microcode}" ] ; then echo "\ - initrd \"${boot_dir_real_path}/"${microcode}"\" initrd \"/${snap_dir_name}/boot/"${i}"\"" + initrd \"${boot_dir_real_path}/"${microcode}"\" initrd \"/"${snap_dir_name}"/boot/"${i}"\"" else echo "\ initrd \"${boot_dir_real_path}/"${i}"\"" @@ -144,7 +144,7 @@ snapshot_list() snap=($snap) local snap_path_name=${snap[@]:13:${#snap[@]}} # Discard deleted snapshots - if [ $snap_path_name = "DELETED" ]; then continue; fi + if [ "$snap_path_name" = "DELETED" ]; then continue; fi [[ ${snap_path_name%%"/"*} == "" ]] && snap_path_name=${snap_path_name#*"/"} echo ${snap[@]:10:2} ${snap_path_name} done @@ -153,14 +153,14 @@ snapshot_list() detect_kernel() { ## Arch original kernel (auto-detect) - for akernel in $(boot_dir)/vmlinuz-* ; do + for akernel in "$(boot_dir)"/vmlinuz-* ; do list_kernel+=("$akernel") done ## Custom name kernel in GRUB_BTRFS_NKERNEL if [ ! -z ${nkernel} ] ; then for ckernel in "${nkernel[@]}" ; do - [[ ! -f /$(boot_dir)/${ckernel} ]] && continue; + [[ ! -f /"$(boot_dir)/${ckernel}" ]] && continue; list_kernel+=("$ckernel") done fi @@ -169,14 +169,14 @@ detect_kernel() detect_initramfs() { ## Arch original initramfs (auto-detect) - for ainitramfs in $(boot_dir)/initramfs-* ; do + for ainitramfs in "$(boot_dir)"/initramfs-* ; do list_initramfs+=("$ainitramfs") done ## Custom name initramfs in GRUB_BTRFS_NINIT if [ ! -z ${ninit} ] ; then for cinitramfs in "${ninit[@]}" ; do - [[ ! -f /$(boot_dir)/${ninit} ]] && continue; + [[ ! -f "/$(boot_dir)/${ninit}" ]] && continue; list_initramfs+=("$ninit") done fi