make binaries cope with Squashfs root
This commit is contained in:
parent
5e11eae951
commit
37bf17e1b7
@ -58,7 +58,7 @@ func logic() error {
|
||||
if err := ioutil.WriteFile(ackFn, c.Ack, 0644); err != nil {
|
||||
return fmt.Errorf("persisting DHCPACK to %s: %v", ackFn, err)
|
||||
}
|
||||
if err := notify.Process("/user/netconfi", syscall.SIGUSR1); err != nil {
|
||||
if err := notify.Process("/user/netconfigd", syscall.SIGUSR1); err != nil {
|
||||
log.Printf("notifying netconfig: %v", err)
|
||||
}
|
||||
select {
|
||||
|
@ -51,7 +51,7 @@ func logic() error {
|
||||
if err := ioutil.WriteFile(configPath, b, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := notify.Process("/user/netconfi", syscall.SIGUSR1); err != nil {
|
||||
if err := notify.Process("/user/netconfigd", syscall.SIGUSR1); err != nil {
|
||||
log.Printf("notifying netconfig: %v", err)
|
||||
}
|
||||
if err := notify.Process("/user/radvd", syscall.SIGUSR1); err != nil {
|
||||
|
@ -108,6 +108,10 @@ func TestNetconfig(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(filepath.Join(tmp, "root", "tmp"), 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := netconfig.Apply(tmp, filepath.Join(tmp, "root")); err != nil {
|
||||
t.Fatalf("netconfig.Apply: %v", err)
|
||||
}
|
||||
@ -119,12 +123,12 @@ func TestNetconfig(t *testing.T) {
|
||||
t.Fatalf("netconfig.Apply: %v", err)
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadFile(filepath.Join(tmp, "root", "etc", "resolv.conf"))
|
||||
b, err := ioutil.ReadFile(filepath.Join(tmp, "root", "tmp", "resolv.conf"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, want := strings.TrimSpace(string(b)), "nameserver 192.168.42.1"; got != want {
|
||||
t.Errorf("/etc/resolv.conf: got %q, want %q", got, want)
|
||||
t.Errorf("/tmp/resolv.conf: got %q, want %q", got, want)
|
||||
}
|
||||
|
||||
return
|
||||
|
@ -257,7 +257,7 @@ func applyInterfaces(dir, root string) error {
|
||||
|
||||
if details.Name == "lan0" {
|
||||
b := []byte("nameserver " + addr.IP.String() + "\n")
|
||||
fn := filepath.Join(root, "etc", "resolv.conf")
|
||||
fn := filepath.Join(root, "tmp", "resolv.conf")
|
||||
if err := os.Remove(fn); err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user