docs: add full command reference; fix module path and KernelURL config
- Add docs/commands.md with per-command purpose, step-by-step shell/SDK call sequences, config tables, outputs, and error conditions - Rename module from github.com/you/fc-orchestrator to github.com/kacerr/fc-orchestrator - Add KernelURL field to Config so the download URL is configurable via FC_KERNEL_URL instead of being hardcoded in Init() - Expose FC_KERNEL_URL in the usage string - Add verbose logging of dd/mkfs.ext4/mount/tar calls in buildRootfs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@ func (o *Orchestrator) Init() error {
|
||||
|
||||
// Download kernel if missing
|
||||
if _, err := os.Stat(o.cfg.Kernel); os.IsNotExist(err) {
|
||||
url := "https://s3.amazonaws.com/spec.ccfc.min/ci-artifacts/kernels/x86_64/vmlinux-6.1.bin"
|
||||
url := o.cfg.KernelURL
|
||||
o.log.Infof("downloading kernel from %s ...", url)
|
||||
if err := downloadFile(url, o.cfg.Kernel); err != nil {
|
||||
return fmt.Errorf("download kernel: %w", err)
|
||||
@@ -81,15 +81,18 @@ func (o *Orchestrator) buildRootfs() error {
|
||||
mnt := filepath.Join(o.cfg.BaseDir, "mnt")
|
||||
|
||||
// create empty ext4 image
|
||||
o.log.Infof("running: dd if=/dev/zero of=%s bs=1M count=%d status=none", o.cfg.Rootfs, sizeMB)
|
||||
if err := run("dd", "if=/dev/zero", "of="+o.cfg.Rootfs,
|
||||
"bs=1M", fmt.Sprintf("count=%d", sizeMB), "status=none"); err != nil {
|
||||
return err
|
||||
}
|
||||
o.log.Infof("running: mkfs.ext4 -qF %s", o.cfg.Rootfs)
|
||||
if err := run("mkfs.ext4", "-qF", o.cfg.Rootfs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
os.MkdirAll(mnt, 0o755)
|
||||
o.log.Infof("running: mount -o loop %s %s", o.cfg.Rootfs, mnt)
|
||||
if err := run("mount", "-o", "loop", o.cfg.Rootfs, mnt); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -106,6 +109,7 @@ func (o *Orchestrator) buildRootfs() error {
|
||||
if err := downloadFile(url, tarPath); err != nil {
|
||||
return fmt.Errorf("download alpine: %w", err)
|
||||
}
|
||||
o.log.Infof("running: tar xzf %s -C %s", tarPath, mnt)
|
||||
if err := run("tar", "xzf", tarPath, "-C", mnt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user