Merge branch 'devel' of github.com:manjaro/manjaro-tools into devel

This commit is contained in:
udeved 2015-11-07 15:04:47 +01:00
commit 4db901c1fe
13 changed files with 97 additions and 132 deletions

View file

@ -1,4 +1,4 @@
Version=0.9.13 Version=0.9.15
PREFIX = /usr/local PREFIX = /usr/local
SYSCONFDIR = /etc SYSCONFDIR = /etc
@ -47,6 +47,7 @@ SHARED = \
SHARED_PKG = \ SHARED_PKG = \
conf/makepkg-i686.conf \ conf/makepkg-i686.conf \
conf/base-devel-udev \
conf/makepkg-x86_64.conf conf/makepkg-x86_64.conf
SHARED_ISO = \ SHARED_ISO = \

View file

@ -1,7 +1,7 @@
manjaro-tools manjaro-tools
============= =============
Manjaro-tools-0.9.10 Manjaro-tools-0.9.14
User manual User manual
@ -44,7 +44,7 @@ Specifying args will override manjaro-tools.conf settings.
# default arch: auto detect # default arch: auto detect
# arch=$(uname -m) # 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 # cache_dir=/var/cache/manjaro-tools
# build dir where buildpkg or buildiso chroots are created # 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 # default pkg buildset; name without .set extension
# buildset_pkg=default # 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 ################ ################ buildiso ################
# default iso buildset; name without .set extension # default iso buildset; name without .set extension
@ -141,6 +133,7 @@ Usage: buildpkg [options] [--] [makepkg args]
-w Clean up cache and sources -w Clean up cache and sources
-n Install and run namcap check -n Install and run namcap check
-s Sign packages -s Sign packages
-u udev base-devel group (no systemd)
-q Query settings and pretend build -q Query settings and pretend build
-h This help -h This help
~~~ ~~~
@ -175,6 +168,9 @@ The arch can also be set in manjaro-tools.conf, but under normal conditions, it
######* -n ######* -n
* Installs the built package in the chroot and runs a namcap check * Installs the built package in the chroot and runs a namcap check
######* -u
* Create udev build root (for eudev builds)
###3. buildiso ###3. buildiso
buildiso is used to build manjaro-iso-profiles. It is run insde the profiles folder. buildiso is used to build manjaro-iso-profiles. It is run insde the profiles folder.

View file

