Correcting the download URL. Also having it search for 'LibreWRT'
[librewrt/.git] / branding / creative-craftsman / librewrt.sh
1 #!/bin/sh
2 # LibreWRT Rebranding Script
3 # Copyright (C) 2011 Jason Self <jason@librewrt.org>
4 # Copyright (C) 2011 Robert Call <eight190@gmail.com>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # The LibreWRT Re-branding script is used to remove non-free software
19 # from OpenWRT. The LibreWRT project does not suggest that users
20 # download LibreWrt Sources, for they contain non-free software.
21 # Free your device.
22
23 # Also note that this script currently does not replace the kernel
24 # that feature will be added at a later date. As of now,
25 # creative-craftsman does use a linux-libre kernel.
26         clear
27         echo "                          "
28         echo "  _ _ _           __      _____ _____    "
29         echo " | (_) |__ _ _ ___\\ \\    / / _ \_   _|  "
30         echo " | | | '_ \\ '_/ -_)\\ \\/\\/ /|   / | |  "
31         echo " |_|_|_.__/_| \___| \\_/\\_/ |_|_\\ |_|   "
32         echo " -----------------------------------------"
33         echo " Creative Craftsman Version 2 Pre-Alpha 1 "
34
35
36 # Remove OpenWRT Subversion / git meta data
37 find ./ -iname .svn -exec rm -fr {} +
38 find ./ -iname .gitnore -exec rm -fr {} +
39
40 # re-name LeTeX documents
41 mv docs/librewrt.sty docs/librewrt.sty
42 mv docs/librewrt.tex docs/librewrt.tex
43
44 # Clean target directory
45 find target/linux \( ! -path "target/linux/ar71xx/*"  ! -path "target/linux/generic/*" ! -path "target/linux/uml/*" ! -path "target/linux/x86/*" ! -path "target/linux/xburst/*" ! -path "target/linux/Makefile" \) -delete > /dev/null
46 rm target/linux/ar71xx/generic/profiles/02-madwifi.mk > /dev/null
47
48 # Clean package directory
49 find package \( ! -path "package/base-files/*" ! -path "package/busybox/*" ! -path "package/dnsmasq/*" ! -path "package/dropbear/*" ! -path "package/firewall/*" ! -path "package/grub/*" ! -path "package/hotplug2/*" ! -path "package/iptables/*" ! -path "package/kernel/*" ! -path "package/libpcap/*" ! -path "package/libreadline/*" ! -path "package/libtool/*" ! -path "package/linux-atm/*" ! -path "package/lua/*" ! -path "package/ncurses/*" ! -path "package/ocf-crypto-headers/*" ! -path "package/mtd/*" ! -path "package/openssl/*" ! -path "package/opkg/*" ! -path "package/ppp/*" ! -path "package/pptp/*" ! -path "package/uci/*" ! -path "package/udevtrigger/*" ! -path "package/zlib/*" ! -path "package/Makefile" \) -delete > /dev/null
50 find package/kernel/modules -iname wireless.mk -exec rm -fr {} +
51 # Clean firmware-utils directory
52 find tools/firmware-utils \( ! -path "tools/firmware-utils/src/sha1.h" ! -path "tools/firmware-utils/src/sha1.c" ! -path "tools/firmware-utils/src/mkplanexfw.c" ! -path "tools/firmware-utils/Makefile" \) -delete > /dev/null
53 find tools/Makefile -exec sed -i 's/firmware-utils//g' {} \;
54 # Clean scripts directory
55 rm scripts/slugimage.pl
56
57 # Clean tools directory
58 rm -fr tools/upslug2
59 rm -fr tools/wrt350nv2-builder
60
61 #create card dir as part of base-files
62 mkdir package/base-files/files/card
63
64 # Find "OPENWRT", "OpenWrt", "openwrt" "OpenWRT" -> "LIBREWRT", "LibreWrt", "librewrt", "LibreWRT"
65 find ./ -type f -exec sed -i 's/OPENWRT/LIBREWRT/g' {} \;
66 find ./ -type f -exec sed -i 's/OpenWrt/LibreWrt/g' {} \;
67 find ./ -type f -exec sed -i 's/OpenWRT/LibreWRT/g' {} \;
68 find ./ -type f -exec sed -i 's/openwrt/librewrt/g' {} \;
69 find ./ -type f -exec sed -i 's/LibreWrt.org/OpenWrt.org/g' {} \;
70 find ./ -type f -exec sed -i 's/Attitude Adjustment/Creative Craftsman/g' {} \;
71 find ./ -type f -exec sed -i 's/http://downloads.openwrt.org/sources/http://download.librewrt.org/sources/g' {} \;