grub2のgrub-mkconfigにlabelベースな設定を書かせるメモ

grub2のgrub-mkconfigにlabelベースな設定を書かせるメモ – WhiteAnthrax
* 2013/08/18 挙動がかわったようなので更新しました
* /etc/grub/10_linux
--- 10_linux.backup 2013-06-21 02:20:47.436531219 +0900
+++ 10_linux 2013-06-22 18:53:47.000000000 +0900
@@ -136,8 +136,6 @@
fi

message="$(gettext_printf "Loading Linux %s ..." "${version}")"
+ auto_label="`e2label ${GRUB_DEVICE} 2>/dev/null`"
+ linux_root_device_thisversion="LABEL=${auto_label}"
sed "s/^/$submenu_indentation/" << EOF echo '$message' linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}

* /usr/share/grub/grub-mkconfig_lib
--- grub-mkconfig_lib.backup 2013-06-21 02:35:50.038459949 +0900
+++ grub-mkconfig_lib 2013-06-22 18:53:46.000000000 +0900
@@ -146,22 +146,20 @@
done
fi

- # If there's a filesystem UUID that GRUB is capable of identifying, use it;
- # otherwise set root as per value in device.map.
- fs_hint="`"${grub_probe}" --device "${device}" --target=compatibility_hint`"
- if [ "x$fs_hint" != x ]; then
- echo "set root='$fs_hint'"
- fi
- if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
- hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`" || hints=
- echo "if [ x\$feature_platform_search_hint = xy ]; then"
- echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
- echo "else"
- echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
- echo "fi"
- fi
+# # If there's a filesystem UUID that GRUB is capable of identifying, use it;
+# # otherwise set root as per value in device.map.
+# fs_hint="`"${grub_probe}" --device "${device}" --target=compatibility_hint`"
+# if [ "x$fs_hint" != x ]; then
+# echo "set root='$fs_hint'"
+# fi
+# if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
+# hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`" || hints=
+# echo "if [ x\$feature_platform_search_hint = xy ]; then"
+# echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
+# echo "else"
+# echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+# echo "fi"
+# fi
+auto_label="`e2label "$@" 2>/dev/null`"↲
+echo "search --no-floppy --label ${auto_label} --set root"↲
}

grub_get_device_id ()

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*
*

Time limit is exhausted. Please reload the CAPTCHA.