Commit 9a1e0683 authored by Tristan Cavelier's avatar Tristan Cavelier

Add cros-gunzip-dd.py to allow write gziped images to a device on ChromeOS

Avoiding the use of `dd` (crashing command).
parent 0498d3f1
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Usage: cros-gunzip-dd.py SRC.gz DEST
It's a shortcut for `zcat SRC.gz | dd of=DEST`. Useful on nayuos because the
"dd" command may crash.
"""
import sys, gzip
src = gzip.open(sys.argv[1], "rb")
dst = open(sys.argv[2], "wb")
while True:
buf = src.read(512)
if len(buf) == 0:
break
dst.write(buf)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment