Bob Mottram vor 8 Jahren
Ursprung
Commit
51e9f9fa47
4 geänderte Dateien mit 46 neuen und 40 gelöschten Zeilen
  1. 9
    9
      src/freedombone-app-ipfs
  2. 3
    3
      src/freedombone-app-tox
  3. 1
    1
      src/freedombone-image
  4. 33
    27
      src/freedombone-image-customise

+ 9
- 9
src/freedombone-app-ipfs Datei anzeigen

@@ -231,7 +231,7 @@ npm install -g ronin@${IPFS_JS_RONIN_VERSION} --save
231 231
 npm install -g ipfs@${IPFS_JS_VERSION} --save
232 232
 exit 0
233 233
 EOF
234
-    chroot ${rootdir} chmod +x /root/install-ipfs.sh
234
+    chroot ${rootdir} /bin/chmod +x /root/install-ipfs.sh
235 235
     chroot ${rootdir} /root/install-ipfs.sh
236 236
     rm -f ${rootdir}/root/install-ipfs.sh
237 237
 
@@ -243,17 +243,17 @@ EOF
243 243
 
244 244
     # directories to mount to
245 245
     if [ ! -d ${rootdir}/ipfs ]; then
246
-        chroot ${rootdir} mkdir /ipfs
247
-        chroot ${rootdir} mkdir /ipns
248
-        chroot ${rootdir} chown $MY_USERNAME:$MY_USERNAME /ipfs
249
-        chroot ${rootdir} chown $MY_USERNAME:$MY_USERNAME /ipns
246
+        chroot ${rootdir} /bin/mkdir /ipfs
247
+        chroot ${rootdir} /bin/mkdir /ipns
248
+        chroot ${rootdir} /bin/chown $MY_USERNAME:$MY_USERNAME /ipfs
249
+        chroot ${rootdir} /bin/chown $MY_USERNAME:$MY_USERNAME /ipns
250 250
     fi
251 251
 
252 252
     if [ -f ${rootdir}/etc/fuse.conf ]; then
253
-        chroot ${rootdir} chown $MY_USERNAME:$MY_USERNAME /etc/fuse.conf
253
+        chroot ${rootdir} /bin/chown $MY_USERNAME:$MY_USERNAME /etc/fuse.conf
254 254
     fi
255 255
     if [ -f ${rootdir}/dev/fuse ]; then
256
-        chroot ${rootdir} chown $MY_USERNAME:$MY_USERNAME /dev/fuse
256
+        chroot ${rootdir} /bin/chown $MY_USERNAME:$MY_USERNAME /dev/fuse
257 257
     fi
258 258
 
259 259
     IPFS_DAEMON_NAME=ipfs
@@ -415,7 +415,7 @@ function mesh_install_ipfs_go {
415 415
         echo $"ipfs was not found in downloaded package"
416 416
         exit 638235
417 417
     fi
418
-    chroot "$rootdir" cp $INSTALL_DIR/ipfs/go-ipfs/ipfs $IPFS_PATH
418
+    chroot "$rootdir" /bin/cp $INSTALL_DIR/ipfs/go-ipfs/ipfs $IPFS_PATH
419 419
     if [ ! -f $rootdir$IPFS_PATH/ipfs ]; then
420 420
         echo $'IPFS was not installed'
421 421
         exit 63722
@@ -434,7 +434,7 @@ function mesh_install_ipfs_go {
434 434
     echo '' >> $IPFS_USER_DAEMON
435 435
     echo '[Install]' >> $IPFS_USER_DAEMON
436 436
     echo 'WantedBy=default.target' >> $IPFS_USER_DAEMON
437
-    chroot ${rootdir} chown -R $MY_USERNAME:$MY_USERNAME /home/${MY_USERNAME}/.config
437
+    chroot ${rootdir} /bin/chown -R $MY_USERNAME:$MY_USERNAME /home/${MY_USERNAME}/.config
438 438
 }
439 439
 
440 440
 function install_ipfs_go {

+ 3
- 3
src/freedombone-app-tox Datei anzeigen

@@ -465,8 +465,8 @@ EOF
465 465
     echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
466 466
 
467 467
     if [ ${rootdir} ]; then
468
-        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
469
-        chroot ${rootdir} chmod 700 /var/lib/tox-bootstrapd
468
+        chroot ${rootdir} /usr/sbin/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
469
+        chroot ${rootdir} /bin/chmod 700 /var/lib/tox-bootstrapd
470 470
     else
471 471
         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
472 472
         chmod 700 /var/lib/tox-bootstrapd
@@ -641,7 +641,7 @@ function enable_tox_repo {
641 641
     echo 'deb http://download.opensuse.org/repositories/home:/antonbatenev:/tox/Debian_8.0/ /' > $rootdir/etc/apt/sources.list.d/tox.list
642 642
 
643 643
 
644
-    chroot "$rootdir" wget -q http://download.opensuse.org/repositories/home:antonbatenev:tox/Debian_8.0/Release.key -O- | apt-key add -
644
+    chroot "$rootdir" /usr/bin/wget -q http://download.opensuse.org/repositories/home:antonbatenev:tox/Debian_8.0/Release.key -O- | apt-key add -
645 645
     chroot "$rootdir" apt-get update
646 646
     echo "Tox Repository Installed."
647 647
 }

+ 1
- 1
src/freedombone-image Datei anzeigen

@@ -136,7 +136,7 @@ function image_setup {
136 136
             sudo pacman -S --noconfirm libc++ git gcc gcc-libs python-docutils mktorrent patch
137 137
             sudo pacman -S --noconfirm debootstrap xz dosfstools btrfs-progs syslinux python-pip
138 138
             sudo pacman -S --noconfirm qemu-static binfmt-qemu-static uboot-tools qemu parted
139
-            sudo pacman -S --noconfirm dpkg-devtools bin86
139
+            sudo pacman -S --noconfirm dpkg-devtools bin86 arch-install-scripts
140 140
             mkdir ~/develop
141 141
             if [ ! -d ~/develop/python-cliapp ]; then
142 142
                 git clone git://git.liw.fi/cliapp ~/develop/python-cliapp

+ 33
- 27
src/freedombone-image-customise Datei anzeigen

@@ -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