Procházet zdrojové kódy

Write freedombone commands to the microSD card

Bob Mottram před 10 roky
rodič
revize
4fd0c97cb0
1 změnil soubory, kde provedl 10 přidání a 8 odebrání
  1. 10
    8
      src/freedombone-prep

+ 10
- 8
src/freedombone-prep Zobrazit soubor

@@ -225,6 +225,13 @@ $SUDO sed -i '/iface usb0 inet static/,/    gateway 192.168.7.1/ s/^/#/' $MICROS
225 225
 $SUDO sed -i "s/nameserver.*/nameserver $NAMESERVER1/g" $MICROSD_MOUNT_POINT/$ROOTFS/etc/resolv.conf
226 226
 $SUDO sed -i "/nameserver $NAMESERVER1/a\nameserver $NAMESERVER2" $MICROSD_MOUNT_POINT/$ROOTFS/etc/resolv.conf
227 227
 
228
+# copy the commands to the card
229
+$SUDO cp -f /usr/local/bin/freedombone* $MICROSD_MOUNT_POINT/$ROOTFS/usr/local/bin/
230
+if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS/usr/local/bin/freedombone ]; then
231
+    echo 'There was a problem with writing freedombone commands to the SD card'
232
+    exit 8736
233
+fi
234
+
228 235
 # change the motd to show further install instructions
229 236
 echo 'Become the root user by typing:' > $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
230 237
 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
243 250
 echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
244 251
 echo '    ssh [username]@$BBB_FIXED_IP_ADDRESS' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
245 252
 echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
246
-echo 'and use the "su" command to become the root user again. You can then load' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
247
-echo 'the freedombone main installation script with:' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
248
-echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
249
-echo '    apt-get update' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
250
-echo '    apt-get -y install git dialog build-essential' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
251
-echo '    git clone https://github.com/bashrc/freedombone.git' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
252
-echo '    cd freedombone' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
253
-echo '    make install' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
253
+echo 'and use the "su" command to become the root user again.' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
254 254
 echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
255 255
 echo 'Finally you can use the freedombone command to install a server configuration:' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
256 256
 echo '' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
257
+echo '    apt-get update' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
258
+echo '    apt-get -y install git dialog build-essential' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
257 259
 echo '    freedombone menuconfig' >> $MICROSD_MOUNT_POINT/$ROOTFS/etc/motd
258 260
 
259 261
 clear