package main

import (
	"fmt"
	"os"

	"kisekinopureya.com.tr/updater/internal/archive"
)

func main() {
	if len(os.Args) != 5 {
		fmt.Fprintf(os.Stderr, "usage: %s <rootfs.img> <dm-verity.img> <kernel.img> <output.tar.xz>\n", os.Args[0])
		os.Exit(1)
	}

	rootfs := os.Args[1]
	verity := os.Args[2]
	kernel := os.Args[3]
	output := os.Args[4]

	if err := archive.Pack(rootfs, verity, kernel, output); err != nil {
		fmt.Fprintf(os.Stderr, "packer error: %v\n", err)
		os.Exit(1)
	}
}
