User Tools

Site Tools


developer_documentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer_documentation [2019/02/14 06:44]
ispyisail [Make Custom]
developer_documentation [2022/04/24 11:50] (current)
lantis
Line 45: Line 45:
  
 You can browse the repository online here, or clone from one of the URLs below. There is both a local copy of the repository and a Github mirror: You can browse the repository online here, or clone from one of the URLs below. There is both a local copy of the repository and a Github mirror:
-<shell>+<code>
 apt-get install git apt-get install git
-git clone git://github.com/ericpaulbishop/gargoyle.git +git clone git@github.com:ericpaulbishop/gargoyle.git 
-</shell>+</code>
  
-<shell+SSH 
-git clone http://github.com/ericpaulbishop/gargoyle.git  +<code
-git clone git://github.com/ericpaulbishop/gargoyle.git +git clone git@github.com:ericpaulbishop/gargoyle.git 
-</shell>+</code> 
 +HTTPS 
 +<code> 
 +git clone https://github.com/ericpaulbishop/gargoyle.git 
 +</code>
  
  
 If you want to build an older branch or tag, use the "git checkout" to switch to it after cloning the repository.  e.g. to switch to the 1.2 branch: If you want to build an older branch or tag, use the "git checkout" to switch to it after cloning the repository.  e.g. to switch to the 1.2 branch:
  
-<shell>+<code>
 git checkout 1.2 git checkout 1.2
-</shell>+</code>
  
 Anyone who still prefers working with subversion can make use of the subversion support provided by the github mirror: Anyone who still prefers working with subversion can make use of the subversion support provided by the github mirror:
-<shell>+<code>
 svn checkout http://svn.github.com/ericpaulbishop/gargoyle.git svn checkout http://svn.github.com/ericpaulbishop/gargoyle.git
-</shell+</code
-<shell>+<code>
 cd gargoyle cd gargoyle
-</shell+</code
-<shell>+<code>
 make make
-</shell>+</code>
  
 You'll notice there are two scripts in the build directory: //full-build.sh// and //rebuild.sh// You'll notice there are two scripts in the build directory: //full-build.sh// and //rebuild.sh//
Line 77: Line 81:
 If you run make without the FULL_BUILD=true flag, and you've previously done a build, it will only rebuild the packages and not the underlying version of OpenWrt. This speeds up testing small changes in the packages dramatically. However, to do a complete build from scratch you really need to run the make command with "FULL_BUILD=true" set: If you run make without the FULL_BUILD=true flag, and you've previously done a build, it will only rebuild the packages and not the underlying version of OpenWrt. This speeds up testing small changes in the packages dramatically. However, to do a complete build from scratch you really need to run the make command with "FULL_BUILD=true" set:
  
-<shell>+<code>
 make FULL_BUILD=true make FULL_BUILD=true
-</shell>+</code>
  
 Or to build (for example) just the ar71xx architecture: Or to build (for example) just the ar71xx architecture:
  
-<shell>+<code>
 make FULL_BUILD=true ar71xx make FULL_BUILD=true ar71xx
-</shell>+</code>
  
  
 Allow building of only one profile for a given architecture by running e.g. "make ar71xx.usb_large" to build usb_large profile instead of all ar71xx profiles Allow building of only one profile for a given architecture by running e.g. "make ar71xx.usb_large" to build usb_large profile instead of all ar71xx profiles
-<shell>+<code>
 make ar71xx.usb_large make ar71xx.usb_large
-</shell>+</code>
  
 ar71xx profiles ar71xx profiles
Line 108: Line 112:
 Building Gargoyle for the first time for even one supported platform can take several hours of churning on your computer.  In addition you can expect each platform to require about 1.6GB of disk space so keep this in mind when deciding how many platforms you will build on your first attempt.  Finally, be aware that only the components unique to Gargoyle are stored in the Gargoyle svn.  Therefore, in order to build gargoyle, the build process must first download many additional components.  If you do not have an internet connection, the build will fail.  If it is a slow connection, the build will take a very,very long time.   Building Gargoyle for the first time for even one supported platform can take several hours of churning on your computer.  In addition you can expect each platform to require about 1.6GB of disk space so keep this in mind when deciding how many platforms you will build on your first attempt.  Finally, be aware that only the components unique to Gargoyle are stored in the Gargoyle svn.  Therefore, in order to build gargoyle, the build process must first download many additional components.  If you do not have an internet connection, the build will fail.  If it is a slow connection, the build will take a very,very long time.  
  
