diff --git a/src/minimal_overlay/bundles/cf_cli/02_install.sh b/src/minimal_overlay/bundles/cf_cli/02_install.sh index e78fd7c57..b71f56273 100755 --- a/src/minimal_overlay/bundles/cf_cli/02_install.sh +++ b/src/minimal_overlay/bundles/cf_cli/02_install.sh @@ -23,7 +23,10 @@ cd $DEST_DIR ln -s ../opt/$BUNDLE_NAME/cf bin/cf -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS echo "Cloud Foundry CLI has been installed." diff --git a/src/minimal_overlay/bundles/coreutils/02_build.sh b/src/minimal_overlay/bundles/coreutils/02_build.sh index fd50d763f..0bb145815 100755 --- a/src/minimal_overlay/bundles/coreutils/02_build.sh +++ b/src/minimal_overlay/bundles/coreutils/02_build.sh @@ -9,26 +9,35 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the coreutils source directory which ls finds, e.g. 'coreutils-8.28'. cd $(ls -d coreutils-*) -echo "Preparing coreutils work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring coreutils." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building coreutils." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing coreutils." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing coreutils size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "coreutils has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/dialog/02_build.sh b/src/minimal_overlay/bundles/dialog/02_build.sh index 0dbbad66b..027e752bc 100755 --- a/src/minimal_overlay/bundles/dialog/02_build.sh +++ b/src/minimal_overlay/bundles/dialog/02_build.sh @@ -9,26 +9,34 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the dialog source directory which ls finds, e.g. 'dialog-1.3-20170509'. cd $(ls -d dialog-*) -echo "Preparing dialog work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing 'dialog' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for 'dialog' has been skipped." +fi rm -rf $DEST_DIR -# Configure dialog -echo "Configuring dialog." +echo "Configuring 'dialog'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building dialog." +echo "Building 'dialog'." make -j $NUM_JOBS -echo "Installing dialog." +echo "Installing 'dialog'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing dialog size." +echo "Reducing 'dialog' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/usr/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/usr/* \ + $OVERLAY_ROOTFS echo "Bundle 'dialog' has been installed." diff --git a/src/minimal_overlay/bundles/dropbear/02_build.sh b/src/minimal_overlay/bundles/dropbear/02_build.sh index 5a41d457f..e99df6e42 100755 --- a/src/minimal_overlay/bundles/dropbear/02_build.sh +++ b/src/minimal_overlay/bundles/dropbear/02_build.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e +set -ex . ../../common.sh @@ -9,21 +9,26 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the Dropbear source directory which ls finds, e.g. 'dropbear-2016.73'. cd $(ls -d dropbear-*) -echo "Preparing Dropbear work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing 'Dropbear' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for 'Dropbear' has been skipped." +fi + rm -rf $DEST_DIR -echo "Configuring Dropbear." +echo "Configuring 'Dropbear'." ./configure \ --prefix=/usr \ --disable-zlib \ --disable-loginfunc CFLAGS="$CFLAGS" -echo "Building Dropbear." +echo "Building 'Dropbear'." make -j $NUM_JOBS -echo "Installing Dropbear." +echo "Installing 'Dropbear'." make -j $NUM_JOBS install DESTDIR="$DEST_DIR" mkdir -p $DEST_DIR/etc/dropbear @@ -31,7 +36,7 @@ mkdir -p $DEST_DIR/etc/dropbear # Create Dropbear SSH configuration BEGIN for key_type in rsa dss ecdsa; do - echo "generating $key_type host key" + echo "Generating '$key_type' host key." $DEST_DIR/usr/bin/dropbearkey \ -t $key_type \ -f $DEST_DIR/etc/dropbear/dropbear_${key_type}_host_key @@ -54,20 +59,27 @@ mkdir -p $DEST_DIR/root # Create Dropbear SSH configuration END -echo "Reducing Dropbear size." +echo "Reducing 'Dropbear' size." +set +e strip -g \ $DEST_DIR/usr/bin/* \ - $DEST_DIR/usr/sbin/* \ - $DEST_DIR/lib/* + $DEST_DIR/usr/sbin/* +set -e mkdir -p $OVERLAY_ROOTFS/usr -cp -r $DEST_DIR/etc $OVERLAY_ROOTFS -cp -r $DEST_DIR/usr/bin $OVERLAY_ROOTFS/usr -cp -r $DEST_DIR/usr/sbin $OVERLAY_ROOTFS/usr -cp -r $DEST_DIR/lib $OVERLAY_ROOTFS + +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/etc \ + $OVERLAY_ROOTFS +cp -r --remove-destination $DEST_DIR/usr/bin \ + $OVERLAY_ROOTFS/usr +cp -r --remove-destination $DEST_DIR/usr/sbin \ + $OVERLAY_ROOTFS/usr + mkdir -p "$OVERLAY_ROOTFS/etc/autorun" install -m 0755 "$SRC_DIR/20_dropbear.sh" "$OVERLAY_ROOTFS/etc/autorun/" -echo "Dropbear has been installed." +echo "Bundle 'Dropbear' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/dropbear/20_dropbear.sh b/src/minimal_overlay/bundles/dropbear/20_dropbear.sh index 8358bec69..fac416202 100755 --- a/src/minimal_overlay/bundles/dropbear/20_dropbear.sh +++ b/src/minimal_overlay/bundles/dropbear/20_dropbear.sh @@ -1,3 +1,9 @@ #!/bin/sh -echo "starting dropbear ssh server" + +cat << CEOF + + Starting Dropbear SSH server. + +CEOF + dropbear diff --git a/src/minimal_overlay/bundles/felix/02_install.sh b/src/minimal_overlay/bundles/felix/02_install.sh index a86e7ef3c..c605834c8 100755 --- a/src/minimal_overlay/bundles/felix/02_install.sh +++ b/src/minimal_overlay/bundles/felix/02_install.sh @@ -4,7 +4,7 @@ set -e . ../../common.sh -echo "Removing old Apache Felix artifacts. This may take a while." +echo "Removing old 'Apache Felix' artifacts. This may take a while." rm -rf $DEST_DIR mkdir -p $DEST_DIR/opt/felix mkdir -p $DEST_DIR/bin @@ -28,9 +28,12 @@ cd $DEST_DIR ln -s ../opt/felix/bin/felix-start.sh bin/felix-start -cp -r $DEST_DIR/* $OVERLAYFS_ROOT +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "Apache Felix has been installed." +echo "Bundle 'Apache Felix' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/fio/02_build.sh b/src/minimal_overlay/bundles/fio/02_build.sh index f86dc191b..8ba8d67cc 100755 --- a/src/minimal_overlay/bundles/fio/02_build.sh +++ b/src/minimal_overlay/bundles/fio/02_build.sh @@ -9,26 +9,35 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the fio source directory which ls finds, e.g. 'fio-3.2'. cd $(ls -d fio-*) -echo "Preparing fio work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing 'fio' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for 'fio' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring fio." +echo "Configuring 'fio'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building fio." +echo "Building 'fio'." make -j $NUM_JOBS -echo "Installing fio." +echo "Installing 'fio'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing fio size." +echo "Reducing 'fio' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "fio has been installed." +echo "Bundle 'fio' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libBrokenLocale/bundle.sh b/src/minimal_overlay/bundles/glibc_libBrokenLocale/bundle.sh index 7460ad525..290630fe4 100755 --- a/src/minimal_overlay/bundles/glibc_libBrokenLocale/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libBrokenLocale/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libBrokenLocale.so.1 $DEST_DIR/lib/ ln -s libBrokenLocale.so.1 $DEST_DIR/lib/libBrokenLocale.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libanl/bundle.sh b/src/minimal_overlay/bundles/glibc_libanl/bundle.sh index ab3c28baf..4977a9651 100755 --- a/src/minimal_overlay/bundles/glibc_libanl/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libanl/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libanl.so.1 $DEST_DIR/lib/ ln -s libanl.so.1 $DEST_DIR/lib/libanl.so -echo "Reducing $BUNDLE_NAME size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libcidn/bundle.sh b/src/minimal_overlay/bundles/glibc_libcidn/bundle.sh index ea3ac2f00..f1cdeedec 100755 --- a/src/minimal_overlay/bundles/glibc_libcidn/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libcidn/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libcidn.so.1 $DEST_DIR/lib/ ln -s libcidn.so.1 $DEST_DIR/lib/libcidn.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libcrypt/bundle.sh b/src/minimal_overlay/bundles/glibc_libcrypt/bundle.sh index 6d686b679..bfb331fdf 100755 --- a/src/minimal_overlay/bundles/glibc_libcrypt/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libcrypt/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libcrypt.so.1 $DEST_DIR/lib/ ln -s libcrypt.so.1 $DEST_DIR/lib/libcrypt.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libdl/bundle.sh b/src/minimal_overlay/bundles/glibc_libdl/bundle.sh index 62a6e1906..eaa638fac 100755 --- a/src/minimal_overlay/bundles/glibc_libdl/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libdl/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libdl.so.2 $DEST_DIR/lib/ ln -s libdl.so.2 $DEST_DIR/lib/libdl.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libnsl/bundle.sh b/src/minimal_overlay/bundles/glibc_libnsl/bundle.sh index 17f27f84f..1218b7227 100755 --- a/src/minimal_overlay/bundles/glibc_libnsl/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libnsl/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libnsl.so.1 $DEST_DIR/lib/ ln -s libnsl.so.1 $DEST_DIR/lib/libnsl.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libnss_db/bundle.sh b/src/minimal_overlay/bundles/glibc_libnss_db/bundle.sh index 9fc037760..c3d3e668a 100755 --- a/src/minimal_overlay/bundles/glibc_libnss_db/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libnss_db/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libnss_db.so.2 $DEST_DIR/lib/ ln -s libnss_db.so.2 $DEST_DIR/lib/libnss_db.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libnss_dns/bundle.sh b/src/minimal_overlay/bundles/glibc_libnss_dns/bundle.sh index 0f82f43cb..7d3c57cd1 100755 --- a/src/minimal_overlay/bundles/glibc_libnss_dns/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libnss_dns/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libnss_dns.so.2 $DEST_DIR/lib/ ln -s libnss_dns.so.2 $DEST_DIR/lib/libnss_dns.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libnss_files/bundle.sh b/src/minimal_overlay/bundles/glibc_libnss_files/bundle.sh index 310508cd7..70293ce4c 100755 --- a/src/minimal_overlay/bundles/glibc_libnss_files/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libnss_files/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libnss_files.so.2 $DEST_DIR/lib/ ln -s libnss_files.so.2 $DEST_DIR/lib/libnss_files.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libnss_hesiod/bundle.sh b/src/minimal_overlay/bundles/glibc_libnss_hesiod/bundle.sh index 74fb42b27..2142eb22b 100755 --- a/src/minimal_overlay/bundles/glibc_libnss_hesiod/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libnss_hesiod/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libnss_hesiod.so.2 $DEST_DIR/lib/ ln -s libnss_hesiod.so.2 $DEST_DIR/lib/libnss_hesiod.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libpthread/bundle.sh b/src/minimal_overlay/bundles/glibc_libpthread/bundle.sh index 466e6c30f..7eb3974b9 100755 --- a/src/minimal_overlay/bundles/glibc_libpthread/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libpthread/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libpthread.so.0 $DEST_DIR/lib/ ln -s libpthread.so.0 $DEST_DIR/lib/libpthread.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libresolv/bundle.sh b/src/minimal_overlay/bundles/glibc_libresolv/bundle.sh index 4f482cd41..b3285ffae 100755 --- a/src/minimal_overlay/bundles/glibc_libresolv/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libresolv/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libresolv.so.2 $DEST_DIR/lib/ ln -s libresolv.so.2 $DEST_DIR/lib/libresolv.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_librt/bundle.sh b/src/minimal_overlay/bundles/glibc_librt/bundle.sh index 48dee8533..7711607eb 100755 --- a/src/minimal_overlay/bundles/glibc_librt/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_librt/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/librt.so.1 $DEST_DIR/lib/ ln -s librt.so.1 $DEST_DIR/lib/librt.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libthread_db/bundle.sh b/src/minimal_overlay/bundles/glibc_libthread_db/bundle.sh index edfcd5888..091485002 100755 --- a/src/minimal_overlay/bundles/glibc_libthread_db/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libthread_db/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libthread_db.so.1 $DEST_DIR/lib/ ln -s libthread_db.so.1 $DEST_DIR/lib/libthread_db.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/glibc_libutil/bundle.sh b/src/minimal_overlay/bundles/glibc_libutil/bundle.sh index ba4156d8d..be8baea03 100755 --- a/src/minimal_overlay/bundles/glibc_libutil/bundle.sh +++ b/src/minimal_overlay/bundles/glibc_libutil/bundle.sh @@ -18,11 +18,16 @@ mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libutil.so.1 $DEST_DIR/lib/ ln -s libutil.so.1 $DEST_DIR/lib/libutil.so -echo "Reducing $BUNDLE_NAME size" +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/java/bundle.sh b/src/minimal_overlay/bundles/java/bundle.sh index 28e90a28a..808e543e6 100755 --- a/src/minimal_overlay/bundles/java/bundle.sh +++ b/src/minimal_overlay/bundles/java/bundle.sh @@ -48,7 +48,10 @@ do ln -s ../opt/$BUNDLE_NAME/bin/$FILE ../bin/$FILE done -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS echo "Java has been installed." diff --git a/src/minimal_overlay/bundles/kbd/02_build.sh b/src/minimal_overlay/bundles/kbd/02_build.sh index f9c115287..123148225 100755 --- a/src/minimal_overlay/bundles/kbd/02_build.sh +++ b/src/minimal_overlay/bundles/kbd/02_build.sh @@ -9,33 +9,45 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the kbd source directory which ls finds, e.g. 'kbd-2.04'. cd $(ls -d kbd-*) -echo "Preparing kbd work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi + rm -rf $DEST_DIR -echo "Configuring kbd." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr \ --disable-vlock # vlock requires PAM -echo "Building kbd." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing kbd." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR="$DEST_DIR" -echo "Reducing kbd size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g \ $DEST_DIR/usr/bin/* \ $DEST_DIR/usr/sbin/* \ $DEST_DIR/lib/* +set -e mkdir -p $OVERLAY_ROOTFS/usr -cp -r "$DEST_DIR/usr/bin" \ - "$DEST_DIR/usr/share" \ - "$OVERLAY_ROOTFS/usr/" +mkdir -p $OVERLAY_ROOTFS/etc/autorun -echo "Bundle 'kbd' has been installed." +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination "$DEST_DIR/usr/bin" "$DEST_DIR/usr/share" \ + "$OVERLAY_ROOTFS/usr/" +cp -r --remove-destination "$SRC_DIR/90_kbd.sh" \ + "$OVERLAY_ROOTFS/etc/autorun" + +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/kbd/90_kbd.sh b/src/minimal_overlay/bundles/kbd/90_kbd.sh new file mode 100755 index 000000000..61d518a27 --- /dev/null +++ b/src/minimal_overlay/bundles/kbd/90_kbd.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# This sample command loads German keyboard layout on boot. +# +# loadkeys de + +cat << CEOF + + The default keyboard layout is English (US). You can + change the keyboard layout to German like this: + + loadkeys de + + You can go back to the original US keyboard layout + like this: + + loadkeys us + + Alternatively, change the file '90_kbd.sh' in the + 'kbd' bundle and set the layout you want to use. + +CEOF diff --git a/src/minimal_overlay/bundles/kexec-tools/02_build.sh b/src/minimal_overlay/bundles/kexec-tools/02_build.sh deleted file mode 100755 index 70d49eecf..000000000 --- a/src/minimal_overlay/bundles/kexec-tools/02_build.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -set -e - -. ../../common.sh - -cd $WORK_DIR/overlay/$BUNDLE_NAME - -# Change to the kexec-tools source directory which ls finds, e.g. 'kexec-tools-2.0.15'. -cd $(ls -d kexec-tools-*) - -echo "Preparing kexec-tools work area. This may take a while." -make -j $NUM_JOBS clean -rm -rf $DEST_DIR - -echo "Building kexec-tools." -CFLAGS="$CFLAGS" ./configure \ - --prefix=/usr \ - --without-lzama - -make -j $NUM_JOBS - -make -j $NUM_JOBS install DESTDIR="$DEST_DIR" - -echo "Reducing kexec-tools size." -strip -g $DEST_DIR/usr/bin/* \ - $DEST_DIR/usr/lib/* 2>/dev/null - -mkdir -p $OVERLAY_ROOTFS/usr/ -cp -r $DEST_DIR/usr/* $OVERLAY_ROOTFS/usr/ - -echo "kexec-tools has been installed." - -cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/kexec-tools/01_get.sh b/src/minimal_overlay/bundles/kexec_tools/01_get.sh similarity index 100% rename from src/minimal_overlay/bundles/kexec-tools/01_get.sh rename to src/minimal_overlay/bundles/kexec_tools/01_get.sh diff --git a/src/minimal_overlay/bundles/kexec_tools/02_build.sh b/src/minimal_overlay/bundles/kexec_tools/02_build.sh new file mode 100755 index 000000000..66758edd8 --- /dev/null +++ b/src/minimal_overlay/bundles/kexec_tools/02_build.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +cd $WORK_DIR/overlay/$BUNDLE_NAME + +# Change to the kexec-tools source directory which ls finds, e.g. 'kexec-tools-2.0.15'. +cd $(ls -d kexec-tools-*) + +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi + +rm -rf $DEST_DIR + +echo "Building '$BUNDLE_NAME'." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr \ + --without-lzama + +make -j $NUM_JOBS + +make -j $NUM_JOBS install DESTDIR="$DEST_DIR" + +echo "Reducing '$BUNDLE_NAME' size." +set +e +strip -g $DEST_DIR/usr/bin/* \ + $DEST_DIR/usr/lib/* 2>/dev/null +set -e + +mkdir -p $OVERLAY_ROOTFS/usr/ + +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/usr/* \ + $OVERLAY_ROOTFS/usr/ + +echo "Bundle '$BUNDLE_NAME' has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/kexec-tools/bundle.sh b/src/minimal_overlay/bundles/kexec_tools/bundle.sh similarity index 100% rename from src/minimal_overlay/bundles/kexec-tools/bundle.sh rename to src/minimal_overlay/bundles/kexec_tools/bundle.sh diff --git a/src/minimal_overlay/bundles/libevent/02_build.sh b/src/minimal_overlay/bundles/libevent/02_build.sh index db3111cf5..7475892bc 100755 --- a/src/minimal_overlay/bundles/libevent/02_build.sh +++ b/src/minimal_overlay/bundles/libevent/02_build.sh @@ -9,25 +9,34 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the libevent source directory which ls finds, e.g. 'libevent-2.1.8-stable'. cd $(ls -d libevent-*) -echo "Preparing libevent work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring libevent." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure -echo "Building libevent." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing libevent." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing libevent size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/usr/local/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r $DEST_DIR/usr/local/* \ + $OVERLAY_ROOTFS -echo "libevent has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/links/02_build.sh b/src/minimal_overlay/bundles/links/02_build.sh index 1fc537e31..26d2a1f76 100755 --- a/src/minimal_overlay/bundles/links/02_build.sh +++ b/src/minimal_overlay/bundles/links/02_build.sh @@ -9,12 +9,16 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the Links source directory which ls finds, e.g. 'links-2.12'. cd $(ls -d links-*) -echo "Preparing Links work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing 'Links' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for 'Links' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring Links." +echo "Configuring 'Links'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr \ --disable-graphics \ @@ -24,18 +28,24 @@ CFLAGS="$CFLAGS" ./configure \ --without-zlib \ --without-x -echo "Building Links." +echo "Building 'Links'." make -j $NUM_JOBS -echo "Installing Links." +echo "Installing 'Links'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing Links size." +echo "Reducing 'Links' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e mkdir -p "$OVERLAY_ROOTFS/usr/bin" -cp -r $DEST_DIR/usr/bin/* $OVERLAY_ROOTFS/usr/bin/ -echo "Links has been installed." +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/usr/bin/* \ + $OVERLAY_ROOTFS/usr/bin/ + +echo "Bundle 'Links' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/lua/02_build.sh b/src/minimal_overlay/bundles/lua/02_build.sh index 8ddcef3bb..1da2bbd52 100755 --- a/src/minimal_overlay/bundles/lua/02_build.sh +++ b/src/minimal_overlay/bundles/lua/02_build.sh @@ -11,23 +11,36 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the Lua source directory which ls finds, e.g. 'lua-5.3.4'. cd $(ls -d lua-*) -echo "Preparing Lua work area. This may take a while." +echo "Preparing 'Lua' work area. This may take a while." # we install lua to /usr and not to /usr/local so we need to fix luaconf.h so lua can find modules, etc. sed -i 's/#define LUA_ROOT.*/#define LUA_ROOT \"\/usr\/\"/' src/luaconf.h -make -j $NUM_JOBS clean + +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi + rm -rf $DEST_DIR -echo "Building Lua." +echo "Building 'Lua'." make -j $NUM_JOBS posix CFLAGS="$CFLAGS" make -j $NUM_JOBS install INSTALL_TOP="$DEST_DIR/usr" -echo "Reducing Lua size." +echo "Reducing 'Lua' size." +set +e strip -g $DEST_DIR/usr/bin/* 2>/dev/null +set -e mkdir -p $OVERLAY_ROOTFS/usr/ -cp -r $DEST_DIR/usr/* $OVERLAY_ROOTFS/usr/ -echo "Lua has been installed." +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r $DEST_DIR/usr/* \ + $OVERLAY_ROOTFS/usr/ + +echo "Bundle 'Lua' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/make/02_build.sh b/src/minimal_overlay/bundles/make/02_build.sh index 1c4664d3d..b49716ae4 100755 --- a/src/minimal_overlay/bundles/make/02_build.sh +++ b/src/minimal_overlay/bundles/make/02_build.sh @@ -9,29 +9,38 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the make source directory which ls finds, e.g. 'make-8.28'. cd $(ls -d make-*) -echo "Preparing make work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring make." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building make." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing make." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR mkdir -p $DEST_DIR/lib cp $SYSROOT/lib/libdl.so.2 $DEST_DIR/lib/ -echo "Reducing make size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "make has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/mll_source/bundle.sh b/src/minimal_overlay/bundles/mll_source/bundle.sh index 956a4d88f..442855a22 100755 --- a/src/minimal_overlay/bundles/mll_source/bundle.sh +++ b/src/minimal_overlay/bundles/mll_source/bundle.sh @@ -26,8 +26,11 @@ cd $DEST_DIR/usr/src # empty folders. find * -type f -name '.gitignore' -exec rm {} + -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "$BUNDLE_NAME has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/mll_utils/04_install.sh b/src/minimal_overlay/bundles/mll_utils/04_install.sh index 709b7f400..feb8307fc 100755 --- a/src/minimal_overlay/bundles/mll_utils/04_install.sh +++ b/src/minimal_overlay/bundles/mll_utils/04_install.sh @@ -5,12 +5,15 @@ set -e . ../../common.sh if [ ! -d "$WORK_DIR/overlay/$BUNDLE_NAME" ] ; then - echo "The directory $WORK_DIR/overlay/$BUNDLE_NAME does not exist. Cannot continue." + echo "The directory '$WORK_DIR/overlay/$BUNDLE_NAME' does not exist. Cannot continue." exit 1 fi # Copy all generated files to the source overlay folder. -cp -r $WORK_DIR/overlay/$BUNDLE_NAME/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r $WORK_DIR/overlay/$BUNDLE_NAME/* \ + $OVERLAY_ROOTFS echo "All MLL utilities have been installed." diff --git a/src/minimal_overlay/bundles/nano/02_build.sh b/src/minimal_overlay/bundles/nano/02_build.sh index 05c5915a3..d596f270d 100755 --- a/src/minimal_overlay/bundles/nano/02_build.sh +++ b/src/minimal_overlay/bundles/nano/02_build.sh @@ -9,27 +9,36 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the nano source directory which ls finds, e.g. 'nano-2.8.7'. cd $(ls -d nano-*) -echo "Preparing nano work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring nano." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr \ LDFLAGS=-L$DEST_DIR/usr/include -echo "Building nano." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing nano." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing nano size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "nano has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/nano/bundle_deps b/src/minimal_overlay/bundles/nano/bundle_deps index 6a470ffa9..26ee58d53 100644 --- a/src/minimal_overlay/bundles/nano/bundle_deps +++ b/src/minimal_overlay/bundles/nano/bundle_deps @@ -1 +1,11 @@ +# TODO - 'nano' seems to work fine but it prints the +# following after file has been saved. +# +# nano: /lib/libncurses.so.5: no version information available (required by nano) +# nano: /lib/libncurses.so.5: no version information available (required by nano) +# nano: /lib/libtinfo.so.5: no version information available (required by nano) +# nano: /lib/libtinfo.so.5: no version information available (required by nano) +# +# This needs further investigation. + ncurses diff --git a/src/minimal_overlay/bundles/ncurses/02_build.sh b/src/minimal_overlay/bundles/ncurses/02_build.sh index 084406e9b..fce00ae36 100755 --- a/src/minimal_overlay/bundles/ncurses/02_build.sh +++ b/src/minimal_overlay/bundles/ncurses/02_build.sh @@ -9,8 +9,12 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the ncurses source directory which ls finds, e.g. 'ncurses-6.0'. cd $(ls -d ncurses-*) -echo "Preparing ncurses work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR @@ -18,8 +22,7 @@ rm -rf $DEST_DIR sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in # http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html -# Configure Ncurses -echo "Configuring ncurses." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr \ --with-termlib \ @@ -42,10 +45,10 @@ CFLAGS="$CFLAGS" ./configure \ # CPPFLAGS fixes a bug with Ubuntu 16.04 # https://trac.sagemath.org/ticket/19762 -echo "Building ncurses." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing ncurses." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR # Symnlink wide character libraries @@ -55,11 +58,16 @@ ln -s libncurses.so.5 libncurses.so ln -s libtinfow.so.5 libtinfo.so.5 ln -s libtinfo.so.5 libtinfo.so -echo "Reducing ncurses size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/usr/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/usr/* \ + $OVERLAY_ROOTFS -echo "ncurses has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/nweb/90_nweb.sh b/src/minimal_overlay/bundles/nweb/90_nweb.sh index ac5389dcf..0ac3838d8 100644 --- a/src/minimal_overlay/bundles/nweb/90_nweb.sh +++ b/src/minimal_overlay/bundles/nweb/90_nweb.sh @@ -1,3 +1,9 @@ #!/bin/sh -echo "starting nweb on port 80 serving /srv/www" + +cat << CEOF + + Starting 'nweb' on port 80. Serving '/srv/www'. + +CEOF + nweb 80 /srv/www diff --git a/src/minimal_overlay/bundles/nweb/bundle.sh b/src/minimal_overlay/bundles/nweb/bundle.sh index b9744f44c..8298b8c43 100755 --- a/src/minimal_overlay/bundles/nweb/bundle.sh +++ b/src/minimal_overlay/bundles/nweb/bundle.sh @@ -4,7 +4,7 @@ set -e . ../../common.sh -echo "removing previous work area" +echo "Removing previous work area." rm -rf $WORK_DIR/overlay/$BUNDLE_NAME mkdir -p $WORK_DIR/overlay/$BUNDLE_NAME cd $WORK_DIR/overlay/$BUNDLE_NAME @@ -12,7 +12,7 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # nweb gcc $CFLAGS $SRC_DIR/nweb23.c -o nweb -echo "nweb has been build." +echo "'nweb' has been compiled." install -d -m755 "$OVERLAY_ROOTFS/usr" install -d -m755 "$OVERLAY_ROOTFS/usr/bin" @@ -24,5 +24,5 @@ install -d -m755 "$OVERLAY_ROOTFS/etc" install -d -m755 "$OVERLAY_ROOTFS/etc/autorun" install -m755 "$SRC_DIR/90_nweb.sh" "$OVERLAY_ROOTFS/etc/autorun/90_nweb.sh" -echo "nweb has been installed." +echo "Bundle 'nweb' has been installed." echo "It will be autostarted on boot." diff --git a/src/minimal_overlay/bundles/openjdk/02_install.sh b/src/minimal_overlay/bundles/openjdk/02_install.sh index b25afc3e0..6cc36c5b1 100755 --- a/src/minimal_overlay/bundles/openjdk/02_install.sh +++ b/src/minimal_overlay/bundles/openjdk/02_install.sh @@ -18,7 +18,9 @@ do ln -s ../opt/$BUNDLE_NAME/bin/$FILE $FILE done -cp -r $WORK_DIR/overlay/$BUNDLE_NAME/* \ +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $WORK_DIR/overlay/$BUNDLE_NAME/* \ $OVERLAY_ROOTFS echo "Open JDK has been installed." diff --git a/src/minimal_overlay/bundles/static_get/02_install.sh b/src/minimal_overlay/bundles/static_get/02_install.sh index 12b565b94..3a50df2f0 100755 --- a/src/minimal_overlay/bundles/static_get/02_install.sh +++ b/src/minimal_overlay/bundles/static_get/02_install.sh @@ -4,7 +4,7 @@ set -e . ../../common.sh -echo "Removing old static-get artifacts. This may take a while." +echo "Removing old 'static-get' artifacts. This may take a while." rm -rf $DEST_DIR mkdir -p $DEST_DIR/opt/$BUNDLE_NAME mkdir -p $DEST_DIR/bin @@ -22,9 +22,11 @@ cd $DEST_DIR ln -s ../opt/$BUNDLE_NAME/static-get.sh bin/static-get ln -s ../opt/$BUNDLE_NAME/static-get.sh bin/mll-get -cp -r $DEST_DIR/* \ +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ $OVERLAY_ROOTFS -echo "static-get has been installed." +echo "Bundle 'static-get' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/stress/02_build.sh b/src/minimal_overlay/bundles/stress/02_build.sh index 1ffafa650..8b012384a 100755 --- a/src/minimal_overlay/bundles/stress/02_build.sh +++ b/src/minimal_overlay/bundles/stress/02_build.sh @@ -6,31 +6,38 @@ set -e cd $WORK_DIR/overlay/$BUNDLE_NAME -DESTDIR="$PWD/stress_installed" - # Change to the stress source directory which ls finds, e.g. 'stress-1.0.4'. cd $(ls -d stress-*) -echo "Preparing stress work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring stress." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building stress." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing stress." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing stress size." +echo "Reducing stress '$BUNDLE_NAME'." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "stress has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/util_linux/02_build.sh b/src/minimal_overlay/bundles/util_linux/02_build.sh index 534ed3249..16671229d 100755 --- a/src/minimal_overlay/bundles/util_linux/02_build.sh +++ b/src/minimal_overlay/bundles/util_linux/02_build.sh @@ -6,15 +6,31 @@ set -e cd $WORK_DIR/overlay/$BUNDLE_NAME +if [ ! "$(id -u)" = "0" ] ; then + cat << CEOF + + The build process for bundle '$BUNDLE_NAME' requires root + permissions. Restart the build process as 'root' in order + to build '$BUNDLE_NAME'. + +CEOF + + exit 1 +fi + # Change to the util-linux source directory which ls finds, e.g. 'util-linux-2.31'. cd $(ls -d util-linux-*) -echo "Preparing util-linux work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Configuring util-linux." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ ADJTIME_PATH=/var/lib/hwclock/adjtime \ --docdir=/usr/share/doc/util-linux-2.31 \ @@ -30,17 +46,22 @@ CFLAGS="$CFLAGS" ./configure \ --without-systemd \ --without-systemdsystemunitdir -echo "Building util-linux." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing util-linux." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Reducing util-linux size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "util-linux has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/vim/02_build.sh b/src/minimal_overlay/bundles/vim/02_build.sh index ebf9d71ad..919cb7bff 100755 --- a/src/minimal_overlay/bundles/vim/02_build.sh +++ b/src/minimal_overlay/bundles/vim/02_build.sh @@ -9,27 +9,31 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the vim source directory which ls finds, e.g. 'vim-8.0.1298'. cd $(ls -d vim-*) -echo "Preparing vim work area. This may take a while." -make -j $NUM_JOBS clean +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi rm -rf $DEST_DIR -echo "Setting vimrc location." +echo "Setting 'vimrc' location." echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h -echo "Configuring vim." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=/usr -echo "Building vim." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing vim." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install DESTDIR=$DEST_DIR -echo "Generating vimrc." +echo "Generating '$BUNDLE_NAME'." mkdir -p $DEST_DIR/etc -cat > $DES_TDIR/etc/vimrc << "EOF" +cat > $DEST_DIR/etc/vimrc << "EOF" " Begin /etc/vimrc set nocompatible @@ -41,16 +45,21 @@ set background=dark " End /etc/vimrc EOF -echo "Symlinking vim to vi." +echo "Symlinking 'vim' to 'vi'." ln -sv vim $DEST_DIR/usr/bin/vi mkdir -p $DEST_DIR/bin ln -sv vim $DEST_DIR/bin/vi -echo "Reducing vim size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/usr/bin/* +set -e -cp -r $DEST_DIR/* $OVERLAY_ROOTFS +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS -echo "vim has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/zlib/02_build.sh b/src/minimal_overlay/bundles/zlib/02_build.sh index ef72990fe..0a01f173f 100755 --- a/src/minimal_overlay/bundles/zlib/02_build.sh +++ b/src/minimal_overlay/bundles/zlib/02_build.sh @@ -9,27 +9,29 @@ cd $WORK_DIR/overlay/$BUNDLE_NAME # Change to the Links source directory which ls finds, e.g. 'zlib-1.2.11'. cd $(ls -d zlib-*) -echo "Preparing ZLIB work area. This may take a while." -make -j $NUM_JOBS clean +echo "Preparing '$BUNDLE_NAME' work area. This may take a while." +make -j $NUM_JOBS distclean rm -rf $DEST_DIR -echo "Configuring ZLIB." +echo "Configuring '$BUNDLE_NAME'." CFLAGS="$CFLAGS" ./configure \ --prefix=$DEST_DIR -echo "Building ZLIB." +echo "Building '$BUNDLE_NAME'." make -j $NUM_JOBS -echo "Installing ZLIB." +echo "Installing '$BUNDLE_NAME'." make -j $NUM_JOBS install -echo "Reducing ZLIB size." +echo "Reducing '$BUNDLE_NAME' size." +set +e strip -g $DEST_DIR/lib/* +set -e mkdir -p "$OVERLAY_ROOTFS/lib" cp -r $DEST_DIR/lib/libz.so.1.* $OVERLAY_ROOTFS/lib/libz.so.1 -echo "ZLIB has been installed." +echo "Bundle '$BUNDLE_NAME' has been installed." cd $SRC_DIR