Package org.platformlayer.ops

Examples of org.platformlayer.ops.OpsTarget.executeCommand()


      command = Command.build("yes | mkfs." + filesystem + " {0}", loopbackPartition);
      command.setTimeout(TimeSpan.FIVE_MINUTES);
      target.executeCommand(command);

      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));

      // Don’t force a check based on dates
      target.executeCommand(Command.build("tune2fs -i 0 {0}", loopbackPartition)
          .setTimeout(TimeSpan.FIVE_MINUTES));
View Full Code Here


      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));

      // Don’t force a check based on dates
      target.executeCommand(Command.build("tune2fs -i 0 {0}", loopbackPartition)
          .setTimeout(TimeSpan.FIVE_MINUTES));

      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));
View Full Code Here

      // Don’t force a check based on dates
      target.executeCommand(Command.build("tune2fs -i 0 {0}", loopbackPartition)
          .setTimeout(TimeSpan.FIVE_MINUTES));

      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));

      // Mount on mnt/
      File mntDir = new File(tempDir, "mnt");
      target.executeCommand("mkdir {0}", mntDir);
View Full Code Here

      // Get this onto disk now, so we don't delay later commands
      target.executeCommand(Command.build("sync").setTimeout(TimeSpan.FIVE_MINUTES));

      // Mount on mnt/
      File mntDir = new File(tempDir, "mnt");
      target.executeCommand("mkdir {0}", mntDir);

      target.executeCommand(Command.build("mount {0} {1}", loopbackPartition, mntDir).setTimeout(
          TimeSpan.FIVE_MINUTES));

      rootfsDir = mntDir;
View Full Code Here

      // Mount on mnt/
      File mntDir = new File(tempDir, "mnt");
      target.executeCommand("mkdir {0}", mntDir);

      target.executeCommand(Command.build("mount {0} {1}", loopbackPartition, mntDir).setTimeout(
          TimeSpan.FIVE_MINUTES));

      rootfsDir = mntDir;
    } else {
      rootfsDir = new File(tempDir, "rootfs");
View Full Code Here

    command.setEnvironment(httpProxyEnv);

    command.setTimeout(TimeSpan.THIRTY_MINUTES);

    try {
      target.executeCommand(command);
    } catch (ProcessExecutionException e) {
      String debootstrapLog = target.readTextFile(new File(rootfsDir, "debootstrap/debootstrap.log"));
      log.warn("Debootstrap log: " + debootstrapLog);

      throw new OpsException("Error running debootstrap", e);
View Full Code Here

      File policyFile = new File(rootfsDir, "usr/sbin/policy-rc.d");
      FileUpload.upload(target, policyFile, policy);
      target.chmod(policyFile, "755");
    }

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
View Full Code Here

    }

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
        rootfsDir);

    if (!buildTar) {
View Full Code Here

    target.executeCommand("mount -t proc proc {0}", new File(rootfsDir, "proc"));

    apt.update(chrootTarget, true);
    target.executeCommand("chroot {0} locale-gen en_US.utf8", rootfsDir);

    target.executeCommand("chroot {0} /bin/bash -c \"DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales\"",
        rootfsDir);

    if (!buildTar) {
      {
        File kernelImgConf = new File(rootfsDir, "etc/kernel-img.conf");
View Full Code Here

        File preseedFile = new File(preseedTmpDir, "kernel.preseed");

        String preseedData = ResourceUtils.get(getClass(), "kernel.preseed");
        FileUpload.upload(target, preseedFile, preseedData);

        target.executeCommand(Command.build("cat {0} | chroot {1} debconf-set-selections", preseedFile,
            rootfsDir));
        apt.install(chrootTarget, kernelPackage);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.