From d1826be26716597d8925a8d541650ede4b0909af Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 24 Apr 2019 14:21:23 -0700 Subject: [PATCH] clean up for a pinebook live installer Signed-off-by: Jeff Carr --- connect-to-wifi/main.go | 6 +++--- rc.local | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/connect-to-wifi/main.go b/connect-to-wifi/main.go index 794b48a..9ad7486 100644 --- a/connect-to-wifi/main.go +++ b/connect-to-wifi/main.go @@ -17,7 +17,7 @@ func dhclient() { shell.Run("systemctl stop wpa_supplicant.service") shell.Run("killall wpa_supplicant") - go shell.Daemon("wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf", 1000 * time.Millisecond) + go shell.Daemon("wpa_supplicant -d -g /tmp/wpa-wlan0.sock -D wext -i wlan0 -c /etc/wpa_supplicant.conf", 1000 * time.Millisecond) log.Println("it for wpa_supplicant, then run dhclient") @@ -25,7 +25,7 @@ func dhclient() { fmt.Println("running wpa_supplicant in the background") fmt.Println("need to figure out how to talk to it to see it's status") shell.Run("ifconfig wlan0") - time.Sleep(5000 * time.Millisecond) + time.Sleep(10000 * time.Millisecond) // every 10 seconds filename := "/tmp/wit-install-done" if _, err := os.Stat(filename); !os.IsNotExist(err) { // log.Println("filename", filename, "does exist") @@ -57,5 +57,5 @@ func main() { log.Println("MACHINE WIFI IS WORKING") log.Println("MACHINE WIFI IS WORKING") - shell.Run("sleep 3600") // force it to bomb after 1 hour so I can debug what to do + shell.Run("sleep 360000") // force it to bomb after 1 hour so I can debug what to do } diff --git a/rc.local b/rc.local index 4bef89f..fef2b83 100755 --- a/rc.local +++ b/rc.local @@ -1,18 +1,18 @@ -#!/bin/bash -x +#!/bin/bash -echo -echo -echo STARTING PINEBOOK IMAGING IN 5 SECONDS -echo STARTING PINEBOOK IMAGING IN 5 SECONDS -echo STARTING PINEBOOK IMAGING IN 5 SECONDS -echo STARTING PINEBOOK IMAGING IN 5 SECONDS -echo STARTING PINEBOOK IMAGING IN 5 SECONDS -echo -echo CONTROL-C TO STOP -echo +export SHELL=/bin/bash +export EDITOR=vim +export PWD=/root +export LOGNAME=root +export HOME=/root +export LANG=C +export USER=root +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/root/go/bin:/usr/games +export _=/usr/bin/env -sleep 5 +cd /root +. /root/.bashrc +env +sleep 1 -/root/go/bin/connect-to-wifi - -touch /tmp/wit-installer-finished +startx