+ # No seperate /boot partition + if [[ -z "$bootdev" ]]; then + subdir='/boot' + fi this branch seems useless in this function. the variable $subdir is not used here?
I was thinking that we could do this assignment here and use it for both the grub and Syslinux menu generation code. However, now looking at it, $subdir would have to be global variable. Since the check is simple and can be condensed to one line of code [[ -z "$bootdev" ]] && local subdir="/boot" it would make more sense to add the assigment in generate_grub_menulst and generate_syslinux_menu. That code isn't very likely to change or get modified.
okay.
-----------------------------------
local raw_device crypt_device lv_device
What do you think of making these variables local? As far as I can tell they are not used anywhere else in the code.
good idea
+ + if get_anchestors_mount ';/;' + then + if echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'dm_crypt$'&& echo "$ANSWER_DEVICES" | sed -n '2p' | grep -q 'raw$' messed up indentation here. Woops, fixed. IIRC that is the way it was originally.
I believe it was okay originally, but doesn't matter.