raspberry-pi - 构建更小尺寸的树莓派镜像
问题描述
我正在尝试使用 packer-builder-arm ( https://github.com/mkaczanowski/packer-builder-arm ) 社区插件构建小型 Raspberry Pi 图像。
生成的图像仍然是 2GB。任何人建议如何减小图像大小。谢谢!
{
"variables": {},
"builders": [
{
"type": "arm",
"file_urls": [
"http://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2020-05-28/2020-05-27-raspios-buster-lite-armhf.zip"
],
"file_checksum_url": "http://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2020-05-28/2020-05-27-raspios-buster-lite-armhf.zip.sha256",
"file_checksum_type": "sha256",
"file_target_extension": "zip",
"image_build_method": "reuse",
"image_path": "custom-raspberry-pi-os.img",
"image_size": "700M",
"image_type": "dos",
"image_partitions": [
{
"name": "boot",
"type": "c",
"start_sector": "8192",
"filesystem": "vfat",
"size": "256M",
"mountpoint": "/boot"
},
{
"name": "root",
"type": "83",
"start_sector": "532480",
"filesystem": "ext4",
"size": "0",
"mountpoint": "/"
}
],
"image_chroot_env": [
"PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
],
"qemu_binary_source_path": "/usr/bin/qemu-arm-static",
"qemu_binary_destination_path": "/usr/bin/qemu-arm-static"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["touch /tmp/test"]
}
]
}```
解决方案
您可能想考虑删除那里不需要的程序。然后使用类似resize2fs
.
推荐阅读
- excel - VBA Implements / Inheritance
- r - 在 dplyr 中的 group_by 之后过滤组内的行
- c# - 尝试编写只读数据库 sqlite Wpf inno setup
- c# - 带有事件处理程序的 Autofac 单实例
- vb.net - ms-access "Great Than" 或相等查询
- google-bigquery - 从数组中删除空值/空值
- python - 批量归一化导致训练和推理损失之间的巨大差异
- c# - 将所有 POST 请求路由到 1 个接收 POST 正文的 APIController 方法
- c++ - 将数组传递给 lambda 函数
- python - SkLearn - 为什么 LabelEncoder().fit 仅适用于训练数据