Speeding up the dd call, thanks to Peter Skogstroem <peter.skogstrom@bitrunner.com>.
This commit is contained in:
parent
2e51237e12
commit
702de9d2ed
|
@ -83,7 +83,7 @@ fi
|
||||||
# Everything which comes here needs to be cleaned up,
|
# Everything which comes here needs to be cleaned up,
|
||||||
DU_DIM="$(du -ms binary | cut -f1)"
|
DU_DIM="$(du -ms binary | cut -f1)"
|
||||||
REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50)" # Just 2% more to be sure, need something more sophistcated here...
|
REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50)" # Just 2% more to be sure, need something more sophistcated here...
|
||||||
dd if=/dev/zero of=chroot/binary.img bs=1024k count=${REAL_DIM}
|
dd if=/dev/zero of=chroot/binary.img bs=1024k count=0 seek=${REAL_DIM}
|
||||||
FREELO="$(${LH_LOSETUP} -f)"
|
FREELO="$(${LH_LOSETUP} -f)"
|
||||||
if [ ! -b chroot/${FREELO} ]
|
if [ ! -b chroot/${FREELO} ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -73,7 +73,7 @@ fi
|
||||||
# Everything which comes here needs to be cleaned up,
|
# Everything which comes here needs to be cleaned up,
|
||||||
DU_DIM="$(du -ms source | cut -f1)"
|
DU_DIM="$(du -ms source | cut -f1)"
|
||||||
REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50)" # Just 2% more to be sure, need something more sophistcated here...
|
REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50)" # Just 2% more to be sure, need something more sophistcated here...
|
||||||
dd if=/dev/zero of=source.img bs=1024k count=${REAL_DIM}
|
dd if=/dev/zero of=source.img bs=1024k count=0 seek=${REAL_DIM}
|
||||||
FREELO="$(${LH_LOSETUP} -f)"
|
FREELO="$(${LH_LOSETUP} -f)"
|
||||||
if [ ! -b chroot/${FREELO} ]
|
if [ ! -b chroot/${FREELO} ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue