-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc_rebrand.sh
executable file
·128 lines (101 loc) · 3.66 KB
/
src_rebrand.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/sh
########################################
# name: src_rebrand.sh
# main: jadedctrl
# lisc: isc
# desc: rebranding obsd base sources for
# use in lbsd.
########################################
. ./libdeblob.sh
if test -z "$1"; then
echo "usage: src_rebrand.sh source_dir"
exit 2
else
SRC_DIR="$1"
fi
PATCH_DIR=/tmp/src_rebrand
mkdir "$PATCH_DIR" 2> /dev/null
# --------------------------------------
arch_list="amd64 i386"
rep "export OBSD=\"OpenBSD/\$ARCH \$VNAME\"" \
"export OBSD=\"LibertyBSD/\$ARCH \$VNAME\"" \
distrib/miniroot/dot.profile
# --------------------------------------
#iso_list="alpha amd64 hppa i386 sgi sparc sparc64 vax"
iso_list="amd64 i386"
for arch in $iso_list; do
rep "OpenBSD \${OSREV} ${arch} Install CD" \
"LibertyBSD \${OSREV} ${arch} Install" \
distrib/$arch/iso/Makefile
rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \
"Copyright (c) `date +%Y` -OpenBSD- and LibertyBSD projects" \
distrib/$arch/iso/Makefile
rep "Theo de Raadt <deraadt@openbsd.org>" \
"Jaidyn Ann <jadedctrl@teknik.io>" \
distrib/$arch/iso/Makefile
rep "OpenBSD/\${MACHINE} \${OSREV} Install CD" \
"LibertyBSD/\${MACHINE} \${OSREV} Install" \
distrib/$arch/iso/Makefile
done
# --------------------------------------
#cdfs_list="alpha amd64 i386 loongson sgi sparc sparc64 vax"
cdfs_list="amd64 i386"
for arch in $(echo $cdfs_list); do
rep "OpenBSD \${OSREV} ${arch} bootonly CD" \
"LibertyBSD \${OSREV} ${arch} bootonly" \
distrib/$arch/ramdisk_cd/Makefile
rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \
"Copyright (c) `date +%Y` -OpenBSD- and LibertyBSD projects" \
distrib/$arch/ramdisk_cd/Makefile
rep "Theo de Raadt <deraadt@openbsd.org>" \
"Jaidyn Ann <jadedctrl@teknik.io>" \
distrib/$arch/ramdisk_cd/Makefile
rep "OpenBSD/${arch} \${OSREV} boot-only CD" \
"LibertyBSD/${arch} \${OSREV} boot-only" \
distrib/$arch/ramdisk_cd/Makefile
done
# --------------------------------------
for arch in $(echo $arch_list); do
rep "You will not be able to boot OpenBSD from \${1}." \
"You will not be able to boot LibertyBSD from \${1}." \
distrib/$arch/common/install.md
done
rep "#define DMESG_START \"OpenBSD \"" \
"#define DMESG_START \"LibertyBSD \"" \
usr.bin/sendbug/sendbug.c
rep "bugs@openbsd.org" "jadedctrl@teknik.io" usr.bin/sendbug/sendbug.c
rep "sysctl -n kern.version | sed 1q >" \
"sysctl -n kern.version | sed 1q | sed 's/OpenBSD/LibertyBSD/' >" \
etc/rc
rep "kerninfo.sysname" "\"LibertyBSD\"" libexec/getty/main.c
# Adding LBSD keys
versions="64 66 67"
local_key="files/keys/libertybsd-"
lbsd_key="etc/signify/libertybsd-"
for ver in $versions; do
filecp ${local_key}${ver}-base.pub \
${lbsd_key}${ver}-base.pub
filecp ${local_key}${ver}-pkg.pub \
${lbsd_key}${ver}-pkg.pub
filecp ${local_key}${ver}-syspatch.pub \
${lbsd_key}${ver}-syspatch.pub
filedel etc/signify/openbsd-${ver}-fw.pub
done
lbsd_key="./etc/signify/libertybsd-"
m_path="distrib/sets/lists/base/mi"
for ver in $versions; do
lineadd "openbsd-${ver}-base.pub" "${lbsd_key}${ver}-base.pub" $m_path
lineadd "openbsd-${ver}-pkg.pub" "${lbsd_key}${ver}-pkg.pub" $m_path
lineadd "openbsd-${ver}-syspatch.pub" \
"${lbsd_key}${ver}-syspatch.pub" $m_path
linedel "openbsd-${ver}-fw.pub" $m_path
done
# --------------------------------------
filecp files/motd etc/motd
filecp files/root.mail etc/root/root.mail
filecp files/install.sub distrib/miniroot/install.sub
rep "openbsd-" "libertybsd-" usr.sbin/syspatch/syspatch.sh
rep "OpenBSD" "LibertyBSD" usr.sbin/syspatch/syspatch.sh
# --------------------------------------
echo "Applying..."
apply