forked from RPi-Distro/pi-gen
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RTKBASE last-realease. Delete cloud-init, add a service firstboot & m…
…ake stage_rtkbase. raspbian bookworm release
- Loading branch information
Showing
8 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Build a RTKbase image for Raspberry Pi | ||
|
||
## Installing qemu-user-static | ||
|
||
```sudo apt-get install qemu-user-static``` | ||
|
||
## clone and choose branch | ||
|
||
### Last release | ||
|
||
``` | ||
git clone https://github.com/CentipedeRTK/pi-gen_RTKbase.git | ||
git checkout last-release | ||
``` | ||
|
||
### Dev Branch | ||
|
||
``` | ||
git clone https://github.com/CentipedeRTK/pi-gen_RTKbase.git | ||
git checkout dev | ||
``` | ||
|
||
## make executable .sh | ||
|
||
``` | ||
cd pi-gen_RTKbase | ||
sudo find ./ -type f -iname "*.sh" -exec chmod +x {} \; | ||
``` | ||
|
||
## make a raspbery pi RTKbase img | ||
|
||
``` | ||
docker rm -v pigen_work | ||
sudo PRESERVE_CONTAINER=1 CONTINUE=1 ./build-docker.sh | ||
``` | ||
|
||
## debug & delete stage before rebuild | ||
|
||
``` | ||
docker run -it --privileged --volumes-from=pigen_work pi-gen /bin/bash | ||
rm -r /pi-gen/work/RTKBaseGNSS/stage_rtkbase | ||
``` | ||
|
||
|
||
## Lancer la fabrication en tâche de fond sur un serveur: | ||
|
||
* sudo apt-get install screen | ||
* lancer ```screen``` | ||
* lancer le build ```sudo PRESERVE_CONTAINER=1 CONTINUE=1 ./build-docker.sh``` | ||
* Pendant la fabrication appuyez simplement sur ```Ctrl + a``` immédiatement suivi de ```d``` pour se deconnecter de la console | ||
* connectez-vous de nouveau au terminal distant et tapez ```screen -r``` | ||
|
||
> https://fr.linux-console.net/?p=1143#gsc.tab=0 | ||
> http://kmdouglass.github.io/posts/create-a-custom-raspbian-image-with-pi-gen-part-1/ | ||
|
||
-------------------------------- | ||
|
||
other cmd: | ||
|
||
``` | ||
touch ./stage5/SKIP ./stage6/SKIP /stage7/SKIP | ||
touch ./stage5/SKIP_IMAGES ./stage6/SKIP_IMAGES ./stage7/SKIP_IMAGES | ||
docker rm -v pigen_work | ||
.sudo ./build-docker.sh | ||
sudo CONTINUE=1 ./build-docker.sh | ||
sudo PRESERVE_CONTAINER=1 ./build-docker.sh | ||
sudo PRESERVE_CONTAINER=1 CONTINUE=1 ./build-docker.sh | ||
sudo PRESERVE_CONTAINER=1 CONTINUE=1 CLEAN=1 ./build-docker.sh | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -e | ||
|
||
install -m 644 files/first_run.sh ${ROOTFS_DIR}/home/${FIRST_USER_NAME}/ | ||
install -m 644 files/firstboot.service ${ROOTFS_DIR}/lib/systemd/system/ | ||
install -m 644 files/firstboot.sh ${ROOTFS_DIR}/boot/ | ||
|
||
on_chroot << EOF | ||
cd /etc/systemd/system/multi-user.target.wants && ln -s /lib/systemd/system/firstboot.service | ||
cd /home/${FIRST_USER_NAME} | ||
find ./ -type f -iname "*.sh" -exec chmod +x {} \; | ||
./first_run.sh | ||
rm first_run.sh | ||
rm install.sh | ||
chmod +x /boot/firstboot.sh | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
_user="${PWD##*/}" | ||
cd /home/$_user | ||
|
||
## install last release | ||
wget https://raw.githubusercontent.com/Stefal/rtkbase/master/tools/install.sh | ||
chmod +x install.sh | ||
sed -i 's/df \"$HOME\"/df \//g' /home/${_user}/install.sh | ||
./install.sh --user ${_user} --dependencies --rtklib --rtkbase-release --gpsd-chrony | ||
find ./ -type f -iname "*.sh" -exec chmod +x {} \; | ||
|
||
|
||
## install dev branch | ||
#wget https://raw.githubusercontent.com/Stefal/rtkbase/dev/tools/install.sh | ||
#chmod +x install.sh | ||
#sed -i 's/df \"$HOME\"/df \//g' /home/${_user}/install.sh | ||
#./install.sh --user ${_user} --dependencies --rtklib --rtkbase-repo dev --gpsd-chrony | ||
#find ./ -type f -iname "*.sh" -exec chmod +x {} \; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=FirstBoot | ||
After=network.target apt-daily.service apt-daily-upgrade.service | ||
Before=rc-local.service | ||
ConditionFileNotEmpty=/boot/firstboot.sh | ||
|
||
[Service] | ||
ExecStart=/boot/firstboot.sh | ||
ExecStartPost=/bin/mv /boot/firstboot.sh /boot/firstboot.sh.done | ||
Type=oneshot | ||
RemainAfterExit=no | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
cd /home/basegnss/rtkbase/tools && \ | ||
sudo ./install.sh --user basegnss --unit-files --detect-modem --detect-gnss --configure-gnss --start-services |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -e | ||
|
||
if [ ! -d "${ROOTFS_DIR}" ]; then | ||
copy_previous | ||
fi |