nohub and replace /root/rc.local

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-04-08 15:21:30 -07:00
parent 59cf4afb5f
commit c305888519
2 changed files with 9 additions and 6 deletions

View File

@ -12,11 +12,14 @@ import "git.wit.com/jcarr/shell"
func main() { func main() {
parseConfig() parseConfig()
if _, err := os.Stat("/home/factory"); !os.IsNotExist(err) { if _, err := os.Stat("/home/factory"); os.IsNotExist(err) {
} else {
shell.Run("mkdir /home/factory") shell.Run("mkdir /home/factory")
} }
if _, err := os.Stat("/usr/bin/dialog"); os.IsNotExist(err) {
shell.Run("apt install dialog")
}
if _, err := os.Stat("/dev/mmcblk0p2"); !os.IsNotExist(err) { if _, err := os.Stat("/dev/mmcblk0p2"); !os.IsNotExist(err) {
log.Println("device /dev/mmcblk0p2 exists") log.Println("device /dev/mmcblk0p2 exists")
} else { } else {
@ -38,7 +41,7 @@ func main() {
if _, err := os.Stat(fullname); !os.IsNotExist(err) { if _, err := os.Stat(fullname); !os.IsNotExist(err) {
log.Println("filename", fullname, "exists. dd here") log.Println("filename", fullname, "exists. dd here")
shell.Run("dd " + fullname + " of=/dev/mmcblk2 bs=1M status=progress oflag=sync") shell.Run("dd if=" + fullname + " of=/dev/mmcblk2 bs=1M status=progress oflag=sync")
succeeded() succeeded()
} else { } else {
log.Println("filename", fullname, "does not exist") log.Println("filename", fullname, "does not exist")
@ -78,8 +81,7 @@ func succeeded () {
log.Println("") log.Println("")
log.Println("") log.Println("")
// try executing this from golang to see what happens shell.Run("dialog --ascii-lines --msgbox 'Flash_Image_Completed' 10 70")
// dialog --ascii-lines --msgbox "Flash Image Completed!" 10 70
os.Exit(0) os.Exit(0)
} }

View File

@ -26,7 +26,7 @@ killall wpa_supplicant
ifconfig wlan0 up ifconfig wlan0 up
sleep 10 sleep 10
ifconfig wlan0 up ifconfig wlan0 up
wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf & nohup wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf &
#nmcli device wifi list #nmcli device wifi list
#nmcli device wifi rescan #nmcli device wifi rescan
#nmcli device wifi list #nmcli device wifi list
@ -48,5 +48,6 @@ git clone https://git.wit.com/wit/pinebook-image.git
echo echo
echo Launching script from git repository echo Launching script from git repository
cp /root/pinebook-image/rc.local /root/
/root/pinebook-image/run.sh /root/pinebook-image/run.sh