diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/arc/arc_util.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/arc/arc_util.cc')
-rw-r--r-- | chromium/components/arc/arc_util.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/chromium/components/arc/arc_util.cc b/chromium/components/arc/arc_util.cc index 7b0e268efe2..ddc04468c0e 100644 --- a/chromium/components/arc/arc_util.cc +++ b/chromium/components/arc/arc_util.cc @@ -11,6 +11,9 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/feature_list.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/logging.h" #include "base/optional.h" #include "base/strings/string_number_conversions.h" #include "chromeos/constants/chromeos_switches.h" @@ -303,7 +306,6 @@ bool IsArcPlayAutoInstallDisabled() { chromeos::switches::kArcDisablePlayAutoInstall); } -// static int32_t GetLcdDensityForDeviceScaleFactor(float device_scale_factor) { const auto* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(chromeos::switches::kArcScale)) { @@ -333,4 +335,26 @@ int32_t GetLcdDensityForDeviceScaleFactor(float device_scale_factor) { kDefaultDensityDpi); } +bool GenerateFirstStageFstab(const base::FilePath& combined_property_file_name, + const base::FilePath& fstab_path) { + DCHECK(IsArcVmEnabled()); + // The file is exposed to the guest by crosvm via /sys/firmware/devicetree, + // which in turn allows the guest's init process to mount /vendor very early, + // in its first stage (device) initialization step. crosvm also special-cases + // #dt-vendor line and expose |combined_property_file_name| via the device + // tree file system too. This also allow the init process to load the expanded + // properties very early even before all file systems are mounted. + // + // The device name for /vendor has to match what arc_vm_client_adapter.cc + // configures. + constexpr const char kFirstStageFstabTemplate[] = + "/dev/block/vdb /vendor squashfs ro,noatime,nosuid,nodev " + "wait,check,formattable,reservedsize=128M\n" + "#dt-vendor build.prop %s default default\n"; + return base::WriteFile( + fstab_path, + base::StringPrintf(kFirstStageFstabTemplate, + combined_property_file_name.value().c_str())); +} + } // namespace arc |