Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
44ad7ff6
Unverified
Commit
44ad7ff6
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Set username on first boot of mesh client
parent
a8007caa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-image-customise
+30
-0
30 additions, 0 deletions
src/freedombone-image-customise
src/freedombone-image-mesh
+5
-0
5 additions, 0 deletions
src/freedombone-image-mesh
with
35 additions
and
0 deletions
src/freedombone-image-customise
+
30
−
0
View file @
44ad7ff6
...
...
@@ -577,6 +577,7 @@ function mesh_client_startup_applications {
fi
START_DESKTOP
=
$rootdir
/home/
$MY_USERNAME
/mesh-desktop.sh
FIRST_BOOT
=
/home/
$MY_USERNAME
/.first_boot
echo
'#!/bin/bash'
>
$START_DESKTOP
echo
'dconf write /org/mate/caja/desktop/volumes-visible false'
>>
$START_DESKTOP
echo
'dconf write /org/mate/caja/desktop/computer-icon-visible false'
>>
$START_DESKTOP
...
...
@@ -590,6 +591,35 @@ function mesh_client_startup_applications {
echo
"chmod 600 /home/
$MY_USERNAME
/.dbus/Xdbus"
>>
$START_DESKTOP
echo
"env | grep DBUS_SESSION_BUS_ADDRESS > /home/
$MY_USERNAME
/.dbus/Xdbus"
>>
$START_DESKTOP
echo
"echo 'export DBUS_SESSION_BUS_ADDRESS' >> /home/
$MY_USERNAME
/.dbus/Xdbus"
>>
$START_DESKTOP
echo
''
>>
$START_DESKTOP
echo
"if [ ! -f
$FIRST_BOOT
]; then"
>>
$START_DESKTOP
echo
' exit 0'
>>
$START_DESKTOP
echo
'fi'
>>
$START_DESKTOP
echo
''
>>
$START_DESKTOP
echo
'INITIAL_TOX_USERNAME='
>>
$START_DESKTOP
echo
'while [ ! $INITIAL_TOX_USERNAME ]; do'
>>
$START_DESKTOP
echo
' data=$(tempfile 2>/dev/null)'
>>
$START_DESKTOP
echo
' trap "rm -f $data" 0 1 2 5 15'
>>
$START_DESKTOP
echo
' dialog --title $"Freedombone Mesh" \'
>>
$START_DESKTOP
echo
' --backtitle $"Freedombone Mesh" \'
>>
$START_DESKTOP
echo
' --inputbox $"\nWelcome to the Freedombone mesh.\n\nThe first thing you will need to do is set a username so that other peers can find you." 12 60 "Anon" 2>$data'
>>
$START_DESKTOP
echo
' sel=$?'
>>
$START_DESKTOP
echo
' case $sel in'
>>
$START_DESKTOP
echo
' 0)'
>>
$START_DESKTOP
echo
' INITIAL_TOX_USERNAME=$(<$data)'
>>
$START_DESKTOP
echo
' if [ ${#INITIAL_TOX_USERNAME} -lt 1 ]; then'
>>
$START_DESKTOP
echo
' INITIAL_TOX_USERNAME='
>>
$START_DESKTOP
echo
' fi'
>>
$START_DESKTOP
echo
' ;;'
>>
$START_DESKTOP
echo
' esac'
>>
$START_DESKTOP
echo
'done'
>>
$START_DESKTOP
echo
''
>>
$START_DESKTOP
echo
'toxid --setuser "$INITIAL_TOX_USERNAME"'
>>
$START_DESKTOP
echo
''
>>
$START_DESKTOP
echo
"rm -f
$FIRST_BOOT
"
>>
$START_DESKTOP
echo
''
>>
$START_DESKTOP
echo
'exit 0'
>>
$START_DESKTOP
chmod
+x
$START_DESKTOP
START_DESKTOP2
=
$rootdir
/home/
$MY_USERNAME
/.config/autostart/mesh-start.desktop
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-image-mesh
+
5
−
0
View file @
44ad7ff6
...
...
@@ -54,6 +54,7 @@ MESH_INSTALL_DIR=/var/lib
MESH_INSTALL_COMPLETED
=
/root/.mesh_setup_completed
MESH_INSTALL_SETUP
=
/root/.initial_mesh_setup
MESH_AMNESIC
=
/root/.amnesic
FIRST_BOOT
=
/home/
$MY_USERNAME
/.first_boot
# Tomb containing logs
TOMB_LOG_SIZE_MB
=
10
...
...
@@ -820,6 +821,10 @@ if [ -f $MESH_INSTALL_SETUP ]; then
if
[
!
-f
$MESH_INSTALL_COMPLETED
]
;
then
echo
$'Mesh node setup complete'
>>
$INSTALL_LOG
touch
$MESH_INSTALL_COMPLETED
if
[
-d
/home/
$MY_USERNAME
/Desktop
]
;
then
touch
$FIRST_BOOT
chown
${
MY_USERNAME
}
:
${
MY_USERNAME
}
$FIRST_BOOT
fi
reboot
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment