+
+fix_home_rw_compatibility ()
+{
+ local device=${1}
+
+ if [ -n "${PERSISTENT_READONLY}" ]
+ then
+ return
+ fi
+
+ local backing="$(where_is_mounted ${device})"
+ if [ -z "${backing}" ]
+ then
+ backing="${rootmnt}/live/persistent/$(basename ${device})"
+ mkdir -p "${backing}"
+ local device_fstype="$(get_fstype ${device})"
+ local device_mount_opts="rw,noatime"
+ if ! mount -t "${device_fstype}" -o "${device_mount_opts}" "${device}" "${backing}" >/dev/null 2>&1
+ then
+ return
+ fi
+
+ local include_list="${backing}/${persistence_list}"
+ if [ ! -r "${include_list}" ]
+ then
+ echo "# home-rw backwards compatibility:
+. /home" > "${include_list}"
+ fi
+}