diff options
Diffstat (limited to 'scripts/lib')
227 files changed, 4499 insertions, 296 deletions
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py index 681720d20a..7d6be239da 100644 --- a/scripts/lib/bsp/engine.py +++ b/scripts/lib/bsp/engine.py @@ -756,6 +756,8 @@ class CheckInputLine(ListValInputLine): return None +dirname_substitutions = {} + class SubstrateBase(object): """ Base class for both expanded and unexpanded file and dir container @@ -764,6 +766,7 @@ class SubstrateBase(object): def __init__(self, filename, filebase, out_filebase): self.filename = filename self.filebase = filebase + self.translated_filename = filename self.out_filebase = out_filebase self.raw_lines = [] self.expanded_lines = [] @@ -869,6 +872,167 @@ class SubstrateBase(object): return self.expand_input_tag(tag, lineno) + def append_translated_filename(self, filename): + """ + Simply append filename to translated_filename + """ + self.translated_filename = os.path.join(self.translated_filename, filename) + + def get_substituted_file_or_dir_name(self, first_line, tag): + """ + If file or dir names contain name substitutions, return the name + to substitute. Note that this is just the file or dirname and + doesn't include the path. + """ + filename = first_line.find(tag) + if filename != -1: + filename += len(tag) + substituted_filename = first_line[filename:].strip() + this = substituted_filename.find(" this") + if this != -1: + head, tail = os.path.split(self.filename) + substituted_filename = substituted_filename[:this + 1] + tail + if tag == DIRNAME_TAG: # get rid of .noinstall in dirname + substituted_filename = substituted_filename.split('.')[0] + + return substituted_filename + + def get_substituted_filename(self, first_line): + """ + If a filename contains a name substitution, return the name to + substitute. Note that this is just the filename and doesn't + include the path. + """ + return self.get_substituted_file_or_dir_name(first_line, FILENAME_TAG) + + def get_substituted_dirname(self, first_line): + """ + If a dirname contains a name substitution, return the name to + substitute. Note that this is just the dirname and doesn't + include the path. + """ + return self.get_substituted_file_or_dir_name(first_line, DIRNAME_TAG) + + def substitute_filename(self, first_line): + """ + Find the filename in first_line and append it to translated_filename. + """ + substituted_filename = self.get_substituted_filename(first_line) + self.append_translated_filename(substituted_filename); + + def substitute_dirname(self, first_line): + """ + Find the dirname in first_line and append it to translated_filename. + """ + substituted_dirname = self.get_substituted_dirname(first_line) + self.append_translated_filename(substituted_dirname); + + def is_filename_substitution(self, line): + """ + Do we have a filename subustition? + """ + if line.find(FILENAME_TAG) != -1: + return True + return False + + def is_dirname_substitution(self, line): + """ + Do we have a dirname subustition? + """ + if line.find(DIRNAME_TAG) != -1: + return True + return False + + def translate_dirname(self, first_line): + """ + Just save the first_line mapped by filename. The later pass + through the directories will look for a dirname.noinstall + match and grab the substitution line. + """ + dirname_substitutions[self.filename] = first_line + + def translate_dirnames_in_path(self, path): + """ + Translate dirnames below this file or dir, not including tail. + dirname_substititions is keyed on actual untranslated filenames. + translated_path contains the subsititutions for each element. + """ + remainder = path[len(self.filebase)+1:] + translated_path = untranslated_path = self.filebase + + untranslated_dirs = remainder.split(os.sep) + + for dir in untranslated_dirs: + key = os.path.join(untranslated_path, dir + '.noinstall') + try: + first_line = dirname_substitutions[key] + except KeyError: + translated_path = os.path.join(translated_path, dir) + untranslated_path = os.path.join(untranslated_path, dir) + continue + substituted_dir = self.get_substituted_dirname(first_line) + translated_path = os.path.join(translated_path, substituted_dir) + untranslated_path = os.path.join(untranslated_path, dir) + + return translated_path + + def translate_file_or_dir_name(self): + """ + Originally we were allowed to use open/close/assign tags and python + code in the filename, which fit in nicely with the way we + processed the templates and generated code. Now that we can't + do that, we make those tags proper file contents and have this + pass substitute the nice but non-functional names with those + 'strange' ones, and then proceed as usual. + + So, if files or matching dir<.noinstall> files contain + filename substitutions, this function translates them into the + corresponding 'strange' names, which future passes will expand + as they always have. The resulting pathname is kept in the + file or directory's translated_filename. Another way to think + about it is that self.filename is the input filename, and + translated_filename is the output filename before expansion. + """ + # remove leaf file or dirname + head, tail = os.path.split(self.filename) + translated_path = self.translate_dirnames_in_path(head) + self.translated_filename = translated_path + + # This is a dirname - does it have a matching .noinstall with + # a substitution? If so, apply the dirname subsititution. + if not os.path.isfile(self.filename): + key = self.filename + ".noinstall" + try: + first_line = dirname_substitutions[key] + except KeyError: + self.append_translated_filename(tail) + return + self.substitute_dirname(first_line) + return + + f = open(self.filename) + first_line = f.readline() + f.close() + + # This is a normal filename not needing translation, just use + # it as-is. + if not first_line or not first_line.startswith("#"): + self.append_translated_filename(tail) + return + + # If we have a filename substitution (first line in the file + # is a FILENAME_TAG line) do the substitution now. If we have + # a dirname substitution (DIRNAME_TAG in dirname.noinstall + # meta-file), hash it so we can apply it when we see the + # matching dirname later. Otherwise we have a regular + # filename, just use it as-is. + if self.is_filename_substitution(first_line): + self.substitute_filename(first_line) + elif self.is_dirname_substitution(first_line): + self.translate_dirname(first_line) + else: + self.append_translated_filename(tail) + def expand_file_or_dir_name(self): """ Expand file or dir names into codeline. Dirnames and @@ -878,7 +1042,7 @@ class SubstrateBase(object): """ lineno = 0 - line = self.filename[len(self.filebase):] + line = self.translated_filename[len(self.filebase):] if line.startswith("/"): line = line[1:] opentag_start = -1 @@ -897,7 +1061,6 @@ class SubstrateBase(object): self.parse_error("No close tag found for open tag", lineno, line) # we have a {{ tag i.e. code tag = line[opentag_start + len(OPEN_TAG):end].strip() - if not tag.lstrip().startswith(IF_TAG): self.parse_error("Only 'if' tags are allowed in file or directory names", lineno, line) @@ -933,6 +1096,7 @@ class SubstrateBase(object): Expand the file or dir name first, eventually this ends up creating the file or dir. """ + self.translate_file_or_dir_name() self.expand_file_or_dir_name() @@ -955,6 +1119,9 @@ class SubstrateFile(SubstrateBase): self.read() for lineno, line in enumerate(self.raw_lines): + # only first line can be a filename substitition + if lineno == 0 and line.startswith("#") and FILENAME_TAG in line: + continue # skip it - we've already expanded it expanded_line = self.expand_tag(line, lineno + 1) # humans not 0-based if not expanded_line: expanded_line = NormalLine(line.rstrip()) @@ -1141,7 +1308,7 @@ def gather_inputlines(files): for file in files: if isinstance(file, SubstrateFile): group = None - basename = os.path.basename(file.filename) + basename = os.path.basename(file.translated_filename) codeline = conditional_filename(basename) if codeline: diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py index 7c436d6be0..4cce100d16 100644 --- a/scripts/lib/bsp/help.py +++ b/scripts/lib/bsp/help.py @@ -230,6 +230,7 @@ DESCRIPTION powerpc i386 mips + mips64 x86_64 qemu diff --git a/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf index 44a80d226c..588367a05e 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} @@ -9,19 +10,13 @@ PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" XSERVER ?= "xserver-xorg \ xf86-input-evdev \ xf86-input-mouse \ - xf86-video-omapfb \ + xf86-video-fbdev \ xf86-input-keyboard" -# Ship all kernel modules by default -MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" +MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" -# Allow for MMC booting (required by the NAND-less Beagleboard XM) EXTRA_IMAGEDEPENDS += "u-boot" -# Uncomment the following line to enable the hard floating point abi. Note that -# this breaks some binary libraries and 3D (neither of which ship with -# meta-yocto). For maximum compatibility, leave this disabled. -#DEFAULTTUNE ?= "cortexa8hf-neon" {{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_cortexa8" }} {{ input type:"choice" val:"tune_arm1136jf_s" msg:"arm1136jf-s tuning optimizations" }} {{ input type:"choice" val:"tune_arm920t" msg:"arm920t tuning optimizations" }} @@ -52,6 +47,7 @@ include conf/machine/include/tune-cortexa5.inc {{ if tunefile == "tune_cortexa7": }} include conf/machine/include/tune-cortexa7.inc {{ if tunefile == "tune_cortexa8": }} +DEFAULTTUNE ?= "cortexa8hf-neon" include conf/machine/include/tune-cortexa8.inc {{ if tunefile == "tune_cortexa9": }} include conf/machine/include/tune-cortexa9.inc @@ -75,9 +71,7 @@ include conf/machine/include/tune-xscale.inc IMAGE_FSTYPES += "tar.bz2 jffs2" EXTRA_IMAGECMD_jffs2 = "-lnp " -# 2.6.37 and later kernels use OMAP_SERIAL, ttyO2 -# earlier kernels use ttyS2 -SERIAL_CONSOLE = "115200 ttyO2" +SERIAL_CONSOLE = "115200 ttyO0" {{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} {{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} @@ -90,12 +84,13 @@ PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" -KERNEL_IMAGETYPE = "zImage" -KERNEL_DEVICETREE = "${S}/arch/arm/boot/dts/omap3-beagle.dts ${S}/arch/arm/boot/dts/omap3-beagle-xm.dts" +KERNEL_IMAGETYPE = "uImage" +KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb" +KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" SPL_BINARY = "MLO" UBOOT_SUFFIX = "img" -{{ input type:"edit" name:"uboot_machine" prio:"40" msg:"Please specify a value for UBOOT_MACHINE:" default:"omap3_beagle_config" }} +{{ input type:"edit" name:"uboot_machine" prio:"40" msg:"Please specify a value for UBOOT_MACHINE:" default:"am335x_evm_config" }} UBOOT_MACHINE = "{{=uboot_machine}}" {{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT:" default:"0x80008000" }} UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}" @@ -103,3 +98,5 @@ UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}" UBOOT_LOADADDRESS = "{{=uboot_loadaddress}}" MACHINE_FEATURES = "usbgadget usbhost vfat alsa" + +IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf index 264f3c91ad..bc52893e2a 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this Section "Module" Load "extmod" Load "dbe" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend @@ -0,0 +1,2 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend deleted file mode 100644 index 72d991c7e5..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend +++ /dev/null @@ -1 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-non_hardware.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg index 361343bb58..9bfc90c6f2 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-non_hardware.cfg +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-non_hardware.cfg # # Miscellaneous filesystems # diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc index 56f7f0f1e3..ca5f3b5be9 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH arm diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc index 80640db4a2..9014c2c97e 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH arm diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc index 51eaf2d32c..3f1c252232 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH arm diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg index 10134c81f5..a2e1ae0f75 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.cfg # # System Type # diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc index 24196e6f67..828400df40 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg kconf non-hardware {{machine}}-non_hardware.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend index 25c87a85ac..2fa6231cbf 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend index 08b1f88d1b..35b0958582 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..5f8db03c64 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend index bc6968d832..f04dd0cce4 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend index d221d5f2a4..471ccbcc3e 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..fb4253271a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.10.bbappend index 1e814c54d7..badb3aa239 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend index ca7f8c5978..1e1cc51315 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.17.bbappend index ca7f8c5978..72af58afc1 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -29,4 +30,4 @@ SRC_URI += "file://{{=machine}}-standard.scc \ # the appropriate changes committed to the upstream linux-yocto repo #SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" #SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" -#LINUX_VERSION = "3.14"
\ No newline at end of file +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig index 3b85d3821f..3b85d3821f 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall index 03b7d84ec2..663dddbb0f 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall @@ -2,22 +2,22 @@ {{ input type:"boolean" name:"custom_kernel_remote" prio:"20" msg:"Is the custom kernel you'd like to use in a remote git repo? (y/n)" default:"y"}} {{ if kernel_choice == "custom" and custom_kernel_remote == "y": }} -{{ input type:"edit-git-repo" name:"custom_kernel_remote_path" prio:"20" msg:"Please enter the full URI to the remote git repo (the default corresponds to linux-stable v3.13.9)" default:"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"}} +{{ input type:"edit-git-repo" name:"custom_kernel_remote_path" prio:"20" msg:"Please enter the full URI to the remote git repo (the default corresponds to linux-stable v3.16.3)" default:"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"}} {{ if kernel_choice == "custom" and custom_kernel_remote == "n": }} -{{ input type:"edit-git-repo" name:"custom_kernel_local_path" prio:"20" msg:"You've indicated that you're not using a remote git repo. Please enter the full path to the local git repo you want to use (the default assumes a local linux-stable v3.13.9)" default:"/home/trz/yocto/kernels/linux-stable.git"}} +{{ input type:"edit-git-repo" name:"custom_kernel_local_path" prio:"20" msg:"You've indicated that you're not using a remote git repo. Please enter the full path to the local git repo you want to use (the default assumes a local linux-stable v3.16.3)" default:"/home/trz/yocto/kernels/linux-stable.git"}} {{ if kernel_choice == "custom": }} {{ input type:"boolean" name:"custom_kernel_need_kbranch" prio:"20" msg:"Do you need to use a specific (non-master) branch? (y/n)" default:"n"}} {{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y": }} -{{ input type:"edit" name:"custom_kernel_kbranch" prio:"20" msg:"Please enter the branch you want to use (the default branch corresponds to the linux-stable 'linux-3.13.y' branch):" default:"linux-3.13.y"}} +{{ input type:"edit" name:"custom_kernel_kbranch" prio:"20" msg:"Please enter the branch you want to use (the default branch corresponds to the linux-stable 'linux-3.16.y' branch):" default:"linux-3.16.y"}} {{ if kernel_choice == "custom": }} {{ input type:"edit" name:"custom_kernel_srcrev" prio:"20" msg:"Please enter the SRCREV (commit id) you'd like to use (use '${AUTOREV}' to track the current HEAD):" default:"${AUTOREV}"}} {{ if kernel_choice == "custom": }} -{{ input type:"edit" name:"custom_kernel_linux_version" prio:"20" msg:"Please enter the Linux version of the kernel you've specified:" default:"3.13.9"}} +{{ input type:"edit" name:"custom_kernel_linux_version" prio:"20" msg:"Please enter the Linux version of the kernel you've specified:" default:"3.16.3"}} {{ if kernel_choice == "custom": }} {{ input type:"edit" name:"custom_kernel_linux_version_extension" prio:"20" msg:"Please enter a Linux version extension if you want (it will show up at the end of the kernel name shown by uname):" default:"-custom"}} diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom.bb b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb index c85e7315ff..80a52e7cae 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom.bb +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "custom": }} this # This file was derived from the linux-yocto-custom.bb recipe in # oe-core. # diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall new file mode 100644 index 0000000000..017d206c24 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice == "custom": }} linux-yocto-custom diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/defconfig b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig index ceb0ffa30c..ceb0ffa30c 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/defconfig +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg index 17c8b503da..922309d5ab 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}-user-config.cfg +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg # # Used by yocto-kernel to manage config options. # diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc index 7a598d9118..6d1138f42a 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}-user-patches.scc +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc # # Used by yocto-kernel to manage patches. # diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg index 95170b12eb..1ba8201f16 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}.cfg +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.cfg # # A convenient place to add config options, nothing more. # diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc index 2e3ca90793..0b6b413377 100644 --- a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == "custom": }} linux-yocto-custom/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc # # The top-level 'feature' for the {{=machine}} custom kernel. # diff --git a/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf index 0df4dc2035..e13dabc1e5 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} @@ -32,19 +33,23 @@ MACHINE_FEATURES += "wifi efi pcbios" {{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} -{{ if xserver == "y" and (kernel_choice == "linux-yocto_3.14" or kernel_choice == "linux-yocto_3.10"): }} -{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }} +{{ if xserver == "y" and (kernel_choice == "linux-yocto_3.17" or kernel_choice == "linux-yocto_3.14" or kernel_choice == "linux-yocto_3.10"): }} +{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_vesa" }} {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} +{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }} +{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }} {{ if xserver == "y" and kernel_choice == "custom": }} -{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }} +{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_vesa" }} {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} +{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }} +{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }} -{{ if xserver == "y" and kernel_choice != "linux-yocto_3.14" and kernel_choice != "linux-yocto_3.10" and kernel_choice != "custom": xserver_choice = "xserver_i915" }} +{{ if xserver == "y" and kernel_choice != "linux-yocto_3.17" and kernel_choice != "linux-yocto_3.14" and kernel_choice != "linux-yocto_3.10" and kernel_choice != "custom": xserver_choice = "xserver_i915" }} {{ if xserver == "y": }} XSERVER ?= "${XSERVER_X86_BASE} \ @@ -55,12 +60,18 @@ XSERVER ?= "${XSERVER_X86_BASE} \ ${XSERVER_X86_I915} \ {{ if xserver == "y" and xserver_choice == "xserver_i965": }} ${XSERVER_X86_I965} \ +{{ if xserver == "y" and xserver_choice == "xserver_fbdev": }} + ${XSERVER_X86_FBDEV} \ +{{ if xserver == "y" and xserver_choice == "xserver_modesetting": }} + ${XSERVER_X86_MODESETTING} \ {{ if xserver == "y": }} " -MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d" +MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts" EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi" +GLIBC_ADDONS = "nptl" + {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} APPEND += "video=vesafb vga=0x318" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..ac9a0f1bb0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf @@ -0,0 +1 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend @@ -0,0 +1,2 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend deleted file mode 100644 index 72d991c7e5..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend +++ /dev/null @@ -1 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc index bfefb0d0a0..619ee3f367 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH i386 diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc index 60b670dffc..682012fafc 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH i386 diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc index ec44ef9485..cc7519699a 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH i386 diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..69efdcc759 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..85be26de97 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..4c59daac46 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg index e93c0b8a08..3b168b7e36 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.cfg CONFIG_X86_32=y CONFIG_MATOM=y CONFIG_PRINTK=y diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc index eda1d62f11..3d32f111b0 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg include features/intel-e1xxxx/intel-e100.scc diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend index 25c87a85ac..2fa6231cbf 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend index 08b1f88d1b..35b0958582 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..5f8db03c64 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend index bc6968d832..f04dd0cce4 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend index d221d5f2a4..471ccbcc3e 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..fb4253271a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.10.bbappend index c1f26540a7..1cfc611949 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend index 948d568cd1..fbb49edb26 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..c8fc73a97d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall new file mode 100644 index 0000000000..3594e6583c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if create_example_bbappend == "y": }} recipes-example-bbappend diff --git a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == "y": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend index 2e50ff668d..353133080a 100644 --- a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == "y": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" # diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall new file mode 100644 index 0000000000..46df8a8e04 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=example_bbappend_name}}-{{=example_bbappend_version}} diff --git a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == "y": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}-{{=example_bbappend_version}}/example.patch b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch index 2000a34da5..2000a34da5 100644 --- a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == "y": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}-{{=example_bbappend_version}}/example.patch +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall new file mode 100644 index 0000000000..b0069b1a5a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if create_example_recipe == "y": }} recipes-example diff --git a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}_0.1.bb b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb index 14bf344da5..ba1ccb16c6 100644 --- a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}_0.1.bb +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=example_recipe_name}}_0.1.bb # # This file was derived from the 'Hello World!' example recipe in the # Yocto Project Development Manual. diff --git a/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall new file mode 100644 index 0000000000..c319c19c57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=example_recipe_name}}-0.1 diff --git a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}-0.1/example.patch b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch index 2000a34da5..2000a34da5 100644 --- a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}-0.1/example.patch +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch diff --git a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}-0.1/helloworld.c b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c index 71f2e46b4e..71f2e46b4e 100644 --- a/scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == "y": }} recipes-example/example/{{=example_recipe_name}}-0.1/helloworld.c +++ b/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c diff --git a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf index 9ea411933c..b319d626f4 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc index b0fb63ac6a..176190cd2e 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH mips diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc index 326663a509..f05dd851d2 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH mips diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc index 4514765eb3..f71c775397 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH mips diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..85be26de97 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..2fe476691c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg @@ -0,0 +1,2 @@ +# yocto-bsp-filename {{=machine}}.cfg +CONFIG_MIPS=y diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc index 1ef01b6e3c..f39dc3edf1 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg include cfg/usb-mass-storage.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend index 25c87a85ac..2fa6231cbf 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend index 08b1f88d1b..35b0958582 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..5f8db03c64 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend index bc6968d832..f04dd0cce4 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..c7e7989821 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..142e38b3bc --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.10.bbappend index 1e814c54d7..badb3aa239 100644 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..1e1cc51315 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..72af58afc1 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg deleted file mode 100644 index a1b333ca56..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MIPS=y diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend deleted file mode 100644 index 85544e812c..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend +++ /dev/null @@ -1,32 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -PR := "${PR}.1" - -COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" - -{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} - -{{ if need_new_kbranch == "y": }} -{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} - -{{ if need_new_kbranch == "n": }} -{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} - -{{ if need_new_kbranch == "n": }} -KBRANCH_{{=machine}} = "{{=existing_kbranch}}" - -{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} -{{ if smp == "y": }} -KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" - -SRC_URI += "file://{{=machine}}-tiny.scc \ - file://{{=machine}}-user-config.cfg \ - file://{{=machine}}-user-patches.scc \ - file://{{=machine}}-user-features.scc \ - " - -# uncomment and replace these SRCREVs with the real commit ids once you've had -# the appropriate changes committed to the upstream linux-yocto repo -#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" -#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" -#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore index e69de29bb2..e69de29bb2 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ b/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf new file mode 100644 index 0000000000..3afc5e093e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf @@ -0,0 +1,39 @@ +# yocto-bsp-filename {{=machine}}.conf +#@TYPE: Machine +#@NAME: {{=machine}} + +#@DESCRIPTION: Machine configuration for {{=machine}} systems + +require conf/machine/include/tune-mips64.inc + +MACHINE_FEATURES = "pci ext2 ext3 serial" + +KERNEL_IMAGETYPE = "vmlinux" +KERNEL_ALT_IMAGETYPE = "vmlinux.bin" +KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment" + +{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }} +{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }} +{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }} +PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" + +{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }} +{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }} +{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }} +PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" +PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" + +{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }} +{{ if xserver == "y": }} +PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" +XSERVER ?= "xserver-xorg \ + xf86-input-evdev \ + xf86-video-fbdev" + +SERIAL_CONSOLE = "115200 ttyS0" +USE_VT ?= "0" + +MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" + +IMAGE_FSTYPES ?= "jffs2 tar.bz2" +JFFS2_ERASEBLOCK = "0x10000" diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc new file mode 100644 index 0000000000..176190cd2e --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -0,0 +1,10 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH mips + +include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} +{{ if need_new_kbranch == "y": }} +branch {{=machine}} + +include {{=machine}}.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc new file mode 100644 index 0000000000..f05dd851d2 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc @@ -0,0 +1,10 @@ +# yocto-bsp-filename {{=machine}}-standard.scc +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH mips + +include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} +{{ if need_new_kbranch == "y": }} +branch {{=machine}} + +include {{=machine}}.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc new file mode 100644 index 0000000000..f71c775397 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc @@ -0,0 +1,10 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc +define KMACHINE {{=machine}} +define KTYPE tiny +define KARCH mips + +include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}} +{{ if need_new_kbranch == "y": }} +branch {{=machine}} + +include {{=machine}}.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..69efdcc759 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..85be26de97 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..4c59daac46 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..0cc906bbf0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg @@ -0,0 +1,66 @@ +# yocto-bsp-filename {{=machine}}.cfg +#SOC +CONFIG_CAVIUM_OCTEON_SOC=y +CONFIG_CAVIUM_CN63XXP1=y +CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2 + +#Kernel +CONFIG_SMP=y +CONFIG_NR_CPUS=32 +#Executable file formats +CONFIG_MIPS32_COMPAT=y +CONFIG_MIPS32_O32=y +CONFIG_MIPS32_N32=y + + +#PCI +CONFIG_PCI=y +CONFIG_PCI_MSI=y + +#I2C +CONFIG_I2C=y +CONFIG_I2C_OCTEON=y + +CONFIG_HW_RANDOM_OCTEON=y + +#SPI +CONFIG_SPI=y +CONFIG_SPI_OCTEON=y + +#Misc +CONFIG_EEPROM_AT24=y +CONFIG_EEPROM_AT25=y +CONFIG_OCTEON_WDT=y + +CONFIG_STAGING=y + +#Ethernet +CONFIG_OCTEON_ETHERNET=y +CONFIG_OCTEON_MGMT_ETHERNET=y +CONFIG_MDIO_OCTEON=y + +#PHY +CONFIG_MARVELL_PHY=y +CONFIG_BROADCOM_PHY=y +CONFIG_BCM87XX_PHY=y + + +#USB +CONFIG_USB=y +CONFIG_OCTEON_USB=y +CONFIG_USB_OCTEON_EHCI=y +CONFIG_USB_OCTEON_OHCI=y +CONFIG_USB_OCTEON2_COMMON=y + +CONFIG_MTD=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CMDLINE_PARTS=y + +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=2 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +CONFIG_SERIAL_8250_DW=y + diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc new file mode 100644 index 0000000000..f39dc3edf1 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc @@ -0,0 +1,8 @@ +# yocto-bsp-filename {{=machine}}.scc +kconf hardware {{=machine}}.cfg + +include cfg/usb-mass-storage.scc +include cfg/fs/vfat.scc + +kconf hardware {{=machine}}-user-config.cfg +include {{=machine}}-user-patches.scc diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall new file mode 100644 index 0000000000..8903a823aa --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall @@ -0,0 +1,5 @@ +{{ if kernel_choice != "custom": }} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} + +{{ if kernel_choice != "custom" and use_default_kernel == "n": }} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend index 25c87a85ac..2fa6231cbf 100644 --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..35b0958582 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.10.9" diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..5f8db03c64 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend index bc6968d832..f04dd0cce4 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend new file mode 100644 index 0000000000..c7e7989821 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..142e38b3bc --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000000..badb3aa239 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "19f7e43b54aef08d58135ed2a897d77b624b320a" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "459165c1dd61c4e843c36e6a1abeb30949a20ba7" +#LINUX_VERSION = "3.10.9"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000000..1e1cc51315 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..72af58afc1 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf index 78fb5db22b..48fcb2bbbe 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} @@ -16,6 +17,9 @@ TARGET_FPU = "" {{ input type:"choice" val:"tune_ppce500v2" msg:"ppce500v2 tuning optimizations" }} {{ input type:"choice" val:"tune_ppce5500" msg:"ppce5500 tuning optimizations" }} {{ input type:"choice" val:"tune_ppce6500" msg:"ppce6500 tuning optimizations" }} +{{ input type:"choice" val:"tune_power5" msg:"power5 tuning optimizations" }} +{{ input type:"choice" val:"tune_power6" msg:"power6 tuning optimizations" }} +{{ input type:"choice" val:"tune_power7" msg:"power7 tuning optimizations" }} {{ if tunefile == "tune_ppc476": }} include conf/machine/include/tune-ppc476.inc {{ if tunefile == "tune_ppc603e": }} @@ -36,6 +40,12 @@ include conf/machine/include/tune-ppce500v2.inc include conf/machine/include/tune-ppce5500.inc {{ if tunefile == "tune_ppce6500": }} include conf/machine/include/tune-ppce6500.inc +{{ if tunefile == "tune_power5": }} +include conf/machine/include/tune-power5.inc +{{ if tunefile == "tune_power6": }} +include conf/machine/include/tune-power6.inc +{{ if tunefile == "tune_power7": }} +include conf/machine/include/tune-power7.inc KERNEL_IMAGETYPE = "uImage" @@ -72,3 +82,6 @@ UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}" KERNEL_DEVICETREE = "${S}/arch/powerpc/boot/dts/{{=kernel_devicetree}}" MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" + +IMAGE_FSTYPES ?= "jffs2 tar.bz2" +JFFS2_ERASEBLOCK = "0x4000" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc index 1da7b0c892..40c9267831 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH powerpc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc index 53a74a6ca2..7a1d35be1e 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH powerpc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc index 4ca6224774..1bf94b2d05 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH powerpc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg index 9f37d07553..5bfe1fe4b0 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.cfg .......................................................................... . WARNING . diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc index c9fd468180..7aac8b0801 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg include cfg/usb-mass-storage.scc diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -0,0 +1,26 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..39bc72d9c4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.10.9"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend index 00c8c68933..7a2544617f 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -29,4 +30,4 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \ # the appropriate changes committed to the upstream linux-yocto repo #SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" #SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" -#LINUX_VERSION = "3.10.9"
\ No newline at end of file +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.10.9" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend index d221d5f2a4..471ccbcc3e 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..fb4253271a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.10.bbappend index a61f5ccb80..15b4b973c9 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend index aebda9b3a5..e688384020 100644 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..2f1933055d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf index d53b6f57b7..67e1cbd997 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} @@ -26,6 +27,7 @@ PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" {{ input type:"choice" val:"arm" msg:"ARM (32-bit)" }} {{ input type:"choice" val:"powerpc" msg:"PowerPC (32-bit)" }} {{ input type:"choice" val:"mips" msg:"MIPS (32-bit)" }} +{{ input type:"choice" val:"mips64" msg:"MIPS64 (64-bit)" }} {{ if qemuarch == "i386": }} require conf/machine/include/qemu.inc require conf/machine/include/tune-i586.inc @@ -42,6 +44,9 @@ require conf/machine/include/tune-ppc7400.inc {{ if qemuarch == "mips": }} require conf/machine/include/qemu.inc require conf/machine/include/tune-mips32.inc +{{ if qemuarch == "mips64": }} +require conf/machine/include/qemu.inc +require conf/machine/include/tune-mips64.inc {{ if qemuarch == "i386" or qemuarch == "x86_64": }} MACHINE_FEATURES += "x86" @@ -62,7 +67,7 @@ SERIAL_CONSOLE = "115200 ttyAMA0" KERNEL_IMAGETYPE = "vmlinux" SERIAL_CONSOLE = "115200 ttyS0" -{{ if qemuarch == "mips": }} +{{ if qemuarch == "mips" or qemuarch == "mips64": }} KERNEL_IMAGETYPE = "vmlinux" KERNEL_ALT_IMAGETYPE = "vmlinux.bin" SERIAL_CONSOLE = "115200 ttyS0" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/{{=machine}}/interfaces b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces index 16967763e5..16967763e5 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/{{=machine}}/interfaces +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf index 13519804bc..3bdde79e6f 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf @@ -14,7 +14,7 @@ EndSection Section "InputDevice" Identifier "Configured Mouse" -{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips": }} +{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips" or qemuarch == "mips64": }} Driver "mouse" {{ if qemuarch == "i386" or qemuarch == "x86_64": }} Driver "vmmouse" @@ -36,7 +36,7 @@ EndSection Section "Device" Identifier "Graphics Controller" -{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips": }} +{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips" or qemuarch == "mips64": }} Driver "fbdev" {{ if qemuarch == "i386" or qemuarch == "x86_64": }} Driver "vmware" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..0fb5283a8d --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc index af34437d0a..6aaffb8184 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH {{=qemuarch}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc index 0e20023764..d2a03ec209 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH {{=qemuarch}} @@ -10,6 +11,8 @@ include bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard include bsp/qemu-ppc32/qemu-ppc32-standard {{ if qemuarch == "mips": }} include bsp/mti-malta32/mti-malta32-be-standard +{{ if qemuarch == "mips64": }} +include bsp/mti-malta64/mti-malta64-be-standard {{ if need_new_kbranch == "y": }} branch {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc index 10c4dac44d..6c098fed21 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH {{=qemuarch}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..69efdcc759 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..4c59daac46 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg new file mode 100644 index 0000000000..d560784b56 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}.cfg
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc index f3739be1e6..8301e05f7d 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg kconf hardware {{=machine}}-user-config.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend index 7599ecb0a5..be479bee67 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -18,10 +19,10 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} {{ if need_new_kbranch == "y" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "n" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend index 73b6e34839..3609787207 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..ce5e1a09b3 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,62 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/qemuppc" }} + +{{ if need_new_kbranch == "y" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend index da4e61ef83..1ee148fd0c 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..0175107899 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,62 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }} + +{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.4.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.4.bbappend index 013883ffeb..5bfb877eb9 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.4.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.4.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.4": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.10.bbappend index 392ace6694..974e291afd 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -18,10 +19,10 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} {{ if need_new_kbranch == "y" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "n" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend index 2cc9b87cf2..626019c40a 100644 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" @@ -18,10 +19,10 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} {{ if need_new_kbranch == "y" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "n" and qemuarch == "i386": }} -{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc/base" }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} {{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} {{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} @@ -35,6 +36,12 @@ COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" {{ if need_new_kbranch == "n" and qemuarch == "mips": }} {{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }} + {{ if need_new_kbranch == "n": }} KBRANCH_{{=machine}} = "{{=existing_kbranch}}" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..b81f272c38 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,62 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "arm": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }} + +{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }} + +{{ if need_new_kbranch == "y" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} + +{{ if need_new_kbranch == "n" and qemuarch == "i386": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }} + +{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }} + +{{ if need_new_kbranch == "n" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "y" and qemuarch == "mips64": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf index 0780af90da..e4b825104f 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.conf #@TYPE: Machine #@NAME: {{=machine}} @@ -36,6 +37,8 @@ MACHINE_FEATURES += "wifi efi pcbios" {{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} {{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} {{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }} +{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }} +{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }} {{ if xserver == "y": }} XSERVER ?= "${XSERVER_X86_BASE} \ ${XSERVER_X86_EXT} \ @@ -45,12 +48,18 @@ XSERVER ?= "${XSERVER_X86_BASE} \ ${XSERVER_X86_I915} \ {{ if xserver == "y" and xserver_choice == "xserver_i965": }} ${XSERVER_X86_I965} \ +{{ if xserver == "y" and xserver_choice == "xserver_fbdev": }} + ${XSERVER_X86_FBDEV} \ +{{ if xserver == "y" and xserver_choice == "xserver_modesetting": }} + ${XSERVER_X86_MODESETTING} \ {{ if xserver == "y": }} " -MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d" +MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts" EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi" +GLIBC_ADDONS = "nptl" + {{ if xserver == "y" and xserver_choice == "xserver_vesa": }} APPEND += "video=vesafb vga=0x318" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall new file mode 100644 index 0000000000..b442d02d57 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{=machine}} diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf new file mode 100644 index 0000000000..ac9a0f1bb0 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf @@ -0,0 +1 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == "y": }} xorg.conf +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend new file mode 100644 index 0000000000..30830031ed --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend @@ -0,0 +1,2 @@ +# yocto-bsp-filename {{ if xserver == "y": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend deleted file mode 100644 index 72d991c7e5..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend +++ /dev/null @@ -1 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall new file mode 100644 index 0000000000..1e0d92c55c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall @@ -0,0 +1 @@ +# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc index c9882590a8..fd5320ba1e 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-preempt-rt.scc +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-preempt-rt.scc define KMACHINE {{=machine}} define KTYPE preempt-rt define KARCH x86_64 diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc index e500bad4b2..569f967c6a 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-standard.scc +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-standard.scc define KMACHINE {{=machine}} define KTYPE standard define KARCH x86_64 diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc index e8e3c1c04d..fb21432a4f 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-tiny.scc +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}-tiny.scc define KMACHINE {{=machine}} define KTYPE tiny define KARCH x86_64 diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg new file mode 100644 index 0000000000..47489e44e9 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-config.cfg diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc new file mode 100644 index 0000000000..582759e612 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-features.scc diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc new file mode 100644 index 0000000000..97f747fa07 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc @@ -0,0 +1 @@ +# yocto-bsp-filename {{=machine}}-user-patches.scc diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg index b4b82d7ca0..3290ddefe7 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.cfg +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.cfg CONFIG_PRINTK=y # Basic hardware support for the box - network, USB, PCI, sound diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc index db45140381..9b7c291a8f 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}.scc +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{=machine}}.scc kconf hardware {{=machine}}.cfg include features/serial/8250.scc diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall index a04e6c7852..8903a823aa 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall @@ -1,5 +1,5 @@ {{ if kernel_choice != "custom": }} -{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}} +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.17) kernel? (y/n)" default:"y"}} {{ if kernel_choice != "custom" and use_default_kernel == "n": }} -{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.17"}} diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 0000000000..2fa6231cbf --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -0,0 +1,26 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend new file mode 100644 index 0000000000..39bc72d9c4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.10.9"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend new file mode 100644 index 0000000000..7a2544617f --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-rt_3.14": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" +#LINUX_VERSION = "3.14"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend new file mode 100644 index 0000000000..f04dd0cce4 --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.10.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.10": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.10.9" diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend index d221d5f2a4..471ccbcc3e 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.14": }} linux-yocto-tiny_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend new file mode 100644 index 0000000000..fb4253271a --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-tiny.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.10.bbappend index 162348114f..e21a333fa4 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.10": }} linux-yocto_3.10.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.10": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend index 81e528bc33..ca0b497ff4 100644 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto_3.14": }} linux-yocto_3.14.bbappend +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -1,3 +1,4 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.14": }} this FILESEXTRAPATHS_prepend := "${THISDIR}/files:" PR := "${PR}.1" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.17.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.17.bbappend new file mode 100644 index 0000000000..08aa00a15c --- /dev/null +++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.17.bbappend @@ -0,0 +1,33 @@ +# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_3.17": }} this +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} + +{{ if need_new_kbranch == "y": }} +{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} + +{{ if need_new_kbranch == "n": }} +{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }} + +{{ if need_new_kbranch == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch}}" + +{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} +{{ if smp == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}-user-config.cfg \ + file://{{=machine}}-user-patches.scc \ + file://{{=machine}}-user-features.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" +#LINUX_VERSION = "3.17" diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-config.cfg +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc deleted file mode 100644 index e69de29bb2..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-patches.scc +++ /dev/null diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend deleted file mode 100644 index 25c87a85ac..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-dev": }} linux-yocto-dev.bbappend +++ /dev/null @@ -1,25 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -PR := "${PR}.1" - -COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" -{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} - -{{ if need_new_kbranch == "y": }} -{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} - -{{ if need_new_kbranch == "n": }} -{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }} - -{{ if need_new_kbranch == "n": }} -KBRANCH_{{=machine}} = "{{=existing_kbranch}}" - -{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}} -{{ if smp == "y": }} -KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" - -SRC_URI += "file://{{=machine}}-standard.scc \ - file://{{=machine}}-user-config.cfg \ - file://{{=machine}}-user-patches.scc \ - file://{{=machine}}-user-features.scc \ - " diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend deleted file mode 100644 index 00c8c68933..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-rt_3.10": }} linux-yocto-rt_3.10.bbappend +++ /dev/null @@ -1,32 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -PR := "${PR}.1" - -COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" - -{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} - -{{ if need_new_kbranch == "y": }} -{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} - -{{ if need_new_kbranch == "n": }} -{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/preempt-rt" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/preempt-rt/base" }} - -{{ if need_new_kbranch == "n": }} -KBRANCH_{{=machine}} = "{{=existing_kbranch}}" - -{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} -{{ if smp == "y": }} -KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" - -SRC_URI += "file://{{=machine}}-preempt-rt.scc \ - file://{{=machine}}-user-config.cfg \ - file://{{=machine}}-user-patches.scc \ - file://{{=machine}}-user-features.scc \ - " - -# uncomment and replace these SRCREVs with the real commit ids once you've had -# the appropriate changes committed to the upstream linux-yocto repo -#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb" -#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f" -#LINUX_VERSION = "3.10.9"
\ No newline at end of file diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend deleted file mode 100644 index bc6968d832..0000000000 --- a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == "linux-yocto-tiny_3.10": }} linux-yocto-tiny_3.10.bbappend +++ /dev/null @@ -1,32 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -PR := "${PR}.1" - -COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" - -{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }} - -{{ if need_new_kbranch == "y": }} -{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} - -{{ if need_new_kbranch == "n": }} -{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }} - -{{ if need_new_kbranch == "n": }} -KBRANCH_{{=machine}} = "{{=existing_kbranch}}" - -{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}} -{{ if smp == "y": }} -KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" - -SRC_URI += "file://{{=machine}}-tiny.scc \ - file://{{=machine}}-user-config.cfg \ - file://{{=machine}}-user-patches.scc \ - file://{{=machine}}-user-features.scc \ - " - -# uncomment and replace these SRCREVs with the real commit ids once you've had -# the appropriate changes committed to the upstream linux-yocto repo -#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8" -#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993" -#LINUX_VERSION = "3.10.9" diff --git a/scripts/lib/bsp/tags.py b/scripts/lib/bsp/tags.py index 6d5feb0a59..3719427884 100644 --- a/scripts/lib/bsp/tags.py +++ b/scripts/lib/bsp/tags.py @@ -25,11 +25,13 @@ # Tom Zanussi <tom.zanussi (at] intel.com> # -OPEN_TAG = "{{" -CLOSE_TAG = "}}" -ASSIGN_TAG = "{{=" -INPUT_TAG = "input" -IF_TAG = "if" +OPEN_TAG = "{{" +CLOSE_TAG = "}}" +ASSIGN_TAG = "{{=" +INPUT_TAG = "input" +IF_TAG = "if" +FILENAME_TAG = "yocto-bsp-filename" +DIRNAME_TAG = "yocto-bsp-dirname" INDENT_STR = " " diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py new file mode 100644 index 0000000000..3f8158e24a --- /dev/null +++ b/scripts/lib/devtool/__init__.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python + +# Development tool - utility functions for plugins +# +# Copyright (C) 2014 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +import os +import sys +import subprocess +import logging + +logger = logging.getLogger('devtool') + +def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): + import bb + if not 'cwd' in options: + options["cwd"] = builddir + if init_path: + logger.debug('Executing command: "%s" using init path %s' % (cmd, init_path)) + init_prefix = '. %s %s > /dev/null && ' % (init_path, builddir) + else: + logger.debug('Executing command "%s"' % cmd) + init_prefix = '' + if watch: + if sys.stdout.isatty(): + # Fool bitbake into thinking it's outputting to a terminal (because it is, indirectly) + cmd = 'script -q -c "%s" /dev/null' % cmd + return exec_watch('%s%s' % (init_prefix, cmd), **options) + else: + return bb.process.run('%s%s' % (init_prefix, cmd), **options) + +def exec_watch(cmd, **options): + if isinstance(cmd, basestring) and not "shell" in options: + options["shell"] = True + + process = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options + ) + + buf = '' + while True: + out = process.stdout.read(1) + if out: + sys.stdout.write(out) + sys.stdout.flush() + buf += out + elif out == '' and process.poll() != None: + break + return buf + +def setup_tinfoil(): + import scriptpath + bitbakepath = scriptpath.add_bitbake_lib_path() + if not bitbakepath: + logger.error("Unable to find bitbake by searching parent directory of this script or PATH") + sys.exit(1) + + import bb.tinfoil + import logging + tinfoil = bb.tinfoil.Tinfoil() + tinfoil.prepare(False) + tinfoil.logger.setLevel(logging.WARNING) + return tinfoil + diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py new file mode 100644 index 0000000000..f016b23dba --- /dev/null +++ b/scripts/lib/devtool/deploy.py @@ -0,0 +1,140 @@ +# Development tool - deploy/undeploy command plugin +# +# Copyright (C) 2014-2015 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os +import subprocess +import logging +from devtool import exec_build_env_command + +logger = logging.getLogger('devtool') + +def plugin_init(pluginlist): + pass + + +def deploy(args, config, basepath, workspace): + import re + from devtool import exec_build_env_command + + if not args.recipename in workspace: + logger.error("no recipe named %s in your workspace" % args.recipename) + return -1 + try: + host, destdir = args.target.split(':') + except ValueError: + destdir = '/' + else: + args.target = host + + deploy_dir = os.path.join(basepath, 'target_deploy', args.target) + deploy_file = os.path.join(deploy_dir, args.recipename + '.list') + + stdout, stderr = exec_build_env_command(config.init_path, basepath, 'bitbake -e %s' % args.recipename, shell=True) + recipe_outdir = re.search(r'^D="(.*)"', stdout, re.MULTILINE).group(1) + if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir): + logger.error('No files to deploy - have you built the %s recipe? If so, the install step has not installed any files.' % args.recipename) + return -1 + + if args.dry_run: + print('Files to be deployed for %s on target %s:' % (args.recipename, args.target)) + for root, dirs, files in os.walk(recipe_outdir): + for fn in files: + print(' %s' % os.path.join(destdir, os.path.relpath(root, recipe_outdir), fn)) + return 0 + + if os.path.exists(deploy_file): + if undeploy(args, config, basepath, workspace): + # Error already shown + return -1 + + extraoptions = '' + if args.no_host_check: + extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' + if not args.show_status: + extraoptions += ' -q' + ret = subprocess.call('scp -r %s %s/* %s:%s' % (extraoptions, recipe_outdir, args.target, destdir), shell=True) + if ret != 0: + logger.error('Deploy failed - rerun with -s to get a complete error message') + return ret + + logger.info('Successfully deployed %s' % recipe_outdir) + + if not os.path.exists(deploy_dir): + os.makedirs(deploy_dir) + + files_list = [] + for root, _, files in os.walk(recipe_outdir): + for filename in files: + filename = os.path.relpath(os.path.join(root, filename), recipe_outdir) + files_list.append(os.path.join(destdir, filename)) + + with open(deploy_file, 'w') as fobj: + fobj.write('\n'.join(files_list)) + + return 0 + +def undeploy(args, config, basepath, workspace): + + deploy_file = os.path.join(basepath, 'target_deploy', args.target, args.recipename + '.list') + if not os.path.exists(deploy_file): + logger.error('%s has not been deployed' % args.recipename) + return -1 + + if args.dry_run: + print('Previously deployed files to be un-deployed for %s on target %s:' % (args.recipename, args.target)) + with open(deploy_file, 'r') as f: + for line in f: + print(' %s' % line.rstrip()) + return 0 + + extraoptions = '' + if args.no_host_check: + extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' + if not args.show_status: + extraoptions += ' -q' + + ret = subprocess.call("scp %s %s %s:/tmp" % (extraoptions, deploy_file, args.target), shell=True) + if ret != 0: + logger.error('Failed to copy file list to %s - rerun with -s to get a complete error message' % args.target) + return -1 + + ret = subprocess.call("ssh %s %s 'xargs -n1 rm -f </tmp/%s'" % (extraoptions, args.target, os.path.basename(deploy_file)), shell=True) + if ret == 0: + logger.info('Successfully undeployed %s' % args.recipename) + os.remove(deploy_file) + else: + logger.error('Undeploy failed - rerun with -s to get a complete error message') + + return ret + + +def register_commands(subparsers, context): + parser_deploy = subparsers.add_parser('deploy-target', help='Deploy recipe output files to live target machine') + parser_deploy.add_argument('recipename', help='Recipe to deploy') + parser_deploy.add_argument('target', help='Live target machine running an ssh server: user@hostname[:destdir]') + parser_deploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true') + parser_deploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true') + parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true') + parser_deploy.set_defaults(func=deploy) + + parser_undeploy = subparsers.add_parser('undeploy-target', help='Undeploy recipe output files in live target machine') + parser_undeploy.add_argument('recipename', help='Recipe to undeploy') + parser_undeploy.add_argument('target', help='Live target machine running an ssh server: user@hostname') + parser_undeploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true') + parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true') + parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true') + parser_undeploy.set_defaults(func=undeploy) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py new file mode 100644 index 0000000000..54920b26f8 --- /dev/null +++ b/scripts/lib/devtool/standard.py @@ -0,0 +1,697 @@ +# Development tool - standard commands plugin +# +# Copyright (C) 2014-2015 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os +import sys +import re +import shutil +import glob +import tempfile +import logging +import argparse +from devtool import exec_build_env_command, setup_tinfoil + +logger = logging.getLogger('devtool') + +def plugin_init(pluginlist): + pass + + +def add(args, config, basepath, workspace): + import bb + import oe.recipeutils + + if args.recipename in workspace: + logger.error("recipe %s is already in your workspace" % args.recipename) + return -1 + + reason = oe.recipeutils.validate_pn(args.recipename) + if reason: + logger.error(reason) + return -1 + + srctree = os.path.abspath(args.srctree) + appendpath = os.path.join(config.workspace_path, 'appends') + if not os.path.exists(appendpath): + os.makedirs(appendpath) + + recipedir = os.path.join(config.workspace_path, 'recipes', args.recipename) + bb.utils.mkdirhier(recipedir) + if args.version: + if '_' in args.version or ' ' in args.version: + logger.error('Invalid version string "%s"' % args.version) + return -1 + bp = "%s_%s" % (args.recipename, args.version) + else: + bp = args.recipename + recipefile = os.path.join(recipedir, "%s.bb" % bp) + if sys.stdout.isatty(): + color = 'always' + else: + color = args.color + stdout, stderr = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s %s' % (color, recipefile, srctree)) + logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) + + _add_md5(config, args.recipename, recipefile) + + initial_rev = None + if os.path.exists(os.path.join(srctree, '.git')): + (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) + initial_rev = stdout.rstrip() + + appendfile = os.path.join(appendpath, '%s.bbappend' % args.recipename) + with open(appendfile, 'w') as f: + f.write('inherit externalsrc\n') + f.write('EXTERNALSRC = "%s"\n' % srctree) + if args.same_dir: + f.write('EXTERNALSRC_BUILD = "%s"\n' % srctree) + if initial_rev: + f.write('\n# initial_rev: %s\n' % initial_rev) + + _add_md5(config, args.recipename, appendfile) + + return 0 + + +def _check_compatible_recipe(pn, d): + if pn == 'perf': + logger.error("The perf recipe does not actually check out source and thus cannot be supported by this tool") + return False + + if pn in ['gcc-source', 'kernel-devsrc', 'package-index']: + logger.error("The %s recipe is not supported by this tool" % pn) + return False + + if bb.data.inherits_class('image', d): + logger.error("The %s recipe is an image, and therefore is not supported by this tool" % pn) + return False + + if bb.data.inherits_class('populate_sdk', d): + logger.error("The %s recipe is an SDK, and therefore is not supported by this tool" % pn) + return False + + if bb.data.inherits_class('packagegroup', d): + logger.error("The %s recipe is a packagegroup, and therefore is not supported by this tool" % pn) + return False + + if bb.data.inherits_class('meta', d): + logger.error("The %s recipe is a meta-recipe, and therefore is not supported by this tool" % pn) + return False + + if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True): + logger.error("externalsrc is currently enabled for the %s recipe. This prevents the normal do_patch task from working. You will need to disable this first." % pn) + return False + + return True + + +def _get_recipe_file(cooker, pn): + import oe.recipeutils + recipefile = oe.recipeutils.pn_to_recipe(cooker, pn) + if not recipefile: + skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn) + if skipreasons: + logger.error('\n'.join(skipreasons)) + else: + logger.error("Unable to find any recipe file matching %s" % pn) + return recipefile + + +def extract(args, config, basepath, workspace): + import bb + import oe.recipeutils + + tinfoil = setup_tinfoil() + + recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) + if not recipefile: + # Error already logged + return -1 + rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) + + srctree = os.path.abspath(args.srctree) + initial_rev = _extract_source(srctree, args.keep_temp, args.branch, rd) + if initial_rev: + return 0 + else: + return -1 + + +def _extract_source(srctree, keep_temp, devbranch, d): + import bb.event + + def eventfilter(name, handler, event, d): + if name == 'base_eventhandler': + return True + else: + return False + + if hasattr(bb.event, 'set_eventfilter'): + bb.event.set_eventfilter(eventfilter) + + pn = d.getVar('PN', True) + + if not _check_compatible_recipe(pn, d): + return None + + if os.path.exists(srctree): + if not os.path.isdir(srctree): + logger.error("output path %s exists and is not a directory" % srctree) + return None + elif os.listdir(srctree): + logger.error("output path %s already exists and is non-empty" % srctree) + return None + + # Prepare for shutil.move later on + bb.utils.mkdirhier(srctree) + os.rmdir(srctree) + + initial_rev = None + tempdir = tempfile.mkdtemp(prefix='devtool') + try: + crd = d.createCopy() + # Make a subdir so we guard against WORKDIR==S + workdir = os.path.join(tempdir, 'workdir') + crd.setVar('WORKDIR', workdir) + crd.setVar('T', os.path.join(tempdir, 'temp')) + if not crd.getVar('S', True).startswith(workdir): + # Usually a shared workdir recipe (kernel, gcc) + # Try to set a reasonable default + if bb.data.inherits_class('kernel', d): + crd.setVar('S', '${WORKDIR}/source') + else: + crd.setVar('S', '${WORKDIR}/${BP}') + if bb.data.inherits_class('kernel', d): + # We don't want to move the source to STAGING_KERNEL_DIR here + crd.setVar('STAGING_KERNEL_DIR', '${S}') + + # FIXME: This is very awkward. Unfortunately it's not currently easy to properly + # execute tasks outside of bitbake itself, until then this has to suffice if we + # are to handle e.g. linux-yocto's extra tasks + executed = [] + def exec_task_func(func, report): + if not func in executed: + deps = crd.getVarFlag(func, 'deps') + if deps: + for taskdepfunc in deps: + exec_task_func(taskdepfunc, True) + if report: + logger.info('Executing %s...' % func) + fn = d.getVar('FILE', True) + localdata = bb.build._task_data(fn, func, crd) + bb.build.exec_func(func, localdata) + executed.append(func) + + logger.info('Fetching %s...' % pn) + exec_task_func('do_fetch', False) + logger.info('Unpacking...') + exec_task_func('do_unpack', False) + srcsubdir = crd.getVar('S', True) + if srcsubdir != workdir and os.path.dirname(srcsubdir) != workdir: + # Handle if S is set to a subdirectory of the source + srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0]) + + if os.path.exists(os.path.join(srcsubdir, '.git')): + alternatesfile = os.path.join(srcsubdir, '.git', 'objects', 'info', 'alternates') + if os.path.exists(alternatesfile): + # This will have been cloned with -s, so we need to convert it to a full clone + bb.process.run('git repack -a', cwd=srcsubdir) + os.remove(alternatesfile) + + patchdir = os.path.join(srcsubdir, 'patches') + haspatches = False + if os.path.exists(patchdir): + if os.listdir(patchdir): + haspatches = True + else: + os.rmdir(patchdir) + + if bb.data.inherits_class('kernel-yocto', d): + (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir) + initial_rev = stdout.rstrip() + else: + if not os.listdir(srcsubdir): + logger.error("no source unpacked to S, perhaps the %s recipe doesn't use any source?" % pn) + return None + + if not os.path.exists(os.path.join(srcsubdir, '.git')): + bb.process.run('git init', cwd=srcsubdir) + bb.process.run('git add .', cwd=srcsubdir) + bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir) + + (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) + initial_rev = stdout.rstrip() + + bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir) + bb.process.run('git tag -f devtool-base', cwd=srcsubdir) + + crd.setVar('PATCHTOOL', 'git') + + logger.info('Patching...') + exec_task_func('do_patch', False) + + bb.process.run('git tag -f devtool-patched', cwd=srcsubdir) + + if os.path.exists(patchdir): + shutil.rmtree(patchdir) + if haspatches: + bb.process.run('git checkout patches', cwd=srcsubdir) + + shutil.move(srcsubdir, srctree) + logger.info('Source tree extracted to %s' % srctree) + finally: + if keep_temp: + logger.info('Preserving temporary directory %s' % tempdir) + else: + shutil.rmtree(tempdir) + return initial_rev + +def _add_md5(config, recipename, filename): + import bb.utils + md5 = bb.utils.md5_file(filename) + with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f: + f.write('%s|%s|%s\n' % (recipename, os.path.relpath(filename, config.workspace_path), md5)) + +def _check_preserve(config, recipename): + import bb.utils + origfile = os.path.join(config.workspace_path, '.devtool_md5') + newfile = os.path.join(config.workspace_path, '.devtool_md5_new') + preservepath = os.path.join(config.workspace_path, 'attic') + with open(origfile, 'r') as f: + with open(newfile, 'w') as tf: + for line in f.readlines(): + splitline = line.rstrip().split('|') + if splitline[0] == recipename: + removefile = os.path.join(config.workspace_path, splitline[1]) + md5 = bb.utils.md5_file(removefile) + if splitline[2] != md5: + bb.utils.mkdirhier(preservepath) + preservefile = os.path.basename(removefile) + logger.warn('File %s modified since it was written, preserving in %s' % (preservefile, preservepath)) + shutil.move(removefile, os.path.join(preservepath, preservefile)) + else: + os.remove(removefile) + else: + tf.write(line) + os.rename(newfile, origfile) + + return False + + +def modify(args, config, basepath, workspace): + import bb + import oe.recipeutils + + if args.recipename in workspace: + logger.error("recipe %s is already in your workspace" % args.recipename) + return -1 + + if not args.extract: + if not os.path.isdir(args.srctree): + logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree) + return -1 + + tinfoil = setup_tinfoil() + + recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) + if not recipefile: + # Error already logged + return -1 + rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) + + if not _check_compatible_recipe(args.recipename, rd): + return -1 + + initial_rev = None + commits = [] + srctree = os.path.abspath(args.srctree) + if args.extract: + initial_rev = _extract_source(args.srctree, False, args.branch, rd) + if not initial_rev: + return -1 + # Get list of commits since this revision + (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=args.srctree) + commits = stdout.split() + else: + if os.path.exists(os.path.join(args.srctree, '.git')): + # Check if it's a tree previously extracted by us + try: + (stdout, _) = bb.process.run('git branch --contains devtool-base', cwd=args.srctree) + except bb.process.ExecutionError: + stdout = '' + for line in stdout.splitlines(): + if line.startswith('*'): + (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=args.srctree) + initial_rev = stdout.rstrip() + if not initial_rev: + # Otherwise, just grab the head revision + (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree) + initial_rev = stdout.rstrip() + + # Check that recipe isn't using a shared workdir + s = rd.getVar('S', True) + workdir = rd.getVar('WORKDIR', True) + if s.startswith(workdir): + # Handle if S is set to a subdirectory of the source + if s != workdir and os.path.dirname(s) != workdir: + srcsubdir = os.sep.join(os.path.relpath(s, workdir).split(os.sep)[1:]) + srctree = os.path.join(srctree, srcsubdir) + + appendpath = os.path.join(config.workspace_path, 'appends') + if not os.path.exists(appendpath): + os.makedirs(appendpath) + + appendname = os.path.splitext(os.path.basename(recipefile))[0] + if args.wildcard: + appendname = re.sub(r'_.*', '_%', appendname) + appendfile = os.path.join(appendpath, appendname + '.bbappend') + with open(appendfile, 'w') as f: + f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n') + f.write('inherit externalsrc\n') + f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n') + f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree)) + if args.same_dir or bb.data.inherits_class('autotools-brokensep', rd): + if args.same_dir: + logger.info('using source tree as build directory since --same-dir specified') + else: + logger.info('using source tree as build directory since original recipe inherits autotools-brokensep') + f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree)) + if initial_rev: + f.write('\n# initial_rev: %s\n' % initial_rev) + for commit in commits: + f.write('# commit: %s\n' % commit) + + _add_md5(config, args.recipename, appendfile) + + logger.info('Recipe %s now set up to build from %s' % (args.recipename, srctree)) + + return 0 + + +def update_recipe(args, config, basepath, workspace): + if not args.recipename in workspace: + logger.error("no recipe named %s in your workspace" % args.recipename) + return -1 + + # Get initial revision from bbappend + appends = glob.glob(os.path.join(config.workspace_path, 'appends', '%s_*.bbappend' % args.recipename)) + if not appends: + logger.error('unable to find workspace bbappend for recipe %s' % args.recipename) + return -1 + + tinfoil = setup_tinfoil() + import bb + from oe.patch import GitApplyTree + import oe.recipeutils + + recipefile = _get_recipe_file(tinfoil.cooker, args.recipename) + if not recipefile: + # Error already logged + return -1 + rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data) + + orig_src_uri = rd.getVar('SRC_URI', False) or '' + if args.mode == 'auto': + if 'git://' in orig_src_uri: + mode = 'srcrev' + else: + mode = 'patch' + else: + mode = args.mode + + def remove_patches(srcuri, patchlist): + # Remove any patches that we don't need + updated = False + for patch in patchlist: + patchfile = os.path.basename(patch) + for i in xrange(len(srcuri)): + if srcuri[i].startswith('file://') and os.path.basename(srcuri[i]).split(';')[0] == patchfile: + logger.info('Removing patch %s' % patchfile) + srcuri.pop(i) + # FIXME "git rm" here would be nice if the file in question is tracked + # FIXME there's a chance that this file is referred to by another recipe, in which case deleting wouldn't be the right thing to do + if patch.startswith(os.path.dirname(recipefile)): + os.remove(patch) + updated = True + break + return updated + + srctree = workspace[args.recipename] + if mode == 'srcrev': + (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) + srcrev = stdout.strip() + if len(srcrev) != 40: + logger.error('Invalid hash returned by git: %s' % stdout) + return 1 + + logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile)) + patchfields = {} + patchfields['SRCREV'] = srcrev + if not args.no_remove: + # Find list of existing patches in recipe file + existing_patches = oe.recipeutils.get_recipe_patches(rd) + + old_srcrev = (rd.getVar('SRCREV', False) or '') + tempdir = tempfile.mkdtemp(prefix='devtool') + removepatches = [] + try: + GitApplyTree.extractPatches(srctree, old_srcrev, tempdir) + newpatches = os.listdir(tempdir) + for patch in existing_patches: + patchfile = os.path.basename(patch) + if patchfile in newpatches: + removepatches.append(patch) + finally: + shutil.rmtree(tempdir) + if removepatches: + srcuri = (rd.getVar('SRC_URI', False) or '').split() + if remove_patches(srcuri, removepatches): + patchfields['SRC_URI'] = ' '.join(srcuri) + + oe.recipeutils.patch_recipe(rd, recipefile, patchfields) + + if not 'git://' in orig_src_uri: + logger.info('You will need to update SRC_URI within the recipe to point to a git repository where you have pushed your changes') + + elif mode == 'patch': + commits = [] + update_rev = None + if args.initial_rev: + initial_rev = args.initial_rev + else: + initial_rev = None + with open(appends[0], 'r') as f: + for line in f: + if line.startswith('# initial_rev:'): + initial_rev = line.split(':')[-1].strip() + elif line.startswith('# commit:'): + commits.append(line.split(':')[-1].strip()) + + if initial_rev: + # Find first actually changed revision + (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) + newcommits = stdout.split() + for i in xrange(min(len(commits), len(newcommits))): + if newcommits[i] == commits[i]: + update_rev = commits[i] + + if not initial_rev: + logger.error('Unable to find initial revision - please specify it with --initial-rev') + return -1 + + if not update_rev: + update_rev = initial_rev + + # Find list of existing patches in recipe file + existing_patches = oe.recipeutils.get_recipe_patches(rd) + + removepatches = [] + if not args.no_remove: + # Get all patches from source tree and check if any should be removed + tempdir = tempfile.mkdtemp(prefix='devtool') + try: + GitApplyTree.extractPatches(srctree, initial_rev, tempdir) + newpatches = os.listdir(tempdir) + for patch in existing_patches: + patchfile = os.path.basename(patch) + if patchfile not in newpatches: + removepatches.append(patch) + finally: + shutil.rmtree(tempdir) + + # Get updated patches from source tree + tempdir = tempfile.mkdtemp(prefix='devtool') + try: + GitApplyTree.extractPatches(srctree, update_rev, tempdir) + + # Match up and replace existing patches with corresponding new patches + updatepatches = False + updaterecipe = False + newpatches = os.listdir(tempdir) + for patch in existing_patches: + patchfile = os.path.basename(patch) + if patchfile in newpatches: + logger.info('Updating patch %s' % patchfile) + shutil.move(os.path.join(tempdir, patchfile), patch) + newpatches.remove(patchfile) + updatepatches = True + srcuri = (rd.getVar('SRC_URI', False) or '').split() + if newpatches: + # Add any patches left over + patchdir = os.path.join(os.path.dirname(recipefile), rd.getVar('BPN', True)) + bb.utils.mkdirhier(patchdir) + for patchfile in newpatches: + logger.info('Adding new patch %s' % patchfile) + shutil.move(os.path.join(tempdir, patchfile), os.path.join(patchdir, patchfile)) + srcuri.append('file://%s' % patchfile) + updaterecipe = True + if removepatches: + if remove_patches(srcuri, removepatches): + updaterecipe = True + if updaterecipe: + logger.info('Updating recipe %s' % os.path.basename(recipefile)) + oe.recipeutils.patch_recipe(rd, recipefile, {'SRC_URI': ' '.join(srcuri)}) + elif not updatepatches: + # Neither patches nor recipe were updated + logger.info('No patches need updating') + finally: + shutil.rmtree(tempdir) + + else: + logger.error('update_recipe: invalid mode %s' % mode) + return 1 + + return 0 + + +def status(args, config, basepath, workspace): + if workspace: + for recipe, value in workspace.iteritems(): + print("%s: %s" % (recipe, value)) + else: + logger.info('No recipes currently in your workspace - you can use "devtool modify" to work on an existing recipe or "devtool add" to add a new one') + return 0 + + +def reset(args, config, basepath, workspace): + import bb.utils + if args.recipename: + if args.all: + logger.error("Recipe cannot be specified if -a/--all is used") + return -1 + elif not args.recipename in workspace: + logger.error("no recipe named %s in your workspace" % args.recipename) + return -1 + elif not args.all: + logger.error("Recipe must be specified, or specify -a/--all to reset all recipes") + return -1 + + if args.all: + recipes = workspace + else: + recipes = [args.recipename] + + for pn in recipes: + if not args.no_clean: + logger.info('Cleaning sysroot for recipe %s...' % pn) + exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % pn) + + _check_preserve(config, pn) + + preservepath = os.path.join(config.workspace_path, 'attic', pn) + def preservedir(origdir): + if os.path.exists(origdir): + for fn in os.listdir(origdir): + logger.warn('Preserving %s in %s' % (fn, preservepath)) + bb.utils.mkdirhier(preservepath) + shutil.move(os.path.join(origdir, fn), os.path.join(preservepath, fn)) + os.rmdir(origdir) + + preservedir(os.path.join(config.workspace_path, 'recipes', pn)) + # We don't automatically create this dir next to appends, but the user can + preservedir(os.path.join(config.workspace_path, 'appends', pn)) + + return 0 + + +def build(args, config, basepath, workspace): + import bb + if not args.recipename in workspace: + logger.error("no recipe named %s in your workspace" % args.recipename) + return -1 + build_task = config.get('Build', 'build_task', 'populate_sysroot') + exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (build_task, args.recipename), watch=True) + + return 0 + + +def register_commands(subparsers, context): + parser_add = subparsers.add_parser('add', help='Add a new recipe', + description='Adds a new recipe', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_add.add_argument('recipename', help='Name for new recipe to add') + parser_add.add_argument('srctree', help='Path to external source tree') + parser_add.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true") + parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)') + parser_add.set_defaults(func=add) + + parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe', + description='Enables modifying the source for an existing recipe', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_modify.add_argument('recipename', help='Name for recipe to edit') + parser_modify.add_argument('srctree', help='Path to external source tree') + parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') + parser_modify.add_argument('--extract', '-x', action="store_true", help='Extract source as well') + parser_modify.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true") + parser_modify.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)') + parser_modify.set_defaults(func=modify) + + parser_extract = subparsers.add_parser('extract', help='Extract the source for an existing recipe', + description='Extracts the source for an existing recipe', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_extract.add_argument('recipename', help='Name for recipe to extract the source for') + parser_extract.add_argument('srctree', help='Path to where to extract the source tree') + parser_extract.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout') + parser_extract.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)') + parser_extract.set_defaults(func=extract) + + parser_update_recipe = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe', + description='Applies changes from external source tree to a recipe (updating/adding/removing patches as necessary, or by updating SRCREV)') + parser_update_recipe.add_argument('recipename', help='Name of recipe to update') + parser_update_recipe.add_argument('--mode', '-m', choices=['patch', 'srcrev', 'auto'], default='auto', help='Update mode (where %(metavar)s is %(choices)s; default is %(default)s)', metavar='MODE') + parser_update_recipe.add_argument('--initial-rev', help='Starting revision for patches') + parser_update_recipe.add_argument('--no-remove', '-n', action="store_true", help='Don\'t remove patches, only add or update') + parser_update_recipe.set_defaults(func=update_recipe) + + parser_status = subparsers.add_parser('status', help='Show workspace status', + description='Lists recipes currently in your workspace and the paths to their respective external source trees', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_status.set_defaults(func=status) + + parser_build = subparsers.add_parser('build', help='Build a recipe', + description='Builds the specified recipe using bitbake', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_build.add_argument('recipename', help='Recipe to build') + parser_build.set_defaults(func=build) + + parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace', + description='Removes the specified recipe from your workspace (resetting its state)', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser_reset.add_argument('recipename', nargs='?', help='Recipe to reset') + parser_reset.add_argument('--all', '-a', action="store_true", help='Reset all recipes (clear workspace)') + parser_reset.add_argument('--no-clean', '-n', action="store_true", help='Don\'t clean the sysroot to remove recipe output') + parser_reset.set_defaults(func=reset) diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py index e794545e94..68d1ce2659 100644 --- a/scripts/lib/image/engine.py +++ b/scripts/lib/image/engine.py @@ -73,8 +73,8 @@ def find_artifacts(image_name): if (get_line_val(line, "IMAGE_ROOTFS")): rootfs_dir = get_line_val(line, "IMAGE_ROOTFS") continue - if (get_line_val(line, "STAGING_KERNEL_DIR")): - kernel_dir = get_line_val(line, "STAGING_KERNEL_DIR") + if (get_line_val(line, "DEPLOY_DIR_IMAGE")): + kernel_dir = get_line_val(line, "DEPLOY_DIR_IMAGE") continue if (get_line_val(line, "STAGING_DIR_NATIVE")): native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE") @@ -200,7 +200,7 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, values from the output of 'bitbake -e': rootfs_dir: IMAGE_ROOTFS - kernel_dir: STAGING_KERNEL_DIR + kernel_dir: DEPLOY_DIR_IMAGE native_sysroot: STAGING_DIR_NATIVE In the above case, bootimg_dir remains unset and the diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index 6b74f57662..e1eb265979 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py @@ -673,10 +673,10 @@ DESCRIPTION The following are supported 'part' options: - --size: The minimum partition size in MBytes. Specify an - integer value such as 500. Do not append the number - with "MB". You do not need this option if you use - --source. + --size: The minimum partition size. Specify an integer value + such as 500. Multipliers k, M ang G can be used. If + not specified, the size is in MB. + You do not need this option if you use --source. --source: This option is a wic-specific option that names the source of the data that will populate the @@ -737,6 +737,24 @@ DESCRIPTION to start a partition on an x KBytes boundary. + --no-table: This option is specific to wic. Space will be + reserved for the partition and it will be + populated but it will not be added to the + partition table. It may be useful for + bootloaders. + + --extra-space: This option is specific to wic. It adds extra + space after the space filled by the content + of the partition. The final size can go + beyond the size specified by --size. + By default, 10MB. + + --overhead-factor: This option is specific to wic. The + size of the partition is multiplied by + this factor. It has to be greater than or + equal to 1. + The default value is 1.3. + * bootloader This command allows the user to specify various bootloader diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc b/scripts/lib/recipetool/__init__.py index e69de29bb2..e69de29bb2 100644 --- a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != "custom": }} files/{{=machine}}-user-features.scc +++ b/scripts/lib/recipetool/__init__.py diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py new file mode 100644 index 0000000000..1c71b24bfb --- /dev/null +++ b/scripts/lib/recipetool/create.py @@ -0,0 +1,419 @@ +# Recipe creation tool - create command plugin +# +# Copyright (C) 2014 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import sys +import os +import argparse +import glob +import fnmatch +import re +import logging + +logger = logging.getLogger('recipetool') + +tinfoil = None +plugins = None + +def plugin_init(pluginlist): + # Take a reference to the list so we can use it later + global plugins + plugins = pluginlist + +def tinfoil_init(instance): + global tinfoil + tinfoil = instance + +class RecipeHandler(): + @staticmethod + def checkfiles(path, speclist): + results = [] + for spec in speclist: + results.extend(glob.glob(os.path.join(path, spec))) + return results + + def genfunction(self, outlines, funcname, content): + outlines.append('%s () {' % funcname) + for line in content: + outlines.append('\t%s' % line) + outlines.append('}') + outlines.append('') + + def process(self, srctree, classes, lines_before, lines_after, handled): + return False + + + +def fetch_source(uri, destdir): + import bb.data + bb.utils.mkdirhier(destdir) + localdata = bb.data.createCopy(tinfoil.config_data) + bb.data.update_data(localdata) + localdata.setVar('BB_STRICT_CHECKSUM', '') + localdata.setVar('SRCREV', '${AUTOREV}') + ret = (None, None) + olddir = os.getcwd() + try: + fetcher = bb.fetch2.Fetch([uri], localdata) + for u in fetcher.ud: + ud = fetcher.ud[u] + ud.ignore_checksums = True + fetcher.download() + fetcher.unpack(destdir) + for u in fetcher.ud: + ud = fetcher.ud[u] + if ud.method.recommends_checksum(ud): + md5value = bb.utils.md5_file(ud.localpath) + sha256value = bb.utils.sha256_file(ud.localpath) + ret = (md5value, sha256value) + except bb.fetch2.BBFetchException, e: + raise bb.build.FuncFailed(e) + finally: + os.chdir(olddir) + return ret + +def supports_srcrev(uri): + localdata = bb.data.createCopy(tinfoil.config_data) + bb.data.update_data(localdata) + fetcher = bb.fetch2.Fetch([uri], localdata) + urldata = fetcher.ud + for u in urldata: + if urldata[u].method.supports_srcrev(): + return True + return False + +def create_recipe(args): + import bb.process + import tempfile + import shutil + + pkgarch = "" + if args.machine: + pkgarch = "${MACHINE_ARCH}" + + checksums = (None, None) + tempsrc = '' + srcsubdir = '' + if '://' in args.source: + # Fetch a URL + srcuri = args.source + if args.extract_to: + srctree = args.extract_to + else: + tempsrc = tempfile.mkdtemp(prefix='recipetool-') + srctree = tempsrc + logger.info('Fetching %s...' % srcuri) + checksums = fetch_source(args.source, srctree) + dirlist = os.listdir(srctree) + if 'git.indirectionsymlink' in dirlist: + dirlist.remove('git.indirectionsymlink') + if len(dirlist) == 1 and os.path.isdir(os.path.join(srctree, dirlist[0])): + # We unpacked a single directory, so we should use that + srcsubdir = dirlist[0] + srctree = os.path.join(srctree, srcsubdir) + else: + # Assume we're pointing to an existing source tree + if args.extract_to: + logger.error('--extract-to cannot be specified if source is a directory') + sys.exit(1) + if not os.path.isdir(args.source): + logger.error('Invalid source directory %s' % args.source) + sys.exit(1) + srcuri = '' + srctree = args.source + + outfile = args.outfile + if outfile and outfile != '-': + if os.path.exists(outfile): + logger.error('Output file %s already exists' % outfile) + sys.exit(1) + + lines_before = [] + lines_after = [] + + lines_before.append('# Recipe created by %s' % os.path.basename(sys.argv[0])) + lines_before.append('# This is the basis of a recipe and may need further editing in order to be fully functional.') + lines_before.append('# (Feel free to remove these comments when editing.)') + lines_before.append('#') + + licvalues = guess_license(srctree) + lic_files_chksum = [] + if licvalues: + licenses = [] + for licvalue in licvalues: + if not licvalue[0] in licenses: + licenses.append(licvalue[0]) + lic_files_chksum.append('file://%s;md5=%s' % (licvalue[1], licvalue[2])) + lines_before.append('# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is') + lines_before.append('# your responsibility to verify that the values are complete and correct.') + if len(licvalues) > 1: + lines_before.append('#') + lines_before.append('# NOTE: multiple licenses have been detected; if that is correct you should separate') + lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there') + lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying') + lines_before.append('# documentation to determine which situation is applicable.') + else: + lines_before.append('# Unable to find any files that looked like license statements. Check the accompanying') + lines_before.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.') + lines_before.append('#') + lines_before.append('# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if') + lines_before.append('# this is not accurate with respect to the licensing of the software being built (it') + lines_before.append('# will not be in most cases) you must specify the correct value before using this') + lines_before.append('# recipe for anything other than initial testing/development!') + licenses = ['CLOSED'] + lines_before.append('LICENSE = "%s"' % ' '.join(licenses)) + lines_before.append('LIC_FILES_CHKSUM = "%s"' % ' \\\n '.join(lic_files_chksum)) + lines_before.append('') + + # FIXME This is kind of a hack, we probably ought to be using bitbake to do this + # we'd also want a way to automatically set outfile based upon auto-detecting these values from the source if possible + recipefn = os.path.splitext(os.path.basename(outfile))[0] + fnsplit = recipefn.split('_') + if len(fnsplit) > 1: + pn = fnsplit[0] + pv = fnsplit[1] + else: + pn = recipefn + pv = None + + if srcuri: + if pv and pv not in 'git svn hg'.split(): + srcuri = srcuri.replace(pv, '${PV}') + else: + lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)') + lines_before.append('SRC_URI = "%s"' % srcuri) + (md5value, sha256value) = checksums + if md5value: + lines_before.append('SRC_URI[md5sum] = "%s"' % md5value) + if sha256value: + lines_before.append('SRC_URI[sha256sum] = "%s"' % sha256value) + if srcuri and supports_srcrev(srcuri): + lines_before.append('') + lines_before.append('# Modify these as desired') + lines_before.append('PV = "1.0+git${SRCPV}"') + lines_before.append('SRCREV = "${AUTOREV}"') + lines_before.append('') + + if srcsubdir and pv: + if srcsubdir == "%s-%s" % (pn, pv): + # This would be the default, so we don't need to set S in the recipe + srcsubdir = '' + if srcsubdir: + if pv and pv not in 'git svn hg'.split(): + srcsubdir = srcsubdir.replace(pv, '${PV}') + lines_before.append('S = "${WORKDIR}/%s"' % srcsubdir) + lines_before.append('') + + if pkgarch: + lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch) + lines_after.append('') + + # Find all plugins that want to register handlers + handlers = [] + for plugin in plugins: + if hasattr(plugin, 'register_recipe_handlers'): + plugin.register_recipe_handlers(handlers) + + # Apply the handlers + classes = [] + handled = [] + for handler in handlers: + handler.process(srctree, classes, lines_before, lines_after, handled) + + outlines = [] + outlines.extend(lines_before) + if classes: + outlines.append('inherit %s' % ' '.join(classes)) + outlines.append('') + outlines.extend(lines_after) + + if outfile == '-': + sys.stdout.write('\n'.join(outlines) + '\n') + else: + with open(outfile, 'w') as f: + f.write('\n'.join(outlines) + '\n') + logger.info('Recipe %s has been created; further editing may be required to make it fully functional' % outfile) + + if tempsrc: + shutil.rmtree(tempsrc) + + return 0 + +def get_license_md5sums(d, static_only=False): + import bb.utils + md5sums = {} + if not static_only: + # Gather md5sums of license files in common license dir + commonlicdir = d.getVar('COMMON_LICENSE_DIR', True) + for fn in os.listdir(commonlicdir): + md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn)) + md5sums[md5value] = fn + # The following were extracted from common values in various recipes + # (double checking the license against the license file itself, not just + # the LICENSE value in the recipe) + md5sums['94d55d512a9ba36caa9b7df079bae19f'] = 'GPLv2' + md5sums['b234ee4d69f5fce4486a80fdaf4a4263'] = 'GPLv2' + md5sums['59530bdf33659b29e73d4adb9f9f6552'] = 'GPLv2' + md5sums['0636e73ff0215e8d672dc4c32c317bb3'] = 'GPLv2' + md5sums['eb723b61539feef013de476e68b5c50a'] = 'GPLv2' + md5sums['751419260aa954499f7abaabaa882bbe'] = 'GPLv2' + md5sums['393a5ca445f6965873eca0259a17f833'] = 'GPLv2' + md5sums['12f884d2ae1ff87c09e5b7ccc2c4ca7e'] = 'GPLv2' + md5sums['8ca43cbc842c2336e835926c2166c28b'] = 'GPLv2' + md5sums['ebb5c50ab7cab4baeffba14977030c07'] = 'GPLv2' + md5sums['c93c0550bd3173f4504b2cbd8991e50b'] = 'GPLv2' + md5sums['9ac2e7cff1ddaf48b6eab6028f23ef88'] = 'GPLv2' + md5sums['4325afd396febcb659c36b49533135d4'] = 'GPLv2' + md5sums['18810669f13b87348459e611d31ab760'] = 'GPLv2' + md5sums['d7810fab7487fb0aad327b76f1be7cd7'] = 'GPLv2' # the Linux kernel's COPYING file + md5sums['bbb461211a33b134d42ed5ee802b37ff'] = 'LGPLv2.1' + md5sums['7fbc338309ac38fefcd64b04bb903e34'] = 'LGPLv2.1' + md5sums['4fbd65380cdd255951079008b364516c'] = 'LGPLv2.1' + md5sums['2d5025d4aa3495befef8f17206a5b0a1'] = 'LGPLv2.1' + md5sums['fbc093901857fcd118f065f900982c24'] = 'LGPLv2.1' + md5sums['a6f89e2100d9b6cdffcea4f398e37343'] = 'LGPLv2.1' + md5sums['d8045f3b8f929c1cb29a1e3fd737b499'] = 'LGPLv2.1' + md5sums['fad9b3332be894bab9bc501572864b29'] = 'LGPLv2.1' + md5sums['3bf50002aefd002f49e7bb854063f7e7'] = 'LGPLv2' + md5sums['9f604d8a4f8e74f4f5140845a21b6674'] = 'LGPLv2' + md5sums['5f30f0716dfdd0d91eb439ebec522ec2'] = 'LGPLv2' + md5sums['55ca817ccb7d5b5b66355690e9abc605'] = 'LGPLv2' + md5sums['252890d9eee26aab7b432e8b8a616475'] = 'LGPLv2' + md5sums['d32239bcb673463ab874e80d47fae504'] = 'GPLv3' + md5sums['f27defe1e96c2e1ecd4e0c9be8967949'] = 'GPLv3' + md5sums['6a6a8e020838b23406c81b19c1d46df6'] = 'LGPLv3' + md5sums['3b83ef96387f14655fc854ddc3c6bd57'] = 'Apache-2.0' + md5sums['385c55653886acac3821999a3ccd17b3'] = 'Artistic-1.0 | GPL-2.0' # some perl modules + return md5sums + +def guess_license(srctree): + import bb + md5sums = get_license_md5sums(tinfoil.config_data) + + licenses = [] + licspecs = ['LICENSE*', 'COPYING*', '*[Ll]icense*', 'LICENCE*', 'LEGAL*', '[Ll]egal*', '*GPL*', 'README.lic*', 'COPYRIGHT*', '[Cc]opyright*'] + licfiles = [] + for root, dirs, files in os.walk(srctree): + for fn in files: + for spec in licspecs: + if fnmatch.fnmatch(fn, spec): + fullpath = os.path.join(root, fn) + if not fullpath in licfiles: + licfiles.append(fullpath) + for licfile in licfiles: + md5value = bb.utils.md5_file(licfile) + license = md5sums.get(md5value, 'Unknown') + licenses.append((license, os.path.relpath(licfile, srctree), md5value)) + + # FIXME should we grab at least one source file with a license header and add that too? + + return licenses + +def read_pkgconfig_provides(d): + pkgdatadir = d.getVar('PKGDATA_DIR', True) + pkgmap = {} + for fn in glob.glob(os.path.join(pkgdatadir, 'shlibs2', '*.pclist')): + with open(fn, 'r') as f: + for line in f: + pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0] + recipemap = {} + for pc, pkg in pkgmap.iteritems(): + pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg) + if os.path.exists(pkgdatafile): + with open(pkgdatafile, 'r') as f: + for line in f: + if line.startswith('PN: '): + recipemap[pc] = line.split(':', 1)[1].strip() + return recipemap + +def convert_pkginfo(pkginfofile): + values = {} + with open(pkginfofile, 'r') as f: + indesc = False + for line in f: + if indesc: + if line.strip(): + values['DESCRIPTION'] += ' ' + line.strip() + else: + indesc = False + else: + splitline = line.split(': ', 1) + key = line[0] + value = line[1] + if key == 'LICENSE': + for dep in value.split(','): + dep = dep.split()[0] + mapped = depmap.get(dep, '') + if mapped: + depends.append(mapped) + elif key == 'License': + values['LICENSE'] = value + elif key == 'Summary': + values['SUMMARY'] = value + elif key == 'Description': + values['DESCRIPTION'] = value + indesc = True + return values + +def convert_debian(debpath): + # FIXME extend this mapping - perhaps use distro_alias.inc? + depmap = {'libz-dev': 'zlib'} + + values = {} + depends = [] + with open(os.path.join(debpath, 'control')) as f: + indesc = False + for line in f: + if indesc: + if line.strip(): + if line.startswith(' This package contains'): + indesc = False + else: + values['DESCRIPTION'] += ' ' + line.strip() + else: + indesc = False + else: + splitline = line.split(':', 1) + key = line[0] + value = line[1] + if key == 'Build-Depends': + for dep in value.split(','): + dep = dep.split()[0] + mapped = depmap.get(dep, '') + if mapped: + depends.append(mapped) + elif key == 'Section': + values['SECTION'] = value + elif key == 'Description': + values['SUMMARY'] = value + indesc = True + + if depends: + values['DEPENDS'] = ' '.join(depends) + + return values + + +def register_command(subparsers): + parser_create = subparsers.add_parser('create', + help='Create a new recipe', + description='Creates a new recipe from a source tree') + parser_create.add_argument('source', help='Path or URL to source') + parser_create.add_argument('-o', '--outfile', help='Specify filename for recipe to create', required=True) + parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true') + parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s') + parser_create.set_defaults(func=create_recipe) + diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py new file mode 100644 index 0000000000..6c9e0efa2a --- /dev/null +++ b/scripts/lib/recipetool/create_buildsys.py @@ -0,0 +1,319 @@ +# Recipe creation tool - create command build system handlers +# +# Copyright (C) 2014 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import re +import logging +from recipetool.create import RecipeHandler, read_pkgconfig_provides + +logger = logging.getLogger('recipetool') + +tinfoil = None + +def tinfoil_init(instance): + global tinfoil + tinfoil = instance + +class CmakeRecipeHandler(RecipeHandler): + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + if RecipeHandler.checkfiles(srctree, ['CMakeLists.txt']): + classes.append('cmake') + lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:') + lines_after.append('EXTRA_OECMAKE = ""') + lines_after.append('') + handled.append('buildsystem') + return True + return False + +class SconsRecipeHandler(RecipeHandler): + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + if RecipeHandler.checkfiles(srctree, ['SConstruct', 'Sconstruct', 'sconstruct']): + classes.append('scons') + lines_after.append('# Specify any options you want to pass to scons using EXTRA_OESCONS:') + lines_after.append('EXTRA_OESCONS = ""') + lines_after.append('') + handled.append('buildsystem') + return True + return False + +class QmakeRecipeHandler(RecipeHandler): + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + if RecipeHandler.checkfiles(srctree, ['*.pro']): + classes.append('qmake2') + handled.append('buildsystem') + return True + return False + +class AutotoolsRecipeHandler(RecipeHandler): + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + autoconf = False + if RecipeHandler.checkfiles(srctree, ['configure.ac', 'configure.in']): + autoconf = True + values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree) + classes.extend(values.pop('inherit', '').split()) + for var, value in values.iteritems(): + lines_before.append('%s = "%s"' % (var, value)) + else: + conffile = RecipeHandler.checkfiles(srctree, ['configure']) + if conffile: + # Check if this is just a pre-generated autoconf configure script + with open(conffile[0], 'r') as f: + for i in range(1, 10): + if 'Generated by GNU Autoconf' in f.readline(): + autoconf = True + break + + if autoconf: + lines_before.append('# NOTE: if this software is not capable of being built in a separate build directory') + lines_before.append('# from the source, you should replace autotools with autotools-brokensep in the') + lines_before.append('# inherit line') + classes.append('autotools') + lines_after.append('# Specify any options you want to pass to the configure script using EXTRA_OECONF:') + lines_after.append('EXTRA_OECONF = ""') + lines_after.append('') + handled.append('buildsystem') + return True + + return False + + @staticmethod + def extract_autotools_deps(outlines, srctree, acfile=None): + import shlex + import oe.package + + values = {} + inherits = [] + + # FIXME this mapping is very thin + progmap = {'flex': 'flex-native', + 'bison': 'bison-native', + 'm4': 'm4-native'} + progclassmap = {'gconftool-2': 'gconf', + 'pkg-config': 'pkgconfig'} + + ignoredeps = ['gcc-runtime', 'glibc', 'uclibc'] + + pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*') + lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*') + progs_re = re.compile('_PROGS?\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)\]?[),].*') + dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?') + + # Build up lib library->package mapping + shlib_providers = oe.package.read_shlib_providers(tinfoil.config_data) + libdir = tinfoil.config_data.getVar('libdir', True) + base_libdir = tinfoil.config_data.getVar('base_libdir', True) + libpaths = list(set([base_libdir, libdir])) + libname_re = re.compile('^lib(.+)\.so.*$') + pkglibmap = {} + for lib, item in shlib_providers.iteritems(): + for path, pkg in item.iteritems(): + if path in libpaths: + res = libname_re.match(lib) + if res: + libname = res.group(1) + if not libname in pkglibmap: + pkglibmap[libname] = pkg[0] + else: + logger.debug('unable to extract library name from %s' % lib) + + # Now turn it into a library->recipe mapping + recipelibmap = {} + pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True) + for libname, pkg in pkglibmap.iteritems(): + try: + with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f: + for line in f: + if line.startswith('PN:'): + recipelibmap[libname] = line.split(':', 1)[-1].strip() + break + except IOError as ioe: + if ioe.errno == 2: + logger.warn('unable to find a pkgdata file for package %s' % pkg) + else: + raise + + # Since a configure.ac file is essentially a program, this is only ever going to be + # a hack unfortunately; but it ought to be enough of an approximation + if acfile: + srcfiles = [acfile] + else: + srcfiles = RecipeHandler.checkfiles(srctree, ['configure.ac', 'configure.in']) + pcdeps = [] + deps = [] + unmapped = [] + unmappedlibs = [] + with open(srcfiles[0], 'r') as f: + for line in f: + if 'PKG_CHECK_MODULES' in line: + res = pkg_re.search(line) + if res: + res = dep_re.findall(res.group(1)) + if res: + pcdeps.extend([x[0] for x in res]) + inherits.append('pkgconfig') + if line.lstrip().startswith('AM_GNU_GETTEXT'): + inherits.append('gettext') + elif 'AC_CHECK_PROG' in line or 'AC_PATH_PROG' in line: + res = progs_re.search(line) + if res: + for prog in shlex.split(res.group(1)): + prog = prog.split()[0] + progclass = progclassmap.get(prog, None) + if progclass: + inherits.append(progclass) + else: + progdep = progmap.get(prog, None) + if progdep: + deps.append(progdep) + else: + if not prog.startswith('$'): + unmapped.append(prog) + elif 'AC_CHECK_LIB' in line: + res = lib_re.search(line) + if res: + lib = res.group(1) + libdep = recipelibmap.get(lib, None) + if libdep: + deps.append(libdep) + else: + if libdep is None: + if not lib.startswith('$'): + unmappedlibs.append(lib) + elif 'AC_PATH_X' in line: + deps.append('libx11') + + if unmapped: + outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(unmapped)) + + if unmappedlibs: + outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(unmappedlibs)) + outlines.append('# (this is based on recipes that have previously been built and packaged)') + + recipemap = read_pkgconfig_provides(tinfoil.config_data) + unmapped = [] + for pcdep in pcdeps: + recipe = recipemap.get(pcdep, None) + if recipe: + deps.append(recipe) + else: + if not pcdep.startswith('$'): + unmapped.append(pcdep) + + deps = set(deps).difference(set(ignoredeps)) + + if unmapped: + outlines.append('# NOTE: unable to map the following pkg-config dependencies: %s' % ' '.join(unmapped)) + outlines.append('# (this is based on recipes that have previously been built and packaged)') + + if deps: + values['DEPENDS'] = ' '.join(deps) + + if inherits: + values['inherit'] = ' '.join(list(set(inherits))) + + return values + + +class MakefileRecipeHandler(RecipeHandler): + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + makefile = RecipeHandler.checkfiles(srctree, ['Makefile']) + if makefile: + lines_after.append('# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the') + lines_after.append('# recipe automatically - you will need to examine the Makefile yourself and ensure') + lines_after.append('# that the appropriate arguments are passed in.') + lines_after.append('') + + scanfile = os.path.join(srctree, 'configure.scan') + skipscan = False + try: + stdout, stderr = bb.process.run('autoscan', cwd=srctree, shell=True) + except bb.process.ExecutionError as e: + skipscan = True + if scanfile and os.path.exists(scanfile): + values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile) + classes.extend(values.pop('inherit', '').split()) + for var, value in values.iteritems(): + if var == 'DEPENDS': + lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation') + lines_before.append('%s = "%s"' % (var, value)) + lines_before.append('') + for f in ['configure.scan', 'autoscan.log']: + fp = os.path.join(srctree, f) + if os.path.exists(fp): + os.remove(fp) + + self.genfunction(lines_after, 'do_configure', ['# Specify any needed configure commands here']) + + func = [] + func.append('# You will almost certainly need to add additional arguments here') + func.append('oe_runmake') + self.genfunction(lines_after, 'do_compile', func) + + installtarget = True + try: + stdout, stderr = bb.process.run('make -qn install', cwd=srctree, shell=True) + except bb.process.ExecutionError as e: + if e.exitcode != 1: + installtarget = False + func = [] + if installtarget: + func.append('# This is a guess; additional arguments may be required') + makeargs = '' + with open(makefile[0], 'r') as f: + for i in range(1, 100): + if 'DESTDIR' in f.readline(): + makeargs += " 'DESTDIR=${D}'" + break + func.append('oe_runmake install%s' % makeargs) + else: + func.append('# NOTE: unable to determine what to put here - there is a Makefile but no') + func.append('# target named "install", so you will need to define this yourself') + self.genfunction(lines_after, 'do_install', func) + + handled.append('buildsystem') + else: + lines_after.append('# NOTE: no Makefile found, unable to determine what needs to be done') + lines_after.append('') + self.genfunction(lines_after, 'do_configure', ['# Specify any needed configure commands here']) + self.genfunction(lines_after, 'do_compile', ['# Specify compilation commands here']) + self.genfunction(lines_after, 'do_install', ['# Specify install commands here']) + + +def plugin_init(pluginlist): + pass + +def register_recipe_handlers(handlers): + # These are in a specific order so that the right one is detected first + handlers.append(CmakeRecipeHandler()) + handlers.append(AutotoolsRecipeHandler()) + handlers.append(SconsRecipeHandler()) + handlers.append(QmakeRecipeHandler()) + handlers.append(MakefileRecipeHandler()) diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py new file mode 100644 index 0000000000..f4f4212559 --- /dev/null +++ b/scripts/lib/recipetool/create_buildsys_python.py @@ -0,0 +1,720 @@ +# Recipe creation tool - create build system handler for python +# +# Copyright (C) 2015 Mentor Graphics Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import ast +import codecs +import collections +import distutils.command.build_py +import email +import imp +import glob +import itertools +import logging +import os +import re +import sys +import subprocess +from recipetool.create import RecipeHandler + +logger = logging.getLogger('recipetool') + +tinfoil = None + + +def tinfoil_init(instance): + global tinfoil + tinfoil = instance + + +class PythonRecipeHandler(RecipeHandler): + base_pkgdeps = ['python-core'] + excluded_pkgdeps = ['python-dbg'] + # os.path is provided by python-core + assume_provided = ['builtins', 'os.path'] + # Assumes that the host python builtin_module_names is sane for target too + assume_provided = assume_provided + list(sys.builtin_module_names) + + bbvar_map = { + 'Name': 'PN', + 'Version': 'PV', + 'Home-page': 'HOMEPAGE', + 'Summary': 'SUMMARY', + 'Description': 'DESCRIPTION', + 'License': 'LICENSE', + 'Requires': 'RDEPENDS_${PN}', + 'Provides': 'RPROVIDES_${PN}', + 'Obsoletes': 'RREPLACES_${PN}', + } + # PN/PV are already set by recipetool core & desc can be extremely long + excluded_fields = [ + 'Name', + 'Version', + 'Description', + ] + setup_parse_map = { + 'Url': 'Home-page', + 'Classifiers': 'Classifier', + 'Description': 'Summary', + } + setuparg_map = { + 'Home-page': 'url', + 'Classifier': 'classifiers', + 'Summary': 'description', + 'Description': 'long-description', + } + # Values which are lists, used by the setup.py argument based metadata + # extraction method, to determine how to process the setup.py output. + setuparg_list_fields = [ + 'Classifier', + 'Requires', + 'Provides', + 'Obsoletes', + 'Platform', + 'Supported-Platform', + ] + setuparg_multi_line_values = ['Description'] + replacements = [ + ('License', r' ', '-'), + ('License', r'-License$', ''), + ('License', r'^UNKNOWN$', ''), + + # Remove currently unhandled version numbers from these variables + ('Requires', r' *\([^)]*\)', ''), + ('Provides', r' *\([^)]*\)', ''), + ('Obsoletes', r' *\([^)]*\)', ''), + ('Install-requires', r'^([^><= ]+).*', r'\1'), + ('Extras-require', r'^([^><= ]+).*', r'\1'), + ('Tests-require', r'^([^><= ]+).*', r'\1'), + + # Remove unhandled dependency on particular features (e.g. foo[PDF]) + ('Install-requires', r'\[[^\]]+\]$', ''), + ] + + classifier_license_map = { + 'License :: OSI Approved :: Academic Free License (AFL)': 'AFL', + 'License :: OSI Approved :: Apache Software License': 'Apache', + 'License :: OSI Approved :: Apple Public Source License': 'APSL', + 'License :: OSI Approved :: Artistic License': 'Artistic', + 'License :: OSI Approved :: Attribution Assurance License': 'AAL', + 'License :: OSI Approved :: BSD License': 'BSD', + 'License :: OSI Approved :: Common Public License': 'CPL', + 'License :: OSI Approved :: Eiffel Forum License': 'EFL', + 'License :: OSI Approved :: European Union Public Licence 1.0 (EUPL 1.0)': 'EUPL-1.0', + 'License :: OSI Approved :: European Union Public Licence 1.1 (EUPL 1.1)': 'EUPL-1.1', + 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)': 'AGPL-3.0+', + 'License :: OSI Approved :: GNU Affero General Public License v3': 'AGPL-3.0', + 'License :: OSI Approved :: GNU Free Documentation License (FDL)': 'GFDL', + 'License :: OSI Approved :: GNU General Public License (GPL)': 'GPL', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)': 'GPL-2.0', + 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)': 'GPL-2.0+', + 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)': 'GPL-3.0', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)': 'GPL-3.0+', + 'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)': 'LGPL-2.0', + 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)': 'LGPL-2.0+', + 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)': 'LGPL-3.0', + 'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)': 'LGPL-3.0+', + 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)': 'LGPL', + 'License :: OSI Approved :: IBM Public License': 'IPL', + 'License :: OSI Approved :: ISC License (ISCL)': 'ISC', + 'License :: OSI Approved :: Intel Open Source License': 'Intel', + 'License :: OSI Approved :: Jabber Open Source License': 'Jabber', + 'License :: OSI Approved :: MIT License': 'MIT', + 'License :: OSI Approved :: MITRE Collaborative Virtual Workspace License (CVW)': 'CVWL', + 'License :: OSI Approved :: Motosoto License': 'Motosoto', + 'License :: OSI Approved :: Mozilla Public License 1.0 (MPL)': 'MPL-1.0', + 'License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)': 'MPL-1.1', + 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)': 'MPL-2.0', + 'License :: OSI Approved :: Nethack General Public License': 'NGPL', + 'License :: OSI Approved :: Nokia Open Source License': 'Nokia', + 'License :: OSI Approved :: Open Group Test Suite License': 'OGTSL', + 'License :: OSI Approved :: Python License (CNRI Python License)': 'CNRI-Python', + 'License :: OSI Approved :: Python Software Foundation License': 'PSF', + 'License :: OSI Approved :: Qt Public License (QPL)': 'QPL', + 'License :: OSI Approved :: Ricoh Source Code Public License': 'RSCPL', + 'License :: OSI Approved :: Sleepycat License': 'Sleepycat', + 'License :: OSI Approved :: Sun Industry Standards Source License (SISSL)': '-- Sun Industry Standards Source License (SISSL)', + 'License :: OSI Approved :: Sun Public License': 'SPL', + 'License :: OSI Approved :: University of Illinois/NCSA Open Source License': 'NCSA', + 'License :: OSI Approved :: Vovida Software License 1.0': 'VSL-1.0', + 'License :: OSI Approved :: W3C License': 'W3C', + 'License :: OSI Approved :: X.Net License': 'Xnet', + 'License :: OSI Approved :: Zope Public License': 'ZPL', + 'License :: OSI Approved :: zlib/libpng License': 'Zlib', + } + + def __init__(self): + pass + + def process(self, srctree, classes, lines_before, lines_after, handled): + if 'buildsystem' in handled: + return False + + if not RecipeHandler.checkfiles(srctree, ['setup.py']): + return + + # setup.py is always parsed to get at certain required information, such as + # distutils vs setuptools + # + # If egg info is available, we use it for both its PKG-INFO metadata + # and for its requires.txt for install_requires. + # If PKG-INFO is available but no egg info is, we use that for metadata in preference to + # the parsed setup.py, but use the install_requires info from the + # parsed setup.py. + + setupscript = os.path.join(srctree, 'setup.py') + try: + setup_info, uses_setuptools, setup_non_literals, extensions = self.parse_setup_py(setupscript) + except Exception: + logger.exception("Failed to parse setup.py") + setup_info, uses_setuptools, setup_non_literals, extensions = {}, True, [], [] + + egginfo = glob.glob(os.path.join(srctree, '*.egg-info')) + if egginfo: + info = self.get_pkginfo(os.path.join(egginfo[0], 'PKG-INFO')) + requires_txt = os.path.join(egginfo[0], 'requires.txt') + if os.path.exists(requires_txt): + with codecs.open(requires_txt) as f: + inst_req = [] + extras_req = collections.defaultdict(list) + current_feature = None + for line in f.readlines(): + line = line.rstrip() + if not line: + continue + + if line.startswith('['): + current_feature = line[1:-1] + elif current_feature: + extras_req[current_feature].append(line) + else: + inst_req.append(line) + info['Install-requires'] = inst_req + info['Extras-require'] = extras_req + elif RecipeHandler.checkfiles(srctree, ['PKG-INFO']): + info = self.get_pkginfo(os.path.join(srctree, 'PKG-INFO')) + + if setup_info: + if 'Install-requires' in setup_info: + info['Install-requires'] = setup_info['Install-requires'] + if 'Extras-require' in setup_info: + info['Extras-require'] = setup_info['Extras-require'] + else: + if setup_info: + info = setup_info + else: + info = self.get_setup_args_info(setupscript) + + self.apply_info_replacements(info) + + if uses_setuptools: + classes.append('setuptools') + else: + classes.append('distutils') + + if 'Classifier' in info: + licenses = [] + for classifier in info['Classifier']: + if classifier in self.classifier_license_map: + license = self.classifier_license_map[classifier] + licenses.append(license) + + if licenses: + info['License'] = ' & '.join(licenses) + + + # Map PKG-INFO & setup.py fields to bitbake variables + bbinfo = {} + for field, values in info.iteritems(): + if field in self.excluded_fields: + continue + + if field not in self.bbvar_map: + continue + + if isinstance(values, basestring): + value = values + else: + value = ' '.join(str(v) for v in values if v) + + bbvar = self.bbvar_map[field] + if bbvar not in bbinfo and value: + bbinfo[bbvar] = value + + comment_lic_line = None + for pos, line in enumerate(list(lines_before)): + if line.startswith('#') and 'LICENSE' in line: + comment_lic_line = pos + elif line.startswith('LICENSE =') and 'LICENSE' in bbinfo: + if line in ('LICENSE = "Unknown"', 'LICENSE = "CLOSED"'): + lines_before[pos] = 'LICENSE = "{}"'.format(bbinfo['LICENSE']) + if line == 'LICENSE = "CLOSED"' and comment_lic_line: + lines_before[comment_lic_line:pos] = [ + '# WARNING: the following LICENSE value is a best guess - it is your', + '# responsibility to verify that the value is complete and correct.' + ] + del bbinfo['LICENSE'] + + src_uri_line = None + for pos, line in enumerate(lines_before): + if line.startswith('SRC_URI ='): + src_uri_line = pos + + if bbinfo: + mdinfo = [''] + for k in sorted(bbinfo): + v = bbinfo[k] + mdinfo.append('{} = "{}"'.format(k, v)) + lines_before[src_uri_line-1:src_uri_line-1] = mdinfo + + mapped_deps, unmapped_deps = self.scan_setup_python_deps(srctree, setup_info, setup_non_literals) + + extras_req = set() + if 'Extras-require' in info: + extras_req = info['Extras-require'] + if extras_req: + lines_after.append('# The following configs & dependencies are from setuptools extras_require.') + lines_after.append('# These dependencies are optional, hence can be controlled via PACKAGECONFIG.') + lines_after.append('# The upstream names may not correspond exactly to bitbake package names.') + lines_after.append('#') + lines_after.append('# Uncomment this line to enable all the optional features.') + lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req.iterkeys()))) + for feature, feature_reqs in extras_req.iteritems(): + unmapped_deps.difference_update(feature_reqs) + + feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs)) + lines_after.append('PACKAGECONFIG[{}] = ",,,{}"'.format(feature.lower(), ' '.join(feature_req_deps))) + + inst_reqs = set() + if 'Install-requires' in info: + if extras_req: + lines_after.append('') + inst_reqs = info['Install-requires'] + if inst_reqs: + unmapped_deps.difference_update(inst_reqs) + + inst_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(inst_reqs)) + lines_after.append('# WARNING: the following rdepends are from setuptools install_requires. These') + lines_after.append('# upstream names may not correspond exactly to bitbake package names.') + lines_after.append('RDEPENDS_${{PN}} += "{}"'.format(' '.join(inst_req_deps))) + + if mapped_deps: + name = info.get('Name') + if name and name[0] in mapped_deps: + # Attempt to avoid self-reference + mapped_deps.remove(name[0]) + mapped_deps -= set(self.excluded_pkgdeps) + if inst_reqs or extras_req: + lines_after.append('') + lines_after.append('# WARNING: the following rdepends are determined through basic analysis of the') + lines_after.append('# python sources, and might not be 100% accurate.') + lines_after.append('RDEPENDS_${{PN}} += "{}"'.format(' '.join(sorted(mapped_deps)))) + + unmapped_deps -= set(extensions) + unmapped_deps -= set(self.assume_provided) + if unmapped_deps: + if mapped_deps: + lines_after.append('') + lines_after.append('# WARNING: We were unable to map the following python package/module') + lines_after.append('# dependencies to the bitbake packages which include them:') + lines_after.extend('# {}'.format(d) for d in sorted(unmapped_deps)) + + handled.append('buildsystem') + + def get_pkginfo(self, pkginfo_fn): + msg = email.message_from_file(open(pkginfo_fn, 'r')) + msginfo = {} + for field in msg.keys(): + values = msg.get_all(field) + if len(values) == 1: + msginfo[field] = values[0] + else: + msginfo[field] = values + return msginfo + + def parse_setup_py(self, setupscript='./setup.py'): + with codecs.open(setupscript) as f: + info, imported_modules, non_literals, extensions = gather_setup_info(f) + + def _map(key): + key = key.replace('_', '-') + key = key[0].upper() + key[1:] + if key in self.setup_parse_map: + key = self.setup_parse_map[key] + return key + + # Naive mapping of setup() arguments to PKG-INFO field names + for d in [info, non_literals]: + for key, value in d.items(): + new_key = _map(key) + if new_key != key: + del d[key] + d[new_key] = value + + return info, 'setuptools' in imported_modules, non_literals, extensions + + def get_setup_args_info(self, setupscript='./setup.py'): + cmd = ['python', setupscript] + info = {} + keys = set(self.bbvar_map.keys()) + keys |= set(self.setuparg_list_fields) + keys |= set(self.setuparg_multi_line_values) + grouped_keys = itertools.groupby(keys, lambda k: (k in self.setuparg_list_fields, k in self.setuparg_multi_line_values)) + for index, keys in grouped_keys: + if index == (True, False): + # Splitlines output for each arg as a list value + for key in keys: + arg = self.setuparg_map.get(key, key.lower()) + try: + arg_info = self.run_command(cmd + ['--' + arg], cwd=os.path.dirname(setupscript)) + except (OSError, subprocess.CalledProcessError): + pass + else: + info[key] = [l.rstrip() for l in arg_info.splitlines()] + elif index == (False, True): + # Entire output for each arg + for key in keys: + arg = self.setuparg_map.get(key, key.lower()) + try: + arg_info = self.run_command(cmd + ['--' + arg], cwd=os.path.dirname(setupscript)) + except (OSError, subprocess.CalledProcessError): + pass + else: + info[key] = arg_info + else: + info.update(self.get_setup_byline(list(keys), setupscript)) + return info + + def get_setup_byline(self, fields, setupscript='./setup.py'): + info = {} + + cmd = ['python', setupscript] + cmd.extend('--' + self.setuparg_map.get(f, f.lower()) for f in fields) + try: + info_lines = self.run_command(cmd, cwd=os.path.dirname(setupscript)).splitlines() + except (OSError, subprocess.CalledProcessError): + pass + else: + if len(fields) != len(info_lines): + logger.error('Mismatch between setup.py output lines and number of fields') + sys.exit(1) + + for lineno, line in enumerate(info_lines): + line = line.rstrip() + info[fields[lineno]] = line + return info + + def apply_info_replacements(self, info): + for variable, search, replace in self.replacements: + if variable not in info: + continue + + def replace_value(search, replace, value): + if replace is None: + if re.search(search, value): + return None + else: + new_value = re.sub(search, replace, value) + if value != new_value: + return new_value + return value + + value = info[variable] + if isinstance(value, basestring): + new_value = replace_value(search, replace, value) + if new_value is None: + del info[variable] + elif new_value != value: + info[variable] = new_value + elif hasattr(value, 'iteritems'): + for dkey, dvalue in value.iteritems(): + new_list = [] + for pos, a_value in enumerate(dvalue): + new_value = replace_value(search, replace, a_value) + if new_value is not None and new_value != value: + new_list.append(new_value) + + if value != new_list: + value[dkey] = new_list + else: + new_list = [] + for pos, a_value in enumerate(value): + new_value = replace_value(search, replace, a_value) + if new_value is not None and new_value != value: + new_list.append(new_value) + + if value != new_list: + info[variable] = new_list + + def scan_setup_python_deps(self, srctree, setup_info, setup_non_literals): + if 'Package-dir' in setup_info: + package_dir = setup_info['Package-dir'] + else: + package_dir = {} + + class PackageDir(distutils.command.build_py.build_py): + def __init__(self, package_dir): + self.package_dir = package_dir + + pd = PackageDir(package_dir) + to_scan = [] + if not any(v in setup_non_literals for v in ['Py-modules', 'Scripts', 'Packages']): + if 'Py-modules' in setup_info: + for module in setup_info['Py-modules']: + try: + package, module = module.rsplit('.', 1) + except ValueError: + package, module = '.', module + module_path = os.path.join(pd.get_package_dir(package), module + '.py') + to_scan.append(module_path) + + if 'Packages' in setup_info: + for package in setup_info['Packages']: + to_scan.append(pd.get_package_dir(package)) + + if 'Scripts' in setup_info: + to_scan.extend(setup_info['Scripts']) + else: + logger.info("Scanning the entire source tree, as one or more of the following setup keywords are non-literal: py_modules, scripts, packages.") + + if not to_scan: + to_scan = ['.'] + + logger.info("Scanning paths for packages & dependencies: %s", ', '.join(to_scan)) + + provided_packages = self.parse_pkgdata_for_python_packages() + scanned_deps = self.scan_python_dependencies([os.path.join(srctree, p) for p in to_scan]) + mapped_deps, unmapped_deps = set(self.base_pkgdeps), set() + for dep in scanned_deps: + mapped = provided_packages.get(dep) + if mapped: + mapped_deps.add(mapped) + else: + unmapped_deps.add(dep) + return mapped_deps, unmapped_deps + + def scan_python_dependencies(self, paths): + deps = set() + try: + dep_output = self.run_command(['pythondeps', '-d'] + paths) + except (OSError, subprocess.CalledProcessError): + pass + else: + for line in dep_output.splitlines(): + line = line.rstrip() + dep, filename = line.split('\t', 1) + if filename.endswith('/setup.py'): + continue + deps.add(dep) + + try: + provides_output = self.run_command(['pythondeps', '-p'] + paths) + except (OSError, subprocess.CalledProcessError): + pass + else: + provides_lines = (l.rstrip() for l in provides_output.splitlines()) + provides = set(l for l in provides_lines if l and l != 'setup') + deps -= provides + + return deps + + def parse_pkgdata_for_python_packages(self): + suffixes = [t[0] for t in imp.get_suffixes()] + pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True) + + ldata = tinfoil.config_data.createCopy() + bb.parse.handle('classes/python-dir.bbclass', ldata, True) + python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR', True) + + dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload') + python_dirs = [python_sitedir + os.sep, + os.path.join(os.path.dirname(python_sitedir), 'dist-packages') + os.sep, + os.path.dirname(python_sitedir) + os.sep] + packages = {} + for pkgdatafile in glob.glob('{}/runtime/*'.format(pkgdata_dir)): + files_info = None + with open(pkgdatafile, 'r') as f: + for line in f.readlines(): + field, value = line.split(': ', 1) + if field == 'FILES_INFO': + files_info = ast.literal_eval(value) + break + else: + continue + + for fn in files_info.iterkeys(): + for suffix in suffixes: + if fn.endswith(suffix): + break + else: + continue + + if fn.startswith(dynload_dir + os.sep): + base = os.path.basename(fn) + provided = base.split('.', 1)[0] + packages[provided] = os.path.basename(pkgdatafile) + continue + + for python_dir in python_dirs: + if fn.startswith(python_dir): + relpath = fn[len(python_dir):] + relstart, _, relremaining = relpath.partition(os.sep) + if relstart.endswith('.egg'): + relpath = relremaining + base, _ = os.path.splitext(relpath) + + if '/.debug/' in base: + continue + if os.path.basename(base) == '__init__': + base = os.path.dirname(base) + base = base.replace(os.sep + os.sep, os.sep) + provided = base.replace(os.sep, '.') + packages[provided] = os.path.basename(pkgdatafile) + return packages + + @classmethod + def run_command(cls, cmd, **popenargs): + if 'stderr' not in popenargs: + popenargs['stderr'] = subprocess.STDOUT + try: + return subprocess.check_output(cmd, **popenargs) + except OSError as exc: + logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc) + raise + except subprocess.CalledProcessError as exc: + logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc.output) + raise + + +def gather_setup_info(fileobj): + parsed = ast.parse(fileobj.read(), fileobj.name) + visitor = SetupScriptVisitor() + visitor.visit(parsed) + + non_literals, extensions = {}, [] + for key, value in visitor.keywords.items(): + if key == 'ext_modules': + if isinstance(value, list): + for ext in value: + if (isinstance(ext, ast.Call) and + isinstance(ext.func, ast.Name) and + ext.func.id == 'Extension' and + not has_non_literals(ext.args)): + extensions.append(ext.args[0]) + elif has_non_literals(value): + non_literals[key] = value + del visitor.keywords[key] + + return visitor.keywords, visitor.imported_modules, non_literals, extensions + + +class SetupScriptVisitor(ast.NodeVisitor): + def __init__(self): + ast.NodeVisitor.__init__(self) + self.keywords = {} + self.non_literals = [] + self.imported_modules = set() + + def visit_Expr(self, node): + if isinstance(node.value, ast.Call) and \ + isinstance(node.value.func, ast.Name) and \ + node.value.func.id == 'setup': + self.visit_setup(node.value) + + def visit_setup(self, node): + call = LiteralAstTransform().visit(node) + self.keywords = call.keywords + for k, v in self.keywords.iteritems(): + if has_non_literals(v): + self.non_literals.append(k) + + def visit_Import(self, node): + for alias in node.names: + self.imported_modules.add(alias.name) + + def visit_ImportFrom(self, node): + self.imported_modules.add(node.module) + + +class LiteralAstTransform(ast.NodeTransformer): + """Simplify the ast through evaluation of literals.""" + excluded_fields = ['ctx'] + + def visit(self, node): + if not isinstance(node, ast.AST): + return node + else: + return ast.NodeTransformer.visit(self, node) + + def generic_visit(self, node): + try: + return ast.literal_eval(node) + except ValueError: + for field, value in ast.iter_fields(node): + if field in self.excluded_fields: + delattr(node, field) + if value is None: + continue + + if isinstance(value, list): + if field in ('keywords', 'kwargs'): + new_value = dict((kw.arg, self.visit(kw.value)) for kw in value) + else: + new_value = [self.visit(i) for i in value] + else: + new_value = self.visit(value) + setattr(node, field, new_value) + return node + + def visit_Name(self, node): + if hasattr('__builtins__', node.id): + return getattr(__builtins__, node.id) + else: + return self.generic_visit(node) + + def visit_Tuple(self, node): + return tuple(self.visit(v) for v in node.elts) + + def visit_List(self, node): + return [self.visit(v) for v in node.elts] + + def visit_Set(self, node): + return set(self.visit(v) for v in node.elts) + + def visit_Dict(self, node): + keys = (self.visit(k) for k in node.keys) + values = (self.visit(v) for v in node.values) + return dict(zip(keys, values)) + + +def has_non_literals(value): + if isinstance(value, ast.AST): + return True + elif isinstance(value, basestring): + return False + elif hasattr(value, 'itervalues'): + return any(has_non_literals(v) for v in value.itervalues()) + elif hasattr(value, '__iter__'): + return any(has_non_literals(v) for v in value) + + +def plugin_init(pluginlist): + pass + + +def register_recipe_handlers(handlers): + # We need to make sure this is ahead of the makefile fallback handler + handlers.insert(0, PythonRecipeHandler()) diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py new file mode 100644 index 0000000000..e7861268a5 --- /dev/null +++ b/scripts/lib/scriptutils.py @@ -0,0 +1,60 @@ +# Script utility functions +# +# Copyright (C) 2014 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import sys +import os +import logging +import glob + +def logger_create(name): + logger = logging.getLogger(name) + loggerhandler = logging.StreamHandler() + loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) + logger.addHandler(loggerhandler) + logger.setLevel(logging.INFO) + return logger + +def logger_setup_color(logger, color='auto'): + from bb.msg import BBLogFormatter + console = logging.StreamHandler(sys.stdout) + formatter = BBLogFormatter("%(levelname)s: %(message)s") + console.setFormatter(formatter) + logger.handlers = [console] + if color == 'always' or (color=='auto' and console.stream.isatty()): + formatter.enable_color() + + +def load_plugins(logger, plugins, pluginpath): + import imp + + def load_plugin(name): + logger.debug('Loading plugin %s' % name) + fp, pathname, description = imp.find_module(name, [pluginpath]) + try: + return imp.load_module(name, fp, pathname, description) + finally: + if fp: + fp.close() + + logger.debug('Loading plugins from %s...' % pluginpath) + for fn in glob.glob(os.path.join(pluginpath, '*.py')): + name = os.path.splitext(os.path.basename(fn))[0] + if name != '__init__': + plugin = load_plugin(name) + if hasattr(plugin, 'plugin_init'): + plugin.plugin_init(plugins) + plugins.append(plugin) diff --git a/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py b/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py index 56b91aa9d9..b564b1a7ab 100644 --- a/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py +++ b/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py @@ -78,7 +78,7 @@ class FC3_PartData(BaseData): if self.recommended: retval += " --recommended" if self.size and self.size != 0: - retval += " --size=%s" % self.size + retval += " --size=%sk" % self.size if hasattr(self, "start") and self.start != 0: retval += " --start=%s" % self.start @@ -216,7 +216,7 @@ class FC3_Partition(KickstartCommand): callback=part_cb, nargs=1, type="string") op.add_option("--recommended", dest="recommended", action="store_true", default=False) - op.add_option("--size", dest="size", action="store", type="int", + op.add_option("--size", dest="size", action="store", type="size", nargs=1) op.add_option("--start", dest="start", action="store", type="int", nargs=1) diff --git a/scripts/lib/wic/3rdparty/pykickstart/options.py b/scripts/lib/wic/3rdparty/pykickstart/options.py index 341c5d7298..b2d8e3e516 100644 --- a/scripts/lib/wic/3rdparty/pykickstart/options.py +++ b/scripts/lib/wic/3rdparty/pykickstart/options.py @@ -143,6 +143,24 @@ def _check_string(option, opt, value): else: return value +def _check_size(option, opt, value): + # Former default was MB + if (value.isdigit()): + return int(value) * 1024L + + mapping = {"opt": opt, "value": value} + if (not value[:-1].isdigit()): + raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping) + + size = int(value[:-1]) + if (value.endswith("k") or value.endswith("K")): + return size + if (value.endswith("M")): + return size * 1024L + if (value.endswith("G")): + return size * 1024L * 1024L + raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping) + # Creates a new Option class that supports several new attributes: # - required: any option with this attribute must be supplied or an exception # is thrown @@ -169,10 +187,11 @@ class KSOption (Option): ACTIONS = Option.ACTIONS + ("map", "map_extend",) STORE_ACTIONS = Option.STORE_ACTIONS + ("map", "map_extend",) - TYPES = Option.TYPES + ("ksboolean", "string") + TYPES = Option.TYPES + ("ksboolean", "string", "size") TYPE_CHECKER = copy(Option.TYPE_CHECKER) TYPE_CHECKER["ksboolean"] = _check_ksboolean TYPE_CHECKER["string"] = _check_string + TYPE_CHECKER["size"] = _check_size def _check_required(self): if self.required and not self.takes_value(): diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 6b2ab3368e..d368401af4 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -74,6 +74,22 @@ class DirectImageCreator(BaseImageCreator): self.kernel_dir = kernel_dir self.native_sysroot = native_sysroot + def __get_part_num(self, num, parts): + """calculate the real partition number, accounting for partitions not + in the partition table and logical partitions + """ + realnum = 0 + for n, p in enumerate(parts, 1): + if not p.no_table: + realnum += 1 + if n == num: + if p.no_table: + return 0 + if self._ptable_format == 'msdos' and realnum > 3: + # account for logical partition numbering, ex. sda5.. + return realnum + 1 + return realnum + def __write_fstab(self, image_rootfs): """overriden to generate fstab (temporarily) in rootfs. This is called from _create, make sure it doesn't get called from @@ -98,12 +114,16 @@ class DirectImageCreator(BaseImageCreator): def _update_fstab(self, fstab_lines, parts): """Assume partition order same as in wks""" for num, p in enumerate(parts, 1): - if not p.mountpoint or p.mountpoint == "/" or p.mountpoint == "/boot": + pnum = self.__get_part_num(num, parts) + if not p.mountpoint or p.mountpoint == "/" or p.mountpoint == "/boot" or pnum == 0: continue - if self._ptable_format == 'msdos' and num > 3: - device_name = "/dev/" + p.disk + str(num + 1) - else: - device_name = "/dev/" + p.disk + str(num) + + part = '' + # mmc device partitions are named mmcblk0p1, mmcblk0p2.. + if p.disk.startswith('mmcblk'): + part = 'p' + + device_name = "/dev/" + p.disk + part + str(pnum) opts = "defaults" if p.fsopts: @@ -230,6 +250,8 @@ class DirectImageCreator(BaseImageCreator): if not self.ks.handler.bootloader.source and p.mountpoint == "/boot": self.ks.handler.bootloader.source = p.source + fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) + for p in parts: # need to create the filesystems in order to get their # sizes before we can add them and do the layout. @@ -238,12 +260,9 @@ class DirectImageCreator(BaseImageCreator): # self.assemble() calls Image.assemble() which calls # __write_partitition() for each partition to dd the fs # into the partitions. - fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) - p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir, self.bootimg_dir, self.kernel_dir, self.native_sysroot) - self._restore_fstab(fstab) self.__image.add_partition(int(p.size), p.disk, @@ -254,8 +273,11 @@ class DirectImageCreator(BaseImageCreator): fsopts = p.fsopts, boot = p.active, align = p.align, + no_table = p.no_table, part_type = p.part_type) + self._restore_fstab(fstab) + self.__image.layout_partitions(self._ptable_format) self.__imgdir = self.workdir @@ -342,10 +364,8 @@ class DirectImageCreator(BaseImageCreator): if p.disk.startswith('mmcblk'): part = 'p' - if self._ptable_format == 'msdos' and num > 3: - rootdev = "/dev/%s%s%-d" % (p.disk, part, num + 1) - else: - rootdev = "/dev/%s%s%-d" % (p.disk, part, num) + pnum = self.__get_part_num(num, parts) + rootdev = "/dev/%s%s%-d" % (p.disk, part, pnum) root_part_uuid = p.part_type return (rootdev, root_part_uuid) diff --git a/scripts/lib/wic/kickstart/__init__.py b/scripts/lib/wic/kickstart/__init__.py index 600098293a..10959213d1 100644 --- a/scripts/lib/wic/kickstart/__init__.py +++ b/scripts/lib/wic/kickstart/__init__.py @@ -58,16 +58,13 @@ def read_kickstart(path): def __init__(self): superclass.__init__(self, mapping=commandMap[using_version]) - ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=False) + ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=True) try: ks.readKickstart(path) except (kserrors.KickstartParseError, kserrors.KickstartError), err: - if msger.ask("Errors occured on kickstart file, skip and continue?"): - msger.warning("%s" % err) - pass - else: - raise errors.KsError("%s" % err) + msger.warning("Errors occurred when parsing kickstart file: %s\n" % path) + msger.error("%s" % err) return ks @@ -77,7 +74,7 @@ def get_image_size(ks, default = None): if p.mountpoint == "/" and p.size: __size = p.size if __size > 0: - return int(__size) * 1024L * 1024L + return int(__size) * 1024L else: return default diff --git a/scripts/lib/wic/kickstart/custom_commands/micpartition.py b/scripts/lib/wic/kickstart/custom_commands/micpartition.py index 43d04f1294..d6be008ceb 100644 --- a/scripts/lib/wic/kickstart/custom_commands/micpartition.py +++ b/scripts/lib/wic/kickstart/custom_commands/micpartition.py @@ -32,7 +32,7 @@ class Mic_PartData(FC4_PartData): retval = FC4_PartData._getArgsAsStr(self) if self.align: - retval += " --align" + retval += " --align=%d" % self.align if self.extopts: retval += " --extoptions=%s" % self.extopts if self.part_type: diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 54a494e033..f3d553b885 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -49,6 +49,9 @@ class Wic_PartData(Mic_PartData): self.source = kwargs.get("source", None) self.sourceparams = kwargs.get("sourceparams", None) self.rootfs = kwargs.get("rootfs-dir", None) + self.no_table = kwargs.get("no-table", False) + self.extra_space = kwargs.get("extra-space", "10M") + self.overhead_factor = kwargs.get("overhead-factor", 1.3) self.source_file = "" self.size = 0 @@ -61,6 +64,10 @@ class Wic_PartData(Mic_PartData): retval += " --sourceparams=%s" % self.sourceparams if self.rootfs: retval += " --rootfs-dir=%s" % self.rootfs + if self.no_table: + retval += " --no-table" + retval += " --extra-space=%d" % self.extra_space + retval += " --overhead-factor=%f" % self.overhead_factor return retval @@ -99,7 +106,7 @@ class Wic_PartData(Mic_PartData): def get_extra_block_count(self, current_blocks): """ - The --size param is reflected in self.size (in MB), and we already + The --size param is reflected in self.size (in kB), and we already have current_blocks (1k) blocks, calculate and return the number of (1k) blocks we need to add to get to --size, 0 if we're already there or beyond. @@ -110,7 +117,7 @@ class Wic_PartData(Mic_PartData): if not self.size: return 0 - requested_blocks = self.size * 1024 + requested_blocks = self.size msger.debug("Requested blocks %d, current_blocks %d" % \ (requested_blocks, current_blocks)) @@ -171,7 +178,7 @@ class Wic_PartData(Mic_PartData): Handle an already-created partition e.g. xxx.ext3 """ rootfs = oe_builddir - du_cmd = "du -Lbms %s" % rootfs + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) rootfs_size = out.split()[0] @@ -186,10 +193,15 @@ class Wic_PartData(Mic_PartData): Currently handles ext2/3/4, btrfs and vfat. """ - pseudo = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot - pseudo += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir - pseudo += "export PSEUDO_PASSWD=%s;" % rootfs_dir - pseudo += "export PSEUDO_NOSYMLINKEXP=1;" + p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot) + p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR", + "%s/../pseudo" % rootfs_dir) + p_passwd = os.environ.get("PSEUDO_PASSWD", rootfs_dir) + p_nosymlinkexp = os.environ.get("PSEUDO_NOSYMLINKEXP", "1") + pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix + pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % p_localstatedir + pseudo += "export PSEUDO_PASSWD=%s;" % p_passwd + pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp pseudo += "%s/usr/bin/pseudo " % native_sysroot if self.fstype.startswith("ext"): @@ -224,12 +236,11 @@ class Wic_PartData(Mic_PartData): actual_rootfs_size = int(out.split()[0]) extra_blocks = self.get_extra_block_count(actual_rootfs_size) - - if extra_blocks < IMAGE_EXTRA_SPACE: - extra_blocks = IMAGE_EXTRA_SPACE + if extra_blocks < self.extra_space: + extra_blocks = self.extra_space rootfs_size = actual_rootfs_size + extra_blocks - rootfs_size *= IMAGE_OVERHEAD_FACTOR + rootfs_size *= self.overhead_factor msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \ (extra_blocks, self.mountpoint, rootfs_size)) @@ -240,15 +251,19 @@ class Wic_PartData(Mic_PartData): extra_imagecmd = "-i 8192" - mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \ - (self.fstype, extra_imagecmd, rootfs, image_rootfs) + label_str = "" + if (self.label): + label_str = "-L %s" % self.label + + mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ + (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs) (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) if rc: print "rootfs_dir: %s" % rootfs_dir msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir)) - # get the rootfs size in the right units for kickstart (Mb) - du_cmd = "du -Lbms %s" % rootfs + # get the rootfs size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) rootfs_size = out.split()[0] @@ -272,12 +287,11 @@ class Wic_PartData(Mic_PartData): actual_rootfs_size = int(out.split()[0]) extra_blocks = self.get_extra_block_count(actual_rootfs_size) - - if extra_blocks < IMAGE_EXTRA_SPACE: - extra_blocks = IMAGE_EXTRA_SPACE + if extra_blocks < self.extra_space: + extra_blocks = self.extra_space rootfs_size = actual_rootfs_size + extra_blocks - rootfs_size *= IMAGE_OVERHEAD_FACTOR + rootfs_size *= self.overhead_factor msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \ (extra_blocks, self.mountpoint, rootfs_size)) @@ -286,14 +300,18 @@ class Wic_PartData(Mic_PartData): (rootfs, rootfs_size) exec_cmd(dd_cmd) - mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \ - (self.fstype, rootfs_size * 1024, image_rootfs, rootfs) + label_str = "" + if (self.label): + label_str = "-L %s" % self.label + + mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ + (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs) (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) if rc: msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir)) - # get the rootfs size in the right units for kickstart (Mb) - du_cmd = "du -Lbms %s" % rootfs + # get the rootfs size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) rootfs_size = out.split()[0] @@ -313,9 +331,8 @@ class Wic_PartData(Mic_PartData): blocks = int(out.split()[0]) extra_blocks = self.get_extra_block_count(blocks) - - if extra_blocks < IMAGE_EXTRA_SPACE: - extra_blocks = IMAGE_EXTRA_SPACE + if extra_blocks < self.extra_space: + extra_blocks = self.extra_space blocks += extra_blocks @@ -330,7 +347,11 @@ class Wic_PartData(Mic_PartData): if blocks % 16 != 0: blocks += (16 - (blocks % 16)) - dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (rootfs, blocks) + label_str = "-n boot" + if (self.label): + label_str = "-n %s" % self.label + + dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks) exec_native_cmd(dosfs_cmd, native_sysroot) mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs) @@ -341,8 +362,8 @@ class Wic_PartData(Mic_PartData): chmod_cmd = "chmod 644 %s" % rootfs exec_cmd(chmod_cmd) - # get the rootfs size in the right units for kickstart (Mb) - du_cmd = "du -Lbms %s" % rootfs + # get the rootfs size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) rootfs_size = out.split()[0] @@ -361,8 +382,8 @@ class Wic_PartData(Mic_PartData): (image_rootfs, rootfs) exec_native_cmd(pseudo + squashfs_cmd, native_sysroot) - # get the rootfs size in the right units for kickstart (Mb) - du_cmd = "du -Lbms %s" % rootfs + # get the rootfs size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) rootfs_size = out.split()[0] @@ -395,13 +416,18 @@ class Wic_PartData(Mic_PartData): """ fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) - dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \ + dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ (fs, self.size) exec_cmd(dd_cmd) extra_imagecmd = "-i 8192" - mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs) + label_str = "" + if (self.label): + label_str = "-L %s" % self.label + + mkfs_cmd = "mkfs.%s -F %s %s %s" % \ + (self.fstype, extra_imagecmd, label_str, fs) (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) if rc: msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) @@ -417,16 +443,16 @@ class Wic_PartData(Mic_PartData): """ fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) - dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \ + dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ (fs, self.size) exec_cmd(dd_cmd) - mkfs_cmd = "mkfs.%s -b %d %s" % (self.fstype, self.size * 1024, rootfs) - (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) - if rc: - msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) + label_str = "" + if (self.label): + label_str = "-L %s" % self.label - mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs) + mkfs_cmd = "mkfs.%s -b %d %s %s" % \ + (self.fstype, self.size * 1024, label_str, fs) (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) if rc: msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) @@ -442,9 +468,13 @@ class Wic_PartData(Mic_PartData): """ fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) - blocks = self.size * 1024 + blocks = self.size - dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (fs, blocks) + label_str = "-n boot" + if (self.label): + label_str = "-n %s" % self.label + + dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, fs, blocks) exec_native_cmd(dosfs_cmd, native_sysroot) chmod_cmd = "chmod 644 %s" % fs @@ -474,8 +504,8 @@ class Wic_PartData(Mic_PartData): os.rmdir(tmpdir) - # get the rootfs size in the right units for kickstart (Mb) - du_cmd = "du -Lbms %s" % fs + # get the rootfs size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % fs out = exec_cmd(du_cmd) fs_size = out.split()[0] @@ -490,7 +520,7 @@ class Wic_PartData(Mic_PartData): """ fs = "%s/fs.%s" % (cr_workdir, self.fstype) - dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \ + dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ (fs, self.size) exec_cmd(dd_cmd) @@ -510,6 +540,11 @@ class Wic_Partition(Mic_Partition): removedAttrs = Mic_Partition.removedAttrs def _getParser(self): + def overhead_cb (option, opt_str, value, parser): + if (value < 1): + raise OptionValueError("Option %s: invalid value: %r" % (option, value)) + setattr(parser.values, option.dest, value) + op = Mic_Partition._getParser(self) # use specified source file to fill the partition # and calculate partition size @@ -521,4 +556,13 @@ class Wic_Partition(Mic_Partition): # use specified rootfs path to fill the partition op.add_option("--rootfs-dir", type="string", action="store", dest="rootfs", default=None) + # wether to add the partition in the partition table + op.add_option("--no-table", dest="no_table", action="store_true", + default=False) + # extra space beyond the partition size + op.add_option("--extra-space", dest="extra_space", action="store", + type="size", nargs=1, default="10M") + op.add_option("--overhead-factor", dest="overhead_factor", + action="callback", callback=overhead_cb, type="float", + nargs=1, default=1.3) return op diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index e4067b6dbf..ee57881e90 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -228,7 +228,7 @@ class BootimgEFIPlugin(SourcePlugin): chmod_cmd = "chmod 644 %s" % bootimg exec_cmd(chmod_cmd) - du_cmd = "du -Lbms %s" % bootimg + du_cmd = "du -Lbks %s" % bootimg out = exec_cmd(du_cmd) bootimg_size = out.split()[0] diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py index 564118ad8b..c5eb7b8b80 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -29,6 +29,7 @@ import re from wic import msger from wic.pluginbase import SourcePlugin from wic.utils.oe.misc import * +from glob import glob class BootimgPartitionPlugin(SourcePlugin): name = 'bootimg-partition' @@ -65,7 +66,7 @@ class BootimgPartitionPlugin(SourcePlugin): - copies all files listed in IMAGE_BOOT_FILES variable """ hdddir = "%s/boot" % cr_workdir - rm_cmd = "rm -rf %s" % cr_workdir + rm_cmd = "rm -rf %s/boot" % cr_workdir exec_cmd(rm_cmd) install_cmd = "install -d %s" % hdddir @@ -87,7 +88,7 @@ class BootimgPartitionPlugin(SourcePlugin): # list of tuples (src_name, dst_name) deploy_files = [] - for src_entry in re.findall(r'[\w;\-\./]+', boot_files): + for src_entry in re.findall(r'[\w;\-\./\*]+', boot_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) if not dst_entry[0] or not dst_entry[1]: @@ -100,14 +101,36 @@ class BootimgPartitionPlugin(SourcePlugin): for deploy_entry in deploy_files: src, dst = deploy_entry - src_path = os.path.join(bootimg_dir, src) - dst_path = os.path.join(hdddir, dst) - - msger.debug('Install %s as %s' % (os.path.basename(src_path), - dst_path)) - install_cmd = "install -m 0644 -D %s %s" \ - % (src_path, dst_path) - exec_cmd(install_cmd) + install_task = [] + if '*' in src: + # by default install files under their basename + entry_name_fn = os.path.basename + if dst != src: + # unless a target name was given, then treat name + # as a directory and append a basename + entry_name_fn = lambda name: \ + os.path.join(dst, + os.path.basename(name)) + + srcs = glob(os.path.join(bootimg_dir, src)) + + msger.debug('Globbed sources: %s' % (', '.join(srcs))) + for entry in srcs: + entry_dst_name = entry_name_fn(entry) + install_task.append((entry, + os.path.join(hdddir, + entry_dst_name))) + else: + install_task = [(os.path.join(bootimg_dir, src), + os.path.join(hdddir, dst))] + + for task in install_task: + src_path, dst_path = task + msger.debug('Install %s as %s' % (os.path.basename(src_path), + dst_path)) + install_cmd = "install -m 0644 -D %s %s" \ + % (src_path, dst_path) + exec_cmd(install_cmd) msger.debug('Prepare boot partition using rootfs in %s' % (hdddir)) part.prepare_rootfs(cr_workdir, oe_builddir, hdddir, diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 8a1aca1ad1..c4786a6e0e 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -190,7 +190,7 @@ class BootimgPcbiosPlugin(SourcePlugin): chmod_cmd = "chmod 644 %s" % bootimg exec_cmd(chmod_cmd) - du_cmd = "du -Lbms %s" % bootimg + du_cmd = "du -Lbks %s" % bootimg out = exec_cmd(du_cmd) bootimg_size = out.split()[0] diff --git a/scripts/lib/wic/plugins/source/fsimage.py b/scripts/lib/wic/plugins/source/fsimage.py new file mode 100644 index 0000000000..0967883afa --- /dev/null +++ b/scripts/lib/wic/plugins/source/fsimage.py @@ -0,0 +1,70 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +import os +import re + +from wic import msger +from wic.pluginbase import SourcePlugin +from wic.utils.oe.misc import * + +class FSImagePlugin(SourcePlugin): + name = 'fsimage' + + @classmethod + def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + bootimg_dir, kernel_dir, native_sysroot): + """ + Called after all partitions have been prepared and assembled into a + disk image. Do nothing. + """ + pass + + @classmethod + def do_configure_partition(self, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + native_sysroot): + """ + Called before do_prepare_partition(). Possibly prepare + configuration files of some sort. + """ + pass + + @classmethod + def do_prepare_partition(self, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + rootfs_dir, native_sysroot): + """ + Called to do the actual content population for a partition i.e. it + 'prepares' the partition to be incorporated into the image. + """ + if not bootimg_dir: + bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") + if not bootimg_dir: + msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") + + msger.debug('Bootimg dir: %s' % bootimg_dir) + + if ('file' not in source_params): + msger.error("No file specified\n") + return + + src = os.path.join(bootimg_dir, source_params['file']) + + + msger.debug('Preparing partition using image %s' % (src)) + part.prepare_rootfs_from_fs_image(cr_workdir, src, "") diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py new file mode 100644 index 0000000000..cf6236a04f --- /dev/null +++ b/scripts/lib/wic/plugins/source/rawcopy.py @@ -0,0 +1,84 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +import os +import re + +from wic import msger +from wic.pluginbase import SourcePlugin +from wic.utils.oe.misc import * + +class RawCopyPlugin(SourcePlugin): + name = 'rawcopy' + + @classmethod + def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + bootimg_dir, kernel_dir, native_sysroot): + """ + Called after all partitions have been prepared and assembled into a + disk image. Do nothing. + """ + pass + + @classmethod + def do_configure_partition(self, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + native_sysroot): + """ + Called before do_prepare_partition(). Possibly prepare + configuration files of some sort. + """ + pass + + @classmethod + def do_prepare_partition(self, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + rootfs_dir, native_sysroot): + """ + Called to do the actual content population for a partition i.e. it + 'prepares' the partition to be incorporated into the image. + """ + if not bootimg_dir: + bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") + if not bootimg_dir: + msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") + + msger.debug('Bootimg dir: %s' % bootimg_dir) + + if ('file' not in source_params): + msger.error("No file specified\n") + return + + src = os.path.join(bootimg_dir, source_params['file']) + dst = src + + if ('skip' in source_params): + dst = os.path.join(cr_workdir, source_params['file']) + dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \ + (src, dst, source_params['skip']) + exec_cmd(dd_cmd) + + # get the size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % dst + out = exec_cmd(du_cmd) + filesize = out.split()[0] + + if filesize > part.size: + part.size = filesize + + part.source_file = dst + diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index b0b5baab73..ea9b6e8ec4 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py @@ -122,8 +122,6 @@ def add_wks_var(key, val): wks_vars[key] = val BOOTDD_EXTRA_SPACE = 16384 -IMAGE_EXTRA_SPACE = 10240 -IMAGE_OVERHEAD_FACTOR = 1.3 __bitbake_env_lines = "" diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index fb95cc790e..162f8e1b9c 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -29,6 +29,9 @@ from wic.utils.oe.misc import * # Overhead of the MBR partitioning scheme (just one sector) MBR_OVERHEAD = 1 +# Overhead of the GPT partitioning scheme +GPT_OVERHEAD = 34 + # Size of a sector in bytes SECTOR_SIZE = 512 @@ -61,6 +64,7 @@ class Image: self.disks[disk_name] = \ { 'disk': None, # Disk object 'numpart': 0, # Number of allocate partitions + 'realpart': 0, # Number of partitions in the partition table 'partitions': [], # Indexes to self.partitions 'offset': 0, # Offset of next partition (in sectors) # Minimum required disk size to fit all partitions (in bytes) @@ -85,15 +89,15 @@ class Image: self.__add_disk(part['disk_name']) def add_partition(self, size, disk_name, mountpoint, source_file = None, fstype = None, - label=None, fsopts = None, boot = False, align = None, + label=None, fsopts = None, boot = False, align = None, no_table=False, part_type = None): """ Add the next partition. Prtitions have to be added in the first-to-last order. """ ks_pnum = len(self.partitions) - # Converting MB to sectors for parted - size = size * 1024 * 1024 / self.sector_size + # Converting kB to sectors for parted + size = size * 1024 / self.sector_size # We still need partition for "/" or non-subvolume if mountpoint == "/" or not fsopts: @@ -109,6 +113,7 @@ class Image: 'num': None, # Partition number 'boot': boot, # Bootable flag 'align': align, # Partition alignment + 'no_table' : no_table, # Partition does not appear in partition table 'part_type' : part_type } # Partition type self.__add_partition(part) @@ -120,7 +125,7 @@ class Image: msger.debug("Assigning %s partitions to disks" % ptable_format) - if ptable_format not in ('msdos'): + if ptable_format not in ('msdos', 'gpt'): raise ImageError("Unknown partition table format '%s', supported " \ "formats are: 'msdos'" % ptable_format) @@ -147,15 +152,26 @@ class Image: # Get the disk where the partition is located d = self.disks[p['disk_name']] d['numpart'] += 1 + if not p['no_table']: + d['realpart'] += 1 d['ptable_format'] = ptable_format if d['numpart'] == 1: if ptable_format == "msdos": overhead = MBR_OVERHEAD + elif ptable_format == "gpt": + overhead = GPT_OVERHEAD # Skip one sector required for the partitioning scheme overhead d['offset'] += overhead + if d['realpart'] > 3: + # Reserve a sector for EBR for every logical partition + # before alignment is performed. + if ptable_format == "msdos": + d['offset'] += 1 + + if p['align']: # If not first partition and we do have alignment set we need # to align the partition. @@ -182,20 +198,15 @@ class Image: d['offset'] += p['size'] p['type'] = 'primary' - p['num'] = d['numpart'] + if not p['no_table']: + p['num'] = d['realpart'] + else: + p['num'] = 0 if d['ptable_format'] == "msdos": - if d['numpart'] > 2: - # Every logical partition requires an additional sector for - # the EBR, so steal the last sector from the end of each - # partition starting from the 3rd one for the EBR. This - # will make sure the logical partitions are aligned - # correctly. - p['size'] -= 1 - - if d['numpart'] > 3: + if d['realpart'] > 3: p['type'] = 'logical' - p['num'] = d['numpart'] + 1 + p['num'] = d['realpart'] + 1 d['partitions'].append(n) msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d " @@ -208,6 +219,8 @@ class Image: # minumim disk sizes. for disk_name, d in self.disks.items(): d['min_size'] = d['offset'] + if d['ptable_format'] == "gpt": + d['min_size'] += GPT_OVERHEAD d['min_size'] *= self.sector_size @@ -257,15 +270,25 @@ class Image: msger.debug("Creating partitions") for p in self.partitions: + if p['num'] == 0: + continue + d = self.disks[p['disk_name']] if d['ptable_format'] == "msdos" and p['num'] == 5: - # The last sector of the 3rd partition was reserved for the EBR - # of the first _logical_ partition. This is why the extended - # partition should start one sector before the first logical - # partition. + # Create an extended partition (note: extended + # partition is described in MBR and contains all + # logical partitions). The logical partitions save a + # sector for an EBR just before the start of a + # partition. The extended partition must start one + # sector before the start of the first logical + # partition. This way the first EBR is inside of the + # extended partition. Since the extended partitions + # starts a sector before the first logical partition, + # add a sector at the back, so that there is enough + # room for all logical partitions. self.__create_partition(d['disk'].device, "extended", None, p['start'] - 1, - d['offset'] - p['start']) + d['offset'] - p['start'] + 1) if p['fstype'] == "swap": parted_fs_type = "linux-swap" @@ -338,14 +361,6 @@ class Image: for p in self.partitions: d = self.disks[p['disk_name']] - if d['ptable_format'] == "msdos" and p['num'] == 5: - # The last sector of the 3rd partition was reserved for the EBR - # of the first _logical_ partition. This is why the extended - # partition should start one sector before the first logical - # partition. - self.__write_partition(p['num'], p['source_file'], - p['start'] - 1, - d['offset'] - p['start']) self.__write_partition(p['num'], p['source_file'], p['start'], p['size']) |