linuxrc: create is_livecd(), stop doing weird ${CDROOT} comparisons

master
Fabio Erculiani 12 years ago
parent 3c9f0c6850
commit 3f14137bc0

@ -209,8 +209,13 @@ uppercase() {
echo $1 | tr 'a-z' 'A-Z' echo $1 | tr 'a-z' 'A-Z'
} }
is_livecd() {
[ "${CDROOT}" = "1" ] && return 0
return 1
}
setup_real_root() { setup_real_root() {
if [ "${CDROOT}" = '0' ] if ! is_livecd
then then
if [ -z "${REAL_ROOT}" -a "${FAKE_ROOT}" != "/dev/ram0" ] if [ -z "${REAL_ROOT}" -a "${FAKE_ROOT}" != "/dev/ram0" ]
then then
@ -435,7 +440,7 @@ findnfsmount() {
NFSOPTIONS="${DEFAULT_NFSOPTIONS},${NFSOPTIONS}" NFSOPTIONS="${DEFAULT_NFSOPTIONS},${NFSOPTIONS}"
fi fi
if [ "${CDROOT}" != '0' ] if is_livecd
then then
good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}" good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}"
mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${CDROOT_PATH} mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${CDROOT_PATH}
@ -816,7 +821,7 @@ setup_keymap() {
[ "${DEVBIND}" = '1' ] && umount /dev [ "${DEVBIND}" = '1' ] && umount /dev
if [ -e /etc/sysconfig/keyboard -a "${CDROOT}" = '1' ] if [ -e /etc/sysconfig/keyboard ] && is_livecd
then then
mkdir -p ${NEW_ROOT}/etc/sysconfig/ mkdir -p ${NEW_ROOT}/etc/sysconfig/
cp /etc/sysconfig/keyboard ${NEW_ROOT}/etc/sysconfig/keyboard cp /etc/sysconfig/keyboard ${NEW_ROOT}/etc/sysconfig/keyboard
@ -1314,7 +1319,7 @@ sdelay() {
then then
good_msg "Waiting ${SDELAY} seconds..." good_msg "Waiting ${SDELAY} seconds..."
sleep ${SDELAY} sleep ${SDELAY}
elif [ "${CDROOT}" = '1' ] elif is_livecd
then then
good_msg 'Hint: Use scandelay[=seconds] if your live medium is slowand boot fails' good_msg 'Hint: Use scandelay[=seconds] if your live medium is slowand boot fails'
fi fi
@ -1332,7 +1337,7 @@ verbose_kmsg() {
cdupdate() { cdupdate() {
if [ "${CDROOT}" = '1' ] if is_livecd
then then
if [ -x /${CDROOT_PATH}/cdupdate.sh ] if [ -x /${CDROOT_PATH}/cdupdate.sh ]
then then

@ -281,12 +281,9 @@ 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 ] is_livecd || start_luks
then
start_luks
fi
if [ "${CDROOT}" != 1 ] if ! is_livecd
then then
if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ] if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
then then
@ -328,7 +325,7 @@ CHROOT="${NEW_ROOT}"
# Run debug shell if requested # Run debug shell if requested
rundebugshell "before setting up the root filesystem" rundebugshell "before setting up the root filesystem"
if [ "${CDROOT}" = '1' ] if is_livecd
then then
good_msg "Making tmpfs for ${NEW_ROOT}" good_msg "Making tmpfs for ${NEW_ROOT}"
mount -n -t tmpfs tmpfs "${NEW_ROOT}" mount -n -t tmpfs tmpfs "${NEW_ROOT}"
@ -554,7 +551,7 @@ done
# End determine root device # End determine root device
# If CD root is set determine the looptype to boot # If CD root is set determine the looptype to boot
if [ "${CDROOT}" = '1' ] if is_livecd
then then
good_msg 'Determining looptype ...' good_msg 'Determining looptype ...'
cd "${NEW_ROOT}" cd "${NEW_ROOT}"

Loading…
Cancel
Save