5 # Creates the build environment with the current directory as the root
6 # To avoid problems with long paths, something like /Openwrt is preferable
8 # Script creates subdir for trunk or the release branch, and dl for downloads
9 # Creates main source repository and luci, packages & routing feeds
11 ### Target definitions
13 GITREPO="-b lede-17.01 --single-branch https://git.lede-project.org/source.git"
16 FILESTAMP=R7800-lede1701-r3389-379155dc0f-20170518-1219
18 ### Prerequisites for buildroot
19 sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev
20 sudo apt-get install gawk gcc-multilib flex git-core gettext libssl-dev
22 ### Prerequisites for being able to send patches to openwrt-devel
23 sudo apt-get install git-email
25 ### Newly patched Ubuntu may not yet have the correct kernel headers.
26 # sudo apt-get install linux-headers-$(uname -r)
28 ### set the preferred umask (LEDE allows 0000-0022)
31 ### download directory (outside main directory to protect from make distclean)
37 ### checkout/clone and change to directory
38 git clone $GITREPO $TARGET
41 ### create symlink to dl (after git clone)
44 ### patch main source first to set feeds correctly
45 ### update the feeds, apply patches to feeds
46 ### re-create index to find new packages, finally install
47 patch -p1 -i ../$FILESTAMP-main.patch
48 scripts/feeds update -a
49 (cd feeds/luci; patch -p1 -i ../../../$FILESTAMP-luci.patch)
50 (cd feeds/packages; patch -p1 -i ../../../$FILESTAMP-packages.patch)
51 (cd feeds/routing; patch -p1 -i ../../../$FILESTAMP-routing.patch)
52 scripts/feeds update -i
53 scripts/feeds install -a
55 ### chmod known script files executable
56 chmod -f 755 files/etc/*.sh
57 chmod -f 755 files/etc/rc.button/*
59 ### chmod buildscripts executable
60 chmod -f 755 hnscripts/*.sh
62 ### add created/modified files in main repo to version control
66 ### add created/modified files in feeds to version control
67 (cd feeds/luci; git add -A)
68 (cd feeds/packages; git add -A)
69 (cd feeds/routing; git add -A)
71 ### initialise .config
72 cp .config.init .config