我有一台 HP-compaq-15s-103tx 笔记本电脑,在 UEFI 模式下双启动了 Ubuntu 14.04 LTS 和 Windows 8.1。
每次我在“暂停”后尝试启动笔记本电脑时,它根本无法启动。
即,通常的 grub 不会出现,并且仅带有下划线的空白屏幕。它卡在这里,没有别的东西。
我必须长按电源按钮然后重新启动。之后,我在桌面角落收到大量错误消息“检测到系统程序问题”,我已经报告过一百次了。
谢谢。
这是 apportcheckresume:
#!/usr/bin/python3
# Copyright (C) 2009 Canonical Ltd.
# Author: Andy Whitcroft <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
# the full text of the license.
import os
import sys
import datetime
from apport import unicode_gettext as _
from apport.hookutils import attach_file_if_exists
def main(argv=None):
if argv is None:
argv = sys.argv
try:
from apport.packaging_impl import impl as packaging
if not packaging.enabled():
return -1
import apport.report
pr = apport.report.Report(type='KernelOops')
libdir = '/var/lib/pm-utils'
flagfile = libdir + '/status'
stresslog = libdir + '/stress.log'
hanglog = libdir + '/resume-hang.log'
pr.add_os_info()
pr.add_proc_info()
pr.add_user_info()
package = apport.packaging.get_kernel_package()
try:
package_version = apport.packaging.get_version(package)
except ValueError as e:
if 'does not exist' in e.message:
package_version = 'unknown'
pr['Package'] = '%s %s' % (package, package_version)
# grab the contents of the suspend/resume flag file
attach_file_if_exists(pr, flagfile, 'Failure')
# grab the contents of the suspend/hibernate log file
attach_file_if_exists(pr, '/var/log/pm-suspend.log', 'SleepLog')
# grab the contents of the suspend/resume stress test log if present.
attach_file_if_exists(pr, stresslog, 'StressLog')
# Ensure we are appropriatly tagged.
if 'Failure' in pr:
pr['Tags'] = 'resume ' + pr['Failure']
# Record the failure mode.
pr['Failure'] += '/resume'
# If we had a late hang pull in the resume-hang logfile. Also
# add an additional tag so we can pick these out.
if os.path.exists(hanglog):
attach_file_if_exists(pr, hanglog, 'ResumeHangLog')
pr['Tags'] += ' resume-late-hang'
# Generate a sensible report message.
if pr.get('Failure') == 'suspend/resume':
pr['Annotation'] = _('This occured during a previous suspend and prevented it from resuming properly.')
else:
pr['Annotation'] = _('This occured during a previous hibernate and prevented it from resuming properly.')
# If we had a late hang make sure the dialog is clear that they may
# not have noticed. Also update the bug title so we notice.
if os.path.exists(hanglog):
pr['Annotation'] += ' ' + _('The resume processing hung very near the end and will have appeared to have completed normally.')
pr['Failure'] = 'late resume'
if pr.check_ignored():
return 0
nowtime = datetime.datetime.now()
pr_filename = '/var/crash/susres.%s.crash' % (str(nowtime).replace(' ', '_'))
with os.fdopen(os.open(pr_filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as report_file:
pr.write(report_file)
return 0
except:
print('apportcheckresume failed')
raise
if __name__ == '__main__':
sys.exit(main())
编辑:
我尝试了给出的两种解决方案代码中心,但对我来说,这两种方法都不起作用。
但我注意到还有另外 3 个文件睡眠.d文件夹可能会有用。所以我上传了整个下午文件夹这里。请看一下。
答案1
我在配备 NVidia GT-940M 的 HP Envy M7-101DX 上运行 Ubuntu 15.10 时遇到了这个问题。解决方法与用户 Manish Sakpal 发布的链接中的方法相同:点击此处查看原始来源
自从法比要求将代码粘贴到这里以供后人参考,我将概述以下步骤:
打开一个新的终端窗口并输入:
sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd
在出现的窗口中粘贴以下代码:
#!/bin/sh
TMPLIST_E=/tmp/ehci-dev-list
TMPLIST_X=/tmp/xhci-dev-list
E_DIR=/sys/bus/pci/drivers/ehci_hcd
X_DIR=/sys/bus/pci/drivers/xhci_hcd
E_BIND=$E_DIR""/bind
E_UNBIND=$E_DIR""/unbind
X_BIND=$X_DIR""/bind
X_UNBIND=$X_DIR""/unbind
#param1 = temp file, param2 = device dir, param3 = unbind
unbindDev (){
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970& postcount=19
echo -n '' > $1
for i in `ls $2 | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
echo -n "$i" | tee $3
echo "$i" >> $1
done
}
#param1 = tem file, param2 = bind
bindDev(){
[ -f $1 ] || return
for i in `cat $1`; do
echo -n "$i" | tee $2
done
rm $1
}
case "${1}" in
hibernate|suspend)
unbindDev $TMPLIST_E $E_DIR $E_UNBIND
unbindDev $TMPLIST_X $X_DIR $X_UNBIND
;;
resume|thaw)
bindDev $TMPLIST_E $E_BIND
bindDev $TMPLIST_X $X_BIND
;;
esac
保存并关闭脚本。
在终端窗口中,输入以下内容:
sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd
这就是我纠正这个问题所需的全部步骤。希望它对你和其他人有用。
答案2
我也有惠普笔记本电脑,今天我自己解决了挂起恢复问题,但为此你必须按照下面链接中给出的说明进行操作,然后重新启动以查看它是否解决了问题链接:- http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug/