comparison core/busybox/busybox.sh @ 1216:6710613b88b9

misc: remove build function
author David Demelier <markand@malikania.fr>
date Wed, 29 Sep 2021 13:49:32 +0200
parents 2fafcd07edb0
children 4ccc42bf0284
comparison
equal deleted inserted replaced
1215:3214f7fed454 1216:6710613b88b9
39 : ${IPV6:=yes} 39 : ${IPV6:=yes}
40 : ${PAM:=no} 40 : ${PAM:=no}
41 : ${SELINUX:=no} 41 : ${SELINUX:=no}
42 : ${STATIC:=yes} 42 : ${STATIC:=yes}
43 43
44 build() 44 rm -rf $PKGNAME-$PKGVERSION
45 { 45 tar xvf $PKGNAME-$PKGVERSION.tar.bz2
46 rm -rf $PKGNAME-$PKGVERSION 46 cd $PKGNAME-$PKGVERSION
47 tar xvf $PKGNAME-$PKGVERSION.tar.bz2 47
48 cd $PKGNAME-$PKGVERSION 48 #
49 # Allow user to specify a full config if specified, otherwise change
50 # package options.
51 #
52 if [ -n "$CONFIG" ] && [ -r "$CONFIG" ]; then
53 cp $CONFIG .config
49 54
50 # 55 #
51 # Allow user to specify a full config if specified, otherwise change 56 # When specifying a config file, force other selective options
52 # package options. 57 # to a dummy value to avoid incorrect information in package
58 # file.
53 # 59 #
54 if [ -n "$CONFIG" ] && [ -r "$CONFIG" ]; then 60 IPV6=""
55 cp $CONFIG .config 61 SELINUX=""
62 PAM=""
63 STATIC=""
64 else
65 cp ../config .config
56 66
57 # 67 if [ "$SELINUX" = "yes" ]; then
58 # When specifying a config file, force other selective options 68 echo "CONFIG_SELINUX=y" >> .config
59 # to a dummy value to avoid incorrect information in package 69 echo "CONFIG_FEATURE_TAR_SELINUX=y" >> .config
60 # file. 70 echo "CONFIG_SELINUXENABLED=y" >> .config
61 #
62 IPV6=""
63 SELINUX=""
64 PAM=""
65 STATIC=""
66 else
67 cp ../config .config
68
69 if [ "$SELINUX" = "yes" ]; then
70 echo "CONFIG_SELINUX=y" >> .config
71 echo "CONFIG_FEATURE_TAR_SELINUX=y" >> .config
72 echo "CONFIG_SELINUXENABLED=y" >> .config
73 fi
74
75 if [ "$PAM" = "yes" ]; then
76 echo "CONFIG_PAM=y" >> .config
77 fi
78
79 if [ "$IPV6" != "yes" ]; then
80 sed -i -e "/CONFIG_FEATURE_IPV6=y/ s/y/n/" .config
81 sed -i -e "/CONFIG_FEATURE_IFUPDOWN_IPV6=y/ s/y/n/" .config
82 fi
83
84 if [ "$STATIC" = "yes" ]; then
85 echo "CONFIG_STATIC=y" >> .config
86 fi
87 fi 71 fi
88 72
89 # 73 if [ "$PAM" = "yes" ]; then
90 # Our start script is located in /etc/rc.init. 74 echo "CONFIG_PAM=y" >> .config
91 # Upstream: rejected a tunable option. 75 fi
92 #
93 sed -i -e 's|/etc/init.d/rcS|/etc/rc.init|' init/init.c
94 76
95 # 77 if [ "$IPV6" != "yes" ]; then
96 # Change the redirection limit which is too small for vpk download. 78 sed -i -e "/CONFIG_FEATURE_IPV6=y/ s/y/n/" .config
97 # Upstream: yes in Git. 79 sed -i -e "/CONFIG_FEATURE_IFUPDOWN_IPV6=y/ s/y/n/" .config
98 # 80 fi
99 sed -i -e "/redir_limit = 5/ s/5/16/" networking/wget.c
100 81
101 # 82 if [ "$STATIC" = "yes" ]; then
102 # TODO: this is temporary, to build under clang. 83 echo "CONFIG_STATIC=y" >> .config
103 # 84 fi
104 # CFLAGS="": fix build under clang by removing all non-standard 85 fi
105 # options.
106 #
107 # -O0: disable optimizations for the same reasons.
108 #
109 # See http://lists.busybox.net/pipermail/busybox/2019-October/087558.html
110 #
111 make \
112 AR="$AR" \
113 AS="$AS" \
114 CC="$CC" \
115 CFLAGS="-DBB_GLOBAL_CONST=''" \
116 HOSTCC="$CC" \
117 HOSTCFLAGS="" \
118 EXTRA_CFLAGS="$CFLAGS -O0" \
119 EXTRA_LDFLAGS="$LDFLAGS" \
120 NM="$NM" \
121 OBJCOPY="$OBJCOPY" \
122 OBJDUMP="$OBJDUMP" \
123 STRIP="$STRIP" \
124 V=1
125 install -Dm0755 busybox $DESTDIR/bin/busybox
126 install -dm0755 $DESTDIR/share/udhcp
127 install -m0644 examples/udhcp/sample.* $DESTDIR/share/udhcp
128 install -Dm0644 examples/udhcp/udhcpd.conf $DESTDIR/etc/udhcpd.conf
129 install -Dm0644 ../busybox.crond $DESTDIR/etc/rc.d/busybox.crond
130 install -Dm0644 ../busybox.klogd $DESTDIR/etc/rc.d/busybox.klogd
131 install -Dm0644 ../busybox.mdev $DESTDIR/etc/rc.d/busybox.mdev
132 install -Dm0644 ../busybox.syslogd $DESTDIR/etc/rc.d/busybox.syslogd
133 86
134 cd .. 87 #
135 rm -rf $PKGNAME-$PKGVERSION 88 # Our start script is located in /etc/rc.init.
136 } 89 # Upstream: rejected a tunable option.
90 #
91 sed -i -e 's|/etc/init.d/rcS|/etc/rc.init|' init/init.c
92
93 #
94 # Change the redirection limit which is too small for vpk download.
95 # Upstream: yes in Git.
96 #
97 sed -i -e "/redir_limit = 5/ s/5/16/" networking/wget.c
98
99 #
100 # TODO: this is temporary, to build under clang.
101 #
102 # CFLAGS="": fix build under clang by removing all non-standard
103 # options.
104 #
105 # -O0: disable optimizations for the same reasons.
106 #
107 # See http://lists.busybox.net/pipermail/busybox/2019-October/087558.html
108 #
109 make \
110 AR="$AR" \
111 AS="$AS" \
112 CC="$CC" \
113 CFLAGS="-DBB_GLOBAL_CONST=''" \
114 HOSTCC="$CC" \
115 HOSTCFLAGS="" \
116 EXTRA_CFLAGS="$CFLAGS -O0" \
117 EXTRA_LDFLAGS="$LDFLAGS" \
118 NM="$NM" \
119 OBJCOPY="$OBJCOPY" \
120 OBJDUMP="$OBJDUMP" \
121 STRIP="$STRIP" \
122 V=1
123 install -Dm0755 busybox $DESTDIR/bin/busybox
124 install -dm0755 $DESTDIR/share/udhcp
125 install -m0644 examples/udhcp/sample.* $DESTDIR/share/udhcp
126 install -Dm0644 examples/udhcp/udhcpd.conf $DESTDIR/etc/udhcpd.conf
127 install -Dm0644 ../busybox.crond $DESTDIR/etc/rc.d/busybox.crond
128 install -Dm0644 ../busybox.klogd $DESTDIR/etc/rc.d/busybox.klogd
129 install -Dm0644 ../busybox.mdev $DESTDIR/etc/rc.d/busybox.mdev
130 install -Dm0644 ../busybox.syslogd $DESTDIR/etc/rc.d/busybox.syslogd
131
132 cd ..
133 rm -rf $PKGNAME-$PKGVERSION