On Thursday, February 4, 2021 at 12:48:56 PM UTC-5 [email protected] wrote:
> Add a case in the initial argument parsing loop to both set the variable > and > append it to the args array. > > While we're here, use a cleaner syntax for appending to an array. > > If arch= isn't given on the build command line, explicitly set it to the > default x64. > > Signed-off-by: Stewart Hildebrand <[email protected]> > --- > scripts/build | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/scripts/build b/scripts/build > index b494141c..d859202a 100755 > --- a/scripts/build > +++ b/scripts/build > @@ -80,11 +80,16 @@ do > image=*|modules=*|fs=*|usrskel=*|check|--append-manifest|--create-disk) ;; > clean) > stage1_args=clean ;; > - *) # yuck... Is there a prettier way to append to array? > - args[${#args[@]}]="$i" ;; > + arch=*) > + eval ${i} > + args+=("$i") ;; > + *) > + args+=("$i") ;; > esac > done > > +arch=${arch:-x64} Should we really default to x64 or the host arch (uname -m)? I build often on my Odroid machine natively. In reality, it probably should be like that: arch=$(uname -m) > if [ "${arch}" == "x86_64" ]; then > arch="x64" > fi > > + > make "${args[@]}" ${stage1_args} | tee build.out > # check exit status of make > status=${PIPESTATUS[0]} > @@ -162,7 +167,6 @@ fs_size=${vars[fs_size]-$(($fs_size_mb*1024*1024))} > fs_size=$((fs_size - (fs_size & 511))) > > SRC=`pwd` > -arch=`expr $OUT : '.*\.\(.*\)'` So I guess we are deciding to default to the host arch (or x64) instead of whatever the last build was, are we? > > mode=`expr $OUT : '.*/\(.*\)\..*'` > > # Set "modules" according to the image= or modules= paramters, or some > -- > 2.30.0 > > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/617231fb-9ae5-4660-ad4f-d77f196a1f5an%40googlegroups.com.
