Add luks device to crypttab and rebuild initramfs

This commit is contained in:
Jeremy Gardais 2020-10-21 09:28:31 +02:00
parent 3f7ba24040
commit e8951c437b
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 8 additions and 0 deletions

View File

@ -214,6 +214,14 @@ mkdir -p -- /target/run/udev
mountpoint -q /target/run/udev || mount --bind -- /run/udev /target/run/udev mountpoint -q /target/run/udev || mount --bind -- /run/udev /target/run/udev
### }}} ### }}}
## }}} ## }}}
## Luks {{{
luks_part_uuid=$(blkid | grep "${hdd}2.*TYPE=\"crypto_LUKS\"" | sed 's/.*UUID="\(.*\)" TYPE.*/\1/')
### Ensure crypttab file contains the LUKS informations
printf '%b\n' "${luks_pv_name} UUID=${luks_part_uuid} none luks,discard" >> /etc/crypttab
### Regenerate initramfs
update-initramfs -k all -u
## }}}
## Network {{{ ## Network {{{
### Get all informations from current network configuration in rescue mode ### Get all informations from current network configuration in rescue mode
net_device=$(ip r | grep "^default" | head -1 | cut -d" " -f5) net_device=$(ip r | grep "^default" | head -1 | cut -d" " -f5)