11#! /bin/bash
2- # build_ramdisk.sh - Build RAM disk images
32
4- # exit on error to stop unexpected errors
3+ # **build_ramdisk.sh**
4+
5+ # Build RAM disk images
6+
7+ # Exit on error to stop unexpected errors
58set -o errexit
69
710if [ ! " $# " -eq " 1" ]; then
8487# Finds the next available NBD device
8588# Exits script if error connecting or none free
8689# map_nbd image
87- # returns full nbd device path
90+ # Returns full nbd device path
8891function map_nbd {
8992 for i in ` seq 0 15` ; do
9093 if [ ! -e /sys/block/nbd$i /pid ]; then
@@ -105,7 +108,7 @@ function map_nbd {
105108 echo $NBD
106109}
107110
108- # prime image with as many apt/pips as we can
111+ # Prime image with as many apt/pips as we can
109112DEV_FILE=$CACHEDIR /$DIST_NAME -dev.img
110113DEV_FILE_TMP=` mktemp $DEV_FILE .XXXXXX`
111114if [ ! -r $DEV_FILE ]; then
@@ -127,11 +130,11 @@ if [ ! -r $DEV_FILE ]; then
127130 mkdir -p $MNTDIR /$DEST
128131 chroot $MNTDIR chown stack $DEST
129132
130- # a simple password - pass
133+ # A simple password - pass
131134 echo stack:pass | chroot $MNTDIR chpasswd
132135 echo root:$ROOT_PASSWORD | chroot $MNTDIR chpasswd
133136
134- # and has sudo ability (in the future this should be limited to only what
137+ # And has sudo ability (in the future this should be limited to only what
135138 # stack requires)
136139 echo " stack ALL=(ALL) NOPASSWD: ALL" >> $MNTDIR /etc/sudoers
137140
@@ -143,7 +146,8 @@ if [ ! -r $DEV_FILE ]; then
143146fi
144147rm -f $DEV_FILE_TMP
145148
146- # clone git repositories onto the system
149+
150+ # Clone git repositories onto the system
147151# ======================================
148152
149153IMG_FILE_TMP=` mktemp $IMG_FILE .XXXXXX`
0 commit comments