Replies: 5 comments
-
I wrote a script to do this, but not in go. Someone please answer this, and I can work on implementing in go, in this software. `#!/bin/bash ###ref #TODO #i dont like errors ###vars: export PARTITION_BOOT=p1 echo "Create Work Dir" ###do stuff: #create work dir #download image #no testing echo "Create Sparse Image File" #setup loop device echo "Loop Device Made" echo "Partitioning loop device." #partition loop device sudo partprobe /dev/loop0 sudo sfdisk -l $LOOPDEVICE #format loop device sudo mkfs.vfat -F 32 $LOOPDEVICE$PARTITION_BOOT echo "Creating mount dir's, and mounting file systems." mkdir -p $WORKDIR/FILESYSTEM sudo bsdtar -vxpf $WORKDIR/INCOMING/$SOURCEFILENAME -C $WORKDIR/FILESYSTEM #there must be other mmcblk devices before the main sd card reader of the device #edit to customize image if needed echo "Unmount, and remove loop device" #do not delete |
Beta Was this translation helpful? Give feedback.
-
I continue to work on this. From core README of project: For list of valid values, see: pkg/image/utils/images.go So most of what image_type does so far is just determine what image_mounts (and there is a bit of auto detection built into it to set image_type from matching keywords in url) will be, and image_mounts is: So back to this, if I set my image_type to raspberrypi I would get (which matches my partition structure): I could set image_mounts directly to, and I may try that, but it seems like the code stops if it can't detect image_type So looking at the source, the one that matches the system structure of archlinux would be There is also some detection of file based on file extension: So i may be smart to set the suffix of the image to .img, but I bet that GetImageFileInCurrentDir would be ran after an unzip/etc. The last thing I have to mess with is iso_url because my image is local, and my knowledge of go is limited, but from what I can see of iso_checksum: I wonder if I can use file:./local/path/file.sum inside of iso_url I also may set iso_checksum to none because I am going to be generating images on the fly. If I wanted to mod this code to accept tars of file systems, I would want to find where we start working with loop devices possibly, interrupt using image type, and work on mounting blank loop devices, and filling them up like I did in my script. |
Beta Was this translation helpful? Give feedback.
-
Manged to make it all the way through, and I am working on archlinux arm. Next step for me is to figure out why networking is not working inside the image when I try to update via packer shell script: Something here?: |
Beta Was this translation helpful? Give feedback.
-
*https://githubmemory.com/repo/solo-io/packer-builder-arm-image/issues/22 |
Beta Was this translation helpful? Give feedback.
-
yea this does look like that resolve.conf issue. |
Beta Was this translation helpful? Give feedback.
-
Does this support tar.gz based images.
Like: http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
Beta Was this translation helpful? Give feedback.
All reactions