From c9b4e3c6cbdb09d7317d19ceebafaa3b3b73485c Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 16 Feb 2017 00:33:52 +0100 Subject: [PATCH] buildiso: get dist info from lsb-release and os-release --- bin/buildiso.in | 2 -- data/manjaro-tools.conf | 12 --------- docbook/manjaro-tools.conf.xml | 36 +-------------------------- lib/util-iso.sh | 6 ++++- lib/util.sh | 45 ++++++++++++++++++++++------------ 5 files changed, 36 insertions(+), 65 deletions(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 63767ba..52f69c6 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -97,8 +97,6 @@ display_settings(){ msg "ISO SETTINGS:" msg2 "iso_label: %s" "${iso_label}" - msg2 "iso_publisher: %s" "${iso_publisher}" - msg2 "iso_app_id: %s" "${iso_app_id}" msg2 "use_overlayfs: %s" "${use_overlayfs}" ${verbose} && msg2 "iso_fs: %s" "${iso_fs}" diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index 3a75b25..bcd33c6 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -43,24 +43,12 @@ # default iso build list; name without .list extension # build_list_iso=default -# the dist name; default: Manjaro -# dist_name="Manjaro" - # the dist release; default: auto # dist_release=17.0 -# the codename; defaults to value sourced from /etc/lsb-release -# dist_codename="Gellivara" - # the branding; default: auto # dist_branding="MJRO" -# iso publisher -# iso_publisher="Manjaro Linux " - -# iso app id -# iso_app_id="Manjaro Linux Live/Rescue CD" - # possible values: openrc,systemd # initsys="systemd" diff --git a/docbook/manjaro-tools.conf.xml b/docbook/manjaro-tools.conf.xml index e1cd994..b9defe8 100644 --- a/docbook/manjaro-tools.conf.xml +++ b/docbook/manjaro-tools.conf.xml @@ -193,27 +193,9 @@ along with systemd; If not, see . - - dist_name= - - Name of the distribution. - - - - - - dist_release= - Release of the distribution. - - - - - dist_codename= - - Codename of this release. It's the value - of DISTRIB_CODENAME in /etc/lsb-release. + Release version of the distribution. @@ -225,22 +207,6 @@ along with systemd; If not, see . - - - iso_publisher= - - Publisher of the iso. - - - - - - iso_app_id= - - Application ID of the iso. - - - gpgkey= diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 30b0c3a..072ac6a 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -161,7 +161,7 @@ make_sfs() { assemble_iso(){ msg "Creating ISO image..." - local efi_boot_args=() + local efi_boot_args=() iso_publisher iso_app_id if [[ -f "${iso_root}/EFI/miso/efiboot.img" ]]; then msg2 "Setting efi args. El Torito detected." efi_boot_args=("-eltorito-alt-boot" @@ -170,6 +170,10 @@ assemble_iso(){ "-no-emul-boot") fi + iso_publisher="$(get_osname) <$(get_disturl)>" + + iso_app_id="$(get_osname) Live/Rescue CD" + xorriso -as mkisofs \ -iso-level 3 -rock -joliet \ -max-iso9660-filenames -omit-period \ diff --git a/lib/util.sh b/lib/util.sh index 9fc69d7..515585c 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -186,12 +186,6 @@ prepare_dir(){ [[ ! -d $1 ]] && mkdir -p $1 } -version_gen(){ - local y=$(date +%Y) m=$(date +%m) ver - ver=${y:2}.$m - echo $ver -} - # $1: chroot get_branch(){ echo $(cat "$1/etc/pacman-mirrors.conf" | grep '^Branch = ' | sed 's/Branch = \s*//g') @@ -260,6 +254,31 @@ get_codename(){ echo "${DISTRIB_CODENAME}" } +get_release(){ + source /etc/lsb-release + echo "${DISTRIB_RELEASE}" +} + +get_distname(){ + source /etc/lsb-release + echo "${DISTRIB_ID%Linux}" +} + +get_disturl(){ + source /etc/os-release + echo "${HOME_URL}" +} + +get_osname(){ + source /etc/os-release + echo "${NAME}" +} + +get_osid(){ + source /etc/os-release + echo "${ID}" +} + init_buildiso(){ chroots_iso="${chroots_dir}/buildiso" @@ -273,22 +292,18 @@ init_buildiso(){ ##### iso settings ##### - [[ -z ${dist_release} ]] && dist_release=$(version_gen) + [[ -z ${dist_release} ]] && dist_release=$(get_release) - [[ -z ${dist_codename} ]] && dist_codename=$(get_codename) + dist_codename=$(get_codename) + + dist_name=$(get_distname) [[ -z ${dist_branding} ]] && dist_branding="MJRO" - [[ -z ${dist_name} ]] && dist_name="Manjaro" - - iso_name=${dist_name,,} + iso_name=$(get_osid) iso_label=$(get_iso_label "${dist_branding}${dist_release//.}") - [[ -z ${iso_publisher} ]] && iso_publisher='Manjaro Linux ' - - [[ -z ${iso_app_id} ]] && iso_app_id='Manjaro Linux Live/Rescue CD' - [[ -z ${initsys} ]] && initsys="systemd" [[ -z ${kernel} ]] && kernel="linux49"