Comments (7)
Fix changes behavior to
`$ go get -u github.com/gokrazy/tools/cmd/gokr-packer`
`# github.com/gokrazy/tools/cmd/gokr-packer`
`go/src/github.com/gokrazy/tools/cmd/gokr-packer/parttable.go:81: undefined: unix.BLKGETSIZE64`
`go/src/github.com/gokrazy/tools/cmd/gokr-packer/parttable.go:93: undefined: unix.BLKRRPART`
still not able to install without errors. Reopening this issue.
from gokrazy.
Thanks for the report. The code in question should only be compiled for the target (linux arm64), but is currently compiled for the host due to the way we pull in code. I’ll push a commit in a second which should fix this. Please reopen if you still encounter issues afterwards.
from gokrazy.
Thanks. I’ll need to make that code conditional, then.
Given that I don’t have a macOS machine handy, any fix would be blind. I might be able to actually test gokrazy (and not just have it compile) on macOS next week. If you want to race me to it, contributions are very welcome :).
from gokrazy.
It looks like the constants
unix.BLKGETSIZE64
unix.BLKRRPART
are not available with darwin/amd64 as Darwin lacks these requests for IOCTL.
A substitute for Darwin has to be identified in order to
determine the device size and re-read partition table.
Maybe The discusscion How do I get the partition offset in OS X with C/C++? on Stackoverflow gives some hints.
from gokrazy.
The commits I just pushed should allow you to install gokr-packer
on macOS.
Prep work
Before you’ll be able to create an image, you’ll need to dump the system root certificates:
mkdir -p ~/.config/gokrazy
security find-certificate -a \
-p /System/Library/Keychains/SystemCACertificates.keychain \
> ~/.config/gokrazy/cacert.pem
Test cross-compilation
Check whether GOOS=linux GOARCH=arm64 go get -u github.com/gokrazy/hello
fails. If it fails due to a permission error (common if you have used the Go installer), you have 3 options:
- Run gokrazy as root, thereby gaining write permission to
/usr/local/go
- Copy
/usr/local/go
to a temporary directory and set theGOROOT
environment variable to that directory - Re-install Go from source into a directory where you have write permission.
Creating an image
I’d recommend to follow https://github.com/gokrazy/tools#alternative-creating-an-sd-card-image and use whichever tool you feel comfortable with to write the image to an SD card.
Creating an image (the harder(?) way)
In case you want to use gokr-packer
to directly write to the SD card, a couple more steps are necessary. Notably, you’ll need to repeat all of these steps whenever you want to directly write to your SD card.
Locate your SD card in diskutil list
. On my machine, it shows up as /dev/disk2
.
In case the SD card contained any partitions with a file system, use umount
to unmount the file systems (otherwise you’ll get a “device busy” error on the next command).
Overwrite the SD card with zeros to remove all partitions and file systems, preventing macOS from mounting the file systems after we overwrite the partition table:
dd if=/dev/zero of=/dev/rdisk2 bs=1m count=1024
Afterwards, the following worked for me:
gokr-packer -overwrite=/dev/disk2 github.com/gokrazy/hello
macOS prompts you halfway through the process about not being able to read any file systems (which aren’t written at that point). Dismiss the dialog by clicking its “ignore” button.
from gokrazy.
I’m closing this issue. We can discuss/track individual remaining issues/improvements to the experience in separate issues, if desired.
from gokrazy.
from gokrazy.
Related Issues (20)
- Proper way to poweroff HOT 3
- Broken version of gokrazy/firmware prevents boot on certain raspberry pi HOT 2
- Implement userspace modprobe
- suggestion: add a cmd/dmesg program HOT 2
- Document state of Raspberry Pi 400 HOT 6
- Panic in status.go HOT 1
- Feature request: GOARCH in config.json HOT 4
- Feature request: discover GOKRAZY_PARENT_DIR by walking $PWD up (til $HOME) HOT 1
- Document ExtraFilePaths relative path base HOT 1
- Docker instructions assume /perm/container-storage exists? HOT 2
- Unable to update executable because root filesystem is read-only HOT 14
- updating over tailscale (sometimes!) fails with HOT 7
- docs: explain what parts of gokrazy should be backed up HOT 2
- tailscale: Setup advertise-routes does not work in config.json HOT 3
- /gokrazy/ntp: permission denied HOT 11
- Running the prometheus server on gokrazy HOT 8
- Update gokrazy+tailscale docs for nftables support HOT 3
- Upgrading version of gokrazy HOT 6
- Using different port does not work HOT 4
- DNS bug that only get fixes whe manualy stop and start service from the UI HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gokrazy.