Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit b70fd5d

Browse files
committed
And here we stop
There's something about tinycore packages and newer kernels that is not ending well. Time for a break. But things are far more compact now. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
1 parent bb4477c commit b70fd5d

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

usb/tczlist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build go1.11
5+
// +build go1.17
66

77
package main
88

usb/urootlist.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build go1.11
6-
75
package main
86

97
var (

usb/usb.go

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build go1.11
6-
75
package main
86

97
//include a loading bar
@@ -205,24 +203,14 @@ func goBuildStatic() error {
205203
return nil
206204
}
207205

206+
// A new change: we no longer need to add u-root to this partition,
207+
// as we build it all for the "static" case.
208208
func goBuildDynamic() error {
209-
args := []string{"-o", filepath.Join(workingDir, initramfs)}
210-
for _, v := range []string{"usr", "lib", "tcz", "etc", "upspin", ".ssh"} {
211-
if _, err := os.Stat(v); err != nil {
212-
continue
213-
}
214-
args = append(args, "-files", filepath.Join(workingDir, v)+":"+v)
215-
}
209+
args := []string{"-o", filepath.Join(workingDir, initramfs), "-nocmd", "-files", "rootfs:", "-files", "/usr/bin/bash", "-base", "/dev/null"}
216210
log.Print("WARNING: skipping pkg/sos/html; fix me")
217211
if false {
218212
args = append(args, "-files", "pkg/sos/html:etc/sos/html")
219213
}
220-
args = append(args, dynamicCmdList...)
221-
n, err := filepath.Glob("../u-root/cmds/*/*")
222-
if err != nil {
223-
return fmt.Errorf("../u-root/cmds/*/*: %v", err)
224-
}
225-
args = append(args, n...)
226214
log.Printf("Run u-root with args %v", args)
227215
cmd := exec.Command("u-root", args...)
228216
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
@@ -346,14 +334,21 @@ func installUrootGpt() error {
346334
func vbutilIt() error {
347335
// Try to read a GPT header from our output file. If we can, add a root_guid
348336
// to config.txt, otherwise, don't bother.
349-
args := []string{"gpt", *dev}
350-
msg, err := exec.Command("sudo", args...).Output()
351-
if err != nil {
352-
log.Printf("gpt %v failed (warning only): %v", args, err)
353-
}
337+
var pt = &gpt.PartitionTable{}
354338
var pg gpt.GUID
355-
if err == nil {
356-
var pt = &gpt.PartitionTable{}
339+
if *dev == "/dev/null" {
340+
log.Printf("Skipping the gpt step, since *dev is /dev/null")
341+
} else {
342+
gptcmd, err := exec.LookPath("gpt")
343+
if err != nil {
344+
return fmt.Errorf("Can not find a GPT command: %v", err)
345+
}
346+
args := []string{gptcmd, *dev}
347+
msg, err := exec.Command("sudo", args...).Output()
348+
if err != nil {
349+
return fmt.Errorf("gpt %v failed: %v", args, err)
350+
}
351+
357352
if err := json.NewDecoder(bytes.NewBuffer(msg)).Decode(&pt); err != nil {
358353
log.Printf("Reading in GPT JSON, warning only: %v", err)
359354
} else if pt.Primary == nil || pt.MasterBootRecord == nil {

0 commit comments

Comments
 (0)