nohub and replace /root/rc.local
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
59cf4afb5f
commit
c305888519
|
@ -12,11 +12,14 @@ import "git.wit.com/jcarr/shell"
|
|||
func main() {
|
||||
parseConfig()
|
||||
|
||||
if _, err := os.Stat("/home/factory"); !os.IsNotExist(err) {
|
||||
} else {
|
||||
if _, err := os.Stat("/home/factory"); os.IsNotExist(err) {
|
||||
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) {
|
||||
log.Println("device /dev/mmcblk0p2 exists")
|
||||
} else {
|
||||
|
@ -38,7 +41,7 @@ func main() {
|
|||
|
||||
if _, err := os.Stat(fullname); !os.IsNotExist(err) {
|
||||
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()
|
||||
} else {
|
||||
log.Println("filename", fullname, "does not exist")
|
||||
|
@ -78,8 +81,7 @@ func succeeded () {
|
|||
log.Println("")
|
||||
log.Println("")
|
||||
|
||||
// try executing this from golang to see what happens
|
||||
// dialog --ascii-lines --msgbox "Flash Image Completed!" 10 70
|
||||
shell.Run("dialog --ascii-lines --msgbox 'Flash_Image_Completed' 10 70")
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
|
3
rc.local
3
rc.local
|
@ -26,7 +26,7 @@ killall wpa_supplicant
|
|||
ifconfig wlan0 up
|
||||
sleep 10
|
||||
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 rescan
|
||||
#nmcli device wifi list
|
||||
|
@ -48,5 +48,6 @@ git clone https://git.wit.com/wit/pinebook-image.git
|
|||
echo
|
||||
echo Launching script from git repository
|
||||
|
||||
cp /root/pinebook-image/rc.local /root/
|
||||
/root/pinebook-image/run.sh
|
||||
|
||||
|
|
Loading…
Reference in New Issue