buildiso: get dist info from lsb-release and os-release

This commit is contained in:
udeved 2017-02-16 00:33:52 +01:00
parent 072374b824
commit c9b4e3c6cb
5 changed files with 36 additions and 65 deletions

View file

@ -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}"

View file

@ -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 <http://www.manjaro.org>"
# iso app id
# iso_app_id="Manjaro Linux Live/Rescue CD"
# possible values: openrc,systemd
# initsys="systemd"

View file

@ -193,27 +193,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
<!-- TODO: We should tell where exactly this is used -->
<term><varname>dist_name=</varname></term>
<listitem><para>Name of the distribution.
</para></listitem>
</varlistentry>
<varlistentry>
<!-- TODO: We should tell where exactly this is used -->
<term><varname>dist_release=</varname></term>
<listitem><para>Release of the distribution.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>dist_codename=</varname></term>
<listitem><para>Codename of this release. It's the value
of DISTRIB_CODENAME in /etc/lsb-release.
<listitem><para>Release version of the distribution.
</para></listitem>
</varlistentry>
@ -225,22 +207,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</para></listitem>
</varlistentry>
<varlistentry>
<!-- TODO: We should tell where exactly this is used -->
<term><varname>iso_publisher=</varname></term>
<listitem><para>Publisher of the iso.
</para></listitem>
</varlistentry>
<varlistentry>
<!-- TODO: We should tell where exactly this is used -->
<term><varname>iso_app_id=</varname></term>
<listitem><para>Application ID of the iso.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>gpgkey=</varname></term>

View file

@ -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 \

View file

@ -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 <http://www.manjaro.org>'
[[ -z ${iso_app_id} ]] && iso_app_id='Manjaro Linux Live/Rescue CD'
[[ -z ${initsys} ]] && initsys="systemd"
[[ -z ${kernel} ]] && kernel="linux49"