Modifications
- [welcome] Use QNetworkAccessManager in checkHasInternet - [bootloader] Fix UEFI firmware workaround for 32-bit UEFI
This commit is contained in:
parent
c8f1134196
commit
d698b98988
@ -231,9 +231,13 @@ def install_grub(efi_directory, fw_type):
|
|||||||
check_target_env_call(["mkdir", "-p", efi_boot_directory])
|
check_target_env_call(["mkdir", "-p", efi_boot_directory])
|
||||||
|
|
||||||
# Workaround for some UEFI firmwares
|
# Workaround for some UEFI firmwares
|
||||||
|
efi_file_source = {"32": os.path.join(efi_directory_firmware, efi_bootloader_id, "grubia32.efi"),
|
||||||
|
"64": os.path.join(efi_directory_firmware, efi_bootloader_id, "grubx64.efi")}
|
||||||
|
efi_file_target = {"32": os.path.join(efi_boot_directory, "bootia32.efi"),
|
||||||
|
"64": os.path.join(efi_boot_directory, "bootx64.efi")}
|
||||||
check_target_env_call(["cp",
|
check_target_env_call(["cp",
|
||||||
os.path.join(efi_directory_firmware, efi_bootloader_id, "grubx64.efi"),
|
efi_file_source[efi_bitness],
|
||||||
os.path.join(efi_boot_directory, "bootx64.efi")])
|
efi_file_target[efi_bitness]])
|
||||||
else:
|
else:
|
||||||
print("Bootloader: grub (bios)")
|
print("Bootloader: grub (bios)")
|
||||||
boot_loader = libcalamares.globalstorage.value("bootLoader")
|
boot_loader = libcalamares.globalstorage.value("bootLoader")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules )
|
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules )
|
||||||
find_package( LIBPARTED REQUIRED )
|
find_package( LIBPARTED REQUIRED )
|
||||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus )
|
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network )
|
||||||
|
|
||||||
set_source_files_properties( checker/partman_devices.c PROPERTIES LANGUAGE CXX )
|
set_source_files_properties( checker/partman_devices.c PROPERTIES LANGUAGE CXX )
|
||||||
|
|
||||||
@ -14,6 +14,7 @@ set( CHECKER_SOURCES
|
|||||||
set( CHECKER_LINK_LIBRARIES
|
set( CHECKER_LINK_LIBRARIES
|
||||||
${LIBPARTED_LIBS}
|
${LIBPARTED_LIBS}
|
||||||
Qt5::DBus
|
Qt5::DBus
|
||||||
|
Qt5::Network
|
||||||
)
|
)
|
||||||
|
|
||||||
calamares_add_plugin( welcome
|
calamares_add_plugin( welcome
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@ -336,32 +337,8 @@ RequirementsChecker::checkHasPower()
|
|||||||
bool
|
bool
|
||||||
RequirementsChecker::checkHasInternet()
|
RequirementsChecker::checkHasInternet()
|
||||||
{
|
{
|
||||||
const QString NM_SVC_NAME( "org.freedesktop.NetworkManager" );
|
// default to true in the QNetworkAccessManager::UnknownAccessibility case
|
||||||
const QString NM_INTF_NAME( "org.freedesktop.NetworkManager" );
|
return QNetworkAccessManager(this).networkAccessible() != QNetworkAccessManager::NotAccessible;
|
||||||
const QString NM_PATH( "/org/freedesktop/NetworkManager" );
|
|
||||||
const int NM_STATE_CONNECTED_GLOBAL = 70;
|
|
||||||
|
|
||||||
QDBusInterface nmIntf( NM_SVC_NAME,
|
|
||||||
NM_PATH,
|
|
||||||
NM_INTF_NAME,
|
|
||||||
QDBusConnection::systemBus(), 0 );
|
|
||||||
|
|
||||||
bool ok = false;
|
|
||||||
int nmState = nmIntf.property( "State" ).toInt( &ok );
|
|
||||||
|
|
||||||
if ( !ok || !nmIntf.isValid() )
|
|
||||||
{
|
|
||||||
// We can't talk to NM, so no idea. Wild guess: we're connected
|
|
||||||
// using ssh with X forwarding, and are therefore connected. This
|
|
||||||
// allows us to proceed with a minimum of complaint.
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "hasInternet", true );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasInternet = nmState == NM_STATE_CONNECTED_GLOBAL;
|
|
||||||
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "hasInternet", hasInternet );
|
|
||||||
return hasInternet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user