initrd.scripts: uniform function names, use the underscore convention

master v13
Fabio Erculiani 12 years ago
parent 9eb774b02f
commit 4b4d3f6d3e

@ -729,7 +729,7 @@ setup_keymap() {
fi fi
[ ! -e /dev/tty0 ] && ln -s /dev/tty1 /dev/tty0 [ ! -e /dev/tty0 ] && ln -s /dev/tty1 /dev/tty0
[ -f /lib/keymaps/keymapList ] && chooseKeymap [ -f /lib/keymaps/keymapList ] && choose_keymap
[ "${DEVBIND}" = '1' ] && umount /dev [ "${DEVBIND}" = '1' ] && umount /dev
@ -741,7 +741,7 @@ setup_keymap() {
fi fi
} }
chooseKeymap() { choose_keymap() {
good_msg "Loading keymaps" good_msg "Loading keymaps"
if [ -z "${keymap}" ] if [ -z "${keymap}" ]
then then
@ -809,11 +809,11 @@ chooseKeymap() {
else else
bad_msg "Sorry, but keymap ''${keymap}'' is invalid!" bad_msg "Sorry, but keymap ''${keymap}'' is invalid!"
unset keymap unset keymap
chooseKeymap choose_keymap
fi fi
} }
startVolumes() { start_volumes() {
#good_msg 'Checking if volumes need to be started...' #good_msg 'Checking if volumes need to be started...'
# Here, we check for /dev/device-mapper, and if it exists, we setup a # Here, we check for /dev/device-mapper, and if it exists, we setup a
@ -940,7 +940,7 @@ startVolumes() {
is_udev && udevadm settle is_udev && udevadm settle
} }
startiscsi() { start_iscsi() {
if [ ! -n "${ISCSI_NOIBFT}" ] if [ ! -n "${ISCSI_NOIBFT}" ]
then then
good_msg "Activating iSCSI via iBFT" good_msg "Activating iSCSI via iBFT"
@ -999,7 +999,7 @@ startiscsi() {
# Open a LUKS device # Open a LUKS device
# It is either the root or a swap, other devices are supported in the scripts provided with sys-fs/cryptsetup-luks # It is either the root or a swap, other devices are supported in the scripts provided with sys-fs/cryptsetup-luks
# $1 - root/swap # $1 - root/swap
openLUKS() { open_luks() {
# please use 'tr' and this line, or remove it # please use 'tr' and this line, or remove it
# eval local TYPE=$(uppercase $1) # eval local TYPE=$(uppercase $1)
@ -1150,17 +1150,17 @@ openLUKS() {
rmdir -p ${mntkey} 2>/dev/null >/dev/null rmdir -p ${mntkey} 2>/dev/null >/dev/null
} }
startLUKS() { start_luks() {
# 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"
if [ -n "${CRYPT_ROOT}" ]; then if [ -n "${CRYPT_ROOT}" ]; then
openLUKS "root" open_luks "root"
if [ -n "${REAL_ROOT}" ] if [ -n "${REAL_ROOT}" ]
then then
# Rescan volumes # Rescan volumes
startVolumes start_volumes
else else
REAL_ROOT="/dev/mapper/root" REAL_ROOT="/dev/mapper/root"
fi fi
@ -1171,7 +1171,7 @@ startLUKS() {
&& { [ -z "${CRYPT_ROOT}" ] && sleep 6; bootstrapKey "SWAP"; } && { [ -z "${CRYPT_ROOT}" ] && sleep 6; bootstrapKey "SWAP"; }
if [ -n "${CRYPT_SWAP}" ]; then if [ -n "${CRYPT_SWAP}" ]; then
openLUKS "swap" open_luks "swap"
if [ -z "${REAL_RESUME}" ] if [ -z "${REAL_RESUME}" ]
then then
# Resume from swap as default # Resume from swap as default

@ -377,7 +377,7 @@ cd /
# Start iSCSI # Start iSCSI
if [ -e /usr/sbin/iscsistart ] if [ -e /usr/sbin/iscsistart ]
then then
startiscsi start_iscsi
fi fi
# Setup btrfs, see bug 303529 # Setup btrfs, see bug 303529
@ -387,14 +387,14 @@ setup_btrfsctl
is_mdev && setup_md_device is_mdev && setup_md_device
# Scan volumes # Scan volumes
startVolumes start_volumes
setup_keymap setup_keymap
# Initialize LUKS root device except for livecd's # Initialize LUKS root device except for livecd's
if [ "${CDROOT}" != 1 ] if [ "${CDROOT}" != 1 ]
then then
startLUKS start_luks
if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ] if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
then then
case "${REAL_RESUME}" in case "${REAL_RESUME}" in
@ -682,7 +682,7 @@ then
losetup /dev/loop0 "${CDROOT_PATH}/${LOOPEXT}${LOOP}" losetup /dev/loop0 "${CDROOT_PATH}/${LOOPEXT}${LOOP}"
test_success 'Preparing loop filesystem' test_success 'Preparing loop filesystem'
startLUKS start_luks
case ${LOOPTYPE} in case ${LOOPTYPE} in
normal) normal)

Loading…
Cancel
Save