mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 05:06:39 +00:00
set some internal OS variables from environment
This commit is contained in:
parent
4a38dd2fff
commit
7bf81fe291
@ -81,6 +81,26 @@ mount -o loop $loop_dev $ROOT
|
|||||||
msg "copying root filesystem contents"
|
msg "copying root filesystem contents"
|
||||||
tar -xpsf $ROOT_SRC -C $ROOT
|
tar -xpsf $ROOT_SRC -C $ROOT
|
||||||
|
|
||||||
|
# set internal OS name, prefix and version according to env variables
|
||||||
|
if [ -f $ROOT/etc/version ]; then
|
||||||
|
if [ -n "$THINGOS_NAME" ]; then
|
||||||
|
msg "setting OS name to $THINGOS_NAME"
|
||||||
|
sed -ri "s/os_name=\".*\"/os_name=\"$THINGOS_NAME\"/" $ROOT/etc/version
|
||||||
|
fi
|
||||||
|
if [ -n "$THINGOS_SHORT_NAME" ]; then
|
||||||
|
msg "setting OS short name to $THINGOS_SHORT_NAME"
|
||||||
|
sed -ri "s/os_short_name=\".*\"/os_short_name=\"$THINGOS_SHORT_NAME\"/" $ROOT/etc/version
|
||||||
|
fi
|
||||||
|
if [ -n "$THINGOS_PREFIX" ]; then
|
||||||
|
msg "setting OS prefix to $THINGOS_PREFIX"
|
||||||
|
sed -ri "s/os_prefix=\".*\"/os_prefix=\"$THINGOS_PREFIX\"/" $ROOT/etc/version
|
||||||
|
fi
|
||||||
|
if [ -n "$THINGOS_VERSION" ]; then
|
||||||
|
msg "setting OS version to $THINGOS_VERSION"
|
||||||
|
sed -ri "s/os_version=\".*\"/os_version=\"$THINGOS_VERSION\"/" $ROOT/etc/version
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
msg "unmounting root filesystem"
|
msg "unmounting root filesystem"
|
||||||
umount $ROOT
|
umount $ROOT
|
||||||
|
|
||||||
|
14
build.sh
14
build.sh
@ -22,19 +22,14 @@ gzip=$(which pigz || which gzip)
|
|||||||
test -f $basedir/.build-env && source $basedir/.build-env
|
test -f $basedir/.build-env && source $basedir/.build-env
|
||||||
|
|
||||||
# OS name
|
# OS name
|
||||||
|
if [ -n "$THINGOS_SHORT_NAME" ]; then
|
||||||
if [ -n "$THINGOS_NAME" ]; then
|
osname=$THINGOS_SHORT_NAME
|
||||||
osname=$THINGOS_NAME
|
|
||||||
else
|
else
|
||||||
osname=$(source $basedir/board/common/overlay/etc/version && echo $os_short_name)
|
osname=$(source $basedir/board/common/overlay/etc/version && echo $os_short_name)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# OS version
|
# OS version
|
||||||
if [ -n "$THINGOS_VERSION" ]; then
|
if [ -n "$THINGOS_VERSION" ]; then
|
||||||
# set internal OS version from env variable
|
|
||||||
if [ -f $outputdir/target/etc/version ]; then
|
|
||||||
sed -r -i "s/os_version=\".*\"/os_version=\"$THINGOS_VERSION\"/" $outputdir/target/etc/version
|
|
||||||
fi
|
|
||||||
osversion=$THINGOS_VERSION
|
osversion=$THINGOS_VERSION
|
||||||
else
|
else
|
||||||
osversion=$(source $basedir/board/common/overlay/etc/version && echo $os_version)
|
osversion=$(source $basedir/board/common/overlay/etc/version && echo $os_version)
|
||||||
@ -113,8 +108,11 @@ elif [ "$target" == "clean-target" ]; then
|
|||||||
|
|
||||||
echo "target is clean"
|
echo "target is clean"
|
||||||
|
|
||||||
|
elif [ "$target" == "all" ]; then
|
||||||
|
make O=$outputdir all
|
||||||
|
|
||||||
elif [ -n "$target" ]; then
|
elif [ -n "$target" ]; then
|
||||||
make O=$outputdir $target
|
$0 $b all
|
||||||
|
|
||||||
else
|
else
|
||||||
make O=$outputdir all
|
make O=$outputdir all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user