diff --git a/.config/cache-config.env b/.config/cache-config.env index 774a4628b40..fa6b2be0b50 100644 --- a/.config/cache-config.env +++ b/.config/cache-config.env @@ -1,3 +1,3 @@ -CACHE_VERSION=v1 +CACHE_VERSION=v2 BAZEL_REMOTE_CACHE="https://storage.googleapis.com/android-cuttlefish-cache" diff --git a/.github/actions/gigabyte-ampere-cuttlefish-installer-check-preseed-after-install-script/action.yaml b/.github/actions/gigabyte-ampere-cuttlefish-installer-check-preseed-after-install-script/action.yaml index f31c36df9a1..83c81bf2419 100644 --- a/.github/actions/gigabyte-ampere-cuttlefish-installer-check-preseed-after-install-script/action.yaml +++ b/.github/actions/gigabyte-ampere-cuttlefish-installer-check-preseed-after-install-script/action.yaml @@ -23,7 +23,6 @@ runs: apt-get install -y lsb-release apt-get install -y pciutils apt-get install -y apt-show-versions - apt-get install -y linux-image-arm64 linux-headers-arm64 - name: Setup base and non-free repository shell: bash run: | diff --git a/.github/workflows/gigabyte-ampere-cuttlefish-installer.yaml b/.github/workflows/gigabyte-ampere-cuttlefish-installer.yaml index 8e52f6694db..32ef8127919 100644 --- a/.github/workflows/gigabyte-ampere-cuttlefish-installer.yaml +++ b/.github/workflows/gigabyte-ampere-cuttlefish-installer.yaml @@ -56,7 +56,7 @@ jobs: nvidia_gpu: ["true", "false"] steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Check preseed after install script uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-check-preseed-after-install-script with: @@ -72,11 +72,11 @@ jobs: image: debian@sha256:13f29b6806e531c3ff3b565bb6eed73f2132506c8c9d41bb996065ca20fb27f2 # debian:trixie-20260223 (amd64) steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Build iso installer uses: ./.github/actions/build-gigabyte-ampere-cuttlefish-installer - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts path: gigabyte-ampere-cuttlefish-installer/preseed-mini.iso.xz @@ -93,9 +93,9 @@ jobs: TEST_DISK_SIZE: "10G" steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -137,9 +137,9 @@ jobs: working-directory: ./gigabyte-ampere-cuttlefish-installer steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -185,9 +185,9 @@ jobs: working-directory: ./gigabyte-ampere-cuttlefish-installer steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -233,9 +233,9 @@ jobs: working-directory: ./gigabyte-ampere-cuttlefish-installer steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -281,9 +281,9 @@ jobs: working-directory: ./gigabyte-ampere-cuttlefish-installer steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -301,6 +301,9 @@ jobs: run: | screen -d -m -L -Logfile console_001.log ./installer-iso-run-qemu.sh while ! egrep "[^[:space:]]+[[:space:]]login:" console_001.log; do sleep 30; done + # The login prompt appears before the system is usable, so wait for the + # boot to complete. "degraded" means booted with some unit failed. + until sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -o "ConnectTimeout 60" -p 33322 vsoc-01@localhost 'systemctl is-system-running | grep -qE "running|degraded"'; do sleep 30; done cp -f console_001.log console_001_p1.log CONSOLELINES=$(cat console_001_p1.log | wc -l) cat console_001_p1.log @@ -361,9 +364,9 @@ jobs: working-directory: ./gigabyte-ampere-cuttlefish-installer steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: gigabyte-ampere-cuttlefish-installer-artifacts - name: Prepare test environment @@ -381,6 +384,9 @@ jobs: run: | screen -d -m -L -Logfile console_001.log ./installer-iso-run-qemu.sh while ! egrep "[^[:space:]]+[[:space:]]login:" console_001.log; do sleep 30; done + # The login prompt appears before the system is usable, so wait for the + # boot to complete. "degraded" means booted with some unit failed. + until sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -o "ConnectTimeout 60" -p 33322 vsoc-01@localhost 'systemctl is-system-running | grep -qE "running|degraded"'; do sleep 30; done cp -f console_001.log console_001_p1.log CONSOLELINES=$(cat console_001_p1.log | wc -l) cat console_001_p1.log diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/cf_vm_configs.cpp b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/cf_vm_configs.cpp index 181707a67ff..83e85a40ecd 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/cf_vm_configs.cpp +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/cf_vm_configs.cpp @@ -49,6 +49,7 @@ inline constexpr char kFlagEnableSandbox[] = "enable_sandbox"; inline constexpr char kFlagCrosvmSimpleMediaDevice[] = "crosvm_simple_media_device"; inline constexpr char kFlagCrosvmV4l2Proxy[] = "crosvm_v4l2_proxy"; +inline constexpr char kFlagVhostUserVsock[] = "vhost_user_vsock"; inline constexpr char kFlagEnablePkvm[] = "enable_pkvm"; std::set GatherFlagNamesUsedInInstanceConfig(const Instance& ins) { @@ -83,6 +84,10 @@ std::set GatherFlagNamesUsedInInstanceConfig(const Instance& ins) { ins.vm().crosvm().has_v4l2_proxy()) { names.insert(kFlagCrosvmV4l2Proxy); } + if (ins.vm().vmm_case() == Vm::VmmCase::kCrosvm && + ins.vm().crosvm().has_vhost_user_vsock()) { + names.insert(kFlagVhostUserVsock); + } if (ins.vm().has_enable_pkvm()) { names.insert(kFlagEnablePkvm); } @@ -179,6 +184,13 @@ static std::string V4l2Proxy(const Instance& instance) { return crosvm.has_v4l2_proxy() ? crosvm.v4l2_proxy() : default_val; } +static std::string VhostUserVsock(const Instance& instance) { + const auto& crosvm = instance.vm().crosvm(); + const auto& default_val = CF_DEFAULTS_VHOST_USER_VSOCK; + return crosvm.has_vhost_user_vsock() ? crosvm.vhost_user_vsock() + : default_val; +} + static bool EnablePkvm(const Instance& instance) { const auto& vm = instance.vm(); return vm.has_enable_pkvm() ? vm.enable_pkvm() : CF_DEFAULTS_ENABLE_PKVM; @@ -269,6 +281,10 @@ Result> GenerateVmFlags( flags.emplace_back( GenerateInstanceFlag(kFlagCrosvmV4l2Proxy, cfg, V4l2Proxy)); } + if (used_names.contains(kFlagVhostUserVsock)) { + flags.emplace_back( + GenerateInstanceFlag(kFlagVhostUserVsock, cfg, VhostUserVsock)); + } if (used_names.contains(kFlagEnablePkvm)) { flags.emplace_back(GenerateInstanceFlag(kFlagEnablePkvm, cfg, EnablePkvm)); } diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/vm_configs_test.cc b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/vm_configs_test.cc index 9401a4bde5d..6d90077e89d 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/vm_configs_test.cc +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/vm_configs_test.cc @@ -743,4 +743,71 @@ TEST(VmFlagsParserTest, ParseTwoInstancesCustomActionsFlagPartialJson) { EXPECT_THAT(ParseJson(custom_actions[0]), IsOkAndValue(expected_actions)); } +TEST(VmFlagsParserTest, ParseTwoInstancesVhostUserVsockFlagPartialJson) { + const char* test_string = R""""( +{ + "instances" : + [ + { + "vm": { + "crosvm":{ + } + } + }, + { + "vm": { + "crosvm":{ + "vhost_user_vsock": "true" + } + } + } + ] +} + )""""; + + Json::Value json_configs; + std::string json_text(test_string); + + EXPECT_TRUE(ParseJsonString(json_text, json_configs)) + << "Invalid Json string"; + auto serialized_data = LaunchCvdParserTester(json_configs); + EXPECT_TRUE(serialized_data.ok()) << serialized_data.error().Trace(); + EXPECT_TRUE(FindConfig(*serialized_data, R"(--vhost_user_vsock=auto,true)")) + << "vhost_user_vsock flag is missing or wrongly formatted"; +} + +TEST(VmFlagsParserTest, ParseTwoInstancesVhostUserVsockFlagFullJson) { + const char* test_string = R""""( +{ + "instances" : + [ + { + "vm": { + "crosvm":{ + "vhost_user_vsock": "true" + } + } + }, + { + "vm": { + "crosvm":{ + "vhost_user_vsock": "false" + } + } + } + ] +} + )""""; + + Json::Value json_configs; + std::string json_text(test_string); + + EXPECT_TRUE(ParseJsonString(json_text, json_configs)) + << "Invalid Json string"; + auto serialized_data = LaunchCvdParserTester(json_configs); + EXPECT_TRUE(serialized_data.ok()) << serialized_data.error().Trace(); + EXPECT_TRUE(FindConfig(*serialized_data, R"(--vhost_user_vsock=true,false)")) + << "vhost_user_vsock flag is missing or wrongly formatted"; +} + } // namespace cuttlefish diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/load_config.proto b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/load_config.proto index a9177160a87..c80696c2b72 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/load_config.proto +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/load_config.proto @@ -199,6 +199,7 @@ message Crosvm { optional bool enable_sandbox = 1; optional bool simple_media_device = 2; optional string v4l2_proxy = 3; + optional string vhost_user_vsock = 4; } message Gem5 {} diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0.xml b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0.xml index 655c37a967a..25ad8495b39 100755 --- a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0.xml +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0.xml @@ -177,5 +177,9 @@ - + + + 3F979580BFFE8210428031A073BE211797 + 89049032000001000000000254806852 + diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml index b4363da9308..1b65eb621a4 100755 --- a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml @@ -203,5 +203,9 @@ - + + + 3F979580BFFE8210428031A073BE211797 + 89049032000001000000000254806852 + diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1.xml b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1.xml new file mode 100755 index 00000000000..f1f77b54035 --- /dev/null +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1.xml @@ -0,0 +1,185 @@ + + + + 144,0,621A8205422100300483022F008A01058B032F0601800200C08801F0 + 144,0,61184F10A0000003431002FF86FF0389FFFFFFFF50044353494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,61184F10A0000000871002FF86FF0389FFFFFFFF50045553494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,62178202412183022FE28A01058B032F06038002000A880110 + 144,0,98683081462002318389 + + 89860318640220133898 + + + 144,0,62178202412183022F058A01058B032F060280020004880128 + 144,0,FFFFFFFF + + + + + + 144,0,62198205422100400283024F308A01058B036F0606800200808800 + 144,0,A81EC0034F3A01C1034F3306C5034F0902C4034F1104C6034F2503C9034F3107A905CA034F5008AA0FC2034F4A09C7034F4B0AC8034F4C0BFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621A8205422100140A83024F4C8A01058B036F060E800200C8880158 + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621A820542210001FA83024F338A01058B036F060E800200FA880130 + + + 144,0,621A820542210002FA83024F098A01058B036F060E800201F4880110 + + + 144,0,621A82054221000FFA83024F118A01058B036F060E80020EA6880120 + + + + + + + + 311740123456790 + + + 144,0,621982054221001C0283026F408A01058B036F0605800200388800 + 144,0,000000000000000000000000000007915155214365F7FFFFFFFFFFFF + + + 144,0,62198205422100050183026FC98A01058B036F0602800200058800 + 144,0,0100000000 + + + 144,0,621982054221001C0283026F408A01058B036F06058002003E8800 + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07915155674523F1FFFFFFFFFFFF + + + 144,0,62178202412183026FAD8A01058B036F060180020004880118 + 144,0,00000003 + + + 144,0,62198205422100050183026FCA8A01058B036F060E800200058800 + 144,0,0000000000 + + + 106,130 + + + 144,0,621C8202412183026F7BA5038001718A01058B036F06038002001E880168 + 144,0,64F00064F02064F04064F07064F080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621982054221001C0A83026F3B8A01058B036F0605800201188800 + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + + + + + 4,6124 + 76,62228202412183025031A503C001408A01058B066F0601010001800200108102002288009000 + 36,A706300404024401A5063004040244029000 + + + + 6,019000 + 4,6b00 + + + + + + + + PINSTATE_UNKNOWN + 1234 + 12345678 + 3 + 10 + 1234 + 12345678 + 3 + 10 + + + + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + + + + + + + + + + + + + + + + + + + + + 3F979580BFFE8210428031A073BE211797 + 89049032000001000000000254806853 + + diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1_for_CtsCarrierApiTestCases.xml b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1_for_CtsCarrierApiTestCases.xml new file mode 100755 index 00000000000..c3e6db772bc --- /dev/null +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/etc/files/iccprofile_for_sim1_for_CtsCarrierApiTestCases.xml @@ -0,0 +1,211 @@ + + + + 144,0,621A8205422100300483022F008A01058B032F0601800200C08801F0 + 144,0,61184F10A0000003431002FF86FF0389FFFFFFFF50044353494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,61184F10A0000000871002FF86FF0389FFFFFFFF50045553494DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,62178202412183022FE28A01058B032F06038002000A880110 + 144,0,98683081462002318389 + + 89860318640220133898 + + + 144,0,62178202412183022F058A01058B032F060280020004880128 + 144,0,FFFFFFFF + + + + + + 144,0,62198205422100400283024F308A01058B036F0606800200808800 + 144,0,A81EC0034F3A01C1034F3306C5034F0902C4034F1104C6034F2503C9034F3107A905CA034F5008AA0FC2034F4A09C7034F4B0AC8034F4C0BFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621A8205422100140A83024F4C8A01058B036F060E800200C8880158 + 144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FFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621A820542210001FA83024F338A01058B036F060E800200FA880130 + + + 144,0,621A820542210002FA83024F098A01058B036F060E800201F4880110 + + + 144,0,621A82054221000FFA83024F118A01058B036F060E80020EA6880120 + + + + + + + + 311740123456790 + + + 144,0,621982054221001C0283026F408A01058B036F0605800200388800 + 144,0,00000000000000000000000000000891688118109844F0FFFFFFFFFF + + + 144,0,62258205422100040183026FC9A503C001408A01058B066F060103000080020004810200188800 + 144,0,01000000 + + + 144,0,62178202412183026FAD8A01058B036F060180020004880118 + 144,0,00000002 + + + 144,0,62258205422100260483026FC7A503C001408A01058B066F060103000080020098810200AC8800 + 144,0 + 144,0 + 144,0 + + + 144,0,62198205422100050183026FCA8A01058B036F060E800200058800 + 144,0,0000000000 + + + 106,130 + + + 144,0,621C8202412183026F7BA5038001718A01058B036F06038002001E880168 + 144,0,64F00064F02064F04064F07064F080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + 144,0,621982054221001C0A83026F3B8A01058B036F0605800201188800 + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 144,0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + + + + + + + + 76,62228202412183024300A503C001408A01058B066F0601010001800201DC810201EE88009000 + 516,30088200300404024310301AA0120410A000000476416E64726F696443545340300404024311301AA0120410A000000476416E64726F696443545341300404024312301AA0120410A000000476416E64726F696443545342300404024313301AA0120410A000000476416E64726F696443545343300404024314301AA0120410A000000476416E64726F696443545344300404024315301AA0120410A000000476416E64726F696443545345300404024316301AA0120410A000000476416E64726F6964435453463004040243173010A0080406FFFFFFFFFFFF300404024318301AA0120410A000000476416E64726F696443545347300404024313301AA0129000 + + + 76,62228202412183024318A503C001408A01058B066F0601010001800200188102002A88009000 + 124,3016041461ED377E85D386A8DFEE6B864BD85B0BFAA5AF8130220420CE7B2B47AE2B7552C8F92CC29124279883041FB623A5F194A82C9BF15D492AA09000 + + + + + 6,019000 + 110,62338202782183023F00A50C80016187010183040007DBF08A01058B062F0601020002C60C90016083010183010A83010D8102FFFF9000 + 6,019000 + 4,9000 + 4,6C35 + 4,6B00 + 4,9000 + 4,6D00 + 4,6B00 + 4,6A82 + 4,6A81 + 4,6E00 + 4,9000 + 24,983311111111111111029000 + 78,622382054221004A1283022F06A503C001408A01058B062F060101000080020534810205489000 + + + + + 6,019000 + 4,6b00 + + + + + + + + PINSTATE_UNKNOWN + 1234 + 12345678 + 3 + 10 + 1234 + 12345678 + 3 + 10 + + + + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + DISABLE + + + + + + + + + + + + + + + + + + + + + 3F979580BFFE8210428031A073BE211797 + 89049032000001000000000254806853 + + diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/main.cpp b/base/cvd/cuttlefish/host/commands/modem_simulator/main.cpp index 3bfc1ec2e99..040b5cce472 100644 --- a/base/cvd/cuttlefish/host/commands/modem_simulator/main.cpp +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/main.cpp @@ -89,7 +89,9 @@ int ModemSimulatorMain(int argc, char** argv) { NvramConfig::InitNvramConfigService(server_fds.size(), FLAGS_sim_type); // Don't get a SIGPIPE from the clients - if (sigaction(SIGPIPE, nullptr, nullptr) != 0) { + struct sigaction sa{}; + sa.sa_handler = SIG_IGN; + if (sigaction(SIGPIPE, &sa, nullptr) != 0) { LOG(ERROR) << "Failed to set SIGPIPE to be ignored: " << strerror(errno); } diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.cpp b/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.cpp index 0d5f7646fd4..46f4d802781 100644 --- a/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.cpp +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.cpp @@ -313,6 +313,12 @@ std::vector SimService::InitializeCommandHandlers() { CommandHandler( "+CICCID", [this](const Client& client) { this->HandleGetIccId(client); }), + CommandHandler( + "+CEID", + [this](const Client& client) { this->HandleGetEid(client); }), + CommandHandler( + "+CATR", + [this](const Client& client) { this->HandleGetAtr(client); }), CommandHandler("+CLCK=", [this](const Client& client, std::string& cmd) { this->HandleFacilityLock(client, cmd); @@ -1323,6 +1329,58 @@ void SimService::HandleGetIccId(const Client& client) { client.SendCommandResponse(responses); } +void SimService::HandleGetEid(const Client& client) { + std::vector responses; + + XMLElement* root = sim_file_system_.GetRootElement(); + if (!root) { + client.SendCommandResponse(kCmeErrorOperationNotAllowed); + return; + } + + XMLElement* card_profile = root->FirstChildElement("CardProfile"); + if (!card_profile) { + client.SendCommandResponse(kCmeErrorNotFound); + return; + } + + XMLElement* final = card_profile->FirstChildElement("EID"); + if (!final) { + client.SendCommandResponse(kCmeErrorNotFound); + return; + } + + responses.push_back("+CEID: " + std::string(final->GetText())); + responses.push_back("OK"); + client.SendCommandResponse(responses); +} + +void SimService::HandleGetAtr(const Client& client) { + std::vector responses; + + XMLElement* root = sim_file_system_.GetRootElement(); + if (!root) { + client.SendCommandResponse(kCmeErrorOperationNotAllowed); + return; + } + + XMLElement* card_profile = root->FirstChildElement("CardProfile"); + if (!card_profile) { + client.SendCommandResponse(kCmeErrorNotFound); + return; + } + + XMLElement* final = card_profile->FirstChildElement("ATR"); + if (!final) { + client.SendCommandResponse(kCmeErrorNotFound); + return; + } + + responses.push_back("+CATR: " + std::string(final->GetText())); + responses.push_back("OK"); + client.SendCommandResponse(responses); +} + /* * AT+CLCK * Execute command is used to lock, unlock or interrogate a MT or a network diff --git a/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.h b/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.h index 198aa697bfb..e3695f7791f 100644 --- a/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.h +++ b/base/cvd/cuttlefish/host/commands/modem_simulator/sim_service.h @@ -42,6 +42,8 @@ class SimService : public ModemService, public std::enable_shared_from_this/dev/null && update-grub || true' +else + echo "No old kernel packages to remove" +fi + # Skip unmounting: # Sometimes systemd starts, making it hard to unmount # In any case we'll unmount cleanly when the instance shuts down