All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.objectos.rio.GentooRealtek Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014 Objectos, Fábrica de Software LTDA.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package br.com.objectos.rio;

import static java.lang.String.format;

import java.util.List;

import com.google.common.collect.ImmutableList;

/**
 * @author [email protected] (Marcio Endo)
 */
class GentooRealtek implements HasCommandList {

  private final String tarball;

  public GentooRealtek(String tarball) {
    this.tarball = tarball;
  }

  @Override
  public List toCommandList() {
    String makeopts = format("-C /usr/src/linux SUBDIRS=/usr/src/%s/src", tarball);
    String modulesDir = "kernel/drivers/net/ethernet/realtek";

    return ImmutableList. builder()
        .add(cmd("cd /usr/src"))
        .add(cmd("tar xjvf /usr/portage/distfiles/%s.tar.bz2", tarball))
        .add(cmd("cd %s/src", tarball))
        .add(cmd("make %s clean", makeopts))
        .add(cmd("make %s modules", makeopts))
        .add(cmd("make %s INSTALL_MOD_DIR=%s modules_install", makeopts, modulesDir))
        .build();
  }

  private String cmd(String format, Object... args) {
    return String.format(format, args);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy