4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
45 flag.StringVar(&infile, "i", "stripped.drv", "input drv file")
46 flag.StringVar(&glob, "r", "", "model search pattern")
47 flag.StringVar(&product, "p", "", "product search pattern")
48 flag.StringVar(&listmod, "l", "", "list models")
49 flag.StringVar(&listprod, "c", "", "list products")
50 flag.StringVar(&cpuprofile, "f", "", "write cpu profile to file")
58 f, err := os.Create(cpuprofile)
62 pprof.StartCPUProfile(f)
63 defer pprof.StopCPUProfile()
72 drvm := drv.LoadDrvm(listmod)
78 drvm := drv.LoadDrvm(listprod)
83 drvm := drv.LoadDrvm(infile)
86 outfile, err = ioutil.TempFile("/tmp", "DRV")
93 defer os.Remove(outfile.Name())
97 if drvm.PrintModel(glob, outfile) != nil {
98 drvm.PrintProduct(glob, outfile)
101 if drvm.PrintProduct(product, outfile) != nil {
102 drvm.PrintModel(product, outfile)
106 cmd := exec.Command("ppdc", "-v", "-d", ".", outfile.Name())
107 out,err := cmd.Output()
109 fmt.Printf("cannot create ppd for model %s : %s\n", glob, err)