| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE.md file. | 4 # BSD-style license that can be found in the LICENSE.md file. |
| 5 # | 5 # |
| 6 # Script for preparing the Raspberry Pi2 image for easy installation of the | 6 # Script for preparing the Raspberry Pi2 image for easy installation of the |
| 7 # fletch agent. All this script does is basically to comment out a few lines | 7 # dartino agent. All this script does is basically to comment out a few lines |
| 8 # in /etc/fstab and /etc/ld.so.preload. | 8 # in /etc/fstab and /etc/ld.so.preload. |
| 9 # | 9 # |
| 10 # It is expected that the script producing the actual release image will remove | 10 # It is expected that the script producing the actual release image will remove |
| 11 # the comment characters to reenable the full system for running on the pi. | 11 # the comment characters to reenable the full system for running on the pi. |
| 12 # | 12 # |
| 13 # TODO(ricow): you can't currently startup the raspbian jessie image with | 13 # TODO(ricow): you can't currently startup the raspbian jessie image with |
| 14 # init=/bin/bash if the ld.so.preload file has not been commented out. Since | 14 # init=/bin/bash if the ld.so.preload file has not been commented out. Since |
| 15 # other people is also experiencing issues with this we should revisit in the | 15 # other people is also experiencing issues with this we should revisit in the |
| 16 # future. | 16 # future. |
| 17 # | 17 # |
| 18 # We push the output of this run to a bundle on google cloud storage and use | 18 # We push the output of this run to a bundle on google cloud storage and use |
| 19 # that to create the actual bundles with specific fletch vm/agents on them. | 19 # that to create the actual bundles with specific dartino vm/agents on them. |
| 20 # | 20 # |
| 21 # PLEASE NOTE THAT THIS SCRIPT WILL DO IN PLACE UPDATING | 21 # PLEASE NOTE THAT THIS SCRIPT WILL DO IN PLACE UPDATING |
| 22 | 22 |
| 23 set -u | 23 set -u |
| 24 set -e | 24 set -e |
| 25 | 25 |
| 26 umask 0027 | 26 umask 0027 |
| 27 | 27 |
| 28 function usage { | 28 function usage { |
| 29 USAGE="Usage: $0 image_file | 29 USAGE="Usage: $0 image_file |
| (...skipping 23 matching lines...) Expand all Loading... |
| 53 sudo mount $1 -o loop,offset=$((122880*512)),rw $MOUNT_DIR | 53 sudo mount $1 -o loop,offset=$((122880*512)),rw $MOUNT_DIR |
| 54 | 54 |
| 55 echo "Fixing ld.so.preload" | 55 echo "Fixing ld.so.preload" |
| 56 sudo sed -i 's/^/#/' $MOUNT_DIR/etc/ld.so.preload | 56 sudo sed -i 's/^/#/' $MOUNT_DIR/etc/ld.so.preload |
| 57 | 57 |
| 58 echo "Fixing fstab" | 58 echo "Fixing fstab" |
| 59 sudo sed -i '/mmcblk/s/^/#/g' $MOUNT_DIR/etc/fstab | 59 sudo sed -i '/mmcblk/s/^/#/g' $MOUNT_DIR/etc/fstab |
| 60 | 60 |
| 61 echo "Umounting" | 61 echo "Umounting" |
| 62 sudo umount $MOUNT_DIR | 62 sudo umount $MOUNT_DIR |
| OLD | NEW |