From 4fd0c97cb084b599fffc702c566a76b1dab7f0b3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 13 Feb 2015 23:31:29 +0000 Subject: [PATCH] Write freedombone commands to the microSD card --- src/freedombone-prep | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/freedombone-prep b/src/freedombone-prep index 8ec2adc5..a5bb28c6 100755 --- a/src/freedombone-prep +++ b/src/freedombone-prep @@ -225,6 +225,13 @@ $SUDO sed -i '/iface usb0 inet static/,/ gateway 192.168.7.1/ s/^/#/' $MICROS $SUDO sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $MICROSD_MOUNT_POINT/$ROOTFS/etc/resolv.conf $SUDO sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $MICROSD_MOUNT_POINT/$ROOTFS/etc/resolv.conf +# copy the commands to the card +$SUDO cp -f /usr/local/bin/freedombone* $MICROSD_MOUNT_POINT/$ROOTFS/usr/local/bin/ +if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS/usr/local/bin/freedombone ]; then + echo 'There was a problem with writing freedombone commands to the SD card' + exit 8736 +fi + # change the motd to show further install instructions echo 'Become the root user by typing:' > $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd @@ -243,17 +250,12 @@ echo 'then log back in as the user you just created with:' >> $MICROSD_MOUNT_POI echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo ' ssh [username]@$BBB_FIXED_IP_ADDRESS' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo 'and use the "su" command to become the root user again. You can then load' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo 'the freedombone main installation script with:' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo ' apt-get update' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo ' apt-get -y install git dialog build-essential' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo ' git clone https://github.com/bashrc/freedombone.git' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo ' cd freedombone' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd -echo ' make install' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd +echo 'and use the "su" command to become the root user again.' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo 'Finally you can use the freedombone command to install a server configuration:' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd +echo ' apt-get update' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd +echo ' apt-get -y install git dialog build-essential' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd echo ' freedombone menuconfig' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd clear