Only run swapon and rc.savecore when the SWAPDEVICE is valid.
(cherry picked from commit d988e0bbf991e28c611b194e9e6ccd99f818209b)
Only run swapon and rc.savecore when the SWAPDEVICE is valid.
(cherry picked from commit d988e0bbf991e28c611b194e9e6ccd99f818209b)