{"action":"created","comment":{"url":"https://api.github.com/repos/lede-project/source/pulls/comments/145765628","pull_request_review_id":70615013,"id":145765628,"diff_hunk":"@@ -1,107 +1,92 @@\n #\n-# Copyright (C) 2010 OpenWrt.org\n-#\n # This is free software, licensed under the GNU General Public License v2.\n # See /LICENSE for more information.\n #\n include $(TOPDIR)/rules.mk\n include $(INCLUDE_DIR)/image.mk\n \n-define imgname\n-$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))\n-endef\n-\n-define sysupname\n-$(call imgname,$(1),$(2))-sysupgrade.bin\n+DEVICE_VARS += DEVICE_PROFILE DTB_SIZE\n+\n+define Device/Default\n+  PROFILES := Default\n+  KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)\n+  DEVICE_PROFILE :=\n+  DEVICE_DTS :=\n+  DTB_SIZE := 128k\n+  KERNEL_ENTRY := 0x00000000\n+  KERNEL_LOADADDR := 0x00000000\n+  KERNEL := dtb | kernel-bin | gzip | uImage gzip\n endef\n \n-define factoryname\n-$(call imgname,$(1),$(2))-factory.bin\n-endef\n-\n-zImage:=$(BIN_DIR)/$(IMG_PREFIX)-zImage\n-\n-DTS_TARGETS = hiveap-330 fsl/p1010rdb-pa tl-wdr4900-v1 fsl/p1020rdb\n-\n-define Build/empty-initramfs\n+define Build/append-empty-initramfs\n \t-mkdir $(KDIR_TMP)/empty-initramfs; \\\n \t\tcd $(KDIR_TMP)/empty-initramfs; \\\n \t\tfind . | cpio -o -H newc | gzip -9n > $(KDIR_TMP)/empty-initramfs.gpio.gz\n \n \t-$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T ramdisk \\\n-\t\t-C gzip -n \"empty initramfs\" \\\n+\t\t-C gzip -n \"$(DEVICE_PROFILE) empty initramfs\" \\\n \t\t-d $(KDIR_TMP)/empty-initramfs.gpio.gz \\\n-\t\t$(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.image\n-endef\n+\t\t$(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.img\n \n-define Image/BuildKernel\n-\tcp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage\n-\t$(foreach dts,$(DTS_TARGETS),\n-\t\t$(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(DTS_DIR)/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(notdir $(dts)).fdt\n-\t)\n+\t-dd if=$(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.img >> $@\n endef\n \n-define Image/BuildKernel/Initramfs\n-\tcp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-initramfs-zImage\n-ifeq ($(SUBTARGET),generic)\n-\tcp $(KDIR)/cuImage.tl-wdr4900-v1-initramfs $(BIN_DIR)/$(IMG_PREFIX)-tl-wdr4900-v1-initramfs.uImage\n-endif\n-ifeq ($(SUBTARGET),p1020)\n-\tcp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-hiveap-330-initramfs.zImage\n-endif\n+define Build/copy-file\n+\tcat \"$(1)\" >> \"$@\"\n endef\n \n-define Image/Build/Aerohive\n-\t$(call Build/empty-initramfs)\n-ifeq ($(2),hiveap-330)\n-\t( \\\n-\t\tdd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2).fdt bs=256k conv=sync; \\\n-\t\tdd if=$(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.image bs=256k conv=sync; \\\n-\t\tdd if=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=40704k conv=sync; \\\n-\t\tdd if=$(KDIR)/zImage conv=sync; \\\n-\t) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-sysupgrade.img\n-endif\n+define Build/dtb\n+\t$(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))\n+\tcp $@.dtb $(BIN_DIR)/$(IMG_PREFIX)-$(DEVICE_NAME).fdt\n endef\n \n-define Image/Build/TPLINK\n-\t-$(STAGING_DIR_HOST)/bin/mktplinkfw \\\n-\t\t-H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \\\n-\t\t-k $(KDIR)/$(3) \\\n-\t\t-r $(KDIR)/root.$(1) \\\n-\t\t-o $(call factoryname,$(1),$(2))\n-\t-$(STAGING_DIR_HOST)/bin/mktplinkfw \\\n-\t\t-H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \\\n-\t\t-k $(KDIR)/$(3) \\\n-\t\t-r $(KDIR)/root.$(1) \\\n-\t\t-o $(call sysupname,$(1),$(2))\n+define Build/tplink-v1-image\n+\t$(STAGING_DIR_HOST)/bin/mktplinkfw \\\n+\t\t-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_LAYOUTID) \\\n+\t\t-N \"$(VERSION_DIST)\" -V $(REVISION) $(1) \\\n+\t\t-k $@ \\\n+\t\t-r $(KDIR)/root.squashfs \\\n+\t\t-o $@.new\n+\t@mv $@.new $@\n endef\n \n-define Image/Build/Profile/hiveap-330\n-\t$(call Image/Build/Aerohive,$(1),hiveap-330)\n-endef\n+ifeq ($(SUBTARGET),generic)\n \n-define Image/Build/Profile/TLWDR4900\n-\t$(call Image/Build/TPLINK,$(1),tl-wdr4900-v1,cuImage.tl-wdr4900-v1,0x49000001,1,16Mppc)\n+define Device/TLWDR4900\n+  DEVICE_TITLE := TP-Link TL-WDR4900\n+  DEVICE_PACKAGES := kmod-ath9k wpad-mini\n+  DEVICE_PROFILE := tl-wdr4900-v1\n+  DEVICE_DTS := $$(DEVICE_PROFILE)\n+  BLOCKSIZE := 128k\n+  TPLINK_HWID := 0x49000001\n+  TPLINK_HWREV := 1\n+  TPLINK_LAYOUTID := 16Mppc\n+  KERNEL := dtb | copy-file $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/cuImage.$$(DEVICE_PROFILE)","path":"target/linux/mpc85xx/image/Makefile","position":123,"original_position":123,"commit_id":"640f581f75466c610a86e3d263f73bbabec6f864","original_commit_id":"640f581f75466c610a86e3d263f73bbabec6f864","user":{"login":"riptidewave93","id":4700774,"avatar_url":"https://avatars2.githubusercontent.com/u/4700774?v=4","gravatar_id":"","url":"https://api.github.com/users/riptidewave93","html_url":"https://github.com/riptidewave93","followers_url":"https://api.github.com/users/riptidewave93/followers","following_url":"https://api.github.com/users/riptidewave93/following{/other_user}","gists_url":"https://api.github.com/users/riptidewave93/gists{/gist_id}","starred_url":"https://api.github.com/users/riptidewave93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riptidewave93/subscriptions","organizations_url":"https://api.github.com/users/riptidewave93/orgs","repos_url":"https://api.github.com/users/riptidewave93/repos","events_url":"https://api.github.com/users/riptidewave93/events{/privacy}","received_events_url":"https://api.github.com/users/riptidewave93/received_events","type":"User","site_admin":false},"body":"I originally was trying to get KERNEL_NAME working, but as cuImage is within the boot directory, it is never exported. The way the old style dealt with this was by using https://github.com/lede-project/source/blob/master/target/linux/mpc85xx/Makefile#L27 and https://github.com/lede-project/source/blob/master/include/kernel-defaults.mk#L126. If anyone has a good way to deal with this besides the method above, please let me know.","created_at":"2017-10-19T17:16:38Z","updated_at":"2017-10-19T17:16:38Z","html_url":"https://github.com/lede-project/source/pull/1429#discussion_r145765628","pull_request_url":"https://api.github.com/repos/lede-project/source/pulls/1429","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/lede-project/source/pulls/comments/145765628"},"html":{"href":"https://github.com/lede-project/source/pull/1429#discussion_r145765628"},"pull_request":{"href":"https://api.github.com/repos/lede-project/source/pulls/1429"}}},"pull_request":{"url":"https://api.github.com/repos/lede-project/source/pulls/1429","id":147614809,"html_url":"https://github.com/lede-project/source/pull/1429","diff_url":"https://github.com/lede-project/source/pull/1429.diff","patch_url":"https://github.com/lede-project/source/pull/1429.patch","issue_url":"https://api.github.com/repos/lede-project/source/issues/1429","number":1429,"state":"open","locked":false,"title":"[RFC] mpc85xx: Move to new build code style","user":{"login":"riptidewave93","id":4700774,"avatar_url":"https://avatars2.githubusercontent.com/u/4700774?v=4","gravatar_id":"","url":"https://api.github.com/users/riptidewave93","html_url":"https://github.com/riptidewave93","followers_url":"https://api.github.com/users/riptidewave93/followers","following_url":"https://api.github.com/users/riptidewave93/following{/other_user}","gists_url":"https://api.github.com/users/riptidewave93/gists{/gist_id}","starred_url":"https://api.github.com/users/riptidewave93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riptidewave93/subscriptions","organizations_url":"https://api.github.com/users/riptidewave93/orgs","repos_url":"https://api.github.com/users/riptidewave93/repos","events_url":"https://api.github.com/users/riptidewave93/events{/privacy}","received_events_url":"https://api.github.com/users/riptidewave93/received_events","type":"User","site_admin":false},"body":"The following moves the mpc85xx target (generic & P1020) to the new\r\nbuild code style.\r\n\r\nCompile & Flash tested on an Aerohive HiveAP-330\r\nComple tested for TL-WDR4900\r\n\r\nNote that this current form is an RFC for feedback/review & improvement.\r\n\r\n@mkresin","created_at":"2017-10-19T17:14:01Z","updated_at":"2017-10-19T17:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2194896a3cb736d23bd5b56425d2e05205299fd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/lede-project/source/pulls/1429/commits","review_comments_url":"https://api.github.com/repos/lede-project/source/pulls/1429/comments","review_comment_url":"https://api.github.com/repos/lede-project/source/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lede-project/source/issues/1429/comments","statuses_url":"https://api.github.com/repos/lede-project/source/statuses/640f581f75466c610a86e3d263f73bbabec6f864","head":{"label":"riptidewave93:mpc85xx-rewrite","ref":"mpc85xx-rewrite","sha":"640f581f75466c610a86e3d263f73bbabec6f864","user":{"login":"riptidewave93","id":4700774,"avatar_url":"https://avatars2.githubusercontent.com/u/4700774?v=4","gravatar_id":"","url":"https://api.github.com/users/riptidewave93","html_url":"https://github.com/riptidewave93","followers_url":"https://api.github.com/users/riptidewave93/followers","following_url":"https://api.github.com/users/riptidewave93/following{/other_user}","gists_url":"https://api.github.com/users/riptidewave93/gists{/gist_id}","starred_url":"https://api.github.com/users/riptidewave93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riptidewave93/subscriptions","organizations_url":"https://api.github.com/users/riptidewave93/orgs","repos_url":"https://api.github.com/users/riptidewave93/repos","events_url":"https://api.github.com/users/riptidewave93/events{/privacy}","received_events_url":"https://api.github.com/users/riptidewave93/received_events","type":"User","site_admin":false},"repo":{"id":105188313,"name":"source","full_name":"riptidewave93/source","owner":{"login":"riptidewave93","id":4700774,"avatar_url":"https://avatars2.githubusercontent.com/u/4700774?v=4","gravatar_id":"","url":"https://api.github.com/users/riptidewave93","html_url":"https://github.com/riptidewave93","followers_url":"https://api.github.com/users/riptidewave93/followers","following_url":"https://api.github.com/users/riptidewave93/following{/other_user}","gists_url":"https://api.github.com/users/riptidewave93/gists{/gist_id}","starred_url":"https://api.github.com/users/riptidewave93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riptidewave93/subscriptions","organizations_url":"https://api.github.com/users/riptidewave93/orgs","repos_url":"https://api.github.com/users/riptidewave93/repos","events_url":"https://api.github.com/users/riptidewave93/events{/privacy}","received_events_url":"https://api.github.com/users/riptidewave93/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/riptidewave93/source","description":"Mirror of https://git.lede-project.org/?p=source.git Please send your PRs against this tree. They will be merged via staging trees and appear in this tree once the staging trees get merged back into source.git","fork":true,"url":"https://api.github.com/repos/riptidewave93/source","forks_url":"https://api.github.com/repos/riptidewave93/source/forks","keys_url":"https://api.github.com/repos/riptidewave93/source/keys{/key_id}","collaborators_url":"https://api.github.com/repos/riptidewave93/source/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/riptidewave93/source/teams","hooks_url":"https://api.github.com/repos/riptidewave93/source/hooks","issue_events_url":"https://api.github.com/repos/riptidewave93/source/issues/events{/number}","events_url":"https://api.github.com/repos/riptidewave93/source/events","assignees_url":"https://api.github.com/repos/riptidewave93/source/assignees{/user}","branches_url":"https://api.github.com/repos/riptidewave93/source/branches{/branch}","tags_url":"https://api.github.com/repos/riptidewave93/source/tags","blobs_url":"https://api.github.com/repos/riptidewave93/source/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/riptidewave93/source/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/riptidewave93/source/git/refs{/sha}","trees_url":"https://api.github.com/repos/riptidewave93/source/git/trees{/sha}","statuses_url":"https://api.github.com/repos/riptidewave93/source/statuses/{sha}","languages_url":"https://api.github.com/repos/riptidewave93/source/languages","stargazers_url":"https://api.github.com/repos/riptidewave93/source/stargazers","contributors_url":"https://api.github.com/repos/riptidewave93/source/contributors","subscribers_url":"https://api.github.com/repos/riptidewave93/source/subscribers","subscription_url":"https://api.github.com/repos/riptidewave93/source/subscription","commits_url":"https://api.github.com/repos/riptidewave93/source/commits{/sha}","git_commits_url":"https://api.github.com/repos/riptidewave93/source/git/commits{/sha}","comments_url":"https://api.github.com/repos/riptidewave93/source/comments{/number}","issue_comment_url":"https://api.github.com/repos/riptidewave93/source/issues/comments{/number}","contents_url":"https://api.github.com/repos/riptidewave93/source/contents/{+path}","compare_url":"https://api.github.com/repos/riptidewave93/source/compare/{base}...{head}","merges_url":"https://api.github.com/repos/riptidewave93/source/merges","archive_url":"https://api.github.com/repos/riptidewave93/source/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/riptidewave93/source/downloads","issues_url":"https://api.github.com/repos/riptidewave93/source/issues{/number}","pulls_url":"https://api.github.com/repos/riptidewave93/source/pulls{/number}","milestones_url":"https://api.github.com/repos/riptidewave93/source/milestones{/number}","notifications_url":"https://api.github.com/repos/riptidewave93/source/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/riptidewave93/source/labels{/name}","releases_url":"https://api.github.com/repos/riptidewave93/source/releases{/id}","deployments_url":"https://api.github.com/repos/riptidewave93/source/deployments","created_at":"2017-09-28T19:02:37Z","updated_at":"2017-09-28T19:02:55Z","pushed_at":"2017-10-19T17:12:34Z","git_url":"git://github.com/riptidewave93/source.git","ssh_url":"git@github.com:riptidewave93/source.git","clone_url":"https://github.com/riptidewave93/source.git","svn_url":"https://github.com/riptidewave93/source","homepage":"","size":145711,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lede-project:master","ref":"master","sha":"9887afb1afcf387f6892315413e610a6816df463","user":{"login":"lede-project","id":18146401,"avatar_url":"https://avatars0.githubusercontent.com/u/18146401?v=4","gravatar_id":"","url":"https://api.github.com/users/lede-project","html_url":"https://github.com/lede-project","followers_url":"https://api.github.com/users/lede-project/followers","following_url":"https://api.github.com/users/lede-project/following{/other_user}","gists_url":"https://api.github.com/users/lede-project/gists{/gist_id}","starred_url":"https://api.github.com/users/lede-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lede-project/subscriptions","organizations_url":"https://api.github.com/users/lede-project/orgs","repos_url":"https://api.github.com/users/lede-project/repos","events_url":"https://api.github.com/users/lede-project/events{/privacy}","received_events_url":"https://api.github.com/users/lede-project/received_events","type":"Organization","site_admin":false},"repo":{"id":58552470,"name":"source","full_name":"lede-project/source","owner":{"login":"lede-project","id":18146401,"avatar_url":"https://avatars0.githubusercontent.com/u/18146401?v=4","gravatar_id":"","url":"https://api.github.com/users/lede-project","html_url":"https://github.com/lede-project","followers_url":"https://api.github.com/users/lede-project/followers","following_url":"https://api.github.com/users/lede-project/following{/other_user}","gists_url":"https://api.github.com/users/lede-project/gists{/gist_id}","starred_url":"https://api.github.com/users/lede-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lede-project/subscriptions","organizations_url":"https://api.github.com/users/lede-project/orgs","repos_url":"https://api.github.com/users/lede-project/repos","events_url":"https://api.github.com/users/lede-project/events{/privacy}","received_events_url":"https://api.github.com/users/lede-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lede-project/source","description":"Mirror of https://git.lede-project.org/?p=source.git Please send your PRs against this tree. They will be merged via staging trees and appear in this tree once the staging trees get merged back into source.git","fork":false,"url":"https://api.github.com/repos/lede-project/source","forks_url":"https://api.github.com/repos/lede-project/source/forks","keys_url":"https://api.github.com/repos/lede-project/source/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lede-project/source/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lede-project/source/teams","hooks_url":"https://api.github.com/repos/lede-project/source/hooks","issue_events_url":"https://api.github.com/repos/lede-project/source/issues/events{/number}","events_url":"https://api.github.com/repos/lede-project/source/events","assignees_url":"https://api.github.com/repos/lede-project/source/assignees{/user}","branches_url":"https://api.github.com/repos/lede-project/source/branches{/branch}","tags_url":"https://api.github.com/repos/lede-project/source/tags","blobs_url":"https://api.github.com/repos/lede-project/source/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lede-project/source/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lede-project/source/git/refs{/sha}","trees_url":"https://api.github.com/repos/lede-project/source/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lede-project/source/statuses/{sha}","languages_url":"https://api.github.com/repos/lede-project/source/languages","stargazers_url":"https://api.github.com/repos/lede-project/source/stargazers","contributors_url":"https://api.github.com/repos/lede-project/source/contributors","subscribers_url":"https://api.github.com/repos/lede-project/source/subscribers","subscription_url":"https://api.github.com/repos/lede-project/source/subscription","commits_url":"https://api.github.com/repos/lede-project/source/commits{/sha}","git_commits_url":"https://api.github.com/repos/lede-project/source/git/commits{/sha}","comments_url":"https://api.github.com/repos/lede-project/source/comments{/number}","issue_comment_url":"https://api.github.com/repos/lede-project/source/issues/comments{/number}","contents_url":"https://api.github.com/repos/lede-project/source/contents/{+path}","compare_url":"https://api.github.com/repos/lede-project/source/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lede-project/source/merges","archive_url":"https://api.github.com/repos/lede-project/source/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lede-project/source/downloads","issues_url":"https://api.github.com/repos/lede-project/source/issues{/number}","pulls_url":"https://api.github.com/repos/lede-project/source/pulls{/number}","milestones_url":"https://api.github.com/repos/lede-project/source/milestones{/number}","notifications_url":"https://api.github.com/repos/lede-project/source/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lede-project/source/labels{/name}","releases_url":"https://api.github.com/repos/lede-project/source/releases{/id}","deployments_url":"https://api.github.com/repos/lede-project/source/deployments","created_at":"2016-05-11T14:31:34Z","updated_at":"2017-10-19T12:10:46Z","pushed_at":"2017-10-19T17:14:01Z","git_url":"git://github.com/lede-project/source.git","ssh_url":"git@github.com:lede-project/source.git","clone_url":"https://github.com/lede-project/source.git","svn_url":"https://github.com/lede-project/source","homepage":"","size":145920,"stargazers_count":965,"watchers_count":965,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":823,"mirror_url":null,"open_issues_count":74,"forks":823,"open_issues":74,"watchers":965,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lede-project/source/pulls/1429"},"html":{"href":"https://github.com/lede-project/source/pull/1429"},"issue":{"href":"https://api.github.com/repos/lede-project/source/issues/1429"},"comments":{"href":"https://api.github.com/repos/lede-project/source/issues/1429/comments"},"review_comments":{"href":"https://api.github.com/repos/lede-project/source/pulls/1429/comments"},"review_comment":{"href":"https://api.github.com/repos/lede-project/source/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lede-project/source/pulls/1429/commits"},"statuses":{"href":"https://api.github.com/repos/lede-project/source/statuses/640f581f75466c610a86e3d263f73bbabec6f864"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"riptidewave93"}}