-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpost-build
executable file
·66 lines (57 loc) · 1.97 KB
/
post-build
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
#!/bin/bash -ex
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 BigSwitch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the
# License.
#
# </bsn.cl>
############################################################
#
# post-build
#
############################################################
TARGET=$1
[ -d "${TARGET}" ] || { echo "Usage: $0 TARGET_DIR" >&2; exit 1; }
ROOTFILES=$(dirname $0)/rootfiles
[ -d "${ROOTFILES}" ] || { echo "Could not find rootfiles dir" >&2; exit 1; }
ARCH_ROOTFILES=${BASE_DIR}/rootfiles
[ -d "${ARCH_ROOTFILES}" ] || { echo "Could not find arch-specific rootfiles dir" >&2; exit 1; }
rm -f ${TARGET}/linuxrc
rm -f ${TARGET}/etc/hostname
rm -f ${TARGET}/etc/inputrc
rm -f ${TARGET}/etc/issue
rm -rf ${TARGET}/etc/ld.so.conf*
rm -f ${TARGET}/etc/mtab
rm -rf ${TARGET}/etc/network
rm -f ${TARGET}/etc/nsswitch.conf
rm -f ${TARGET}/etc/os-release
rm -f ${TARGET}/etc/protocols
rm -f ${TARGET}/etc/random-seed
rm -f ${TARGET}/etc/securetty
rm -f ${TARGET}/etc/services
rm -rf ${TARGET}/etc/init.d
rm -rf ${TARGET}/home
rm -rf ${TARGET}/media
rm -rf ${TARGET}/opt
rm -rf ${TARGET}/root
rm -f ${TARGET}/sbin/udhcpc
rm -f ${TARGET}/sbin/zcip
rm -f ${TARGET}/var/lib/misc
rm -f ${TARGET}/var/lib/pcmcia
rm -f ${TARGET}/var/pcmcia
mkdir -p ${TARGET}/lib/modules
tar -c --exclude '.*~' -C ${ROOTFILES} . | tar -xv -C ${TARGET}
tar -c --exclude '.*~' -C ${ARCH_ROOTFILES} . | tar -xv -C ${TARGET}