Beispiel #1
0
        private bool RemountRW()
        {
            Print("Remount rootfs RW");
            var    process = SDBLib.CreateSdbProcess();
            string cmdline = DeviceManager.AdjustSdbArgument("shell \"mount / -o remount,rw\"");

            SDBLib.RunSdbProcess(process, cmdline);
            var rc = process.ExitCode;

            process.Close();
            return(rc == 0);
        }
Beispiel #2
0
        private bool SwitchToRoot(bool on)
        {
            Print($"Switch to root: {on}");

            var    process = SDBLib.CreateSdbProcess();
            string cmdline = DeviceManager.AdjustSdbArgument($"root {((on) ? "on" : "off")}");

            SDBLib.RunSdbProcess(process, cmdline);
            var rc = process.ExitCode;

            process.Close();
            return(rc == 0);
        }
Beispiel #3
0
        private bool InstallPackage(string name, ProfilerPackage p)
        {
            string rpm = name + "-" + p.AvailableVersion + "-" + p.AvailableRelease
                         + "." + ArchToSuffix(GetArch()) + ".rpm";
            string package_path = GetRpmsPath() + "/" + rpm;

            Print($"Installing {package_path}");
            var    process = SDBLib.CreateSdbProcess();
            string cmdline = DeviceManager.AdjustSdbArgument($"shell \"rpm -U --force {package_path}\"");

            SDBLib.RunSdbProcess(process, cmdline, true);
            int rc = process.ExitCode;

            process.Close();
            return(rc == 0);
        }
Beispiel #4
0
        private bool PushPackage(string name, ProfilerPackage p)
        {
            string rpm = name + "-" + p.AvailableVersion + "-" + p.AvailableRelease
                         + "." + ArchToSuffix(GetArch()) + ".rpm";
            string src = ToolsPathInfo.OndemandFolderPath + @"\" + rpm;
            string dst = GetRpmsPath() + "/" + rpm;

            Print($"Push {src} -> {dst}");
            var    proc    = SDBLib.CreateSdbProcess(true, true);
            string cmdline = DeviceManager.AdjustSdbArgument($"push \"{src}\" {dst}");

            SDBLib.RunSdbProcess(proc, cmdline, true);
            int rc = proc.ExitCode;

            proc.Close();
            return(rc == 0);
        }