Correction: if then statement code style.
Corrected the if; then statement to follow bash convention. Change-Id: Ia3f80520bb9446c4feb5ce36dccffa2b1c1d72c4
This commit is contained in:
parent
5ee5aa5c89
commit
d06a1caafb
10
README.md
10
README.md
@ -368,12 +368,14 @@ Ramdisk elements support the following files in their element directories:
|
|||||||
|
|
||||||
* udev.d : udev rules files that will be copied into the ramdisk.
|
* udev.d : udev rules files that will be copied into the ramdisk.
|
||||||
|
|
||||||
### Whitespace Rules
|
### Element coding standard ###
|
||||||
|
|
||||||
- lines should not include trailing whitespace
|
- lines should not include trailing whitespace.
|
||||||
- there should be no hard tabs in the file
|
- there should be no hard tabs in the file.
|
||||||
- indents are 4 spaces, and all indentation should be some multiple of
|
- indents are 4 spaces, and all indentation should be some multiple of
|
||||||
them
|
them.
|
||||||
|
- `do` and `then` keywords should be on the same line as the if, while or
|
||||||
|
for conditions.
|
||||||
|
|
||||||
Global image-build variables
|
Global image-build variables
|
||||||
----------------------------
|
----------------------------
|
||||||
|
@ -26,8 +26,7 @@ export DIB_ENV=$(export | grep ' DIB_.*=')
|
|||||||
|
|
||||||
SCRIPTNAME=$(basename $0)
|
SCRIPTNAME=$(basename $0)
|
||||||
SCRIPT_HOME=$(dirname $0)
|
SCRIPT_HOME=$(dirname $0)
|
||||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]
|
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
|
||||||
then
|
|
||||||
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
||||||
else
|
else
|
||||||
export _PREFIX=$SCRIPT_HOME/..
|
export _PREFIX=$SCRIPT_HOME/..
|
||||||
|
@ -18,8 +18,7 @@ set -e
|
|||||||
|
|
||||||
SCRIPTNAME=$(basename $0)
|
SCRIPTNAME=$(basename $0)
|
||||||
SCRIPT_HOME=$(dirname $0)
|
SCRIPT_HOME=$(dirname $0)
|
||||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]
|
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
|
||||||
then
|
|
||||||
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
||||||
else
|
else
|
||||||
export _PREFIX=$SCRIPT_HOME/..
|
export _PREFIX=$SCRIPT_HOME/..
|
||||||
|
@ -7,8 +7,7 @@ set -o pipefail
|
|||||||
|
|
||||||
sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon
|
sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon
|
||||||
|
|
||||||
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]
|
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]; then
|
||||||
then
|
|
||||||
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl
|
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@ echo "Warning: Fake start-stop-daemon called, doing nothing"
|
|||||||
EOF
|
EOF
|
||||||
sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon
|
sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon
|
||||||
|
|
||||||
if [ -f $TARGET_ROOT/sbin/initctl ]
|
if [ -f $TARGET_ROOT/sbin/initctl ]; then
|
||||||
then
|
|
||||||
sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL
|
sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL
|
||||||
sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF
|
sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
@ -6,8 +6,7 @@ if [ -d /etc/first-boot.d ]; then
|
|||||||
rc_local=/etc/rc.d/rc.local
|
rc_local=/etc/rc.d/rc.local
|
||||||
|
|
||||||
FILE_EXISTED=
|
FILE_EXISTED=
|
||||||
if [ -f $rc_local ]
|
if [ -f $rc_local ]; then
|
||||||
then
|
|
||||||
FILE_EXISTED=1
|
FILE_EXISTED=1
|
||||||
mv $rc_local $rc_local.REAL
|
mv $rc_local $rc_local.REAL
|
||||||
fi
|
fi
|
||||||
@ -20,8 +19,7 @@ set -o xtrace
|
|||||||
dib-first-boot
|
dib-first-boot
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ $FILE_EXISTED ]
|
if [ $FILE_EXISTED ]; then
|
||||||
then
|
|
||||||
echo "mv $rc_local.REAL $rc_local" >> $rc_local
|
echo "mv $rc_local.REAL $rc_local" >> $rc_local
|
||||||
else
|
else
|
||||||
echo "rm \$0" >> $rc_local
|
echo "rm \$0" >> $rc_local
|
||||||
|
@ -5,8 +5,7 @@ set -o pipefail
|
|||||||
|
|
||||||
export DIB_RHSM_USER=${DIB_RHSM_USER:-}
|
export DIB_RHSM_USER=${DIB_RHSM_USER:-}
|
||||||
|
|
||||||
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]
|
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] ; then
|
||||||
then
|
|
||||||
opts="--force"
|
opts="--force"
|
||||||
if [[ -n "$DIB_SAT_KEY" ]]; then
|
if [[ -n "$DIB_SAT_KEY" ]]; then
|
||||||
opts="$opts --activationkey ${DIB_SAT_KEY}"
|
opts="$opts --activationkey ${DIB_SAT_KEY}"
|
||||||
|
@ -275,8 +275,7 @@ function create_base () {
|
|||||||
sudo touch $TMP_MOUNT_PATH/etc/resolv.conf
|
sudo touch $TMP_MOUNT_PATH/etc/resolv.conf
|
||||||
sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf
|
sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf
|
||||||
# use system configured resolv.conf if available to support internal proxy resolving
|
# use system configured resolv.conf if available to support internal proxy resolving
|
||||||
if [ -e /etc/resolv.conf ]
|
if [ -e /etc/resolv.conf ]; then
|
||||||
then
|
|
||||||
cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf
|
cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf
|
||||||
else
|
else
|
||||||
echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf
|
echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf
|
||||||
|
@ -35,7 +35,7 @@ function cleanup () {
|
|||||||
|
|
||||||
function ensure_nbd () {
|
function ensure_nbd () {
|
||||||
NBD=`which qemu-nbd` || true
|
NBD=`which qemu-nbd` || true
|
||||||
if [ -z "$NBD" ]; then
|
if [ -z "$NBD" ]; then
|
||||||
echo "qemu-nbd is not found in your PATH"
|
echo "qemu-nbd is not found in your PATH"
|
||||||
echo "Please install it on your system"
|
echo "Please install it on your system"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user