@ -67,7 +67,9 @@ display_settings(){
msg2 "wipe_clean: ${wipe_clean}" msg2 "wipe_clean: ${wipe_clean}"
msg2 "namcap: ${namcap}" msg2 "namcap: ${namcap}"
msg2 "sign: ${sign}" 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:" msg "PATHS:"
msg2 "work_dir: ${work_dir}" msg2 "work_dir: ${work_dir}"
@ -75,10 +77,6 @@ display_settings(){
msg2 "cache_dir_pkg: ${cache_dir_pkg}" msg2 "cache_dir_pkg: ${cache_dir_pkg}"
msg2 "build_mirror: ${build_mirror}/${branch}" msg2 "build_mirror: ${build_mirror}/${branch}"
msg "BLACKLIST:"
msg2 "blacklist_trigger: ${blacklist_trigger[*]}"
msg2 "blacklist: ${blacklist[*]}"
if ${clean_first};then if ${clean_first};then
msg "PKG:" msg "PKG:"
msg2 "base_packages: ${base_packages[*]}" msg2 "base_packages: ${base_packages[*]}"
@ -96,8 +94,6 @@ load_config "${SYSCONFDIR}/manjaro-tools.conf"
load_vars "$USER_HOME/.makepkg.conf" load_vars "$USER_HOME/.makepkg.conf"
load_vars /etc/makepkg.conf load_vars /etc/makepkg.conf
pacman_conf_arch='default'
base_packages=('base-devel')
install_pkgs=() install_pkgs=()
clean_first=false clean_first=false
@ -106,6 +102,7 @@ namcap=false
pretend=false pretend=false
is_buildset=false is_buildset=false
sign=false sign=false
udev_root=false
usage() { usage() {
echo "Usage: ${0##*/} [options] [--] [makepkg args]" echo "Usage: ${0##*/} [options] [--] [makepkg args]"
@ -119,6 +116,7 @@ usage() {
echo ' -w Clean up cache and sources' echo ' -w Clean up cache and sources'
echo ' -n Install and run namcap check' echo ' -n Install and run namcap check'
echo ' -s Sign packages' echo ' -s Sign packages'
echo ' -u Udev base-devel group (no systemd)'
echo ' -q Query settings and pretend build' echo ' -q Query settings and pretend build'
echo ' -h This help' echo ' -h This help'
echo '' echo ''
@ -128,7 +126,7 @@ usage() {
orig_argv=("$@") orig_argv=("$@")
opts='p:a:b:r:i:cwnsqh' opts='p:a:b:r:i:cwnsuqh'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
@ -141,6 +139,7 @@ while getopts "${opts}" arg; do
w) wipe_clean=true ;; w) wipe_clean=true ;;
n) namcap=true; mkchrootpkg_args+=(-n) ;; n) namcap=true; mkchrootpkg_args+=(-n) ;;
s) sign=true ;; s) sign=true ;;
u) udev_root=true ;;
q) pretend=true ;; q) pretend=true ;;
h|?) usage 0 ;; h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;; *) echo "invalid argument '${arg}'"; usage 1 ;;
@ -148,24 +147,23 @@ while getopts "${opts}" arg; do
done done
if [[ "${arch}" == 'multilib' ]]; then if [[ "${arch}" == 'multilib' ]]; then
pacman_conf_arch='multilib' pacman_conf_arch=${arch}
base_packages+=('multilib-devel') work_dir=${chroots_pkg}/${branch}/${arch}
work_dir=${chroots_pkg}/${branch}/${arch} cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch}
cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} arch='x86_64'
arch='x86_64' is_multilib=true
is_multilib=true
else else
work_dir=${chroots_pkg}/${branch}/${arch} pacman_conf_arch='default'
cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch} work_dir=${chroots_pkg}/${branch}/${arch}
is_multilib=false cache_dir_pkg=${cache_dir}/pkg/${branch}/${arch}
is_multilib=false
fi fi
pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf" pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf"
makepkg_conf="${PKGDATADIR}/makepkg-${arch}.conf" makepkg_conf="${PKGDATADIR}/makepkg-${arch}.conf"
mirrors_conf="${PKGDATADIR}/pacman-mirrors-${branch}.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}")
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -S ${mirrors_conf} -B "${build_mirror}/${branch}" -L)
mkchrootpkg_args+=(-r ${work_dir}) mkchrootpkg_args+=(-r ${work_dir})
@ -181,6 +179,8 @@ eval_buildset "${buildset_pkg}" "${sets_dir_pkg}"
check_requirements check_requirements
init_base_devel
${pretend} && display_settings && exit ${pretend} && display_settings && exit
${wipe_clean} && clean_up ${wipe_clean} && clean_up

View file

@ -24,4 +24,6 @@ sudo
texinfo texinfo
util-linux util-linux
which which
lib32-flex >multilib gcc-multilib
>multilib lib32-fakeroot
>multilib lib32-libltdl

View file

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

View file

@ -38,8 +38,8 @@ CHOST="i686-pc-linux-gnu"
# -march (or -mcpu) builds exclusively for an architecture # -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family # -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2" CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-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 -fstack-check" CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
@ -61,7 +61,7 @@ DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
#-- check: Run the check() function if present in the PKGBUILD #-- check: Run the check() function if present in the PKGBUILD
#-- sign: Generate PGP signature file #-- 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, #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster. #-- specify a space-delimited list of hosts running in the DistCC cluster.

View file

@ -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/lftpget -c
# /usr/bin/wget # /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' # Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr' VCSCLIENTS=('bzr::bzr'
'git::git' 'git::git'
@ -37,8 +37,8 @@ CHOST="x86_64-unknown-linux-gnu"
# -march (or -mcpu) builds exclusively for an architecture # -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family # -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2" CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-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 -fstack-check" CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
@ -60,7 +60,7 @@ DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
#-- check: Run the check() function if present in the PKGBUILD #-- check: Run the check() function if present in the PKGBUILD
#-- sign: Generate PGP signature file #-- 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, #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster. #-- specify a space-delimited list of hosts running in the DistCC cluster.

View file

@ -8,7 +8,7 @@
# default arch: auto detect # default arch: auto detect
# arch=$(uname -m) # 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 # cache_dir=/var/cache/manjaro-tools
# build dir where buildpkg or buildiso chroots are created # build dir where buildpkg or buildiso chroots are created
@ -35,14 +35,6 @@
# default pkg buildset; name without .set extension # default pkg buildset; name without .set extension
# buildset_pkg=default # 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 ################ ################ buildiso ################
# default iso buildset; name without .set extension # default iso buildset; name without .set extension

View file

@ -199,7 +199,7 @@ write_isolinux_cfg(){
if [[ ${initsys} == 'systemd' ]]; then if [[ ${initsys} == 'systemd' ]]; then
plymouth_settings="" plymouth_settings=""
else else
plymouth_settings="quiet" plymouth_settings=" quiet"
fi fi
fi fi
if [[ -f ${path_iso}/${iso_name}/boot/intel_ucode.img ]] ; then if [[ -f ${path_iso}/${iso_name}/boot/intel_ucode.img ]] ; then

View file

@ -184,9 +184,9 @@ detect_desktop_env(){
default_desktop_executable="pantheon-session" default_desktop_executable="pantheon-session"
default_desktop_file="pantheon" default_desktop_file="pantheon"
msg2 "Detected Pantheon desktop environment" 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_executable="budgie-session"
default_desktop_file="budgie-session" default_desktop_file="budgie-desktop"
msg2 "Detected Budgie desktop environment" msg2 "Detected Budgie desktop environment"
elif [ -e "$1/usr/bin/i3" ] && [ -e "$1/usr/share/xsessions/i3.desktop" ]; then elif [ -e "$1/usr/bin/i3" ] && [ -e "$1/usr/share/xsessions/i3.desktop" ]; then
default_desktop_executable="i3" default_desktop_executable="i3"
@ -200,6 +200,10 @@ detect_desktop_env(){
default_desktop_executable="startfluxbox" default_desktop_executable="startfluxbox"
default_desktop_file="fluxbox" default_desktop_file="fluxbox"
msg2 "Detected Fluxbox desktop environment" 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 else
default_desktop_executable="none" default_desktop_executable="none"
default_desktop_file="none" default_desktop_file="none"

View file

@ -13,11 +13,13 @@ import ${LIBDIR}/util-iso-image.sh
import ${LIBDIR}/util-iso-boot.sh import ${LIBDIR}/util-iso-boot.sh
import ${LIBDIR}/util-iso-calamares.sh import ${LIBDIR}/util-iso-calamares.sh
if ${use_overlayfs};then import_util_iso_fs(){
import ${LIBDIR}/util-iso-overlayfs.sh if ${use_overlayfs};then
else import ${LIBDIR}/util-iso-overlayfs.sh
import ${LIBDIR}/util-iso-aufs.sh else
fi import ${LIBDIR}/util-iso-aufs.sh
fi
}
# $1: path # $1: path
# $2: exit code # $2: exit code
@ -139,7 +141,8 @@ squash_image_dir() {
local highcomp="-b 256K -Xbcj x86" local highcomp="-b 256K -Xbcj x86"
[[ "${iso_compression}" != "xz" ]] && highcomp="" [[ "${iso_compression}" != "xz" ]] && highcomp=""
msg2 "Creating SquashFS image. This may take some time..." 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 ..." mksquashfs "${1}" "${sq_img}" -noappend -comp lz4 || die "Exit ..."
else else
mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..." mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..."
@ -650,6 +653,7 @@ make_profile(){
msg "Start building [$1]" msg "Start building [$1]"
cd $1 cd $1
load_profile "$1" load_profile "$1"
import_util_iso_fs
${clean_first} && chroot_clean "${work_dir}" ${clean_first} && chroot_clean "${work_dir}"
if ${iso_only}; then if ${iso_only}; then
[[ ! -d ${work_dir} ]] && die "Create images: buildiso -p ${buildset_iso} -i" [[ ! -d ${work_dir} ]] && die "Create images: buildiso -p ${buildset_iso} -i"

View file

@ -25,13 +25,49 @@ check_requirements(){
fi 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(){ chroot_create(){
msg "Creating chroot for [${branch}] (${arch})..." msg "Creating chroot for [${branch}] (${arch})..."
mkdir -p "${work_dir}" mkdir -p "${work_dir}"
setarch "${arch}" mkchroot \ setarch "${arch}" \
${mkchroot_args[*]} \ mkchroot ${mkchroot_args[*]} \
"${work_dir}/root" \ "${work_dir}/root" \
${base_packages[*]} || abort ${base_packages[*]} || abort
} }
chroot_clean(){ chroot_clean(){
@ -54,7 +90,7 @@ chroot_clean(){
chroot_update(){ chroot_update(){
msg "Updating chroot for [${branch}] (${arch})..." msg "Updating chroot for [${branch}] (${arch})..."
chroot-run ${chroot_run_args[*]} \ chroot-run ${mkchroot_args[*]} \
"${work_dir}/${OWNER}" \ "${work_dir}/${OWNER}" \
pacman -Syu --noconfirm || abort pacman -Syu --noconfirm || abort
@ -70,13 +106,6 @@ clean_up(){
fi fi
} }
blacklist_pkg(){
msg "Removing ${blacklist[@]}..."
for item in "${blacklist[@]}"; do
chroot-run $1/root pacman -Rdd "$item" --noconfirm
done
}
prepare_cachedir(){ prepare_cachedir(){
prepare_dir "${cache_dir_pkg}" prepare_dir "${cache_dir_pkg}"
chown -R "${OWNER}:users" "${cache_dir_pkg}" chown -R "${OWNER}:users" "${cache_dir_pkg}"
@ -126,9 +155,6 @@ run_post_build(){
make_pkg(){ make_pkg(){
msg "Start building [$1]" msg "Start building [$1]"
cd $1 cd $1
for p in ${blacklist_trigger[@]}; do
[[ $1 == $p ]] && blacklist_pkg "${work_dir}"
done
setarch "${arch}" \ setarch "${arch}" \
mkchrootpkg ${mkchrootpkg_args[*]} -- ${makepkg_args[*]} || eval "$2" mkchrootpkg ${mkchrootpkg_args[*]} -- ${makepkg_args[*]} || eval "$2"
run_post_build run_post_build

View file

@ -337,10 +337,6 @@ init_buildpkg(){
prepare_dir "${sets_dir_pkg}" prepare_dir "${sets_dir_pkg}"
[[ -z ${buildset_pkg} ]] && buildset_pkg='default' [[ -z ${buildset_pkg} ]] && buildset_pkg='default'
[[ -z ${blacklist_trigger[@]} ]] && blacklist_trigger=('eudev' 'upower-pm-utils' 'eudev-systemdcompat')
[[ -z ${blacklist[@]} ]] && blacklist=('libsystemd')
} }
init_buildiso(){ init_buildiso(){
@ -465,7 +461,7 @@ load_profile_config(){
fi fi
if [[ -z ${start_openrc[@]} ]];then 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 fi
if [[ -z ${disable_openrc[@]} ]];then if [[ -z ${disable_openrc[@]} ]];then