Kill trailing whitespaces!!!!!

cleanup-cruft
Fabio Erculiani 12 years ago
parent 90da2a1a66
commit 06af416264

@ -1,4 +1,4 @@
#!/bin/ash #!/bin/sh
. /etc/initrd.defaults . /etc/initrd.defaults
@ -169,7 +169,7 @@ findmediamount() {
# $2 = recognition file # $2 = recognition file
# $3 = variable to have the device path # $3 = variable to have the device path
# $4 = actual mount dir path (full path) # $4 = actual mount dir path (full path)
# args remaining are possible devices # args remaining are possible devices
local media=$1 recon=$2 vrbl=$3 mntdir=$4 local media=$1 recon=$2 vrbl=$3 mntdir=$4
shift 4 shift 4
@ -332,16 +332,15 @@ findnfsmount() {
if [ "${NFSROOT}" = '' ] if [ "${NFSROOT}" = '' ]
then then
# Obtain NFSIP # Obtain NFSIP
OPTIONS=$(busybox dmesg | grep rootserver | sed -e "s/,/ /g") OPTIONS=$(busybox dmesg | grep rootserver | sed -e "s/,/ /g")
for OPTION in $OPTIONS for OPTION in $OPTIONS
do do
if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootserver' ] if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootserver' ]
then then
NFSIP=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) NFSIP=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2)
fi fi
done done
# Obtain NFSPATH # Obtain NFSPATH
OPTIONS=$(busybox dmesg | grep rootpath | sed -e "s/,/ /g") OPTIONS=$(busybox dmesg | grep rootpath | sed -e "s/,/ /g")
for OPTION in $OPTIONS for OPTION in $OPTIONS
@ -383,7 +382,7 @@ findnfsmount() {
else else
bad_msg "NFS Mounting failed. Is the path corrent ?" bad_msg "NFS Mounting failed. Is the path corrent ?"
fi fi
else else
good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}"
mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}
if [ "$?" = '0' ] if [ "$?" = '0' ]
@ -433,11 +432,9 @@ find_real_device() {
check_loop() { check_loop() {
if [ "${LOOP}" = '' -o ! -e "${CDROOT_PATH}/${LOOP}" ] if [ "${LOOP}" = '' -o ! -e "${CDROOT_PATH}/${LOOP}" ]
then then
bad_msg "Invalid loop location: ${LOOP}" bad_msg "Invalid loop location: ${LOOP}"
bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...' bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...'
bad_msg 'kernel command line!' bad_msg 'kernel command line!'
run_shell run_shell
fi fi
} }
@ -487,7 +484,7 @@ mount_devfs () {
test_success() { test_success() {
retcode=$? retcode=$?
# If last command failed send error message and fall back to a shell # If last command failed send error message and fall back to a shell
if [ "$retcode" != '0' ] if [ "$retcode" != '0' ]
then then
error_string=$1 error_string=$1
@ -518,7 +515,7 @@ bad_msg() {
splashcmd verbose splashcmd verbose
echo -e "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}" echo -e "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
fi fi
} }
warn_msg() { warn_msg() {
msg_string=$1 msg_string=$1
@ -685,18 +682,17 @@ cmdline_hwopts() {
fi fi
done done
done done
# Shouldnt need to sort this as the following loop should figure out the # Shouldnt need to sort this as the following loop should figure out the
# duplicates and strip them out # duplicates and strip them out
#MY_HWOPTS=$(echo ${MY_HWOPTS}| sort) #MY_HWOPTS=$(echo ${MY_HWOPTS}| sort)
for x in ${MY_HWOPTS} for x in ${MY_HWOPTS}
do do
FOUND=0 FOUND=0
for y in ${TMP_HWOPTS} for y in ${TMP_HWOPTS}
do do
if [ "${y}" = "${x}" ] if [ "${y}" = "${x}" ]
then then
continue 2 continue 2
fi fi
done done
@ -736,7 +732,7 @@ setup_keymap() {
[ -f /lib/keymaps/keymapList ] && chooseKeymap [ -f /lib/keymaps/keymapList ] && chooseKeymap
[ "${DEVBIND}" = '1' ] && umount /dev [ "${DEVBIND}" = '1' ] && umount /dev
if [ -e /etc/sysconfig/keyboard -a "${CDROOT}" = '1' ] if [ -e /etc/sysconfig/keyboard -a "${CDROOT}" = '1' ]
then then
mkdir -p ${NEW_ROOT}/etc/sysconfig/ mkdir -p ${NEW_ROOT}/etc/sysconfig/
@ -827,7 +823,7 @@ startVolumes() {
mkdir -p /dev/mapper mkdir -p /dev/mapper
ln -sf /dev/device-mapper /dev/mapper/control ln -sf /dev/device-mapper /dev/mapper/control
fi fi
if [ "${USE_MDADM}" = '1' ] if [ "${USE_MDADM}" = '1' ]
then then
if [ -e '/sbin/mdadm' ] if [ -e '/sbin/mdadm' ]
@ -838,15 +834,15 @@ startVolumes() {
fi fi
fi fi
if [ "${USE_MULTIPATH_NORMAL}" = '1' ] if [ "${USE_MULTIPATH_NORMAL}" = '1' ]
then then
good_msg "Scanning for multipath devices" good_msg "Scanning for multipath devices"
/sbin/multipath -v 0 /sbin/multipath -v 0
sleep 2 sleep 2
good_msg "Activating multipath devices" good_msg "Activating multipath devices"
/sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -v" /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -v"
#for MULTIPATH_VOLUMES in /dev/mapper/*; do kpartx -a $MULTIPATH_VOLUMES; done #for MULTIPATH_VOLUMES in /dev/mapper/*; do kpartx -a $MULTIPATH_VOLUMES; done
fi fi
if [ "${USE_DMRAID_NORMAL}" = '1' ] if [ "${USE_DMRAID_NORMAL}" = '1' ]
then then
@ -899,7 +895,7 @@ startVolumes() {
bad_msg "vgscan or vgchange not found: skipping LVM volume group activation!" bad_msg "vgscan or vgchange not found: skipping LVM volume group activation!"
fi fi
fi fi
if [ "${USE_ZFS}" = '1' ] if [ "${USE_ZFS}" = '1' ]
then then
if [ -z "${ZFS_POOL}" ] if [ -z "${ZFS_POOL}" ]
@ -1058,10 +1054,10 @@ openLUKS() {
cryptsetup_options="${cryptsetup_options} --allow-discards" cryptsetup_options="${cryptsetup_options} --allow-discards"
fi fi
if [ -n "${LUKS_KEY}" ] if [ -n "${LUKS_KEY}" ]
then then
local REAL_LUKS_KEYDEV="${LUKS_KEYDEV}" local REAL_LUKS_KEYDEV="${LUKS_KEYDEV}"
if [ ! -e "${mntkey}${LUKS_KEY}" ] if [ ! -e "${mntkey}${LUKS_KEY}" ]
then then
REAL_LUKS_KEYDEV=$(find_real_device "${LUKS_KEYDEV}") REAL_LUKS_KEYDEV=$(find_real_device "${LUKS_KEYDEV}")
if [ -b "${REAL_LUKS_KEYDEV}" ] if [ -b "${REAL_LUKS_KEYDEV}" ]
@ -1155,9 +1151,7 @@ openLUKS() {
} }
startLUKS() { startLUKS() {
# if key is set but key device isn't, find it # if key is set but key device isn't, find it
[ -n "${CRYPT_ROOT_KEY}" ] && [ -z "${CRYPT_ROOT_KEYDEV}" ] \ [ -n "${CRYPT_ROOT_KEY}" ] && [ -z "${CRYPT_ROOT_KEYDEV}" ] \
&& sleep 6 && bootstrapKey "ROOT" && sleep 6 && bootstrapKey "ROOT"

@ -532,9 +532,8 @@ do
prompt_user "REAL_ROOT" "root block device" prompt_user "REAL_ROOT" "root block device"
continue continue
fi fi
ROOT_DEV="${REAL_ROOT#*=}" ROOT_DEV="${REAL_ROOT#*=}"
if [ "${ROOT_DEV}" != 'ZFS' ] if [ "${ROOT_DEV}" != 'ZFS' ]
then then
if [ "$(zfs get type -o value -H ${ROOT_DEV})" = 'filesystem' ] if [ "$(zfs get type -o value -H ${ROOT_DEV})" = 'filesystem' ]
then then
@ -563,10 +562,8 @@ do
REAL_ROOT=${i} REAL_ROOT=${i}
ROOTFSTYPE=zfs ROOTFSTYPE=zfs
break break
fi fi
done
done;
else else
got_good_root=0 got_good_root=0
fi fi
@ -577,7 +574,6 @@ do
prompt_user "REAL_ROOT" "root block device" prompt_user "REAL_ROOT" "root block device"
got_good_root=0 got_good_root=0
fi fi
continue continue
;; ;;
esac esac

@ -118,12 +118,12 @@ config_kernel() {
fi fi
# Multipath # Multipath
if isTrue ${CMD_MULTIPATH} if isTrue ${CMD_MULTIPATH}
then then
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH is.*/CONFIG_DM_MULTIPATH=m/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH is.*/CONFIG_DM_MULTIPATH=m/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH_RDAC is.*/CONFIG_DM_MULTIPATH_RDAC=m/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_DM_MULTIPATH_RDAC is.*/CONFIG_DM_MULTIPATH_RDAC=m/g'
fi fi
# Make sure dmraid modules are on if --dmraid # Make sure dmraid modules are on if --dmraid
if isTrue ${CMD_DMRAID} if isTrue ${CMD_DMRAID}
@ -147,10 +147,10 @@ config_kernel() {
then then
sed -i ${KERNEL_OUTPUTDIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g' sed -i ${KERNEL_OUTPUTDIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'
fi fi
# VirtIO # VirtIO
if isTrue ${CMD_VIRTIO} if isTrue ${CMD_VIRTIO}
then then
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_PARAVIRT_GUEST.*/CONFIG_PARAVIRT_GUEST=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_PARAVIRT_GUEST.*/CONFIG_PARAVIRT_GUEST=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_PCI.*/CONFIG_VIRTIO_PCI=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_PCI.*/CONFIG_VIRTIO_PCI=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_BALLOON.*/CONFIG_VIRTIO_BALLOON=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_BALLOON.*/CONFIG_VIRTIO_BALLOON=y/g'
@ -159,5 +159,5 @@ config_kernel() {
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SCSI_VIRTIO.*/CONFIG_SCSI_VIRTIO=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SCSI_VIRTIO.*/CONFIG_SCSI_VIRTIO=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g' sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g'
fi fi
} }

@ -14,7 +14,7 @@ CPIO_ARGS="--quiet -o -H newc"
# CC0 are compatible with the GNU GPL." # CC0 are compatible with the GNU GPL."
# (from https://www.gnu.org/licenses/license-list.html#CC0) # (from https://www.gnu.org/licenses/license-list.html#CC0)
# #
# Written by: # Written by:
# - Sebastian Pipping <sebastian@pipping.org> (error checking) # - Sebastian Pipping <sebastian@pipping.org> (error checking)
# - Robin H. Johnson <robbat2@gentoo.org> (complete rewrite) # - Robin H. Johnson <robbat2@gentoo.org> (complete rewrite)
# - Richard Yao <ryao@cs.stonybrook.edu> (original concept) # - Richard Yao <ryao@cs.stonybrook.edu> (original concept)
@ -201,7 +201,7 @@ append_multipath(){
copy_binaries "${TEMP}/initramfs-multipath-temp" \ copy_binaries "${TEMP}/initramfs-multipath-temp" \
/bin/mountpoint \ /bin/mountpoint \
/sbin/{multipath,kpartx,mpath_prio_*,devmap_name,dmsetup} \ /sbin/{multipath,kpartx,mpath_prio_*,devmap_name,dmsetup} \
/{lib,lib64}/{udev/scsi_id,multipath/*so} /{lib,lib64}/{udev/scsi_id,multipath/*so}
if [ -x /sbin/multipath ] if [ -x /sbin/multipath ]
then then
@ -647,7 +647,7 @@ append_modules() {
find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
|| gen_die "compressing modules cpio" || gen_die "compressing modules cpio"
cd "${TEMP}" cd "${TEMP}"
rm -r "${TEMP}/initramfs-modules-${KV}-temp/" rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
} }
# check for static linked file with objdump # check for static linked file with objdump
@ -903,7 +903,6 @@ create_initramfs() {
gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;; gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;;
lzop) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;; lzop) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;;
esac esac
if [ -n "${compression}" ]; then if [ -n "${compression}" ]; then
print_info 1 " >> Compressing cpio data (${compress_ext})..." print_info 1 " >> Compressing cpio data (${compress_ext})..."
${compress_cmd} "${CPIO}" || gen_die "Compression (${compress_cmd}) failed" ${compress_cmd} "${CPIO}" || gen_die "Compression (${compress_cmd}) failed"

Loading…
Cancel
Save