Skip to content

Commit

Permalink
Merge branch 'v1.xx'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antynea committed Aug 30, 2015
2 parents d598529 + 2e58a2b commit 615cbe9
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ snapshots_entry()
echo " submenu '${1} ${2} ${3}' {"
for k in "${name_kernel[@]}"; do
for i in "${name_initramfs[@]}"; do
for u in "${name_microcode[@]}"; do
echo "\
menuentry '${2} with "${k}" & "${i}"' ${CLASS} "\$menuentry_id_option" 'gnulinux-snapshots-$boot_uuid'{
$(save_default_entry)
Expand All @@ -123,14 +124,15 @@ snapshots_entry()
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
if [ -f "$(boot_dir)"/"${u}" ] ; then
echo "\
initrd \"${boot_dir_real_path}/"${microcode}"\" initrd \"/"${snap_dir_name}"/boot/"${i}"\""
initrd \"${boot_dir_real_path}/"${u}"\" initrd \"/"${snap_dir_name}"/boot/"${i}"\""
else
echo "\
initrd \"${boot_dir_real_path}/"${i}"\""
fi
echo " }"
done
done
done
echo " }"
Expand Down Expand Up @@ -182,7 +184,22 @@ detect_initramfs()
fi
}

## List of kernels and initramfs in snapshots
detect_microcode()
{
## Arch original intel microcode
for aucode in "$(boot_dir)"/intel-ucode.img ; do
list_ucode+=("$aucode")
done

## Custom name microcode in GRUB_BTRFS_INTEL_UCODE
if [ ! -z "$microcode" ] ; then
for cucode in "${microcode[@]}" ; do
[[ ! -f /"$(boot_dir)"/"${cucode}" ]] && continue
list_ucode+=("$cucode")
done
fi
}
## List of kernels, initramfs and microcode in snapshots
list_kernels_initramfs()
{
IFS=$'\n'
Expand All @@ -201,6 +218,10 @@ list_kernels_initramfs()
detect_initramfs
name_initramfs=("${list_initramfs[@]##*"/"}")
# echo "initramfs = ${name_initramfs[*]}"
unset list_ucode
detect_microcode
name_microcode=("${list_ucode[@]##*"/"}")
# echo "ucode = ${name_microcode[*]}"
boot_dir_real_path="$(make_system_path_relative_to_its_root "$(boot_dir)")"
# Create menu entries
snapshots_entry "${prefixentry}" "${snap_dir_name}" "${snap_date_time}"
Expand Down

0 comments on commit 615cbe9

Please sign in to comment.