diff --git a/Makefile b/Makefile index 77781f66e4a1fdcb278255c7d318769f2fba2afa..8d52f3483d5603f21e5a465342c169542b2ad17f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -Version=0.9.10 +Version=0.9.11 PREFIX = /usr/local SYSCONFDIR = /etc diff --git a/bin/manjaro-chroot.in b/bin/manjaro-chroot.in index 62ccb20b76ba8bbf84cd22ba139dc3ee34eb66a5..cb842b225c03855def5e1265de3f9c520fa32830 100644 --- a/bin/manjaro-chroot.in +++ b/bin/manjaro-chroot.in @@ -46,10 +46,11 @@ usage() { echo ' -q Query settings and pretend' echo ' -h Print this help message' echo '' - echo "If 'command' is unspecified, ${0##*/} will launch /bin/sh." + echo " If 'command' is unspecified, ${0##*/} will launch /bin/sh." + echo '' + echo " If 'automount' is true, ${0##*/} will launch /bin/bash" + echo " and ${chroots_dir}/manjaro-chroot." echo '' - echo "If 'automount' is true, ${0##*/} will launch /bin/bash" - echo "and ${chroots_dir}/manjaro-chroot." echo '' exit $1 } @@ -62,8 +63,8 @@ while getopts ${opts} arg; do case "${arg}" in a) automount=true ;; q) pretend=true ;; - *) echo "invalid argument ${arg}"; usage 1;; h|?) usage 0 ;; + *) echo "invalid argument ${arg}"; usage 1 ;; esac done shift $(( OPTIND - 1 )) @@ -77,6 +78,16 @@ if ${automount};then ${pretend} && display_settings && exit 1 + if [[ -z $(cat /proc/modules | grep dm_mod) ]];then + vgscan + vgchange -ay + if [[ -d /run/systemd ]]; then + systemctl start lvmetad + else + rc-service lvmetad start + fi + fi + os_list=$(detect) select_os else diff --git a/lib/util-iso-boot.sh b/lib/util-iso-boot.sh index f16df4bb61590f703f15bb5ba2786b7f7419468c..52809dc80aea0fbc04fc71c27fb860f068e7586e 100644 --- a/lib/util-iso-boot.sh +++ b/lib/util-iso-boot.sh @@ -281,9 +281,9 @@ write_isomounts(){ echo '' >> $1 msg2 "Writing livecd entry ..." echo "${arch}/livecd-image.sqfs ${arch} / squashfs" >> $1 - if [[ -f Packages-Xorg ]] ; then - msg2 "Writing pkgs entry ..." - echo "${arch}/pkgs-image.sqfs ${arch} / squashfs" >> $1 + if [[ -f Packages-Mhwd ]] ; then + msg2 "Writing mhwd entry ..." + echo "${arch}/mhwd-image.sqfs ${arch} / squashfs" >> $1 fi if [[ -f "${packages_custom}" ]] ; then msg2 "Writing ${custom} entry ..." diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index eba6e3e04655e98408268bc30d99a7fda07408bc..73b86d23228183252b5ed07570123427ebab96e6 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -116,9 +116,14 @@ write_calamares_users_conf(){ brand_calamares_settings_conf(){ local conf="$1/usr/share/calamares/settings.conf" - local branding="$1/usr/share/calamares/branding/manjaro-${custom}" + local branding="$1/usr/share/calamares/branding/${iso_name}-${custom}" if [[ -d $branding ]];then - sed -i -e "s|branding: manjaro|branding: manjaro-${custom}|g" "$conf" + sed -i -e "s|^.*branding:.*|branding: ${iso_name}-${custom}|" "$conf" + else + local branding="$1/usr/share/calamares/branding/${iso_name}" + if [[ -d $branding ]];then + sed -i -e "s|^.*branding:.*|branding: ${iso_name}|" "$conf" + fi fi } diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 452c3067bbb6ec89a078648f395fa63539385bc6..28ead162d17aa8b38d589a26676e324f94402e11 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -318,7 +318,7 @@ chroot_clean(){ msg "Cleaning up ..." for image in "$1"/*-image; do [[ -d ${image} ]] || continue - if [[ $(basename "${image}") != "pkgs-image" ]];then + if [[ $(basename "${image}") != "mhwd-image" ]];then msg2 "Deleting chroot '$(basename "${image}")'..." lock 9 "${image}.lock" "Locking chroot '${image}'" if [[ "$(stat -f -c %T "${image}")" == btrfs ]]; then @@ -380,7 +380,7 @@ configure_livecd_image(){ } make_repo(){ - repo-add ${work_dir}/pkgs-image/opt/livecd/pkgs/gfx-pkgs.db.tar.gz ${work_dir}/pkgs-image/opt/livecd/pkgs/*pkg*z + repo-add ${work_dir}/mhwd-image/opt/livecd/pkgs/gfx-pkgs.db.tar.gz ${work_dir}/mhwd-image/opt/livecd/pkgs/*pkg*z } # $1: work dir diff --git a/lib/util-iso.sh b/lib/util-iso.sh index a88af47edd0f674364f70b8afb819bf6ea09fcd9..6cc06429a9a2819157e223203c1907263b981850 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -111,7 +111,7 @@ copy_livecd_helpers(){ copy_cache_mhwd(){ msg2 "Copying mhwd package cache ..." - rsync -v --files-from="${work_dir}/pkgs-image/cache-packages.txt" /var/cache/pacman/pkg "${work_dir}/pkgs-image/opt/livecd/pkgs" + rsync -v --files-from="${work_dir}/mhwd-image/cache-packages.txt" /var/cache/pacman/pkg "${work_dir}/mhwd-image/opt/livecd/pkgs" } # $1: image path @@ -195,7 +195,6 @@ make_iso() { run_xorriso - chown -R "${OWNER}:users" "${cache_dir_iso}" msg "Done [Build ISO]" } @@ -246,7 +245,12 @@ make_image_custom() { fi pacman -Qr "${path}" > "${path}/${custom}-image-pkgs.txt" - cp "${path}/${custom}-image-pkgs.txt" ${cache_dir_iso}/${iso_name}-${custom}-${dist_release}-${arch}-pkgs.txt + if [[ ${initsys} == 'openrc' ]];then + local pkgs_file="${iso_name}-${custom}-${initsys}-${dist_release}-${arch}-pkgs.txt" + else + local pkgs_file="${iso_name}-${custom}-${dist_release}-${arch}-pkgs.txt" + fi + cp "${path}/${custom}-image-pkgs.txt" ${cache_dir_iso}/${pkgs_file} [[ -d ${custom}-overlay ]] && copy_overlay_custom configure_custom_image "${path}" ${is_custom_pac_conf} && clean_pacman_conf "${path}" @@ -296,8 +300,8 @@ make_image_livecd() { make_image_mhwd() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - msg "Prepare [pkgs-image]" - local path="${work_dir}/pkgs-image" + msg "Prepare [mhwd-image]" + local path="${work_dir}/mhwd-image" mkdir -p ${path}/opt/livecd/pkgs if [[ -n "${custom}" ]] ; then @@ -331,7 +335,7 @@ make_image_mhwd() { rm -f "${path}/cache-packages.txt" : > ${work_dir}/build.${FUNCNAME} - msg "Done [pkgs-image]" + msg "Done [mhwd-image]" fi } @@ -590,7 +594,11 @@ load_profile(){ done custom=${packages_custom#*-} custom=${custom,,} - iso_file="${iso_name}-${custom}-${dist_release}-${arch}.iso" + if [[ ${initsys} == 'openrc' ]];then + iso_file="${iso_name}-${custom}-${initsys}-${dist_release}-${arch}.iso" + else + iso_file="${iso_name}-${custom}-${dist_release}-${arch}.iso" + fi check_custom_pacman_conf @@ -604,6 +612,7 @@ compress_images(){ local timer=$(get_timer) make_iso make_checksum "${iso_file}" + chown -R "${OWNER}:users" "${cache_dir_iso}" msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer}) minutes" } diff --git a/lib/util-mount.sh b/lib/util-mount.sh index ac27c5c0c1517d53ed88859e02f3afb9e6a9cf17..aab52a48427d0d198543e9739d5d3b260de81ddb 100644 --- a/lib/util-mount.sh +++ b/lib/util-mount.sh @@ -73,10 +73,9 @@ get_root(){ select_os(){ for system in ${os_list[@]};do - case "${system##*:}" in - 'linux') chroot_mount_partitions "${chrootdir}" "${system}" ;; - *) die "Detected: ${system##*:} is not a Linux" ;; - esac + if [[ "${system##*:}" == 'linux' ]];then + chroot_mount_partitions "${chrootdir}" "${system}" + fi done } @@ -105,7 +104,7 @@ chroot_mount_partitions(){ esac done - local chroot_arch=$(get_chroot_arch $1) + local chroot_arch=$(get_chroot_arch $1) [[ ${chroot_arch} == x86-64 ]] && chroot_arch=${chroot_arch/-/_} case ${arch} in i686)