Merge "Correction: if then statement code style."
This commit is contained in:
commit
4e97def3d5
10
README.md
10
README.md
@ -370,12 +370,14 @@ Ramdisk elements support the following files in their element directories:
|
||||
|
||||
* udev.d : udev rules files that will be copied into the ramdisk.
|
||||
|
||||
### Whitespace Rules
|
||||
### Element coding standard ###
|
||||
|
||||
- lines should not include trailing whitespace
|
||||
- there should be no hard tabs in the file
|
||||
- lines should not include trailing whitespace.
|
||||
- there should be no hard tabs in the file.
|
||||
- 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
|
||||
----------------------------
|
||||
|
@ -26,8 +26,7 @@ export DIB_ENV=$(export | grep ' DIB_.*=')
|
||||
|
||||
SCRIPTNAME=$(basename $0)
|
||||
SCRIPT_HOME=$(dirname $0)
|
||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]
|
||||
then
|
||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
|
||||
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
||||
else
|
||||
export _PREFIX=$SCRIPT_HOME/..
|
||||
|
@ -18,8 +18,7 @@ set -e
|
||||
|
||||
SCRIPTNAME=$(basename $0)
|
||||
SCRIPT_HOME=$(dirname $0)
|
||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]
|
||||
then
|
||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
|
||||
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
||||
else
|
||||
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
|
||||
|
||||
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]
|
||||
then
|
||||
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]; then
|
||||
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl
|
||||
fi
|
||||
|
||||
|
@ -14,8 +14,7 @@ echo "Warning: Fake start-stop-daemon called, doing nothing"
|
||||
EOF
|
||||
sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon
|
||||
|
||||
if [ -f $TARGET_ROOT/sbin/initctl ]
|
||||
then
|
||||
if [ -f $TARGET_ROOT/sbin/initctl ]; then
|
||||
sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL
|
||||
sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF
|
||||
#!/bin/sh
|
||||
|
@ -6,8 +6,7 @@ if [ -d /etc/first-boot.d ]; then
|
||||
rc_local=/etc/rc.d/rc.local
|
||||
|
||||
FILE_EXISTED=
|
||||
if [ -f $rc_local ]
|
||||
then
|
||||
if [ -f $rc_local ]; then
|
||||
FILE_EXISTED=1
|
||||
mv $rc_local $rc_local.REAL
|
||||
fi
|
||||
@ -20,8 +19,7 @@ set -o xtrace
|
||||
dib-first-boot
|
||||
EOF
|
||||
|
||||
if [ $FILE_EXISTED ]
|
||||
then
|
||||
if [ $FILE_EXISTED ]; then
|
||||
echo "mv $rc_local.REAL $rc_local" >> $rc_local
|
||||
else
|
||||
echo "rm \$0" >> $rc_local
|
||||
|
@ -5,8 +5,7 @@ set -o pipefail
|
||||
|
||||
export DIB_RHSM_USER=${DIB_RHSM_USER:-}
|
||||
|
||||
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]
|
||||
then
|
||||
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] ; then
|
||||
opts="--force"
|
||||
if [[ -n "$DIB_SAT_KEY" ]]; then
|
||||
opts="$opts --activationkey ${DIB_SAT_KEY}"
|
||||
|
@ -275,8 +275,7 @@ function create_base () {
|
||||
sudo touch $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
|
||||
if [ -e /etc/resolv.conf ]
|
||||
then
|
||||
if [ -e /etc/resolv.conf ]; then
|
||||
cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf
|
||||
else
|
||||
echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf
|
||||
|
@ -35,7 +35,7 @@ function cleanup () {
|
||||
|
||||
function ensure_nbd () {
|
||||
NBD=`which qemu-nbd` || true
|
||||
if [ -z "$NBD" ]; then
|
||||
if [ -z "$NBD" ]; then
|
||||
echo "qemu-nbd is not found in your PATH"
|
||||
echo "Please install it on your system"
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user