Skip to content

Commit

Permalink
Better control of build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Sep 10, 2017
1 parent 1a66d85 commit a7ede6b
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if [[ ! -f $STEP_DIR ]]; then
echo -e "${WHT}Installing Node.js${CLR}"

# Delete previous initramfs
rm -rf $OBJ_GEN_INIT_CPIO
rm -rf $OUT_INITRAM

# Install
(
Expand All @@ -135,13 +135,18 @@ fi

STEP_DIR=$OBJ_RELEASE

mkdir -p `dirname $STEP_DIR`
if [[ ! -f $STEP_DIR ]]; then
# Delete previous initramfs
rm -rf $OUT_INITRAM

VERSION=`node -p "require('./package.json').version"` || VERSION="(unknown)"
CODENAME="Amanda"
BUILD_ID=`node -p "(new Date()).toISOString().substr(0,10)"`
mkdir -p `dirname $STEP_DIR`

eval "echo \"$(< resources/os-release)\"" > $STEP_DIR || err 30
VERSION=`node -p "require('./package.json').version"` || VERSION="(unknown)"
CODENAME="Amanda"
BUILD_ID=`node -p "(new Date()).toISOString().substr(0,10)"`

eval "echo \"$(< resources/os-release)\"" > $STEP_DIR || err 30
fi


#
Expand All @@ -150,24 +155,29 @@ eval "echo \"$(< resources/os-release)\"" > $STEP_DIR || err 30

STEP_DIR=$OBJ_CPIO_TXT

mkdir -p `dirname $STEP_DIR`
if [[ ! -f $STEP_DIR ]]; then
# Delete previous initramfs
rm -rf $OUT_INITRAM

mkdir -p `dirname $STEP_DIR`

BINARY=bin/node
BINARY_PATH=$OBJ_NODE
BINARY=bin/node
BINARY_PATH=$OBJ_NODE

eval "echo \"$(< resources/cpio.txt)\"" > $STEP_DIR || err 40
eval "echo \"$(< resources/cpio.txt)\"" > $STEP_DIR || err 40
fi


#
# Generate initramfs
# gen_init_cpio
#

SRC_DIR=$LINUX
STEP_DIR=$OBJ_GEN_INIT_CPIO

if [[ ! -f $STEP_DIR ]]; then
# Delete previous initramfs and kernel
rmStep $OUT_DIR $PREBUILD
rmStep $OUT_INITRAM

(
cd $SRC_DIR/usr &&
Expand All @@ -176,19 +186,28 @@ if [[ ! -f $STEP_DIR ]]; then
mkdir -p `dirname $STEP_DIR` &&
mv gen_init_cpio $STEP_DIR || exit 51
) || err $?
fi


#
# Generate initramfs
#

mkdir -p $OUT_DIR &&
$STEP_DIR $OBJ_CPIO_TXT | gzip > $OUT_DIR/barebones.cpio.gz || err 52
STEP_DIR=$OUT_INITRAM

if [[ ! -f $STEP_DIR ]]; then
# Delete previous initramfs and kernel
rmStep $OUT_DIR $PREBUILD

mkdir -p `dirname $STEP_DIR` &&
$OBJ_GEN_INIT_CPIO $OBJ_CPIO_TXT | gzip > $STEP_DIR || err 52
fi


#
# Wrap the system up and pack it
#

SRC_DIR=$SRC_LINUX
STEP_DIR=$OBJ_LINUX

case $KERNEL in
nokernel)
;;
Expand Down

0 comments on commit a7ede6b

Please sign in to comment.