Skip to content

Commit

Permalink
fixme : detect snapshot name with spaces
Browse files Browse the repository at this point in the history
fixme : detect snapshot name with spaces
  • Loading branch information
Antynea committed Aug 29, 2015
1 parent 31a0baa commit b925f63
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"\""
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b925f63

Please sign in to comment.