#!/usr/bin/bash # # This is a build script file for OS image generation using mkosi (https://github.com/systemd/mkosi). # It is invoked in a build environment, with the following set well-known variables: # # $SRCDIR # $DESTDIR # $BUILDDIR # # create_libublk() { local src=$1 local rs_dir=$2 shift 2 local para=$@ cp -fr $src $rs_dir cd $rs_dir cargo test $para -v --no-run cargo run --example loop -- help cargo run --example null -- help cd - TA=`find $rs_dir/target/debug/deps/ -type f -executable -name "libublk*"` TB=`find $rs_dir/target/debug/deps/ -type f -executable -name "basic*"` ln $TA $rs_dir/target/debug/test-libublk ln $TB $rs_dir/target/debug/test-basic ls -l $rs_dir/ci/ } set -eo pipefail mkdir -p $DESTDIR/root/ echo "systemctl restart systemd-networkd" >> $DESTDIR/root/.bash_profile chmod +x $DESTDIR/root/.bash_profile # Copy tests into the dest mkdir -p $DESTDIR/usr/share create_libublk $SRCDIR $DESTDIR/usr/share/libublk-rs create_libublk $SRCDIR $DESTDIR/usr/share/libublk-rs2 --features=fat_complete