Adding build instructions into README file.
[lede.git] / README
1 This is the buildsystem for the LEDE Linux distribution.
2
3 Please use "make menuconfig" to choose your preferred
4 configuration for the toolchain and firmware.
5
6 You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
7 find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
8
9 Run "./scripts/feeds update -a" to get all the latest package definitions
10 defined in feeds.conf / feeds.conf.default respectively
11 and "./scripts/feeds install -a" to install symlinks of all of them into
12 package/feeds/.
13
14 Use "make menuconfig" to configure your image.
15
16 Simply running "make" will build your firmware.
17 It will download all sources, build the cross-compile toolchain, 
18 the kernel and all choosen applications.
19
20 To build your own firmware you need to have access to a Linux, BSD or MacOSX system
21 (case-sensitive filesystem required). Cygwin will not be supported because of
22 the lack of case sensitiveness in the file system.
23
24
25 Sunshine!
26         Your LEDE Community
27         http://www.lede-project.org
28
29 ================================================================================
30
31 This LEDE lede-17.01 branch was taken in July 2017 from the LEDE github
32 repository for Sentinel system. A few things have been added including a patch
33 for hostapd to make disable_dgaf and proxy_arp options work properly.
34
35 The followings are the steps to be done to install this correctly on a NETGEAR R7800
36 Nighthawk X4S router:
37
38 1) Do "git clone ssh://plrg.eecs.uci.edu/home/git/lede" to download this LEDE
39 onto your local repository. Then execute "git checkout lede-17.01" to checkout
40 the right branch---this is a detached branch (there is no master branch), so we 
41 have to do this to make sure that we can push and pull changes correctly.
42
43 2) Copy the compilation configuration file sentinel.config into a .config file in
44 the main folder by executing "cp sentinel.config .config".
45
46 3) Do "make defconfig" to setup the build options, then do "make world -j<number-of-proc>",
47 e.g. make world -j12.
48
49 4) After the compilation, the image will be found in
50 bin/targets/ipq806x/generic/lede-ipq806x-R7800-squashfs-factory.img. We can flash 
51 this image onto the Netgear R7800 Nighthawk X4S router using the instructions here:
52 https://lede-project.org/docs/guide-quick-start/standardflashinginstructions.
53
54 5) After flashing and booting for the first time, we need to set up the router using
55 RJ45 cables; if we plug it into the WAN connection through DHCP mechanism, we can get
56 an IP address for that WAN port instantly; to set up network configrations, we can
57 access the router by connecting a device to the router, opening a browser, and typing
58 the default router IP address: http://192.168.1.1; this will open the lUCI configuration
59 page and we can set up the router now.
60
61 6) We can set up first the LAN connection according to the LAN configuration
62 in sentinel_setup/config/network.
63
64 7) Then we can set up a password for the system by typing "passwd" and giving it
65 a new password.
66
67 8) Reboot the system and we can login using dropbear ssh authentication by typing
68 "ssh root@128.195.204.115" and inputting the password. If we want to use SSL key
69 for the sake of convenience, then we have to do the steps here:
70 https://wiki.openwrt.org/doc/howto/dropbear.public-key.auth
71 Basically we copy our machine's public-key to the LEDE system by typing:
72 ssh root@128.195.204.115 "tee -a /etc/dropbear/authorized_keys" < ~/.ssh/id_rsa.pub
73
74 9) We need to copy the setup in dhcp, network, wireless, and hostapd-psk files in
75 sentinel_setup/config/ into the same files in /etc/config/ on the LEDE system.
76 Also we need to copy sentinel_setup/rc.local that contains the initial setup scripts
77 into /etc on the LEDE system. For the firewall file, since we do not use the
78 default firewall setup from LEDE, we can do
79 "mv /etc/config/firewall /etc/config/firewall.bak" to make it unreadable by LEDE
80 UCI when it is initializing the firewall rules when the system is booting up.
81
82 10) Last, we need to copy the setup scripts in sentinel_setup/setup into /setup on
83 our LEDE system. This contains a number of scripts. 
84 - "startup.sh" will be run by the rc.local script when LEDE is booting up. This script 
85 contains the initial firewall rules for Sentinel router and a number of workaround 
86 rules to fix a few issues when disable_dgaf and proxy_arp options are activated, i.e.
87 hostapd checksum bug (for disable_dgaf feature) and DHCPDECLINE issue when
88 a device gets an ARP unicast message about itself, causing it to think that its
89 IP address has been used by another device (so far only the ESP8266 is known to
90 have this problem). 
91 - "clean" and "nat" scripts are for cleaning and activating NAT(Network Address Translation) 
92 on the system.
93 - "dhcp" shows the IP address assignments to different connected devices.
94 - "show" shows the active iptables rules.
95 - "transfer" contains commands to transfer files through the "scp" command.
96
97 12) Reboot the system and we will have a working LEDE router for Sentinel system.