Merge branch 'master' of github.com:manjaro/manjaro-tools into stable-0.14.x

This commit is contained in:
udeved 2017-02-03 17:28:38 +01:00
commit 1ba6257db8
11 changed files with 64 additions and 111 deletions

View file

@ -31,7 +31,6 @@ show_profile(){
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "pxe_boot: %s" "${pxe_boot}"
msg2 "plymouth_boot: %s" "${plymouth_boot}"
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"

View file

@ -28,7 +28,6 @@ show_profile(){
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "pxe_boot: %s" "${pxe_boot}"
msg2 "plymouth_boot: %s" "${plymouth_boot}"
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"

View file

@ -46,9 +46,6 @@
# use geoip
# geoip="true"
# unset defaults to given value
# plymouth_theme=manjaro-elegant
# unset defaults to given values
# names must match systemd service names
# enable_systemd=('bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep')

View file

@ -132,15 +132,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>plymouth_theme=</varname></term>
<listitem><para>Takes the name of the plymouth
theme. It should be the directory of a valid
plymouth theme installed in /usr/share/plymouth/themes/
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>enable_systemd=</varname></term>

View file

@ -9,32 +9,37 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
track_image() {
track_fs() {
info "%s mount: [%s]" "${iso_fs}" "$6"
mount "$@" && IMAGE_ACTIVE_MOUNTS=("$6" "${IMAGE_ACTIVE_MOUNTS[@]}")
mount "$@" && FS_ACTIVE_MOUNTS=("$6" "${FS_ACTIVE_MOUNTS[@]}")
}
# $1: new branch
mount_image(){
IMAGE_ACTIVE_MOUNTS=()
track_image -t aufs -o br="$1":${work_dir}/rootfs=ro none "$1"
mount_fs_root(){
FS_ACTIVE_MOUNTS=()
track_fs -t aufs -o br="$1":${work_dir}/rootfs=ro none "$1"
}
mount_image_custom(){
IMAGE_ACTIVE_MOUNTS=()
track_image -t aufs -o br="$1":${work_dir}/desktopfs=ro:${work_dir}/rootfs=ro none "$1"
mount_fs_desktop(){
FS_ACTIVE_MOUNTS=()
track_fs -t aufs -o br="$1":${work_dir}/desktopfs=ro:${work_dir}/rootfs=ro none "$1"
}
mount_image_live(){
IMAGE_ACTIVE_MOUNTS=()
track_image -t aufs -o br="$1":${work_dir}/livefs=ro:${work_dir}/desktopfs=ro:${work_dir}/rootfs=ro none "$1"
mount_fs_live(){
FS_ACTIVE_MOUNTS=()
track_fs -t aufs -o br="$1":${work_dir}/livefs=ro:${work_dir}/desktopfs=ro:${work_dir}/rootfs=ro none "$1"
}
mount_fs_net(){
FS_ACTIVE_MOUNTS=()
track_fs -t aufs -o br="$1":${work_dir}/livefs=ro:${work_dir}/rootfs=ro none "$1"
}
# $1: image path
umount_image(){
if [[ -n ${IMAGE_ACTIVE_MOUNTS[@]} ]];then
umount "${IMAGE_ACTIVE_MOUNTS[@]}"
unset IMAGE_ACTIVE_MOUNTS
umount_fs(){
if [[ -n ${FS_ACTIVE_MOUNTS[@]} ]];then
umount "${FS_ACTIVE_MOUNTS[@]}"
unset FS_ACTIVE_MOUNTS
find $1 -name '.wh.*' -delete &> /dev/null
fi
}

View file

@ -26,7 +26,7 @@ set_mkinicpio_hooks(){
}
gen_boot_args(){
# local args=(quiet)
local args=(quiet)
local args=()
if ${plymouth_boot};then
args+=(splash)

View file

@ -40,22 +40,6 @@ umount_img() {
fi
}
# has_plymouth(){
# if $(chroot "$1" which plymouth);then
# return 0
# else
# return 1
# fi
# }
configure_plymouth(){
if [[ -f "$1"/usr/bin/plymouth ]];then
msg2 "Configuring plymouth: %s" "${plymouth_theme}"
local conf=$1/etc/plymouth/plymouthd.conf
sed -i -e "s/^.*Theme=.*/Theme=${plymouth_theme}/" "${conf}"
fi
}
add_svc_rc(){
if [[ -f $1/etc/init.d/$2 ]];then
msg2 "Setting %s ..." "$2"
@ -250,7 +234,6 @@ configure_live_image(){
configure_mhwd "$1"
configure_system "$1"
configure_services "$1"
configure_plymouth "$1"
configure_calamares "$1"
[[ ${edition} == "sonar" ]] && configure_thus "$1"
write_live_session_conf "$1"

View file

@ -9,35 +9,41 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
track_image() {
track_fs() {
info "%s mount: [%s]" "${iso_fs}" "$5"
mount "$@" && IMAGE_ACTIVE_MOUNTS=("$5" "${IMAGE_ACTIVE_MOUNTS[@]}")
mount "$@" && FS_ACTIVE_MOUNTS=("$5" "${FS_ACTIVE_MOUNTS[@]}")
}
# $1: new branch
mount_image(){
IMAGE_ACTIVE_MOUNTS=()
mount_fs_root(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
track_image -t overlay overlay -olowerdir="${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
mount_image_custom(){
IMAGE_ACTIVE_MOUNTS=()
mount_fs_desktop(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
track_image -t overlay overlay -olowerdir="${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
mount_image_live(){
IMAGE_ACTIVE_MOUNTS=()
mount_fs_live(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
track_image -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
umount_image(){
if [[ -n ${IMAGE_ACTIVE_MOUNTS[@]} ]];then
info "%s umount: [%s]" "${iso_fs}" "${IMAGE_ACTIVE_MOUNTS[@]}"
umount "${IMAGE_ACTIVE_MOUNTS[@]}"
unset IMAGE_ACTIVE_MOUNTS
mount_fs_net(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
umount_fs(){
if [[ -n ${FS_ACTIVE_MOUNTS[@]} ]];then
info "%s umount: [%s]" "${iso_fs}" "${FS_ACTIVE_MOUNTS[@]}"
umount "${FS_ACTIVE_MOUNTS[@]}"
unset FS_ACTIVE_MOUNTS
rm -rf "${mnt_dir}/work"
fi
}

View file

@ -22,7 +22,7 @@ error_function() {
error "A failure occurred in %s()." "$1"
plain "Aborting..."
fi
umount_image
umount_fs
umount_img
exit 2
}
@ -63,7 +63,7 @@ run_safe() {
trap_exit() {
local sig=$1; shift
error "$@"
umount_image
umount_fs
trap -- "$sig"
kill "-$sig" "$$"
}
@ -256,7 +256,7 @@ make_image_desktop() {
local path="${work_dir}/desktopfs"
mkdir -p ${path}
mount_image "${path}"
mount_fs_root "${path}"
chroot_create "${path}" "${packages}"
@ -266,18 +266,18 @@ make_image_desktop() {
reset_pac_conf "${path}"
umount_image
umount_fs
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [Desktop installation] (desktopfs)"
fi
}
mount_image_select(){
mount_fs_select(){
if [[ -f "${packages_desktop}" ]]; then
mount_image_custom "$1"
mount_fs_desktop "$1"
else
mount_image "$1"
mount_fs_root "$1"
fi
}
@ -287,7 +287,7 @@ make_image_live() {
local path="${work_dir}/livefs"
mkdir -p ${path}
mount_image_select "${path}"
mount_fs_select "${path}"
chroot_create "${path}" "${packages}"
@ -297,7 +297,7 @@ make_image_live() {
reset_pac_conf "${path}"
umount_image
umount_fs
# Clean up GnuPG keys
rm -rf "${path}/etc/pacman.d/gnupg"
@ -313,7 +313,7 @@ make_image_mhwd() {
local path="${work_dir}/mhwdfs"
mkdir -p ${path}${mhwd_repo}
mount_image_select "${path}"
mount_fs_select "${path}"
reset_pac_conf "${path}"
@ -328,7 +328,7 @@ make_image_mhwd() {
make_repo "${path}"
configure_mhwd_drivers "${path}"
umount_image
umount_fs
clean_up_image "${path}"
: > ${work_dir}/build.${FUNCNAME}
msg "Done [drivers repository] (mhwdfs)"
@ -346,7 +346,11 @@ make_image_boot() {
local path="${work_dir}/bootfs"
mkdir -p ${path}
mount_image_live "${path}"
if [[ -f "${packages_desktop}" ]]; then
mount_fs_live "${path}"
else
mount_fs_net "${path}"
fi
# if [[ ${gpg_key} ]]; then
# gpg --export ${gpg_key} >${work_dir}/gpgkey
@ -363,7 +367,7 @@ make_image_boot() {
mv ${path}/boot/initramfs.img ${boot}/${target_arch}/initramfs.img
prepare_boot_extras "${path}" "${boot}"
umount_image
umount_fs
rm -R ${path}
: > ${work_dir}/build.${FUNCNAME}
@ -474,18 +478,6 @@ compress_images(){
show_elapsed_time "${FUNCNAME}" "${timer}"
}
# prepare_boot_loaders(){
# local timer=$(get_timer)
# run_safe "make_image_boot"
# run_safe "make_isolinux"
# run_safe "make_syslinux"
# if [[ "${target_arch}" == "x86_64" ]]; then
# run_safe "make_efi_usb"
# run_safe "make_efi_dvd"
# fi
# show_elapsed_time "${FUNCNAME}" "${timer}"
# }
prepare_images(){
local timer=$(get_timer)
load_pkgs "${profile_dir}/Packages-Root"

View file

@ -166,6 +166,8 @@ write_packages_conf(){
msg2 "Writing %s ..." "${conf##*/}"
echo "---" > "$conf"
echo "backend: pacman" >> "$conf"
echo '' >> "$conf"
echo "update_db: true" >> "$conf"
}
write_welcome_conf(){
@ -240,7 +242,7 @@ get_yaml(){
if ${chrootcfg};then
args+=('chrootcfg')
else
args+=("${profile}/packages")
args+=("packages")
fi
args+=("${initsys}")
[[ ${edition} == 'sonar' ]] && args+=("${edition}")
@ -257,13 +259,6 @@ write_netinstall_conf(){
echo "groupsUrl: ${netgroups}/$(get_yaml)" >> "$conf"
}
write_plymouthcfg_conf(){
local conf="${modules_dir}/plymouthcfg.conf"
msg2 "Writing %s ..." "${conf##*/}"
echo "---" > "$conf"
echo "plymouth_theme: ${plymouth_theme}" >> "$conf"
}
write_locale_conf(){
local conf="${modules_dir}/locale.conf"
msg2 "Writing %s ..." "${conf##*/}"
@ -317,7 +312,6 @@ write_settings_conf(){
echo " - localecfg" >> "$conf"
echo " - luksopenswaphookcfg" >> "$conf"
echo " - luksbootkeyfile" >> "$conf"
echo " - plymouthcfg" >> "$conf" && write_plymouthcfg_conf
echo " - initcpiocfg" >> "$conf"
echo " - initcpio" >> "$conf" && write_initcpio_conf
echo " - users" >> "$conf"

View file

@ -401,7 +401,6 @@ load_profile_config(){
[[ -z ${pxe_boot} ]] && pxe_boot="true"
[[ -z ${plymouth_boot} ]] && plymouth_boot="true"
# [[ ${initsys} == 'openrc' ]] && plymouth_boot="false"
[[ -z ${nonfree_mhwd} ]] && nonfree_mhwd="true"
@ -411,14 +410,12 @@ load_profile_config(){
[[ -z ${username} ]] && username="manjaro"
[[ -z ${plymouth_theme} ]] && plymouth_theme="manjaro-elegant"
[[ -z ${password} ]] && password="manjaro"
[[ -z ${login_shell} ]] && login_shell='/bin/bash'
if [[ -z ${addgroups} ]];then
addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel"
addgroups="video,power,storage,optical,network,lp,scanner,wheel"
fi
if [[ -z ${enable_systemd[@]} ]];then
@ -501,7 +498,6 @@ reset_profile(){
unset netgroups
unset geoip
unset plymouth_boot
unset plymouth_theme
}
check_profile(){
@ -605,13 +601,6 @@ load_pkgs(){
;;
esac
local _plymouth _plymouth_rm
if ${plymouth_boot};then
_plymouth="s|>plymouth||g"
else
_plymouth_rm="s|>plymouth.*||g"
fi
local _edition _edition_rm
case "${edition}" in
'sonar')
@ -649,8 +638,6 @@ load_pkgs(){
| sed "$_kernel" \
| sed "$_edition" \
| sed "$_edition_rm" \
| sed "$_plymouth" \
| sed "$_plymouth_rm" \
| sed "$_clean")
if [[ $1 == "${packages_mhwd}" ]]; then