From 8482d3c1035095c89d112c75bfcc2e4095b486bf Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 17 Dec 2022 11:59:24 +0100 Subject: pkg/image: factor out from prog Move image compression-related function to a separate package. In preperation for subsequent changes that make decompression more complex. Prog package is already large and complex. Also makes running compression tests/benchmarks much faster. --- sys/linux/init_images.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/linux') diff --git a/sys/linux/init_images.go b/sys/linux/init_images.go index 8b62455d2..c9a3035ef 100644 --- a/sys/linux/init_images.go +++ b/sys/linux/init_images.go @@ -8,6 +8,7 @@ import ( "fmt" "io" + "github.com/google/syzkaller/pkg/image" "github.com/google/syzkaller/prog" ) @@ -25,7 +26,7 @@ func (arch *arch) extractSyzMountImage(c *prog.Call) (io.Reader, error) { return nil, fmt.Errorf("an empty image") } buf := new(bytes.Buffer) - if err := prog.DecompressWriter(buf, data); err != nil { + if err := image.DecompressWriter(buf, data); err != nil { return nil, err } return buf, nil -- cgit mrf-deployment