-Before you can build Gargoyle, you will require the appropriate tools to [[http://wiki.openwrt.org/doc/howto/buildroot.exigence|build OpenWRT]]. +Before you can build Gargoyle, you will require the appropriate tools to [[https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem|build OpenWRT]]. 
  
  
 To install these (list edited to add the additional things missing on Ubuntu Server 10.10), use the following on a 32 bit system: To install these (list edited to add the additional things missing on Ubuntu Server 10.10), use the following on a 32 bit system:
  
-<shell>+<code>
 sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev subversion flex uglifyjs texinfo sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev subversion flex uglifyjs texinfo
-</shell>+</code>
  
 Or for a 64 bit system: Or for a 64 bit system:
  
-<shell>+<code>
 sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo
-</shell>+</code>
  
 ===== Ubuntu 18.04 ===== ===== Ubuntu 18.04 =====
 Enable universe repository Enable universe repository
-<shell>+<code>
 sudo add-apt-repository universe sudo add-apt-repository universe
-</shell+</code
-<shell>+<code>
 sudo add-apt-repository multiverse sudo add-apt-repository multiverse
-</shell>+</code>
  
 ===== NPM ===== ===== NPM =====
Line 137: Line 141:
 **NOTE:** To save build time, consider also installing npm, which will also install nodejs as a dependency. It is recommended that you install nodejs v6.13.1 (or equivalent) and npm v3.10.10 (or equivalent). See below **NOTE:** To save build time, consider also installing npm, which will also install nodejs as a dependency. It is recommended that you install nodejs v6.13.1 (or equivalent) and npm v3.10.10 (or equivalent). See below
  
-For more details on building OpenWRT, you can see their wiki page [[http://wiki.openwrt.org/doc/howto/build|here]].+For more details on building OpenWrt, you can see their wiki page [[https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem|here]].
  
 ===== Building ===== ===== Building =====
Line 144: Line 148:
 Simply entering: Simply entering:
  
-<shell>+<code>
 make make
-</shell>+</code>
  
 will result in all targets being built. If you prefer to build a single target (in this example ar71xx, though you could substitute brcm47xx or another valid target), enter: will result in all targets being built. If you prefer to build a single target (in this example ar71xx, though you could substitute brcm47xx or another valid target), enter:
  
-<shell>+<code>
 make ar71xx make ar71xx
-</shell>+</code>
  
 The makefile calls the full-build-backfire.sh script found in the same directory.  This script controls the overall build process.  In addition to the makefile and the build script you will find these subdirectories in the Gargoyle root build directory: The makefile calls the full-build-backfire.sh script found in the same directory.  This script controls the overall build process.  In addition to the makefile and the build script you will find these subdirectories in the Gargoyle root build directory:
Line 195: Line 199:
  
 It is also possible to build Gargoyle using a custom build configuration.  The process of building OpenWRT involves a configuration step in which packages are either included or excluded from the build image.  Due to a lack of memory space on most routers it is not possible to included every package.  The architecture of OpenWRT allows most packages not included in the original build image to be installed later if they are needed and space is available.  So the general philosophy is to build with the least code practical in order to support routers with the least available memory.  If you wish to create your own image with a different set of packages in the base image you should run make custom. It is also possible to build Gargoyle using a custom build configuration.  The process of building OpenWRT involves a configuration step in which packages are either included or excluded from the build image.  Due to a lack of memory space on most routers it is not possible to included every package.  The architecture of OpenWRT allows most packages not included in the original build image to be installed later if they are needed and space is available.  So the general philosophy is to build with the least code practical in order to support routers with the least available memory.  If you wish to create your own image with a different set of packages in the base image you should run make custom.
-<shell>+<code>
 make custom make custom
-</shell>+</code>
  
  
Line 597: Line 601:
 ===== Building Older Versions of Gargoyle ===== ===== Building Older Versions of Gargoyle =====
  
-Due to changes in upstream infrastructure, some of the older Gargoyle revisions no longer build out of the box. +Due to changes in upstream infrastructure, some of the older Gargoyle tagged revisions no longer build out of the box. 
-The following is a patch to restore 1.8.1 (or any Barrier Breaker 14.07 based version of Gargoyle) builds to build correctly: +The latest commits on each branch back to 1.6 have all been fixed to build as of November 2020
-<code diff> +
---- a/build.sh +
-+++ b/build.sh +
-@@ -21,15 +21,17 @@ set_version_variables() +
-  +
-  #openwrt branch +
-  branch_name="Barrier Breaker" +
-- branch_id="barrier_breaker" +
-+ branch_id="14.07" +
-  branch_is_trunk="0" +
-- branch_packages_path="branches/packages_14.07" +
-+ branch_packages_path="packages" +
-  +
-  +
-- # set svn revision number to use  +
-- # you can set this to an alternate revision  +
-+ # set precise commit in repo to use  +
-+ # you can set this to an alternate commit  +
-  # or empty to checkout latest  +
-- rnum=46817 +
-+ openwrt_commit="a0847febf3afac0997b821f62be8c91e00e25fa0" +
-+ openwrt_abbrev_commit=$( echo "$openwrt_commit" | cut -b 1-7 ) +
-+  +
-  +
-  #set date here, so it's guaranteed the same for all images +
-  #even though build can take several hours +
-@@ -82,7 +84,7 @@ create_gargoyle_banner() +
-  local gargoyle_version="$4" +
-  local gargoyle_commit="$5" +
-  local openwrt_branch="$6+
-- local openwrt_revision="$7" +
-+ local openwrt_cmt="$7" +
-  local banner_file_path="$8" +
-  local revision_save_dir="$9" +
-  +
-@@ -92,7 +94,7 @@ create_gargoyle_banner() +
-  fi +
-  +
-  local top_line=$(printf "| %-26s| %-35s|" "Gargoyle version $gargoyle_version" "$openwrt_branch_str"+
-- local middle_line=$(printf "| %-26s| %-35s|" "Gargoyle revision $gargoyle_commit" "OpenWrt revision r$openwrt_revision"+
-+ local middle_line=$(printf "| %-26s| %-35s|" "Gargoyle revision $gargoyle_commit" "OpenWrt commit $openwrt_cmt"+
-  local bottom_line=$(printf "| %-26s| %-35s|" "Built $date" "Target  $target/$profile"+
-  +
-  cat << 'EOF' >"$banner_file_path" +
-@@ -198,7 +200,6 @@ distrib_init () +
-  fi +
-  #git log --since=5/16/2013 $(git log -1 --pretty=format:%h) --pretty=format:"%h%x09%ad%x09%s" --date=short > "$top_dir/Distribution/changelog.txt" +
-  git log $(git describe --abbrev=0 --tags)..$(git log -1 --pretty=format:%h) --no-merges --pretty=format:"%h%x09%ad%x09%s" --date=short > "$top_dir/Distribution/Gargoyle changelog.txt" +
-- svn log -r "$rnum":36425 svn://svn.openwrt.org/openwrt/branches/attitude_adjustment/ > "$top_dir/Distribution/OpenWrt changelog.txt" +
-  cp -fR "$top_dir/LICENSES" "$top_dir/Distribution/" +
- } +
-  +
-@@ -334,9 +335,9 @@ fi +
-  +
- openwrt_src_dir="$top_dir/downloaded/$branch_id" +
- openwrt_package_dir="$top_dir/downloaded/$branch_id-packages" +
--if [ -n "$rnum" ] ; then +
-- openwrt_src_dir="$top_dir/downloaded/$branch_id-$rnum" +
-- openwrt_package_dir="$top_dir/downloaded/$branch_id-packages-$rnum" +
-+if [ -n "$openwrt_commit" ] ; then +
-+ openwrt_src_dir="$top_dir/downloaded/$branch_id-${openwrt_abbrev_commit}" +
-+ openwrt_package_dir="$top_dir/downloaded/$branch_id-packages-${openwrt_abbrev_commit}" +
- else +
-  rm -rf "$openwrt_src_dir" +
-  rm -rf "$openwrt_package_dir" +
-@@ -345,23 +346,22 @@ fi +
-  +
- #download openwrt source if we haven't already +
- if [ ! -d "$openwrt_src_dir" ] ; then +
-- revision="" +
-- if [ -n "$rnum" ] ; then +
-- revision=" -r $rnum " +
-- fi +
-  echo "fetching openwrt source" +
-  rm -rf "$branch_name" "$branch_id" +
-  if [ "$branch_is_trunk" = "1" ] ; then  +
-- svn checkout $revision svn://svn.openwrt.org/openwrt/trunk "$branch_id" +
-+ git clone  git://git.openwrt.org/openwrt.git "$openwrt_src_dir" +
-  else +
-- svn checkout $revision svn://svn.openwrt.org/openwrt/branches/$branch_id/ +
-+ git clone  git://git.archive.openwrt.org/$branch_id/openwrt.git "$openwrt_src_dir" +
-  fi +
-- if [ ! -d "$branch_id" ] ; then +
-+ if [ ! -d "$openwrt_src_dir" ] ; then +
-  echo "ERROR: could not download source, exiting" +
-  exit +
-  fi +
-- cd "$branch_id" +
-- find . -name ".svn" | xargs -r rm -rf +
-+ if [ -n "$openwrt_commit" ] ; then +
-+ cd "$openwrt_src_dir" +
-+ git checkout "$openwrt_commit" +
-+ fi +
-+
-  cd "$top_dir"  +
-  mv "$branch_id" "$openwrt_src_dir" +
- fi +
-@@ -475,14 +475,10 @@ for target in $targets ; do +
-  if [ "$target" = "custom" ] ; then +
-  if [ ! -d "$openwrt_package_dir" ] ; then +
-   +
-- if [ "$branch_is_trunk" = "1" ] ; then  +
-- svn checkout $revision svn://svn.openwrt.org/openwrt/packages "$openwrt_package_dir"  +
-- else +
-- svn checkout $revision "svn://svn.openwrt.org/openwrt/$branch_packages_path" "$openwrt_package_dir"  +
-- fi +
-+ git clone git://git.openwrt.org/packages.git "$openwrt_package_dir" +
-   +
-  cd "$openwrt_package_dir" +
-- find . -name ".svn" | xargs rm -rf +
-+
-  for gp in $gargoyle_packages ; do +
-  IFS_ORIG="$IFS" +
-  IFS_LINEBREAK="$(printf '\n\r')" +
-@@ -507,10 +503,9 @@ for target in $targets ; do +
-  +
-  +
-  +
-- #enter build directory and make sure we get rid of all those pesky .svn files,  +
-- #and any crap left over from editing +
-+ #enter build directory and make sure we get rid of +
-+ #any crap left over from editing +
-  cd "$top_dir/$target-src" +
-- find . -name ".svn"  | xargs rm -rf +
-  find . -name "*~"    | xargs rm -rf +
-  find . -name ".*sw*" | xargs rm -rf +
-   +
-@@ -534,7 +529,7 @@ for target in $targets ; do +
-  +
-   +
-  openwrt_target=$(get_target_from_config "./.config"+
-- create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$rnum" "package/base-files/files/etc/banner" "." +
-+ create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$openwrt_abbrev_commit" "package/base-files/files/etc/banner" "." +
-  +
-  make $num_build_thread_str GARGOYLE_VERSION="$numeric_gargoyle_version" GARGOYLE_VERSION_NAME="$lower_short_gargoyle_version" GARGOYLE_PROFILE="$default_profile" +
-  +
-@@ -551,7 +546,7 @@ for target in $targets ; do +
-  +
-  +
-  openwrt_target=$(get_target_from_config "./.config"+
-- create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$rnum" "package/base-files/files/etc/banner" "." +
-+ create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$openwrt_abbrev_commit" "package/base-files/files/etc/banner" "." +
-  +
-  make $num_build_thread_str V=99 GARGOYLE_VERSION="$numeric_gargoyle_version" GARGOYLE_VERSION_NAME="$lower_short_gargoyle_version" GARGOYLE_PROFILE="$default_profile" +
-  +
-@@ -565,8 +560,9 @@ for target in $targets ; do +
-  +
-  #copy packages to built/target directory +
-  mkdir -p "$top_dir/built/$target/$default_profile" +
-- package_files=$(find bin -name "*.ipk"+
-- index_files=$(find bin -name "Packa*"+
-+ package_base_dir=$(find bin -name "base"+
-+ package_files=$(find "$package_base_dir" -name "*.ipk"+
-+ index_files=$(find "$package_base_dir" -name "Packa*"+
-  if [ -n "$package_files" ] && [ -n "$index_files" ] ; then +
-  +
-  for pf in $package_files ; do +
-@@ -643,7 +639,7 @@ for target in $targets ; do +
-   +
-   +
-  openwrt_target=$(get_target_from_config "./.config"+
-- create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$rnum" "package/base-files/files/etc/banner" "." +
-+ create_gargoyle_banner "$openwrt_target" "$profile_name" "$build_date" "$short_gargoyle_version" "$gargoyle_git_revision" "$branch_name" "$openwrt_abbrev_commit" "package/base-files/files/etc/banner" "." +
-  +
-   +
-  echo "" +
-@@ -674,8 +670,9 @@ for target in $targets ; do +
-  #copy packages to build/target directory +
-  mkdir -p "$top_dir/built/$target/$profile_name" +
-  arch=$(ls bin) +
-- package_files=$(find bin -name "*.ipk"+
-- index_files=$(find bin -name "Packa*"+
-+ package_base_dir=$(find bin -name "base"+
-+ package_files=$(find "$package_base_dir" -name "*.ipk"+
-+ index_files=$(find "$package_base_dir" -name "Packa*"+
-  if [ -n "$package_files" ] && [ -n "$index_files" ] ; then +
-  for pf in $package_files ; do +
-  cp "$pf" "$top_dir/built/$target/$profile_name/" +
-@@ -684,7 +681,10 @@ for target in $targets ; do +
-  cp "$inf" "$top_dir/built/$target/$profile_name/" +
-  done +
-  fi +
--  +
-+
-+
-+
-+  +
-  if [ "$distribution" = "true" ] ; then +
-  mkdir -p "$top_dir/Distribution/Images/$target-$profile_name" +
-  fi +
-@@ -719,3 +719,4 @@ for target in $targets ; do +
-  cd "$top_dir" +
- done +
-  +
-+
---- /dev/null +
-+++ b/patches-generic/66-Fix-Kernel-Download.patch +
-@@ -0,0 +1,13 @@ +
-+--- a/scripts/download.pl +
-++++ b/scripts/download.pl +
-+@@ -165,8 +165,8 @@ foreach my $mirror (@ARGV) { +
-+ push @extra, "$extra[0]/longterm/v$1"; +
-+ }  +
-+ foreach my $dir (@extra) { +
-+- push @mirrors, "ftp://ftp.all.kernel.org/pub/$dir"; +
-+- push @mirrors, "http://ftp.all.kernel.org/pub/$dir"; +
-++ push @mirrors, "https://cdn.kernel.org/pub/$dir"; +
-++ push @mirrors, "https://www.kernel.org/pub/$dir"; +
-+ } +
-+     } elsif ($mirror =~ /^\@GNOME\/(.+)$/) { +
-+ push @mirrors, "http://ftp.gnome.org/pub/GNOME/sources/$1"; +
-</code> +
-The same patch should work for earlier versions including 1.6.2 with some modifications+
developer_documentation.1550126652.txt.gz · Last modified: 2019/02/14 06:44 by ispyisail