mirror of
https://github.com/xcat2/confluent.git
synced 2026-10-20 06:35:33 +00:00
Make sure that ls reads the actual size without being confsued by symbolic links
This commit is contained in:
@@ -44,7 +44,11 @@ if grep '^Format: confluent_crypted' /tmp/rootimg.info > /dev/null; then
|
||||
fi
|
||||
cipher=$(head -n 1 /tmp/rootimg.key)
|
||||
key=$(tail -n 1 /tmp/rootimg.key)
|
||||
len=$(ls -l /mnt/remoteimg/rootimg.sfs | awk '{print $3}')
|
||||
rootimgfile=/mnt/remoteimg/rootimg.sfs
|
||||
while [ -L "$rootimgfile" ]; do
|
||||
rootimgfile=$(readlink -f "$rootimgfile")
|
||||
done
|
||||
len=$(ls -l $rootimgfile | awk '{print $3}')
|
||||
len=$(((len-4096)/512))
|
||||
dmsetup create cryptimg --table "0 $len crypt $cipher $key 0 $loopdev 8"
|
||||
/opt/confluent/bin/confluent_imginfo /dev/mapper/cryptimg > /tmp/rootimg.info
|
||||
|
||||
Reference in New Issue
Block a user