diff options
author | Aaron Ball <nullspoon@oper.io> | 2019-03-31 16:05:38 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2019-03-31 16:05:38 -0600 |
commit | 08d69e6d5b1d529f91745419065d4a2879b717af (patch) | |
tree | 5ab4f0a8e2c00d5f5846b9b14323e539ca8b1be0 | |
parent | c828d033f57ff8170b6eb83cff8460e9f34c0e4e (diff) | |
download | mkinitramfs-08d69e6d5b1d529f91745419065d4a2879b717af.tar.gz mkinitramfs-08d69e6d5b1d529f91745419065d4a2879b717af.tar.xz |
init:remove get_part_type function
The cryptsetup utility contains a 'isLuks' command which makes this
function uneeded. Updated call to this function with the cryptsetup
directive.
-rwxr-xr-x | init | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -84,25 +84,6 @@ parse_cmdline() { done } - -# -# Returns type of partition. If part is LUKS encrypted, returns 'luks'. If -# anything else, returns 'fs'. -# -# Most installations of the mount command don't require specification of the -# filesystem, but won't automatically detect luks partitions and prompt for a -# password. This allows the script to be smarter about encrypted partitions. -# -get_part_type() { - local path="${1}" - local typestr="$(blkid -s TYPE ${path})" - if [ "$(echo ${typestr} | grep 'crypto_LUKS')" ]; then - echo 'luks' - else - echo 'fs' - fi -} - # # Takes an encrypted device path and executes cryptsetup luksOpen. Returns path @@ -201,7 +182,7 @@ main() { /bin/bash -i fi - if [ "$(get_part_type ${ROOTDEV})" == 'luks' ]; then + if cryptsetup isLuks "${ROOTDEV}"; then # Set new rootdev location (/dev/mapper/something). This will update it to # the decrypted block device path. log "Root device ${ROOTDEV} is encrypted." |