-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.c
executable file
·95 lines (70 loc) · 3.65 KB
/
install.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <stdio.h>
#include <stdlib.h>
//this will handle the install of all gas software
char GIT_CODE_BASE [] ="https://github.com/SmallSatGasTeam/CubeWorks.git";
char crontabComand [] ="@reboot sudo runuser pi -c ./startup.exe";
//to change the branch take out the -b codeBase for master or change it to a different branch.
char cammand0 [] = "git clone https://github.com/SmallSatGasTeam/CubeWorks2.git CubeWorks0/";
char cammand1 [] = "git clone https://github.com/SmallSatGasTeam/CubeWorks2.git CubeWorks1/";
char cammand2 [] = "git clone https://github.com/SmallSatGasTeam/CubeWorks2.git CubeWorks2/";
char cammand3 [] = "git clone https://github.com/SmallSatGasTeam/CubeWorks2.git CubeWorks3/";
char cammand4 [] = "git clone https://github.com/SmallSatGasTeam/CubeWorks2.git CubeWorks4/";
//this code compiles the c code that is need to run transmission.
char branchCommand0 [] = "cd ; cd CubeWorks0/TXISR/TXServiceCode ; gcc TXServiceCode.c -o TXService.run; cd ;";
char branchCommand1 [] = "cd ; cd CubeWorks1/TXISR/TXServiceCode ; gcc TXServiceCode.c -o TXService.run; cd ;";
char branchCommand2 [] = "cd ; cd CubeWorks2/TXISR/TXServiceCode ; gcc TXServiceCode.c -o TXService.run; cd ;";
char branchCommand3 [] = "cd ; cd CubeWorks3/TXISR/TXServiceCode ; gcc TXServiceCode.c -o TXService.run; cd ;";
char branchCommand4 [] = "cd ; cd CubeWorks4/TXISR/TXServiceCode ; gcc TXServiceCode.c -o TXService.run; cd ;";
char upDateCommand [] = "cd ; cd CubeWorks0/ ; gcc upDateCode.c -o upDateCode.exe ; cp upDateCode.exe ~/ ; rm upDateCode.exe";
char testingCommand [] = "cd ; cd CubeWorks0/ ; gcc setNewTXWindow.c -o setNewTXWindow.exe ; mkdir ../TXISRData; sudo cp setNewTXWindow.exe ~/TXISRData/setNewTXWindow.exe ; rm setNewTXWindow.exe";
// #update and install python
// #NO long in use cause the version are lock for FLIGHT!
// # sudo apt full-upgrade
// # sudo apt-get update
// # sudo apt install python3
// # sudo apt install python3-pip
// # sudo apt install python3-numpy
// # sudo apt install git
void main()
{
printf("\n>>>Creating a CubeWorks0<<<\n");
//install the first code base
system(cammand0);
// //install the code bases
printf("\n>>>Creating a CubeWorks1<<<\n");
system(cammand1);
printf("\n>>>Creating a CubeWorks2<<<\n");
system(cammand2);
printf("\n>>>Creating a CubeWorks3<<<\n");
system(cammand3);
printf("\n>>>Creating a CubeWorks4<<<\n");
system(cammand4);
//complie the code
printf("\n>>>Creating tx routine for CubeWorks0<<<\n");
system(branchCommand0);
printf("\n>>>Creating tx routine for CubeWorks1<<<\n");
system(branchCommand1);
printf("\n>>>Creating tx routine for CubeWorks2<<<\n");
system(branchCommand2);
printf("\n>>>Creating tx routine for CubeWorks3<<<\n");
system(branchCommand3);
printf("\n>>>Creating tx routine for CubeWorks4<<<\n");
system(branchCommand4);
//create the upDate code
printf("\n>>>Creating update code<<<\n");
system(upDateCommand);
//Create the set new txWindows code
printf("\n>>>Creating setTXWindows routine<<<\n");
system(testingCommand);
//create the start up code, and then move it to the root
printf("\n>>>creating multi-code base protocol\n");
system("cd CubeWorks0\ngcc startup.c -o startup.exe\ncp startup.exe ~/");
//up date the crontab to run the startup.exe
// printf("\n>>>creating start up proticol<<<\n");
// system("sudo crontab -l > mycron");
// system("echo @reboot sudo runuser pi -c cd ; ./startup.exe >> mycron");
// system("sudo crontab mycron");
// system("rm mycron");
printf(">>rebooting to finish installation<<<\n");
system("sudo reboot");
}