Skip to content

Commit

Permalink
adjust units used by du and dd
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Jun 6, 2023
1 parent 743c883 commit 0368050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/fai-cd
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ create_ext3fs_image() {
calculate_required_size

# creates an empty file
dd if=/dev/zero of=$tmp/$liveos/ext3fs.img bs=1MB count=$count 2>/dev/null ||
dd if=/dev/zero of=$tmp/$liveos/ext3fs.img bs=1M count=$count 2>/dev/null ||
die 9 "dd failed. Maybe no enough free space in $tmp"

mkfs.ext4 -m1 -q -O^has_journal -F -L FAI-NFSROOT $tmp/$liveos/ext3fs.img
Expand Down Expand Up @@ -231,9 +231,9 @@ calculate_required_size() {

[ $configset -eq 1 ] && unset FAI_CONFIGDIR
if [ $nomirror -eq 0 ]; then
size=$(du -sc $ONFSROOT $FAI_CONFIGDIR $mirrordir/{dists,pool} | tail -n1 | awk '{print $1}')
size=$(du -sck $ONFSROOT $FAI_CONFIGDIR $mirrordir/{dists,pool} | tail -n1 | awk '{print $1}')
else
size=$(du -sc $ONFSROOT $FAI_CONFIGDIR $mdir | tail -n1 | awk '{print $1}')
size=$(du -sck $ONFSROOT $FAI_CONFIGDIR $mdir | tail -n1 | awk '{print $1}')
fi

# not dividing by 1024 to get the exact, this allows us to get some additional space
Expand Down

0 comments on commit 0368050

Please sign in to comment.