diff options
-rwxr-xr-x | bootstrap | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -97,6 +97,14 @@ if [ "$stage" -lt "1" -o "$stage" -gt "$stage_max" ]; then error "invalid stage number $stage" fi +# Extract version. +# +version="$(sed -n -re 's/^version: ([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p' ./manifest)" +version_id="$(sed -n -re 's/^([0-9]+\.[0-9]+)\.[0-9]+$/\1/p' <<<"$version")" +if [ -z "$version" -o -z "$version_id" ]; then + error "unable to extract version from manifest" +fi + # Btrfs subvolume manipulation. # function subvol_delete () # <path> @@ -244,24 +252,24 @@ chattr +i /etc/localtime # cat <<EOF1 >/etc/os-release NAME="Build OS" -VERSION="0.6.0" +VERSION="$version" ID=buildos ID_LIKE=debian -PRETTY_NAME="Build OS 0.6.0 (Based on Debian)" -VERSION_ID="0.6" +PRETTY_NAME="Build OS $version (Based on Debian)" +VERSION_ID="$version_id" HOME_URL="https://build2.org/" SUPPORT_URL="https://lists.build2.org/" BUG_REPORT_URL="https://lists.build2.org/" EOF1 cat <<EOF1 >/etc/issue -Build OS 0.6.0 (Based on Debian) \n \l +Build OS $version (Based on Debian) \n \l EOF1 cat <<EOF1 >/etc/motd -Welcome to Build OS 0.6.0 (https://build2.org)! +Welcome to Build OS $version (https://build2.org)! EOF1 |