diff options
author | Daniel Baumann <daniel@debian.org> | 2010-09-26 12:38:38 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:19:23 +0100 |
commit | c5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a (patch) | |
tree | 44a6d3a12cd11067aea2a4d43eb9133cc25bad2f /examples/hooks/all_chroot_losetup-lukshome.sh | |
parent | 941a47be0ca3061f54a237583092357d1ff80f7c (diff) | |
download | vyos-live-build-c5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a.tar.gz vyos-live-build-c5c3f6133a0fb62ba9c2c3b839e6ea5774f9c76a.zip |
Adding debian version 3.0~a1-1.
Diffstat (limited to 'examples/hooks/all_chroot_losetup-lukshome.sh')
-rwxr-xr-x | examples/hooks/all_chroot_losetup-lukshome.sh | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/examples/hooks/all_chroot_losetup-lukshome.sh b/examples/hooks/all_chroot_losetup-lukshome.sh index b6f33bf7f..95d3c053a 100755 --- a/examples/hooks/all_chroot_losetup-lukshome.sh +++ b/examples/hooks/all_chroot_losetup-lukshome.sh @@ -333,32 +333,27 @@ do esac done -if [ -x /sbin/blkid ] -then - CRYPTHOME=$(/sbin/blkid -L ${LUKSPART}) -else - # search for a partition labeled "lukshome" or $LUKSPART - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) +# search for a partition labeled "lukshome" or $LUKSPART +for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) +do + for dev in $(subdevices "${sysblock}") do - for dev in $(subdevices "${sysblock}") - do - devname=$(sys2dev "${dev}") - # find partition name and filesystem type - if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${LUKSPART}" ] - then - # found one partition with correct label - CRYPTHOME="${devname}" - # don't search further - break - fi - done - # if already found, don't search further - if [ -n "${CRYPTHOME}" ] + devname=$(sys2dev "${dev}") + # find partition name and filesystem type + if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${LUKSPART}" ] then + # found one partition with correct label + CRYPTHOME="${devname}" + # don't search further break fi done -fi + # if already found, don't search further + if [ -n "${CRYPTHOME}" ] + then + break + fi +done # if no partition found, exit if [ -z "${CRYPTHOME}" ] |