annotate sources/sections/busybox.build @ 1793:d461b345c3c9 draft

Build sh2eb for the numato mimas v2. Still a lot of rough edges.
author Rob Landley <rob@landley.net>
date Tue, 06 Oct 2015 22:05:53 -0500
parents d33dcb246984
children 9aa5983fbbaa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
865
15522b490e53 Build busybox static by default (but not for host-tools.sh, since static glibc is buggy, and let .config to switch it off).
Rob Landley <rob@landley.net>
parents: 849
diff changeset
1 # Build busybox statically by default, but don't statically link against
1036
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
2 # glibc (during host_tools) build because glibc is buggy and can't combine
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
3 # --static with --gc-sections.
865
15522b490e53 Build busybox static by default (but not for host-tools.sh, since static glibc is buggy, and let .config to switch it off).
Rob Landley <rob@landley.net>
parents: 849
diff changeset
4
849
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # Build busybox
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
1544
e2f722cc97a6 Make busybox build by default, switch override knob to BUSYBOX=1 to use defconfig busybox, always use toybox for oneit, cleanup/fix record-commands logic.
Rob Landley <rob@landley.net>
parents: 1507
diff changeset
7 if [ ! -z "$BUSYBOX" ]
1477
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
8 then
1721
d33dcb246984 Pipe through BUILD_VERBOSE to the busybox build.
Rob Landley <rob@landley.net>
parents: 1544
diff changeset
9 make defconfig V=${BUILD_VERBOSE:+1} &&
1477
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
10 # breaks on ubuntu 11.10
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
11 sed -i -e 's/^\(CONFIG_UBI.*\)=y/# \1 is not set/' .config &&
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
12 cp .config "$WORK"/config-busybox || dienow
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
13 else
1544
e2f722cc97a6 Make busybox build by default, switch override knob to BUSYBOX=1 to use defconfig busybox, always use toybox for oneit, cleanup/fix record-commands logic.
Rob Landley <rob@landley.net>
parents: 1507
diff changeset
14 getconfig busybox | sed '/toybox/,$d' > "$WORK/config-busybox" &&
1477
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
15 make allnoconfig KCONFIG_ALLCONFIG="$WORK/config-busybox" || dienow
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
16 fi
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
17
1793
d461b345c3c9 Build sh2eb for the numato mimas v2. Still a lot of rough edges.
Rob Landley <rob@landley.net>
parents: 1721
diff changeset
18 LDFLAGS="$LDFLAGS $STATIC_FLAGS" make -j $CPUS V=${BUILD_VERBOSE:+2} \
d461b345c3c9 Build sh2eb for the numato mimas v2. Still a lot of rough edges.
Rob Landley <rob@landley.net>
parents: 1721
diff changeset
19 $DO_CROSS ${ELF2FLT:+SKIP_STRIP=y} &&
1036
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
20 make busybox.links || dienow
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
21
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
22 [ -d "$STAGE_DIR/bin" ] && INSTDIR="$STAGE_DIR/bin" || INSTDIR="$STAGE_DIR"
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
23
e021bba5e22e Yank ugly STAGE_DIR adjustment and instead teach busybox/toybox bilds to auto-detect "bin" directory on install. (And while we're at it, don't build hello-dynamic on static-only system.)
Rob Landley <rob@landley.net>
parents: 944
diff changeset
24 cp busybox${SKIP_STRIP:+_unstripped} "$INSTDIR/busybox" || dienow
849
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
25
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 for i in $(sed 's@.*/@@' busybox.links)
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 do
1229
313c702a0984 Remove toybox.
Rob Landley <rob@landley.net>
parents: 1197
diff changeset
28 # busybox mke2fs/tune2fs don't support -j
313c702a0984 Remove toybox.
Rob Landley <rob@landley.net>
parents: 1197
diff changeset
29 if [ "$i" == mke2fs ] || [ "$i" == tune2fs ]
313c702a0984 Remove toybox.
Rob Landley <rob@landley.net>
parents: 1197
diff changeset
30 then
313c702a0984 Remove toybox.
Rob Landley <rob@landley.net>
parents: 1197
diff changeset
31 continue
313c702a0984 Remove toybox.
Rob Landley <rob@landley.net>
parents: 1197
diff changeset
32 fi
1177
7ca3dfbc9e06 Update to busybox 1.17.1 and switch to defconfig instead of trimconfig.
Rob Landley <rob@landley.net>
parents: 1083
diff changeset
33 [ ! -f "$INSTDIR/$i" ] && (ln -sf busybox "$INSTDIR/$i" || dienow)
849
5dd1a99a0737 Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 done
1477
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
35
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
36 # Reset error condition, the last file already existing is not an error
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
37
431d5b4ee537 Switch from busybox defconfig to baseconfig-busybox selecting just what we need, with a config variable to use defconfig instead if you really want that.
Rob Landley <rob@landley.net>
parents: 1229
diff changeset
38 true