3 Star 2 Fork 0

Gitee 极速下载 / ali-kernel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/alibaba/ali_kernel
克隆/下载
kabitool 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
Tao Ma 提交于 2013-05-20 13:50 . Init commit for Alibaba Kernel.
#!/usr/bin/python
#
# kabitool - Red Hat kABI extraction tool (version 2)
#
# We use this script to generate RPM dependencies based on symversions.
#
# Author: Jon Masters <jcm@redhat.com>
# Copyright (C) 2009 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# General Public License (GPL).
# Changelog:
#
# 2009/08/01 - New version based on kABI dep plan for RHEL6.
#
__author__ = "Jon Masters <jcm@redhat.com>"
__version__ = "$Revisions: 2.0 $"
__date__ = "$Date$"
__copyright__ = "Copyright (C) 2009 Red Hat, Inc"
__license__ = "GPL"
import getopt
import os
import re
import sha
import string
import sys
true = 1
false = 0
def load_symbols(filename):
"""Load the kernel exported symbols from Module.symvers."""
ksyms = open(filename,"r")
symbols={}
while true:
line = ksyms.readline()
if line == "":
break;
if line == "\n":
continue
checksum,symbol,path,license = string.split(line)
symbols[symbol] = dict(checksum=checksum,
path=path,
license=license)
return symbols
def output_deps(depsfile,symbols):
deps_file = open(depsfile,"w")
for symbol in sorted(symbols.keys()):
deps_file.write("kernel("+symbol+") = " +
symbols[symbol]['checksum'] + "\n")
def usage():
print """
kabitool: process Module.symvers into useful exported kABI dependencies
kabitool [-k kernel] [-s symbols ]
-o The file to output sorted dependencies to
-s The Module.symvers file to import from
"""
if __name__ == "__main__":
symdeps_file = ""
symvers_file = ""
opts, args = getopt.getopt(sys.argv[1:], 'ho:s:')
for o, v in opts:
if o == "-h":
usage()
sys.exit(0)
if o == "-o":
symdeps_file = v
if o == "-s":
symvers_file = v
if (symdeps_file == ""):
symdeps_file = "Module.symdeps"
if (symvers_file == ""):
symvers_file = "Module.symvers"
if not (os.path.isfile(symvers_file)):
print "cannot read Module.symvers file"
usage()
exit(1)
symbols = load_symbols(symvers_file)
output_deps(symdeps_file, symbols)
1
https://gitee.com/mirrors/ali-kernel.git
git@gitee.com:mirrors/ali-kernel.git
mirrors
ali-kernel
ali-kernel
master

搜索帮助