diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed2502d3..e7874f50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,7 @@ repos: hooks: - id: go-fmt #- id: golangci-lint +- repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell diff --git a/README.md b/README.md index 2d3c4762..b214c356 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This plugin allows you to build or extend ARM system image. It operates in two m * resize - uses already existing image but resize given partition (ie. root) Plugin mimics standard image creation process, such as: -* builing base empty image (dd) +* building base empty image (dd) * partitioning (sgdisk / sfdisk) * filesystem creation (mkfs.type) * partition mapping (losetup) @@ -59,7 +59,7 @@ go build sudo packer build boards/odroid-u3/archlinuxarm.json ``` ## Run in Docker -This method is primarily for macOS users where is no native way to use qemu-user-static, loop mount Linux specifc filesystems and install all above mentioned Linux specific tools (or Linux users, who do not want to setup packer and all the tools). +This method is primarily for macOS users where is no native way to use qemu-user-static, loop mount Linux specific filesystems and install all above mentioned Linux specific tools (or Linux users, who do not want to setup packer and all the tools). The container is a multi-arch container (linux/amd64 or linux/arm64), that can be used on Intel (x86_64) or Apple M1 (arm64) Macs and also on Linux machines running linux (x86_64 or aarch64) kernels. @@ -118,6 +118,8 @@ Describes the remote file that is going to be used as base image or rootfs archi "file_target_extension": "tar.gz", ``` +Downloads of the `file_urls` are done with the help of `github.com/hashicorp/go-getter`, which supports various protocols: local files, http(s) and various others, see https://github.com/hashicorp/go-getter#supported-protocols-and-detectors). Downloading via more protocols can be done by using other tools (curl, wget, rclone, ...) before running packer and referencing the downloaded files as local file in `file_urls`. + The `file_unarchive_cmd` is optional and should be used if the standard golang archiver can't handle the archive format. Raw images format (`.img` or `.iso`) can be used by defining the `file_target_extension` appropriately. @@ -195,7 +197,7 @@ rootfs archive instead of image: ``` ## Resizing image -Currently resizing is only limited to expanding single `ext{2,3,4}` partition with `resize2fs`. This is often requested feature where already built image is given and we need to expand the main partition to accomodate changes made in provisioner step (ie. installing packages). +Currently resizing is only limited to expanding single `ext{2,3,4}` partition with `resize2fs`. This is often requested feature where already built image is given and we need to expand the main partition to accommodate changes made in provisioner step (ie. installing packages). To resize a partition you need to set `image_build_method` to `resize` mode and set selected partition size to `0`, for example: ``` diff --git a/builder/step_expand_partition.go b/builder/step_expand_partition.go index 8c99255b..77941c80 100644 --- a/builder/step_expand_partition.go +++ b/builder/step_expand_partition.go @@ -29,7 +29,7 @@ func findExpandablePartition(config *Config) (int, error) { if len(partitions) > 1 { return 0, fmt.Errorf( - "found %d resizable partions (%v), but we can expand only one", + "found %d resizable partitions (%v), but we can expand only one", len(partitions), partitions, ) } diff --git a/builder/step_setup_qemu.go b/builder/step_setup_qemu.go index c8d25b4d..9d6ac09d 100644 --- a/builder/step_setup_qemu.go +++ b/builder/step_setup_qemu.go @@ -38,7 +38,7 @@ func checkBinfmtMisc(srcPath string) (string, error) { if fields[0] == "interpreter" { fieldStat, _ := os.Stat(fields[1]) - // os.SameFile allows also comparing of sym- and relativ symlinks. + // os.SameFile allows also comparing of sym- and relative symlinks. if os.SameFile(fieldStat, srcPathStat) { return pth, nil }