fixme : detect snapshot name with spaces

fixme : detect snapshot name with spaces
This commit is contained in:
Antynea
2015-08-30 01:19:25 +02:00
parent 31a0baa2b1
commit b925f639cd
+7 -7
View File
@@ -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%%"/"*} == "<FS_TREE>" ]] && 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