Compare commits

..

19 Commits
v1.0 ... v1.6

Author SHA1 Message Date
Antynea
615cbe9f3a Merge branch 'v1.xx' 2015-08-30 03:43:08 +02:00
Antynea
2e58a2b74d enhanced detect microcode 2015-08-30 03:39:15 +02:00
Antynea
4f725a8431 Merge branch 'master' into v1.xx 2015-08-30 02:38:23 +02:00
Antynea
d598529001 fixme : detect kernesl and initramfs with spaces
fixme : detect kernel and initramfs with spaces
2015-08-30 02:23:18 +02:00
Antynea
b925f639cd fixme : detect snapshot name with spaces
fixme : detect snapshot name with spaces
2015-08-30 01:19:25 +02:00
Antynea
31a0baa2b1 redundancy test
redundancy test
2015-08-30 00:15:15 +02:00
Antynea
3a7c6abece fixme : detect microcode
fixme : detect microcode
2015-08-29 23:45:32 +02:00
Antynea
5e0951d8cb Fixme : broken $boot_dir_real_path
Fixme : broken $boot_dir_real_path
2015-08-29 23:17:03 +02:00
Antynea
c9f5938e04 Merge branch 'v1.xx' 2015-08-29 18:22:16 +02:00
Antynea
128cbe28f3 Merge branch 'master' into v1.xx
Conflicts:
	41_snapshots-btrfs
2015-08-29 18:17:42 +02:00
Antynea
aae6892218 Update README.md 2015-08-10 06:29:19 +02:00
Antynea
84ecc2a5a7 Update README.md 2015-08-10 06:27:31 +02:00
Antynea
7c1178b17c Update README.md 2015-08-10 06:26:49 +02:00
Antynea
7d07503f07 Update README.md 2015-08-09 04:21:52 +02:00
Antynea
f646dfd900 Update README.md 2015-08-09 04:20:25 +02:00
Antynea
b4d4bc0aac Update README.md 2015-08-09 04:19:38 +02:00
Antynea
6f7fb178fb Merge pull request #9 from Antynea/Development
enhanced
2015-07-22 02:05:05 +02:00
Antynea
d561206775 enhanced
enhanced
2015-07-22 01:59:28 +02:00
Antynea
563151507d enhanced
enhanced
2015-07-22 01:52:48 +02:00
2 changed files with 37 additions and 14 deletions

View File

@@ -90,7 +90,6 @@ boot_dir()
boot_dir="$gbgmp/$snap_dir_name/boot"
[[ "$root_uuid" != "$boot_uuid" ]] && boot_dir="/boot"
echo "$boot_dir"
if [ -d ${boot_dir} ]; then boot_dir_real_path="$(make_system_path_relative_to_its_root "$boot_dir")"; fi
}
@@ -107,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)
@@ -120,18 +120,19 @@ 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_real_path}/"${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 " }"
@@ -145,7 +146,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
@@ -154,14 +155,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
if [ ! -z "${nkernel}" ] ; then
for ckernel in "${nkernel[@]}" ; do
[[ ! -f /$(boot_dir)/${ckernel} ]] && continue;
[[ ! -f /"$(boot_dir)"/"${ckernel}" ]] && continue;
list_kernel+=("$ckernel")
done
fi
@@ -170,20 +171,35 @@ 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
if [ ! -z "$ninit" ] ; then
for cinitramfs in "${ninit[@]}" ; do
[[ ! -f /$(boot_dir)/${ninit} ]] && continue;
list_initramfs+=("$ninit")
[[ ! -f /"$(boot_dir)"/"${cinitramfs}" ]] && continue;
list_initramfs+=("$cinitramfs")
done
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'
@@ -202,6 +218,11 @@ 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}"
done
@@ -220,4 +241,4 @@ if [ ${choise_of_method} = "1" ] ; then
umount $gbgmp
gettext_printf "###### - Grub-btrfs: Auto-detect - ######\n" >&2 ;
fi
### End choice of method ###
### End choice of method ###

View File

@@ -1,3 +1,5 @@
[![GitHub release](https://img.shields.io/github/release/Antynea/grub-btrfs.svg)](https://github.com/Antynea/grub-btrfs)
### grub-btrfs