ALT Linux Bugzilla
– Attachment 5686 Details for
Bug 27786
OOM в installer
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
> ... усложнение рантайма с адаптивной оценкой расхождения
livecd-install.patch (text/plain), 4.46 KB, created by
vx8400
on 2012-12-26 15:53:42 MSK
(
hide
)
Description:
> ... усложнение рантайма с адаптивной оценкой расхождения
Filename:
MIME Type:
Creator:
vx8400
Created:
2012-12-26 15:53:42 MSK
Size:
4.46 KB
patch
obsolete
>--- livecd-install.orig 2012-12-26 15:52:20 +0400 >+++ livecd-install 2012-12-25 22:23:11 +0400 >@@ -84,12 +84,122 @@ > ## > # unpack squashfs image > # >+no_unsquashfs=yes > > do_install() > { > local img="$1";shift > local dst="$1";shift > local percent1= >+ local unpacked= >+ local free= >+ local live_mount= >+ local retval=0 >+ local curr_dir=`pwd` >+ local list_du tot sd s d IFS_bak bytes_done pct_done blk_done blk_cur bytes_per_blk bytes_cur pct_cur >+ >+if [ "x$no_unsquashfs" = "xyes" ] ; then >+ >+ live_mount="$( mount | sed '/ type squashfs /!d; s/^.* on [ ]*\([^ ]\+\) type squashfs .*$/\1/')" >+ if [ "x$live_mount" = "x" ] ; then >+ do_notify_error "Can't find squashfs mount point" >+ return 1 >+ fi >+ unpacked="$(du -sb ${live_mount} | sed 's,^[ ]*\([0-9]\+\).*$,\1,')" >+ if [ "x$unpacked" = "x" ] ; then >+ do_notify_error "Can't calculate unpacked squashfs size" >+ return 1 >+ fi >+ free=$(free_space "$dst") >+ if [ $unpacked -gt $free ]; then >+ do_notify_error "No free space to unpack squashfs image" >+ return 1 >+ fi >+ do_notify_stage install >+ >+ >+ cd $live_mount >+ >+ #tot_du=`du -sb . | sed 's,[ \t].*$,,'` >+ list_du=$( >+ LANG=C LC_ALL=C \ >+ du -sb `ls -1 | \ >+ grep -vE "^dev|^image|^media|^proc|^sys|^mnt|^sys"` | \ >+ sort -r -g | \ >+ tr '\n' ';' >+ ) >+# echo list_du:$list_du: > /tmp/i.log >+ IFS_bak=$IFS >+ IFS=';' >+ tot=0 >+ for sd in $list_du ; do >+ s=`echo $sd | sed 's,[ \t].*$,,'` >+ d=`echo $sd | sed 's,^[^ \t]\+[ \t]\+,,'` >+ tot=`expr $s + $tot` >+ done >+ if test $tot -eq 0 ; then >+ tot=1 >+ fi >+# echo "tot:$tot" >> /tmp/i.log >+ >+ bytes_done=0 >+ pct_done=0 >+ blk_done=0 >+ blk_cur=0 >+ bytes_per_blk=1024 >+ >+ for sd in $list_du ; do >+ s=`echo $sd | sed 's,[ \t].*$,,'` >+ d=`echo $sd | sed 's,^[^ \t]\+[ \t]\+,,'` >+ cd $live_mount >+# echo "---- dir $d -- du -sb: $s -----" >> /tmp/i.log >+ blk_done=$( >+ export LANG=C LC_ALL=C >+ tar cf - $d \ >+ | { >+ cd $dst >+ tar xfvR - -b 2 --checkpoint=100 >+ } 2>&1 \ >+ | sed '/^tar: Read/!d;s,^.*point[ \t]\+,,' \ >+ | { >+ blk_cur=$blk_done >+ while read blk ; do >+ bytes_cur=`expr $bytes_done + $blk \* $bytes_per_blk ` >+ pct_cur=`expr $bytes_cur \* 100 / $tot` >+ #echo blk: $blk bytes_cur: $bytes_cur pct_cur: $pct_cur >> /tmp/i.log >+ if test $pct_cur -gt $pct_done ; then >+ pct_done=$pct_cur >+ if test $pct_done -ge 100 ; then >+ pct_done=99 >+ fi >+ #echo MSG $pct_done % >> /tmp/i.log >+ do_notify_status "$pct_done" >+ fi >+ blk_cur=`expr $blk_done + $blk` >+ #echo blk_cur: $blk_cur >> /tmp/i.log >+ done >+ echo $blk_cur >+ } >+ ) >+ bytes_done=`expr $bytes_done + $s` >+ pct_done=`expr $bytes_done \* 100 / $tot` >+ if test $pct_done -gt 100 ; then >+ pct_done=100 >+ fi >+ bytes_per_blk=`expr $bytes_done / $blk_done` >+ #echo blk_done: $blk_done : $bytes_per_blk >>/tmp/i.log >+ #echo bytes_done: $bytes_done pct_done: $pct_done >>/tmp/i.log >+ #echo MSG $pct_done % >> /tmp/i.log >+ #echo "====================" >> /tmp/i.log >+ do_notify_status "$pct_done" >+ done >+ >+ IFS=$IFS_bak >+ >+ mkdir -p -- ${dst}/{dev,mnt,proc,sys,media} >+ cd ${curr_dir} >+ >+else # default: > > if ! [ -r "$img" ]; then > do_notify_error "Can't read squashfs image $img" >@@ -108,14 +218,14 @@ > percent1="$((percent1/99))" > > # calculate size necessary for unpacked squashfs image >- local unpacked=$(sqfs_size "$img") >+ unpacked=$(sqfs_size "$img") > > if [ -z "$unpacked" ]; then > do_notify_error "Can't calculate unpacked squashfs size" > return 1 > fi > >- local free=$(free_space "$dst") >+ free=$(free_space "$dst") > > if [ $unpacked -gt $free ]; then > do_notify_error "No free space to unpack squashfs image" >@@ -124,7 +234,7 @@ > > do_notify_stage install > >- unsquashfs -force -no-progress -info -dest "$dst" "$img" 2>/dev/null | >+ { unsquashfs -force -no-progress -info -dest "$dst" "$img" 2>/dev/null ; retval=$? ; } | > { > local i=0 > local progress=0 >@@ -138,6 +248,12 @@ > fi > done > } >+ if [ $retval -ne 0 ] ; then >+ do_notify_error "Can't read squashfs image $img" >+ return 1 >+ fi >+ >+fi #end of unsquashfs ... > > # Set right perms on root directory of installed system > chmod 0755 "$dst" >@@ -223,4 +339,3 @@ > } > > message_loop >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27786
:
5681
|
5682
| 5686