Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.49 KB | None | 0 0
  1. diff --git a/kickstart/pack/f5121/hybris b/kickstart/pack/f5121/hybris
  2. index f433b94..4335804 100644
  3. --- a/kickstart/pack/f5121/hybris
  4. +++ b/kickstart/pack/f5121/hybris
  5. @@ -39,7 +39,11 @@ ROOT_LOOP=$(/sbin/losetup -f)
  6.  /sbin/e2fsck -f -y $ROOT_LOOP
  7.  # The "on is al ready" sed hack is added to handle cases when resize2fs
  8.  # outputs "The filesystem is already X blocks long" to stderr:
  9. -BLOCKS=$(/sbin/resize2fs -M $ROOT_LOOP 2>&1 | tail -n 2 | sed "s/is already/on is al ready/" | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  10. +IFS=\n
  11. +OUT=$(/sbin/resize2fs -M $ROOT_LOOP 2>&1)
  12. +echo $OUT
  13. +BLOCKS=$(echo $OUT | tail -n 2 | sed "s/is already/on is al ready/" | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  14. +IFS=" "
  15.  echo We got ourselves root blocks _ $BLOCKS _
  16.  SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
  17.  echo after maths size _ $SIZE _
  18. @@ -54,7 +58,11 @@ HOME_LOOP=$(/sbin/losetup -f)
  19.  /sbin/e2fsck -f -y $HOME_LOOP
  20.  # The "on is al ready" sed hack is added to handle cases when resize2fs
  21.  # outputs "The filesystem is already X blocks long" to stderr:
  22. -BLOCKS=$(/sbin/resize2fs -M $HOME_LOOP 2>&1 | tail -n 2 | sed "s/is already/on is al ready/" | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  23. +IFS=\n
  24. +OUT=$(/sbin/resize2fs -M $HOME_LOOP 2>&1)
  25. +echo $OUT
  26. +BLOCKS=$(echo $OUT | tail -n 2 | sed "s/is already/on is al ready/" | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  27. +IFS=" "
  28.  echo We got ourselves home size _ $BLOCKS _
  29.  SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement