diff --git a/Makefile b/Makefile index 4de043b..e5c448e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -Version=0.9.13 +Version=0.9.15 PREFIX = /usr/local SYSCONFDIR = /etc @@ -47,6 +47,7 @@ SHARED = \ SHARED_PKG = \ conf/makepkg-i686.conf \ + conf/base-devel-udev \ conf/makepkg-x86_64.conf SHARED_ISO = \ diff --git a/README.md b/README.md index ae76d40..a37159f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ manjaro-tools ============= -Manjaro-tools-0.9.10 +Manjaro-tools-0.9.14 User manual @@ -44,7 +44,7 @@ Specifying args will override manjaro-tools.conf settings. # default arch: auto detect # arch=$(uname -m) -# cache dir where buildpkg or buildiso cache packages +# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files # cache_dir=/var/cache/manjaro-tools # build dir where buildpkg or buildiso chroots are created @@ -71,14 +71,6 @@ Specifying args will override manjaro-tools.conf settings. # default pkg buildset; name without .set extension # buildset_pkg=default -# Next settings are only useful if you compile packages against eudev - -# default packages to trigger blacklist -# blacklist_trigger=('eudev' 'upower-pm-utils' 'eudev-systemdcompat') - -# default blacklisted packages to remove from chroot -# blacklist=('libsystemd') - ################ buildiso ################ # default iso buildset; name without .set extension @@ -141,6 +133,7 @@ Usage: buildpkg [options] [--] [makepkg args] -w Clean up cache and sources -n Install and run namcap check -s Sign packages + -u udev base-devel group (no systemd) -q Query settings and pretend build -h This help ~~~ @@ -175,6 +168,9 @@ The arch can also be set in manjaro-tools.conf, but under normal conditions, it ######* -n * Installs the built package in the chroot and runs a namcap check +######* -u +* Create udev build root (for eudev builds) + ###3. buildiso buildiso is used to build manjaro-iso-profiles. It is run insde the profiles folder. diff --git a/bin/buildpkg.in b/bin/buildpkg.in index 75f6c3a..fb40547 100644 --- a/bin/buildpkg.in +++ b/bin/buildpkg.in @@ -67,7 +67,9 @@ display_settings(){ msg2 "wipe_clean: ${wipe_clean}" msg2 "namcap: ${namcap}" msg2 "sign: ${sign}" - msg2 "makepkg_args: ${makepkg_args[*]}" + msg2 "udev_root: ${udev_root}" + msg2 "mkchroot_args: ${mkchroot_args[*]}" + msg2 "makepkg_args: ${makepkg_args[*]}" msg "PATHS:" msg2 "work_dir: ${work_dir}" @@ -75,10 +77,6 @@ display_settings(){ msg2 "cache_dir_pkg: ${cache_dir_pkg}" msg2 "build_mirror: ${build_mirror}/${branch}" - msg "BLACKLIST:" - msg2 "blacklist_trigger: ${blacklist_trigger[*]}" - msg2 "blacklist: ${blacklist[*]}" - if ${clean_first};then msg "PKG:" msg2 "base_packages: ${base_packages[*]}" @@ -96,8 +94,6 @@ load_config "${SYSCONFDIR}/manjaro-tools.conf" load_vars "$USER_HOME/.makepkg.conf" load_vars /etc/makepkg.conf -pacman_conf_arch='default' -base_packages=('base-devel') install_pkgs=() clean_first=false @@ -106,6 +102,7 @@ namcap=false pretend=false is_buildset=false sign=false +udev_root=false usage() { echo "Usage: ${0##*/} [options] [--] [makepkg args]" @@ -119,6 +116,7 @@ usage() { echo ' -w Clean up cache and sources' echo ' -n Install and run namcap check' echo ' -s Sign packages' + echo ' -u Udev base-devel group (no systemd)' echo ' -q Query settings and pretend build' echo ' -h This help' echo '' @@ -128,7 +126,7 @@ usage() { orig_argv=("$@") -opts='p:a:b:r:i:cwnsqh' +opts='p:a:b:r:i:cwnsuqh' while getopts "${opts}" arg; do case "${arg}" in @@ -141,6 +139,7 @@ while getopts "${opts}" arg; do w) wipe_clean=true ;; n) namcap=true; mkchrootpkg_args+=(-n) ;; s) sign=true ;; + u) udev_root=true ;; q) pretend=true ;; h|?) usage 0 ;; *) echo "invalid argument '${arg}'"; usage 1 ;; @@ -148,24 +147,23 @@ while getopts "${opts}" arg; do done if [[ "${arch}" == 'multilib' ]]; then - pacman_conf_arch='multilib' - base_packages+=('multilib-devel') - work_dir=${chroots_pkg}/${branch}/${arch} - cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} - arch='x86_64' - is_multilib=true + pacman_conf_arch=${arch} + work_dir=${chroots_pkg}/${branch}/${arch} + cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} + arch='x86_64' + is_multilib=true else - work_dir=${chroots_pkg}/${branch}/${arch} - cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} - is_multilib=false + pacman_conf_arch='default' + work_dir=${chroots_pkg}/${branch}/${arch} + cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} + is_multilib=false fi pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf" makepkg_conf="${PKGDATADIR}/makepkg-${arch}.conf" mirrors_conf="${PKGDATADIR}/pacman-mirrors-${branch}.conf" -chroot_run_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}") -mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}" -L) +mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}") mkchrootpkg_args+=(-r ${work_dir}) @@ -181,6 +179,8 @@ eval_buildset "${buildset_pkg}" "${sets_dir_pkg}" check_requirements +init_base_devel + ${pretend} && display_settings && exit ${wipe_clean} && clean_up diff --git a/conf/base-devel_nosystemd b/conf/base-devel-udev similarity index 72% rename from conf/base-devel_nosystemd rename to conf/base-devel-udev index 0463220..38eb565 100644 --- a/conf/base-devel_nosystemd +++ b/conf/base-devel-udev @@ -24,4 +24,6 @@ sudo texinfo util-linux which -lib32-flex +>multilib gcc-multilib +>multilib lib32-fakeroot +>multilib lib32-libltdl diff --git a/conf/base_nosystemd b/conf/base_nosystemd deleted file mode 100644 index 110e94c..0000000 --- a/conf/base_nosystemd +++ /dev/null @@ -1,56 +0,0 @@ -bash -bzip2 -coreutils -cryptsetup -device-mapper -dhcpcd -diffutils -eudev-systemdcompat -e2fsprogs -file -filesystem -findutils -gawk -gcc-libs -gettext -glibc -grep -gzip -inetutils -iproute2 -iputils -jfsutils -less -licenses -logrotate -lvm2 -man-db -man-pages -manjaro-hotfixes -manjaro-system -mdadm -mhwd -mhwd-db -nano -openrc-core -pacman -pciutils -pcmciautils -perl -procps-ng -psmisc -reiserfsprogs -s-nail -sed -shadow -sysfsutils -tar -texinfo -usbutils -util-linux -vi -which -xfsprogs -tcp_wrappers -lib32-tcp_wrappers - diff --git a/conf/makepkg-i686.conf b/conf/makepkg-i686.conf index 76809f2..055cf3d 100644 --- a/conf/makepkg-i686.conf +++ b/conf/makepkg-i686.conf @@ -38,8 +38,8 @@ CHOST="i686-pc-linux-gnu" # -march (or -mcpu) builds exclusively for an architecture # -mtune optimizes for an architecture, but builds for whole processor family CPPFLAGS="-D_FORTIFY_SOURCE=2" -CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fstack-check" -CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fstack-check" +CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong" +CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" #-- Make Flags: change this for DistCC/SMP systems #MAKEFLAGS="-j2" @@ -61,7 +61,7 @@ DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" #-- check: Run the check() function if present in the PKGBUILD #-- sign: Generate PGP signature file # -BUILDENV=(fakeroot !distcc color !ccache check !sign) +BUILDENV=(!distcc color !ccache check !sign) # #-- If using DistCC, your MAKEFLAGS will also need modification. In addition, #-- specify a space-delimited list of hosts running in the DistCC cluster. diff --git a/conf/makepkg-x86_64.conf b/conf/makepkg-x86_64.conf index 3750d33..a9af94e 100644 --- a/conf/makepkg-x86_64.conf +++ b/conf/makepkg-x86_64.conf @@ -19,7 +19,7 @@ DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o % # /usr/bin/lftpget -c # /usr/bin/wget -#-- The the package required by makepkg to download VCS sources +#-- The package required by makepkg to download VCS sources # Format: 'protocol::package' VCSCLIENTS=('bzr::bzr' 'git::git' @@ -37,8 +37,8 @@ CHOST="x86_64-unknown-linux-gnu" # -march (or -mcpu) builds exclusively for an architecture # -mtune optimizes for an architecture, but builds for whole processor family CPPFLAGS="-D_FORTIFY_SOURCE=2" -CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fstack-check" -CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fstack-check" +CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong" +CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" #-- Make Flags: change this for DistCC/SMP systems #MAKEFLAGS="-j2" @@ -60,7 +60,7 @@ DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" #-- check: Run the check() function if present in the PKGBUILD #-- sign: Generate PGP signature file # -BUILDENV=(fakeroot !distcc color !ccache check !sign) +BUILDENV=(!distcc color !ccache check !sign) # #-- If using DistCC, your MAKEFLAGS will also need modification. In addition, #-- specify a space-delimited list of hosts running in the DistCC cluster. diff --git a/conf/manjaro-tools.conf b/conf/manjaro-tools.conf index 6d2b3c5..a0ff378 100644 --- a/conf/manjaro-tools.conf +++ b/conf/manjaro-tools.conf @@ -8,7 +8,7 @@ # default arch: auto detect # arch=$(uname -m) -# cache dir where buildpkg or buildiso cache packages +# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files # cache_dir=/var/cache/manjaro-tools # build dir where buildpkg or buildiso chroots are created @@ -35,14 +35,6 @@ # default pkg buildset; name without .set extension # buildset_pkg=default -# Next settings are only useful if you compile packages against eudev - -# default packages to trigger blacklist -# blacklist_trigger=('eudev' 'upower-pm-utils' 'eudev-systemdcompat') - -# default blacklisted packages to remove from chroot -# blacklist=('libsystemd') - ################ buildiso ################ # default iso buildset; name without .set extension diff --git a/lib/util-iso-boot.sh b/lib/util-iso-boot.sh index 3975d8d..9988f1a 100644 --- a/lib/util-iso-boot.sh +++ b/lib/util-iso-boot.sh @@ -199,7 +199,7 @@ write_isolinux_cfg(){ if [[ ${initsys} == 'systemd' ]]; then plymouth_settings="" else - plymouth_settings="quiet" + plymouth_settings=" quiet" fi fi if [[ -f ${path_iso}/${iso_name}/boot/intel_ucode.img ]] ; then diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index b426e4a..4aad721 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -184,9 +184,9 @@ detect_desktop_env(){ default_desktop_executable="pantheon-session" default_desktop_file="pantheon" msg2 "Detected Pantheon desktop environment" - elif [ -e "$1/usr/bin/budgie-session" ] && [ -e "$1/usr/share/xsessions/budgie-session.desktop" ]; then + elif [ -e "$1/usr/bin/budgie-session" ] && [ -e "$1/usr/share/xsessions/budgie-desktop.desktop" ]; then default_desktop_executable="budgie-session" - default_desktop_file="budgie-session" + default_desktop_file="budgie-desktop" msg2 "Detected Budgie desktop environment" elif [ -e "$1/usr/bin/i3" ] && [ -e "$1/usr/share/xsessions/i3.desktop" ]; then default_desktop_executable="i3" @@ -200,6 +200,10 @@ detect_desktop_env(){ default_desktop_executable="startfluxbox" default_desktop_file="fluxbox" msg2 "Detected Fluxbox desktop environment" + elif [ -e "$1/usr/bin/dde-desktop" ] && [ -e "$1/usr/share/xsessions/deepin.desktop" ]; then + default_desktop_executable="dde-desktop" + default_desktop_file="deepin" + msg2 "Detected Deepin desktop environment" else default_desktop_executable="none" default_desktop_file="none" diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 84e62f6..e826fa3 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -13,11 +13,13 @@ import ${LIBDIR}/util-iso-image.sh import ${LIBDIR}/util-iso-boot.sh import ${LIBDIR}/util-iso-calamares.sh -if ${use_overlayfs};then - import ${LIBDIR}/util-iso-overlayfs.sh -else - import ${LIBDIR}/util-iso-aufs.sh -fi +import_util_iso_fs(){ + if ${use_overlayfs};then + import ${LIBDIR}/util-iso-overlayfs.sh + else + import ${LIBDIR}/util-iso-aufs.sh + fi +} # $1: path # $2: exit code @@ -139,7 +141,8 @@ squash_image_dir() { local highcomp="-b 256K -Xbcj x86" [[ "${iso_compression}" != "xz" ]] && highcomp="" msg2 "Creating SquashFS image. This may take some time..." - if [[ "$(basename "$1")" == "mhwd-image" ]]; then + local used_kernel=$(echo ${kernel} | cut -c 6) + if [[ "$(basename "$1")" == "mhwd-image" && ${used_kernel} -ge "4" ]]; then mksquashfs "${1}" "${sq_img}" -noappend -comp lz4 || die "Exit ..." else mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..." @@ -650,6 +653,7 @@ make_profile(){ msg "Start building [$1]" cd $1 load_profile "$1" + import_util_iso_fs ${clean_first} && chroot_clean "${work_dir}" if ${iso_only}; then [[ ! -d ${work_dir} ]] && die "Create images: buildiso -p ${buildset_iso} -i" diff --git a/lib/util-pkg.sh b/lib/util-pkg.sh index 14f93c8..2083ee2 100644 --- a/lib/util-pkg.sh +++ b/lib/util-pkg.sh @@ -25,13 +25,49 @@ check_requirements(){ fi } +load_group(){ + local _multi \ + _space="s| ||g" \ + _clean=':a;N;$!ba;s/\n/ /g' \ + _com_rm="s|#.*||g" \ + devel_packages='' \ + file=${PKGDATADIR}/base-devel-udev + + msg3 "Loading Group [$file] ..." + + if ${is_multilib}; then + _multi="s|>multilib||g" + else + _multi="s|>multilib.*||g" + fi + + devel_packages=$(sed "$_com_rm" "$file" \ + | sed "$_space" \ + | sed "$_multi" \ + | sed "$_clean") + + echo ${devel_packages} +} + +init_base_devel(){ + if ${udev_root};then + base_packages=( "$(load_group)" ) + else + if ${is_multilib};then + base_packages=('base-devel' 'multilib-devel') + else + base_packages=('base-devel') + fi + fi +} + chroot_create(){ msg "Creating chroot for [${branch}] (${arch})..." mkdir -p "${work_dir}" - setarch "${arch}" mkchroot \ - ${mkchroot_args[*]} \ - "${work_dir}/root" \ - ${base_packages[*]} || abort + setarch "${arch}" \ + mkchroot ${mkchroot_args[*]} \ + "${work_dir}/root" \ + ${base_packages[*]} || abort } chroot_clean(){ @@ -54,7 +90,7 @@ chroot_clean(){ chroot_update(){ msg "Updating chroot for [${branch}] (${arch})..." - chroot-run ${chroot_run_args[*]} \ + chroot-run ${mkchroot_args[*]} \ "${work_dir}/${OWNER}" \ pacman -Syu --noconfirm || abort @@ -70,13 +106,6 @@ clean_up(){ fi } -blacklist_pkg(){ - msg "Removing ${blacklist[@]}..." - for item in "${blacklist[@]}"; do - chroot-run $1/root pacman -Rdd "$item" --noconfirm - done -} - prepare_cachedir(){ prepare_dir "${cache_dir_pkg}" chown -R "${OWNER}:users" "${cache_dir_pkg}" @@ -126,9 +155,6 @@ run_post_build(){ make_pkg(){ msg "Start building [$1]" cd $1 - for p in ${blacklist_trigger[@]}; do - [[ $1 == $p ]] && blacklist_pkg "${work_dir}" - done setarch "${arch}" \ mkchrootpkg ${mkchrootpkg_args[*]} -- ${makepkg_args[*]} || eval "$2" run_post_build diff --git a/lib/util.sh b/lib/util.sh index 92c5b56..aed77e3 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -337,10 +337,6 @@ init_buildpkg(){ prepare_dir "${sets_dir_pkg}" [[ -z ${buildset_pkg} ]] && buildset_pkg='default' - - [[ -z ${blacklist_trigger[@]} ]] && blacklist_trigger=('eudev' 'upower-pm-utils' 'eudev-systemdcompat') - - [[ -z ${blacklist[@]} ]] && blacklist=('libsystemd') } init_buildiso(){ @@ -465,7 +461,7 @@ load_profile_config(){ fi if [[ -z ${start_openrc[@]} ]];then - start_openrc=('acpid' 'bluetooth' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') + start_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') fi if [[ -z ${disable_openrc[@]} ]];then