个人工具
登录
查看“UbuntuHelp:FeistyLUKSTwoFormFactor”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:FeistyLUKSTwoFormFactor”的源代码
来自Ubuntu中文
←
UbuntuHelp:FeistyLUKSTwoFormFactor
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=== /usr/share/initramfs-tools/scripts/local-top/cryptroot === Copy the diff into a temporary patch file and apply. ''vgchange doesn't exist in the initramfs so but lvm does.'' <pre><nowiki> vi /tmp/patch2 </nowiki></pre> <pre><nowiki> --- cryptroot.orig 2007-04-14 17:52:22.000000000 -0500 +++ cryptroot 2007-07-03 18:33:33.000000000 -0500 @@ -43,6 +43,7 @@ cryptlvm="" cryptkeyscript="" cryptkey="" # This is only used as an argument to an eventual keyscript + crypttwoform="" # TwoForm factor local IFS=" ," for x in $cryptopts; do @@ -68,6 +69,9 @@ keyscript=*) cryptkeyscript=${x#keyscript=} ;; + twoform=*) + crypttwoform=${x#twoform=} + ;; key=*) if [ "${x#key=}" != "none" ]; then cryptkey=${x#key=} @@ -89,7 +93,7 @@ vg="${1#/dev/mapper/}" # Sanity checks - if [ ! -x /sbin/vgchange ] || [ "$vg" = "$1" ]; then + if [ ! -x /sbin/lvm ] || [ "$vg" = "$1" ]; then return 1 fi @@ -104,7 +108,7 @@ # Reduce padded --'s to -'s vg=$(echo ${vg} | sed -e 's#--#-#g') - vgchange -ay ${vg} + lvm vgchange -ay ${vg} return $? } @@ -189,6 +193,7 @@ # Try to get a satisfactory password three times count=0 + ckscon=y while [ $count -lt 3 ]; do count=$(( $count + 1 )) @@ -200,23 +205,38 @@ sleep 2 fi - if [ -n "$cryptkeyscript" ]; then + if [ -n "$cryptkeyscript" ] && [ "$ckscon" = "y" ]; then if [ ! -x "$cryptkeyscript" ]; then echo "cryptsetup: error - $cryptkeyscript missing" return 1 fi - $cryptkeyscript $cryptkey < /dev/console | $cryptcreate --key-file=- + + if [ -z $crypttwoform ]; then + $cryptkeyscript $cryptkey < /dev/console | $cryptcreate --key-file=- + else + $cryptkeyscript $cryptkey < /dev/console + $cryptcreate --key-file=/mnt/cryptkeys$crypttwoform + fi else $cryptcreate < /dev/console fi if [ $? -ne 0 ]; then echo "cryptsetup: cryptsetup failed, bad password or options?" + if [ -n "$cryptkeyscript" ]; then + echo -n "Continue using the cryptkeyscript? [y/n]: " + read ckscon < /dev/console + fi + sleep 3 continue elif [ ! -e "$NEWROOT" ]; then echo "cryptsetup: unknown error setting up device mapping" return 1 + elif [ -n $crypttwoform ] && [ -n $cryptkeyscript ] && [ -e $cryptkey ]; then + # The keyscript was called at least once so call the + # keyscript again to unmount the usb cryptkey device. + $cryptkeyscript $cryptkey fi FSTYPE='' </nowiki></pre> <pre><nowiki> patch -b -l /usr/share/initramfs-tools/scripts/local-top/cryptroot < /tmp/patch2 </nowiki></pre>
返回至
UbuntuHelp:FeistyLUKSTwoFormFactor
。