|
@@ -118,18 +118,20 @@ ENABLE_ZERONET=
|
118
|
118
|
|
119
|
119
|
MESH_TEXT_EDITOR='pluma'
|
120
|
120
|
|
|
121
|
+PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
122
|
+
|
121
|
123
|
function configure_backports {
|
122
|
124
|
echo "deb http://${DEBIAN_REPO}/debian/ ${DEBIAN_VERSION}-backports main" >> $rootdir/etc/apt/sources.list
|
123
|
125
|
}
|
124
|
126
|
|
125
|
127
|
function configure_contrib_repo {
|
126
|
128
|
if ! grep -q "contrib" $rootdir/etc/apt/sources.list; then
|
127
|
|
- chroot "$rootdir" sed -i "s| main| main contrib|g" /etc/apt/sources.list
|
|
129
|
+ chroot "$rootdir" /bin/sed -i "s| main| main contrib|g" /etc/apt/sources.list
|
128
|
130
|
fi
|
129
|
131
|
}
|
130
|
132
|
|
131
|
133
|
enable_eatmydata_override() {
|
132
|
|
- chroot $rootdir apt-get install --no-install-recommends -y eatmydata
|
|
134
|
+ chroot $rootdir apt-get install -y eatmydata
|
133
|
135
|
if [ -x $rootdir/usr/bin/eatmydata ] && \
|
134
|
136
|
[ ! -f $rootdir/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then
|
135
|
137
|
echo $"info: Adding apt config to call dpkg via eatmydata"
|
|
@@ -269,7 +271,7 @@ configure_ssh() {
|
269
|
271
|
mkdir $rootdir/home/$MY_USERNAME/.ssh
|
270
|
272
|
fi
|
271
|
273
|
echo "$SSH_PUBKEY" > $rootdir/home/$MY_USERNAME/.ssh/authorized_keys
|
272
|
|
- chroot $rootdir chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
|
|
274
|
+ chroot $rootdir /bin/chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh
|
273
|
275
|
sed -i 's|PasswordAuthentication.*|PasswordAuthentication no|g' $rootdir/etc/ssh/sshd_config
|
274
|
276
|
echo $"Using ssh public key:"
|
275
|
277
|
echo $SSH_PUBKEY
|
|
@@ -309,7 +311,7 @@ create_generic_image() {
|
309
|
311
|
# The presence of this file indicates that the initial
|
310
|
312
|
# setup has not yet been completed
|
311
|
313
|
touch $rootdir/home/$MY_USERNAME/.initial_setup
|
312
|
|
- chroot $rootdir chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.initial_setup
|
|
314
|
+ chroot $rootdir /bin/chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.initial_setup
|
313
|
315
|
touch $rootdir/root/.initial_setup
|
314
|
316
|
|
315
|
317
|
cat >> $rootdir/home/$MY_USERNAME/.bashrc <<EOF
|
|
@@ -539,7 +541,7 @@ initialise_mesh() {
|
539
|
541
|
|
540
|
542
|
# enable non-free repo
|
541
|
543
|
if ! grep -q "non-free" $rootdir/etc/apt/sources.list; then
|
542
|
|
- chroot "$rootdir" sed -i "s| main| main non-free|g" /etc/apt/sources.list
|
|
544
|
+ chroot "$rootdir" /bin/sed -i "s| main| main non-free|g" /etc/apt/sources.list
|
543
|
545
|
fi
|
544
|
546
|
|
545
|
547
|
chroot "$rootdir" apt-get update
|
|
@@ -600,7 +602,7 @@ function mesh_client_startup_applications {
|
600
|
602
|
|
601
|
603
|
if [ ! -d $rootdir/home/$MY_USERNAME/.config/autostart ]; then
|
602
|
604
|
mkdir -p $rootdir/home/$MY_USERNAME/.config/autostart
|
603
|
|
- chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config
|
|
605
|
+ chroot "$rootdir" /bin/chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config
|
604
|
606
|
fi
|
605
|
607
|
|
606
|
608
|
START_DESKTOP=$rootdir/home/$MY_USERNAME/mesh-desktop.sh
|
|
@@ -703,7 +705,7 @@ function mesh_desktop_icons {
|
703
|
705
|
#echo 'Icon=terminal' >> $rootdir/home/$MY_USERNAME/Desktop/terminal.desktop
|
704
|
706
|
#echo 'StartupNotify=true' >> $rootdir/home/$MY_USERNAME/Desktop/terminal.desktop
|
705
|
707
|
|
706
|
|
- chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop
|
|
708
|
+ chroot "$rootdir" /bin/chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop
|
707
|
709
|
}
|
708
|
710
|
|
709
|
711
|
function configure_user_interface {
|
|
@@ -842,8 +844,8 @@ else
|
842
|
844
|
fi
|
843
|
845
|
fi
|
844
|
846
|
EOF
|
845
|
|
- chroot "$rootdir" chown $MY_USERNAME:$MY_USERNAME /usr/bin/list-tox-users
|
846
|
|
- chroot "$rootdir" chmod +x /usr/bin/list-tox-users
|
|
847
|
+ chroot "$rootdir" /bin/chown $MY_USERNAME:$MY_USERNAME /usr/bin/list-tox-users
|
|
848
|
+ chroot "$rootdir" /bin/chmod +x /usr/bin/list-tox-users
|
847
|
849
|
echo "* * * * * $MY_USERNAME bash -c /usr/bin/list-tox-users > /dev/null" >> $rootdir/etc/crontab
|
848
|
850
|
|
849
|
851
|
if [[ $VARIANT != "usb" ]]; then
|
|
@@ -874,7 +876,7 @@ EOF
|
874
|
876
|
if [ -f $MESH_DESKTOP_BACKGROUND_IMAGE ]; then
|
875
|
877
|
if [ -d $rootdir/usr/share/images/desktop-base ]; then
|
876
|
878
|
cp $MESH_DESKTOP_BACKGROUND_IMAGE $rootdir/usr/share/images/desktop-base/${PROJECT_NAME}_mesh_background.png
|
877
|
|
- chroot "$rootdir" rm /usr/share/images/desktop-base/desktop-background
|
|
879
|
+ chroot "$rootdir" /bin/rm /usr/share/images/desktop-base/desktop-background
|
878
|
880
|
chroot "$rootdir" ln -s /usr/share/images/desktop-base/${PROJECT_NAME}_mesh_background.png /usr/share/images/desktop-base/desktop-background
|
879
|
881
|
fi
|
880
|
882
|
fi
|
|
@@ -890,7 +892,7 @@ EOF
|
890
|
892
|
mkdir -p $rootdir/home/${MY_USERNAME}/help/images
|
891
|
893
|
cd $rootdir/root/${PROJECT_NAME}/website
|
892
|
894
|
./deploy.sh EN $rootdir/home/${MY_USERNAME}/help
|
893
|
|
- chroot "$rootdir" chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/help
|
|
895
|
+ chroot "$rootdir" /bin/chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/help
|
894
|
896
|
|
895
|
897
|
# Tox user interface
|
896
|
898
|
enable_tox_repo
|
|
@@ -899,7 +901,7 @@ EOF
|
899
|
901
|
if [ ! -d ${rootdir}/home/${MY_USERNAME}/.config/tox ]; then
|
900
|
902
|
mkdir ${rootdir}/home/${MY_USERNAME}/.config/tox
|
901
|
903
|
cp /usr/local/bin/${PROJECT_NAME}-config-qtox ${rootdir}/home/${MY_USERNAME}/.config/tox/qtox.ini
|
902
|
|
- chroot "$rootdir" chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.config
|
|
904
|
+ chroot "$rootdir" /bin/chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.config
|
903
|
905
|
fi
|
904
|
906
|
|
905
|
907
|
if [[ $VARIANT == "usb" ]]; then
|
|
@@ -914,7 +916,7 @@ EOF
|
914
|
916
|
chroot "$rootdir" mkdir /home/$GENERIC_IMAGE_USERNAME/.local/share/gajim/plugins -p
|
915
|
917
|
chroot "$rootdir" git clone https://github.com/omemo/gajim-omemo /home/$GENERIC_IMAGE_USERNAME/.local/share/gajim/plugins/gajim-omemo
|
916
|
918
|
chroot "$rootdir" pip install protobuf==2.6.1, python-axolotl==0.1.35
|
917
|
|
- chroot "$rootdir" chown -R $GENERIC_IMAGE_USERNAME:$GENERIC_IMAGE_USERNAME /home/$GENERIC_IMAGE_USERNAME/.local
|
|
919
|
+ chroot "$rootdir" /bin/chown -R $GENERIC_IMAGE_USERNAME:$GENERIC_IMAGE_USERNAME /home/$GENERIC_IMAGE_USERNAME/.local
|
918
|
920
|
|
919
|
921
|
# IRC client
|
920
|
922
|
chroot "$rootdir" apt-get -y install hexchat profanity
|
|
@@ -948,22 +950,26 @@ fi
|
948
|
950
|
username=$MY_USERNAME
|
949
|
951
|
echo $"warning: creating initial user $username with well known password!"
|
950
|
952
|
password=$MY_PASSWORD
|
|
953
|
+chroot "$rootdir" /usr/bin/env -i \
|
|
954
|
+ HOME=/root \
|
|
955
|
+ PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
956
|
+echo "export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:" >> $rootdir/root/.bashrc
|
951
|
957
|
chroot "$rootdir" adduser --gecos $username --disabled-password $username
|
952
|
|
-echo $username:$password | chroot $rootdir /usr/sbin/chpasswd
|
|
958
|
+echo $username:$password | chroot "$rootdir" /usr/sbin/chpasswd
|
953
|
959
|
chroot "$rootdir" adduser $username sudo
|
954
|
960
|
|
955
|
|
-case "$MACHINE" in
|
956
|
|
- virtualbox)
|
957
|
|
- # hide irrelevant console keyboard messages.
|
958
|
|
- echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
|
959
|
|
- >> /etc/init.d/rc.local
|
960
|
|
- ;;
|
961
|
|
- qemu)
|
962
|
|
- # hide irrelevant console keyboard messages.
|
963
|
|
- echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
|
964
|
|
- >> /etc/init.d/rc.local
|
965
|
|
- ;;
|
966
|
|
-esac
|
|
961
|
+#case "$MACHINE" in
|
|
962
|
+# virtualbox)
|
|
963
|
+# # hide irrelevant console keyboard messages.
|
|
964
|
+# echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
|
|
965
|
+# >> /etc/init.d/rc.local
|
|
966
|
+# ;;
|
|
967
|
+# qemu)
|
|
968
|
+# # hide irrelevant console keyboard messages.
|
|
969
|
+# echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
|
|
970
|
+# >> /etc/init.d/rc.local
|
|
971
|
+# ;;
|
|
972
|
+#esac
|
967
|
973
|
|
968
|
974
|
if [ ! $DEBIAN_REPO ]; then
|
969
|
975
|
DEBIAN_REPO='ftp.de.debian.org'
|
|
@@ -974,7 +980,7 @@ fi
|
974
|
980
|
|
975
|
981
|
set_apt_sources $BUILD_MIRROR
|
976
|
982
|
chroot "$rootdir" apt-get clean
|
977
|
|
-chroot "$rootdir" rm -rf /var/lib/apt/lists/*
|
|
983
|
+chroot "$rootdir" /bin/rm -rf /var/lib/apt/lists/*
|
978
|
984
|
chroot "$rootdir" apt-get clean
|
979
|
985
|
set_apt_sources $MIRROR
|
980
|
986
|
configure_backports
|