aboutsummaryrefslogtreecommitdiffstats
path: root/target/sdk
Commit message (Collapse)AuthorAgeFilesLines
* sdk: use prepare target to initialize git snapshotJo-Philipp Wich2015-02-083-11/+19
| | | | | | | | | The new approach is less prone to race conditions and will properly snapshot the symlinks prepared by the prereq-build target. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44330
* sdk: rename file to mention target/subtarget and move host system to suffixJo-Philipp Wich2015-02-071-4/+1
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44312
* sdk: track files with git and use it to implement proper clean targetsJo-Philipp Wich2015-01-101-3/+16
| | | | | | | | | | | | Initialize a Git repository in the SDK and use git reset / git clean to rollback any SDK changes with "make clean" or "make dirclean". This approach is more robust than nuking entire directory trees because some parts of them might have been shipped with the original archive. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 43904
* build: add version number to filenamesJo-Philipp Wich2015-01-081-1/+2
| | | | | | | | | | | | This commit introduces a new option CONFIG_VERSION_FILENAMES which causes OpenWrt to embed the version number in generated image files, SDK- and ImageBuilder archives. The option is enabled by default if CONFIG_VERSIONOPT is set. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 43869
* sdk: add missing kernel include filesFelix Fietkau2014-12-111-0/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43621
* sdk: improve feed setupJo-Philipp Wich2014-10-161-7/+12
| | | | | | | | | - Add current buildroot scm url as base feed to feeds.conf - Prefer feeds.conf over feeds.conf.default when generating the SDK feeds.conf.default Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 42935
* sdk: predefine kernel version magicJo-Philipp Wich2014-09-171-0/+1
| | | | | | | | | | | | | | | Kernel modules which are built using the SDK do not have access to the .vermagic file in the Linux build dir, therefore the generated .ipk metadata depends on kernel versions like '3.10.49-1-unknown' which are not satisfiable by the kernel meta package in the image. Fix this problem by substituting 'unknown' with the current version magic in include/kernel.mk when packing the SDK. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 42590
* sdk: keep $(STAGING_DIR)/usr/bin, at least curl needs itFelix Fietkau2014-09-011-2/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42397
* target/sdk: strip host binaries before packingFelix Fietkau2014-03-131-2/+19
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39915
* target/sdk: leave out some unnecessary directoriesFelix Fietkau2014-03-131-1/+11
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39914
* target/sdk: use .config instead of unconditionally enabling all build dirsFelix Fietkau2014-03-131-0/+9
| | | | | | | | Call make defconfig on every build to catch newly added packages Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39913
* target/sdk: fix parallel build callsFelix Fietkau2014-03-131-0/+5
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39912
* target/sdk: remove obsolete make calls for the ancient package directory formatFelix Fietkau2014-03-131-3/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39911
* target/sdk: generate a Config.in file with the settings of the build that ↵Felix Fietkau2014-03-103-0/+33
| | | | | | | | | | the SDK was generated from This allows make oldconfig/menuconfig to run Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39864
* target/sdk: remove obsolete compatibility makefilesFelix Fietkau2014-03-103-102/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39863
* target/sdk: remove obsolete exclude lineFelix Fietkau2014-03-101-1/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39861
* target/sdk: remove some unnecessary filesFelix Fietkau2014-03-101-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39859
* target/sdk: add support for building kernel module packagesFelix Fietkau2014-03-101-3/+28
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39858
* build: consistently use 'depends on' instead of 'depends'Felix Fietkau2013-04-171-1/+1
| | | | | | | | make the syntax more compatible with kernel menuconfig Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 36351
* Fix feeds.conf.default when no SVN info presentDaniel Dickinson2012-11-011-2/+3
| | | | SVN-Revision: 34051
* derive system from hostcc to allow building inside a chrootJohn Crispin2012-08-221-2/+2
| | | | SVN-Revision: 33228
* don't overwrite version.mk, substitute REVISION insteadJo-Philipp Wich2012-04-131-1/+1
| | | | SVN-Revision: 31271
* make sure .config gets copied as file When using scripts/env, .config is ↵Jo-Philipp Wich2012-01-281-1/+1
| | | | | | most likely a symbolic link pointing to env/.config. Previously the symbolic link got copied as-is into the SDK tarball, leading to a dangling .config symlink on the target system which prevented the SDK from working. SVN-Revision: 29927
* fix generation for arm platforms Based on patch by Roman Yeryomin ↵Jo-Philipp Wich2011-09-131-1/+5
| | | | | | <roman@advem.lv> SVN-Revision: 28225
* sdk: fix up paths for $(ARCH_SUFFIX)Felix Fietkau2010-03-171-1/+1
| | | | SVN-Revision: 20254
* disable IB & SDK when using an external toolchain (closes: #6001)Nicolas Thill2009-12-181-0/+1
| | | | SVN-Revision: 18837
* do not exclude the share directory for bison and other programs to work (#5629)Florian Fainelli2009-08-091-1/+5
| | | | SVN-Revision: 17198
* now that we support multiple libc, include the gcc version, libc type and ↵Florian Fainelli2009-06-181-1/+1
| | | | | | libc version in the SDK filename SVN-Revision: 16508
* do not copy all the staging_dir/ directories, only the right toolchain and ↵Florian Fainelli2009-06-181-1/+1
| | | | | | target directories SVN-Revision: 16507
* get rid of $Id$ - it has never helped us and it has broken too many patches ;)Felix Fietkau2009-04-171-1/+0
| | | | SVN-Revision: 15242
* allow SDK to install trunk packages with scripts/feeds & build them, instead ↵Nicolas Thill2008-09-241-1/+6
| | | | | | of trying to embed precompiled ones (closes: #3097) SVN-Revision: 12689
* add LICENSE & minimal Config.in files (closes: #3710)Nicolas Thill2008-08-222-0/+3
| | | | SVN-Revision: 12367
* add feeds config file to SDKNicolas Thill2008-08-221-1/+2
| | | | SVN-Revision: 12365
* some more build system cleanupFelix Fietkau2008-08-171-0/+2
| | | | SVN-Revision: 12329
* Detach the building of sdk and imagebuilder from "Select all packages by ↵Felix Fietkau2008-03-191-1/+0
| | | | | | | | default", since those really represent two distinct build operations from normal package selection. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> SVN-Revision: 10621
* fix the sdkFelix Fietkau2007-12-143-93/+69
| | | | SVN-Revision: 9747
* strip -$(KERNEL) from sdk/imagebuilder namesFelix Fietkau2007-12-131-1/+1
| | | | SVN-Revision: 9742
* suppress bug after compiling last package in kamikaze SDK.Felix Fietkau2007-12-091-3/+3
| | | | | | | | This patch corrects https://dev.openwrt.org/ticket/2508 An error was raised when no Config.in file was found in package/ Signed-off-by: Julien Pinon <julien.pinon@luceor.com> SVN-Revision: 9692
* Fix the sdk generation with the new staging_dir layoutFlorian Fainelli2007-08-271-3/+4
| | | | SVN-Revision: 8503
* fix sdk buildFelix Fietkau2007-07-021-1/+1
| | | | SVN-Revision: 7855
* add portability fixes from #1720Felix Fietkau2007-06-301-1/+1
| | | | SVN-Revision: 7791
* fixes for a few build errors on osx without finkFelix Fietkau2007-04-292-3/+3
| | | | SVN-Revision: 7065
* revert find | xargs => find | exec changes - this is completely unnecessary ↵Felix Fietkau2007-04-121-2/+2
| | | | | | and introduces additional dependencies that we do not need SVN-Revision: 6942
* Accidentially broke sdk and imagebuilder in [6857]Mike Baker2007-04-031-6/+6
| | | | SVN-Revision: 6858
* more [6849]Mike Baker2007-04-031-2/+2
| | | | SVN-Revision: 6850
* Use find -exec instead of xargsFlorian Fainelli2007-04-021-2/+2
| | | | SVN-Revision: 6837
* Remove extra -Mike Baker2007-03-301-1/+1
| | | | SVN-Revision: 6763
* fix the sdkFelix Fietkau2007-03-261-11/+28
| | | | SVN-Revision: 6718
* Add an 'Image Configuration' menu to menuconfig Packages can export a list ↵Felix Fietkau2007-03-161-0/+3
| | | | | | of config options with labels and data types through the metadata. The selected config values will be exported to the target filesystem in /etc/uci-defaults and applied on the first boot. SVN-Revision: 6572
* Fix config checks for Image Builder and SDK - only build them when ↵Felix Fietkau2007-01-141-3/+2
| | | | | | requested. Clear all packages from bin/packages at the beginning of package/compile when the Image Builder is selected, because the Image Builder can't handle multiple versions of the same package. SVN-Revision: 6102
mi">0: dst_base = 1 if dst_base > base: return value / (dst_base / base) else: return value * (base / dst_base) def err(msg): print >>sys.stderr, "Error:", msg def handle_xend_error(cmd, dom, ex): error = str(ex) if error == "Not found" and dom != None: err("Domain '%s' not found when running 'xm %s'" % (dom, cmd)) sys.exit(1) else: raise ex ######################################################################### # # Main xm functions # ######################################################################### def xm_create(args): from xen.xm import create # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") create.main(args) def xm_save(args): arg_check(args,2,"save") dom = args[0] # TODO: should check if this exists savefile = os.path.abspath(args[1]) from xen.xend.XendClient import server server.xend_domain_save(dom, savefile) def xm_restore(args): arg_check(args,1,"restore") savefile = os.path.abspath(args[0]) from xen.xend.XendClient import server info = server.xend_domain_restore(savefile) PrettyPrint.prettyprint(info) id = sxp.child_value(info, 'id') if id is not None: server.xend_domain_unpause(id) def xm_migrate(args): # TODO: arg_check from xen.xm import migrate # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") migrate.main(args) def xm_list(args): use_long = 0 show_vcpus = 0 try: (options, params) = getopt(args, 'lv', ['long','vcpus']) except GetoptError, opterr: err(opterr) sys.exit(1) n = len(params) for (k, v) in options: if k in ['-l', '--long']: use_long = 1 if k in ['-v', '--vcpus']: show_vcpus = 1 domsinfo = [] from xen.xend.XendClient import server if n == 0: doms = server.xend_domains() doms.sort() else: doms = params for dom in doms: info = server.xend_domain(dom) domsinfo.append(parse_doms_info(info)) if use_long: for dom in doms: info = server.xend_domain(dom) PrettyPrint.prettyprint(info) elif show_vcpus: xm_show_vcpus(domsinfo) else: xm_brief_list(domsinfo) def parse_doms_info(info): dominfo = {} dominfo['dom'] = int(sxp.child_value(info, 'id', '-1')) dominfo['name'] = sxp.child_value(info, 'name', '??') dominfo['mem'] = int(sxp.child_value(info, 'memory', '0')) dominfo['cpu'] = str(sxp.child_value(info, 'cpu', '0')) dominfo['vcpus'] = int(sxp.child_value(info, 'vcpus', '0')) # if there is more than 1 cpu, the value doesn't mean much if dominfo['vcpus'] > 1: dominfo['cpu'] = '-' dominfo['state'] = sxp.child_value(info, 'state', '??') dominfo['cpu_time'] = float(sxp.child_value(info, 'cpu_time', '0')) # security identifiers if ((int(sxp.child_value(info, 'ssidref', '0'))) != 0): dominfo['ssidref1'] = int(sxp.child_value(info, 'ssidref', '0')) & 0xffff dominfo['ssidref2'] = (int(sxp.child_value(info, 'ssidref', '0')) >> 16) & 0xffff # get out the vcpu information dominfo['vcpulist'] = [] vcpu_to_cpu = sxp.child_value(info, 'vcpu_to_cpu', '-1').split('|') cpumap = sxp.child_value(info, 'cpumap', []) mask = ((int(sxp.child_value(info, 'vcpus', '0')))**2) - 1 count = 0 for cpu in vcpu_to_cpu: vcpuinfo = {} vcpuinfo['name'] = sxp.child_value(info, 'name', '??') vcpuinfo['dom'] = int(sxp.child_value(info, 'id', '-1')) vcpuinfo['vcpu'] = int(count) vcpuinfo['cpu'] = int(cpu) vcpuinfo['cpumap'] = int(cpumap[count])&mask count = count + 1 dominfo['vcpulist'].append(vcpuinfo) return dominfo def xm_brief_list(domsinfo): print 'Name Id Mem(MB) CPU VCPU(s) State Time(s)' for dominfo in domsinfo: if dominfo.has_key("ssidref1"): print ("%(name)-16s %(dom)3d %(mem)7d %(cpu)3s %(vcpus)5d %(state)5s %(cpu_time)7.1f s:%(ssidref2)02x/p:%(ssidref1)02x" % dominfo) else: print ("%(name)-16s %(dom)3d %(mem)7d %(cpu)3s %(vcpus)5d %(state)5s %(cpu_time)7.1f" % dominfo) def xm_show_vcpus(domsinfo): print 'Name Id VCPU CPU CPUMAP' for dominfo in domsinfo: for vcpuinfo in dominfo['vcpulist']: print ("%(name)-16s %(dom)3d %(vcpu)4d %(cpu)3d 0x%(cpumap)x" % vcpuinfo) def xm_vcpu_list(args): args.insert(0,"-v") xm_list(args) def xm_destroy(args): arg_check(args,1,"destroy") from xen.xm import destroy # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") destroy.main(args) def xm_reboot(args): arg_check(args,1,"reboot") # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") args.insert(2,"-R") from xen.xm import shutdown shutdown.main(args) def xm_shutdown(args): arg_check(args,1,"shutdown") # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") from xen.xm import shutdown shutdown.main(args) def xm_sysrq(args): from xen.xm import sysrq # ugly hack because the opt parser apparently wants # the subcommand name just to throw it away! args.insert(0,"bogus") sysrq.main(args) def xm_pause(args): arg_check(args, 1, "pause") dom = args[0] from xen.xend.XendClient import server server.xend_domain_pause(dom) def xm_unpause(args): arg_check(args, 1, "unpause") dom = args[0] from xen.xend.XendClient import server server.xend_domain_unpause(dom) ############################################################# def cpu_make_map(cpulist): cpus = [] cpumap = 0 for c in cpulist.split(','): if c.find('-') != -1: (x,y) = c.split('-') for i in range(int(x),int(y)+1): cpus.append(int(i)) else: cpus.append(int(c)) cpus.sort() for c in cpus: cpumap = cpumap | 1<<c return cpumap def xm_cpus_set(args): arg_check(args, 3, "cpus-set") dom = args[0] vcpu = int(args[1]) cpumap = cpu_make_map(args[2]) from xen.xend.XendClient import server server.xend_domain_pincpu(dom, vcpu, cpumap) def xm_mem_max(args): arg_check(args, 2, "mem-max") dom = args[0] mem = int_unit(args[1], 'm') from xen.xend.XendClient import server server.xend_domain_maxmem_set(dom, mem) def xm_mem_set(args): arg_check(args, 2, "mem-set") dom = args[0] mem_target = int_unit(args[1], 'm') from xen.xend.XendClient import server server.xend_domain_mem_target_set(dom, mem_target) # TODO: why does this lookup by name? and what if that fails!? def xm_vcpu_enable(args): arg_check(args, 2, "vcpu-enable") name = args[0] vcpu = int(args[1]) from xen.xend.XendClient import server dom = server.xend_domain(name) id = sxp.child_value(dom, 'id') server.xend_domain_vcpu_hotplug(id, vcpu, 1) def xm_vcpu_disable(args): arg_check(args, 2, "vcpu-disable") name = args[0] vcpu = int(args[1]) from xen.xend.XendClient import server dom = server.xend_domain(name) id = sxp.child_value(dom, 'id') server.xend_domain_vcpu_hotplug(id, vcpu, 0) def xm_domid(args): name = args[0] from xen.xend.XendClient import server dom = server.xend_domain(name) print sxp.child_value(dom, 'id') def xm_domname(args): name = args[0] from xen.xend.XendClient import server dom = server.xend_domain(name) print sxp.child_value(dom, 'name') def xm_bvt(args): arg_check(args, 6, "bvt") dom = args[0] v = map(long, args[1:6]) from xen.xend.XendClient import server server.xend_domain_cpu_bvt_set(dom, *v) def xm_bvt_ctxallow(args): arg_check(args, 1, "bvt_ctxallow") slice = int(args[0]) from xen.xend.XendClient import server server.xend_node_cpu_bvt_slice_set(slice) def xm_sedf(args): arg_check(args, 6, "sedf") dom = args[0] v = map(int, args[1:6]) from xen.xend.XendClient import server server.xend_domain_cpu_sedf_set(dom, *v) def xm_info(args): from xen.xend.XendClient import server info = server.xend_node() for x in info[1:]: print "%-23s:" % x[0], x[1] # TODO: remove as soon as console server shows up def xm_console(args): arg_check(args,1,"console") dom = args[0] from xen.xend.XendClient import server info = server.xend_domain(dom) domid = int(sxp.child_value(info, 'id', '-1')) cmd = "/usr/libexec/xen/xenconsole %d" % domid os.execvp('/usr/libexec/xen/xenconsole', cmd.split()) console = sxp.child(info, "console") def xm_dmesg(args): gopts = Opts(use="""[-c|--clear] Read Xen's message buffer (boot output, warning and error messages) or clear its contents if the [-c|--clear] flag is specified. """) gopts.opt('clear', short='c', fn=set_true, default=0, use="Clear the contents of the Xen message buffer.") # Work around for gopts args.insert(0,"bogus") gopts.parse(args) if not (1 <= len(args) <= 2): err('Invalid arguments: ' + str(args)) from xen.xend.XendClient import server if not gopts.vals.clear: print server.xend_node_get_dmesg() else: server.xend_node_clear_dmesg() def xm_log(args): from xen.xend.XendClient import server print server.xend_node_log() def xm_network_limit(args): arg_check(args,4,"network-limit") dom = args[0] v = map(int, args[1:4]) from xen.xend.XendClient import server server.xend_domain_vif_limit(dom, *v) def xm_network_list(args): arg_check(args,1,"network-list") dom = args[0] from xen.xend.XendClient import server for x in server.xend_domain_devices(dom, 'vif'): sxp.show(x) print def xm_block_list(args): arg_check(args,1,"block-list") dom = args[0] from xen.xend.XendClient import server for x in server.xend_domain_devices(dom, 'vbd'): sxp.show(x) print def xm_block_create(args): n = len(args) if n < 4 or n > 5: err("%s: Invalid argument(s)" % args[0]) usage("block-create") dom = args[0] vbd = ['vbd', ['uname', args[1]], ['dev', args[2]], ['mode', args[3]]] if n == 5: vbd.append(['backend', args[4]]) from xen.xend.XendClient import server server.xend_domain_device_create(dom, vbd) def xm_block_refresh(args): arg_check(args,2,"block-refresh") dom = args[0] dev = args[1] from xen.xend.XendClient import server server.xend_domain_device_refresh(dom, 'vbd', dev) def xm_block_destroy(args): arg_check(args,2,"block-destroy") dom = args[0] dev = args[1] from xen.xend.XendClient import server server.xend_domain_device_destroy(dom, 'vbd', dev) commands = { # console commands "console": xm_console, # domain commands "domid": xm_domid, "domname": xm_domname, "create": xm_create, "destroy": xm_destroy, "restore": xm_restore, "save": xm_save, "shutdown": xm_shutdown, "reboot": xm_reboot, "list": xm_list, # memory commands "mem-max": xm_mem_max, "mem-set": xm_mem_set, # cpu commands "cpus-set": xm_cpus_set, # "cpus-list": xm_cpus_list, "vcpu-enable": xm_vcpu_enable, "vcpu-disable": xm_vcpu_disable, "vcpu-list": xm_vcpu_list, # migration "migrate": xm_migrate, # special "sysrq": xm_sysrq, "pause": xm_pause, "unpause": xm_unpause, # host commands "dmesg": xm_dmesg, "info": xm_info, "log": xm_log, # scheduler "bvt": xm_bvt, "bvt_ctxallow": xm_bvt_ctxallow, "sedf": xm_sedf, # block "block-create": xm_block_create, "block-destroy": xm_block_destroy, "block-list": xm_block_list, "block-refresh": xm_block_refresh, # network "network-limit": xm_network_limit, "network-list": xm_network_list } aliases = { "balloon": "mem-set", "vif-list": "network-list", "vif-limit": "network-limit", "vbd-create": "block-create", "vbd-destroy": "block-destroy", "vbd-list": "block-list", "vbd-refresh": "block-refresh", } help = { "--long": longhelp } def xm_lookup_cmd(cmd): if commands.has_key(cmd): return commands[cmd] elif aliases.has_key(cmd): deprecated(cmd,aliases[cmd]) return commands[aliases[cmd]] else: if len( cmd ) > 1: matched_commands = filter( lambda (command, func): command[ 0:len(cmd) ] == cmd, commands.iteritems() ) if len( matched_commands ) == 1: return matched_commands[0][1] err('Sub Command %s not found!' % cmd) usage() def deprecated(old,new): err('Option %s is deprecated, and will be removed in future!!!' % old) err('Option %s is the new replacement, see "xm help %s" for more info' % (new, new)) def usage(cmd=None): if cmd == "full": print fullhelp elif help.has_key(cmd): print help[cmd] else: print shorthelp sys.exit(1) def main(argv=sys.argv): if len(argv) < 2: usage() if re.compile('-*help').match(argv[1]): if len(argv) > 2 and help.has_key(argv[2]): usage(argv[2]) else: usage() sys.exit(0) cmd = xm_lookup_cmd(argv[1]) # strip off prog name and subcmd args = argv[2:] if cmd: try: from xen.xend.XendClient import XendError rc = cmd(args) if rc: usage() except socket.error, ex: print >>sys.stderr, ex err("Error connecting to xend, is xend running?") sys.exit(1) except IOError: err("Most commands need root access. Please try again as root") sys.exit(1) except XendError, ex: if len(args) > 0: handle_xend_error(argv[1], args[1], ex) else: print "Unexpected error:", sys.exc_info()[0] print print "Please report to xen-devel@lists.xensource.com" raise except SystemExit: sys.exit(1) except: print "Unexpected error:", sys.exc_info()[0] print print "Please report to xen-devel@lists.xensource.com" raise else: usage() if __name__ == "__main__": main()