Changeset - 6c3d6c665f83
[Not reviewed]
master
0 1 0
x - 12 hours ago 2025-08-23 02:29:52
xbr@c3l.lu
fix: misuse of popd in build.sh
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
build_script/build.sh
Show inline comments
 
#!/usr/bin/env bash
 
USER_DIR=/home/user
 

	
 
GLUON_DIR=$USER_DIR/gluon
 
SITE_DIR=$USER_DIR/Firmware-building/site_config
 

	
 
EXPERIMENTAL_SITE=$SITE_DIR/experimental/site
 
BETA_SITE=$SITE_DIR/beta/site
 
STABLE_SITE=$SITE_DIR/stable/site
 

	
 
# $1: site directory
 
set_site_directory() {
 
    pushd $GLUON_DIR
 

	
 
    # if site file exists, remove it
 
    if [ -a site ]; then
 
        unlink site
 
    fi
 
    ln -s $1
 

	
 
    popd $GLUON_DIR
 
    popd
 
}
 

	
 
build() {
 
    pushd $GLUON_DIR
 

	
 
    for TARGET in $(make list-targets); do
 
        make -j16 GLUON_TARGET=$TARGET
 
    done
 

	
 
    popd
 
}
 

	
 
# $1: autoupdater branch
 
move_output_images() {
 
    pushd $GLUON_DIR
 

	
 
    mv output/images output-images-$1
 

	
 
    popd
 
}
 

	
 
#unset multiple env vars
 
unset BUILD_EXPERIMENTAL BUILD_BETA BUILD_STABLE
 

	
 
@@ -86,25 +86,25 @@ build() {
 
}
 

	
 
move_output_images() {
 
    echo "Moving output images to output-images-$1"
 
}
 

	
 
if [ -n "$BUILD_EXPERIMENTAL" ]; then
 
    set_site_directory $EXPERIMENTAL_SITE
 
    build
 
    move_output_images experimental
 
fi
 

	
 
if [ -n "$BUILD_BETA" ]; then
 
    set_site_directory $BETA_SITE
 
    build
 
    move_output_images beta
 
fi
 

	
 
if [ -n "$BUILD_STABLE" ]; then
 
    set_site_directory $STABLE_SITE
 
    build
 
    move_output_images stable
 
fi
 

	
 
popd
 
\ No newline at end of file
 
popd
0 comments (0 inline, 0 general)