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
d1388191
Commit
d1388191
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Fix broken chroot
parent
3c74fc83
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-tox
+55
-19
55 additions, 19 deletions
src/freedombone-app-tox
with
55 additions
and
19 deletions
src/freedombone-app-tox
+
55
−
19
View file @
d1388191
...
...
@@ -369,15 +369,19 @@ function mesh_tox_node {
exit
16865
fi
mesh_tox_node_prefix
=
''
if
[
$rootdir
]
;
then
mesh_tox_node_prefix
=
"chroot
\"
$rootdir
\"
"
chroot
${
rootdir
}
apt-get
-y
install
build-essential libtool autotools-dev
chroot
${
rootdir
}
apt-get
-y
install
automake checkinstall check git yasm
chroot
${
rootdir
}
apt-get
-y
install
libsodium13 libsodium-dev libcap2-bin
chroot
${
rootdir
}
apt-get
-y
install
libconfig9 libconfig-dev autoconf
chroot
${
rootdir
}
apt-get
-y
install
libopus-dev libvpx-dev
else
apt-get
-y
install
build-essential libtool autotools-dev
apt-get
-y
install
automake checkinstall check git yasm
apt-get
-y
install
libsodium13 libsodium-dev libcap2-bin
apt-get
-y
install
libconfig9 libconfig-dev autoconf
apt-get
-y
install
libopus-dev libvpx-dev
fi
$mesh_tox_node_prefix
apt-get
-y
install
build-essential libtool autotools-dev
$mesh_tox_node_prefix
apt-get
-y
install
automake checkinstall check git yasm
$mesh_tox_node_prefix
apt-get
-y
install
libsodium13 libsodium-dev libcap2-bin
$mesh_tox_node_prefix
apt-get
-y
install
libconfig9 libconfig-dev autoconf
$mesh_tox_node_prefix
apt-get
-y
install
libopus-dev libvpx-dev
if
[
!
-d
${
rootdir
}${
INSTALL_DIR
}
]
;
then
mkdir
-p
${
rootdir
}${
INSTALL_DIR
}
...
...
@@ -389,18 +393,32 @@ function mesh_tox_node {
cd
${
rootdir
}
$INSTALL_DIR
/toxcore
git checkout
$TOXCORE_COMMIT
-b
$TOXCORE_COMMIT
$mesh_tox_node_prefix
/bin/bash
-x
<<
EOF
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
/bin/bash
-x
<<
EOF
cd
${
INSTALL_DIR
}
/toxcore
autoreconf -i
./configure --enable-daemon
make
make install
EOF
else
/bin/bash
-x
<<
EOF
cd
${
INSTALL_DIR
}
/toxcore
autoreconf -i
./configure --enable-daemon
make
make install
EOF
fi
cp
$rootdir
/usr/local/lib/libtoxcore
*
$rootdir
/usr/lib/
cp
${
rootdir
}${
INSTALL_DIR
}
/toxcore/other/bootstrap_daemon/tox-bootstrapd.service
$rootdir
/etc/systemd/system/
sed
-i
's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g'
$rootdir
/etc/systemd/system/tox-bootstrapd.service
$mesh_tox_node_prefix
systemctl
enable
tox-bootstrapd.service
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
systemctl
enable
tox-bootstrapd.service
else
systemctl
enable
tox-bootstrapd.service
fi
SECONDS
=
0
if
[
!
-f
$rootdir
/usr/local/bin/tox-bootstrapd
]
;
then
...
...
@@ -412,8 +430,13 @@ EOF
duration
=
$SECONDS
echo
$"Toxcore compile
$((
$duration
/
60
))
minutes and
$((
$duration
%
60
))
seconds elapsed."
$mesh_tox_node_prefix
useradd
--home-dir
/var/lib/tox-bootstrapd
--create-home
--system
--shell
/sbin/nologin
--comment
$"Account to run Tox's DHT bootstrap daemon"
--user-group
tox-bootstrapd
$mesh_tox_node_prefix
chmod
700 /var/lib/tox-bootstrapd
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
useradd
--home-dir
/var/lib/tox-bootstrapd
--create-home
--system
--shell
/sbin/nologin
--comment
$"Account to run Tox's DHT bootstrap daemon"
--user-group
tox-bootstrapd
chroot
${
rootdir
}
chmod
700 /var/lib/tox-bootstrapd
else
useradd
--home-dir
/var/lib/tox-bootstrapd
--create-home
--system
--shell
/sbin/nologin
--comment
$"Account to run Tox's DHT bootstrap daemon"
--user-group
tox-bootstrapd
chmod
700 /var/lib/tox-bootstrapd
fi
# remove Maildir
if
[
-d
$rootdir
/var/lib/tox-bootstrapd/Maildir
]
;
then
...
...
@@ -488,11 +511,19 @@ function mesh_tox_avahi {
exit
768352
fi
$mesh_tox_avahi_prefix
/bin/bash
-x
<<
EOF
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
/bin/bash
-x
<<
EOF
cd
${
INSTALL_DIR
}
/toxid
make
make install
EOF
else
/bin/bash
-x
<<
EOF
cd
${
INSTALL_DIR
}
/toxid
make
make install
EOF
fi
if
[
!
-f
$rootdir
/usr/local/bin/toxid
]
;
then
echo
$'toxid not found'
...
...
@@ -505,10 +536,6 @@ EOF
}
function
mesh_tox_client
{
mesh_tox_client_prefix
=
''
if
[
$rootdir
]
;
then
mesh_tox_client_prefix
=
"chroot
\"
$rootdir
\"
"
fi
TOXIC_FILE
=
$(
cat
/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-tox
|
grep
"TOXIC_FILE="
|
head
-n
1 |
awk
-F
'='
'{print $2}'
)
...
...
@@ -523,8 +550,13 @@ function mesh_tox_client {
TOXIC_REPO
=
$TOXIC_REPO_MAIN
fi
$mesh_tox_client_prefix
apt-get
-y
install
libncursesw5-dev libconfig-dev libqrencode-dev
$mesh_tox_client_prefix
apt-get
-y
install
libcurl4-openssl-dev libvpx-dev libopenal-dev
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
apt-get
-y
install
libncursesw5-dev libconfig-dev libqrencode-dev
chroot
${
rootdir
}
apt-get
-y
install
libcurl4-openssl-dev libvpx-dev libopenal-dev
else
apt-get
-y
install
libncursesw5-dev libconfig-dev libqrencode-dev
apt-get
-y
install
libcurl4-openssl-dev libvpx-dev libopenal-dev
fi
TEMP_SCRIPT_NAME
=
fbtmp728353.sh
TEMP_SCRIPT
=
/tmp/
$TEMP_SCRIPT_NAME
...
...
@@ -545,7 +577,11 @@ function mesh_tox_client {
TOXIC_FILE
=
$(
cat
/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-tox
|
grep
"TOXIC_FILE="
|
head
-n
1 |
awk
-F
'='
'{print $2}'
)
SECONDS
=
0
$mesh_tox_client_prefix
/root/
$TEMP_SCRIPT_NAME
if
[
${
rootdir
}
]
;
then
chroot
${
rootdir
}
/root/
$TEMP_SCRIPT_NAME
else
/root/
$TEMP_SCRIPT_NAME
fi
if
[
!
"
$?
"
=
"0"
]
;
then
duration
=
$SECONDS
echo
$"Toxic client compile failed at
$((
$duration
/
60
))
minutes and
$((
$duration
%
60
))
seconds elapsed."
...
...
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