File wiper-intel.diff of Package hdparm
Index: wiper.sh
===================================================================
--- wiper.sh.orig
+++ wiper.sh
@@ -724,7 +724,7 @@ GAWKPROG='
nsectors += count;
while (count > 0) {
this_count = (count > 65535) ? 65535 : count
- printf "%u:%u ", lba, this_count
+ printf "%u:%u \n", lba, this_count
if (verbose > 1)
printf "%u:%u ", lba, this_count > "/dev/stderr"
lba += this_count
@@ -864,6 +864,23 @@ $get_trimlist 2>/dev/null | $GAWK \
-v verbose="$verbose" \
-v xfs_blksects="$xfs_blksects" \
-v xfs_agoffsets="$xfs_agoffsets" \
- "$GAWKPROG" | $TRIM
+ "$GAWKPROG" | if true; then
+ declare -i i=0
+ ranges=""
+ while read range; do
+ ((i++))
+ if ((i<=512)); then
+ ranges=$ranges" "$range
+ else
+ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n"
+ echo $ranges | $TRIM
+ ranges=$range
+ i=1
+ fi
+ done
+ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n"
+ echo $ranges | $TRIM
+ ranges=""
+ fi
do_cleanup $?