forked from artix/artools
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
68e23f7e47 | |||
c5228a8b43 | |||
84151f360f | |||
a6ca83be7e | |||
0a07a1f1dd | |||
9dedb2e4cb | |||
dcf6ec1d7b | |||
62022faad7 | |||
dea81dd9f9 | |||
e49d2d77bd | |||
4a06d4d2eb |
@@ -112,10 +112,10 @@ chroot_extra_mount() {
|
||||
chroot_add_resolv_conf "$1"
|
||||
chroot_mount "/etc/hosts" "$1/etc/hosts" -B
|
||||
chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B
|
||||
if [[ -e /etc/localtime ]];then
|
||||
[[ -e $1/etc/localtime ]] || touch $1/etc/localtime
|
||||
chroot_mount "/etc/localtime" "$1/etc/localtime" -B
|
||||
fi
|
||||
# if [[ -e /etc/localtime ]];then
|
||||
# [[ -e $1/etc/localtime ]] || touch $1/etc/localtime
|
||||
# chroot_mount "/etc/localtime" "$1/etc/localtime" -B
|
||||
# fi
|
||||
|
||||
for cache_dir in ${cache_dirs[@]:1}; do
|
||||
chroot_mount "$cache_dir" "$1${cache_dir}" -Br
|
||||
|
@@ -33,7 +33,7 @@ gen_iso_fn(){
|
||||
prepare_build(){
|
||||
timer_start=$(get_timer)
|
||||
|
||||
load_profile "${PROFILE}"
|
||||
load_profile
|
||||
|
||||
local pacman_conf pac_file="pacman-default.conf"
|
||||
|
||||
|
@@ -73,6 +73,25 @@ show_deps(){
|
||||
[[ -n ${optdepends[@]} ]] && msg2 "optdepends: %s" "${optdepends[@]}"
|
||||
}
|
||||
|
||||
subrepo_new(){
|
||||
local group="$1" team="$2"
|
||||
local dest=${TREE_DIR_ARTIX}/$group/${PACKAGE}/trunk
|
||||
|
||||
cd ${TREE_DIR_ARTIX}/$group
|
||||
|
||||
local org=$(get_pkg_org "${PACKAGE}")
|
||||
|
||||
create_repo "${PACKAGE}" "$org"
|
||||
|
||||
add_repo_to_team "${PACKAGE}" "$org" "$team"
|
||||
|
||||
subrepo_clone "${PACKAGE}" "$org"
|
||||
|
||||
prepare_dir "$dest"
|
||||
|
||||
commit_jenkins_files "${PACKAGE}"
|
||||
}
|
||||
|
||||
from_arch(){
|
||||
local src= dest=
|
||||
|
||||
@@ -103,7 +122,7 @@ from_arch(){
|
||||
|
||||
msg2 "Artix Version: %s" "$artixver"
|
||||
else
|
||||
subrepo_new "${PACKAGE}" "$tree_dir" "$git_tree_arch"
|
||||
subrepo_new "$tree_dir" "$git_tree_arch"
|
||||
fi
|
||||
|
||||
msg "Sync (%s) from [%s] to [%s]" "${PACKAGE}" "$git_tree_arch" "$tree_dir"
|
||||
@@ -146,25 +165,6 @@ sync_repos(){
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
subrepo_new(){
|
||||
local dest=${TREE_DIR_ARTIX}/${GROUP}/${PACKAGE}/trunk
|
||||
|
||||
cd ${TREE_DIR_ARTIX}/${GROUP}
|
||||
|
||||
local org=$(get_pkg_org "${PACKAGE}")
|
||||
|
||||
create_repo "${PACKAGE}" "$org"
|
||||
|
||||
add_repo_to_team "${PACKAGE}" "$org" "${TEAM:-$GROUP}"
|
||||
|
||||
subrepo_clone "${PACKAGE}" "$org"
|
||||
|
||||
prepare_dir "$dest"
|
||||
|
||||
commit_jenkins_files "${PACKAGE}"
|
||||
}
|
||||
|
||||
load_user_info
|
||||
|
||||
load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
|
||||
|
@@ -74,7 +74,7 @@ commit_pkg(){
|
||||
|
||||
${push} && pull_tree "${git_tree}" "$head"
|
||||
|
||||
subrepo_pull "${PACKAGE}"
|
||||
# subrepo_pull "${PACKAGE}"
|
||||
subrepo_push "${PACKAGE}"
|
||||
subrepo_clean "${PACKAGE}"
|
||||
|
||||
@@ -130,7 +130,7 @@ symlink_commit_pkg(){
|
||||
|
||||
${push} && pull_tree "${git_tree}" "$head"
|
||||
|
||||
subrepo_pull "${PACKAGE}"
|
||||
# subrepo_pull "${PACKAGE}"
|
||||
subrepo_push "${PACKAGE}"
|
||||
subrepo_clean "${PACKAGE}"
|
||||
|
||||
|
@@ -225,14 +225,8 @@ _chrootbuild() {
|
||||
sudo --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
|
||||
ret=$?
|
||||
case $ret in
|
||||
0)
|
||||
0|14)
|
||||
return 0;;
|
||||
14)
|
||||
# whitelist "The package failed to install." but only if there are multiple split packages
|
||||
# in which case they might be conflicting
|
||||
local pkgfiles=(/pkgdest/*.pkg.tar.xz)
|
||||
(( ${#pkgfiles[@]} > 1))
|
||||
return $?;;
|
||||
*)
|
||||
return $ret;;
|
||||
esac
|
||||
|
@@ -25,6 +25,7 @@
|
||||
# packages-kernel
|
||||
# packages-openrc
|
||||
# packages-runit
|
||||
# packages-s6
|
||||
# packages-media
|
||||
# packages-xorg
|
||||
# packages-python
|
||||
@@ -38,6 +39,7 @@
|
||||
# packages-lxqt
|
||||
# packages-mate
|
||||
# packages-kde
|
||||
# packages-xfce
|
||||
# )
|
||||
|
||||
# HOST_TREE_ARCH=git://git.archlinux.org/svntogit
|
||||
@@ -60,7 +62,7 @@
|
||||
# the dist release; default: auto
|
||||
# ISO_VERSION=$(date +%Y%m%d)
|
||||
|
||||
# possible values: openrc, runit (s6 not yet supported)
|
||||
# possible values: openrc, runit, s6
|
||||
# INITSYS="openrc"
|
||||
|
||||
# gpg key; leave empty or commented to skip sfs signing
|
||||
|
@@ -93,6 +93,7 @@ init_artools_pkg(){
|
||||
packages-lxqt
|
||||
packages-mate
|
||||
packages-kde
|
||||
packages-xfce
|
||||
)
|
||||
|
||||
HOST_TREE_ARTIX=${HOST_TREE_ARTIX:-"gitea@${GIT_DOMAIN}:artixlinux"}
|
||||
|
@@ -28,6 +28,15 @@ add_svc_runit(){
|
||||
fi
|
||||
}
|
||||
|
||||
add_svc_s6(){
|
||||
local mnt="$1" name="$2"
|
||||
if [[ -d $mnt/etc/s6/sv/$name ]]; then
|
||||
msg2 "Setting %s ..." "$name"
|
||||
chroot $mnt s6-rc-bundle $name default &>/dev/null
|
||||
chroot $mnt s6-rc -u change default &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
set_xdm(){
|
||||
if [[ -f $1/etc/conf.d/xdm ]];then
|
||||
local conf='DISPLAYMANAGER="'${DISPLAYMANAGER}'"'
|
||||
@@ -70,6 +79,14 @@ configure_services(){
|
||||
add_svc_runit "$mnt" "$svc"
|
||||
done
|
||||
;;
|
||||
's6')
|
||||
for svc in ${SERVICES[@]}; do
|
||||
add_svc_s6 "$mnt" "$svc"
|
||||
done
|
||||
for svc in ${SERVICES_LIVE[@]}; do
|
||||
add_svc_s6 "$mnt" "$svc"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
info "Done configuring [%s]" "${INITSYS}"
|
||||
}
|
||||
@@ -77,7 +94,7 @@ configure_services(){
|
||||
configure_system(){
|
||||
local mnt="$1"
|
||||
case ${INITSYS} in
|
||||
'openrc' | 'runit')
|
||||
'openrc' | 'runit'|'s6')
|
||||
configure_logind "$mnt" "elogind"
|
||||
;;
|
||||
esac
|
||||
@@ -131,6 +148,15 @@ write_servicescfg_conf(){
|
||||
yaml+=$(write_yaml_map 4 'runlevel' 'default')
|
||||
done
|
||||
;;
|
||||
's6')
|
||||
yaml+=$(write_yaml_map 0 'svDir' '/etc/s6/sv')
|
||||
yaml+=$(write_yaml_map 0 'rcDir' '/etc/s6-rc')
|
||||
yaml+=$(write_yaml_map 0 'services')
|
||||
for svc in ${SERVICES[@]};do
|
||||
yaml+=$(write_yaml_seq_map 2 'name' "$svc")
|
||||
yaml+=$(write_yaml_map 4 'bundle' 'default')
|
||||
done
|
||||
;;
|
||||
esac
|
||||
yaml+=$(write_empty_line)
|
||||
printf '%s' "${yaml}"
|
||||
@@ -159,14 +185,14 @@ configure_calamares(){
|
||||
fi
|
||||
}
|
||||
|
||||
configure_live_image(){
|
||||
configure_image(){
|
||||
local fs="$1"
|
||||
msg "Configuring [livefs]"
|
||||
msg "Configuring [%s]" "${fs##*/}"
|
||||
configure_hosts "$fs"
|
||||
configure_system "$fs"
|
||||
configure_services "$fs"
|
||||
configure_calamares "$fs"
|
||||
[[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools"
|
||||
write_live_session_conf > "$fs/etc/artools/live.conf"
|
||||
msg "Done configuring [livefs]"
|
||||
msg "Done configuring [%s]" "${fs##*/}"
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ configure_grub(){
|
||||
prepare_grub(){
|
||||
local platform=i386-pc img='core.img' prefix=/boot/grub
|
||||
local lib=$1/usr/lib/grub theme=$2/usr/share/grub
|
||||
local grub=$3/boot/grub efi=$3/efi/boot
|
||||
local grub=${iso_root}/boot/grub efi=${iso_root}/efi/boot
|
||||
|
||||
prepare_dir ${grub}/${platform}
|
||||
|
||||
|
@@ -44,7 +44,10 @@ mount_overlay(){
|
||||
mkdir -p "$upper"
|
||||
case $upper in
|
||||
*/livefs) lower="$work/rootfs" ;;
|
||||
*/bootfs) lower="$work/livefs":"$work/rootfs" ;;
|
||||
*/bootfs)
|
||||
lower="$work/rootfs"
|
||||
[[ -d "$work/livefs" ]] && lower="$work/livefs":"$work/rootfs"
|
||||
;;
|
||||
esac
|
||||
track_fs -t overlay overlay -olowerdir="$lower",upperdir="$upper",workdir="${mnt_dir}/work" "$upper"
|
||||
}
|
||||
|
@@ -12,21 +12,6 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
init_profile(){
|
||||
local profdir="$1" prof="$2"
|
||||
|
||||
ROOT_LIST="$profdir/base/Packages-Root"
|
||||
ROOT_OVERLAY="$profdir/base/root-overlay"
|
||||
LIVE_LIST="$profdir/base/Packages-Live"
|
||||
LIVE_OVERLAY="$profdir/base/live-overlay"
|
||||
|
||||
[[ -f "$profdir/$prof/Packages-Root" ]] && ROOT_LIST="$profdir/$prof/Packages-Root"
|
||||
[[ -d "$profdir/$prof/root-overlay" ]] && ROOT_OVERLAY="$profdir/$prof/root-overlay"
|
||||
|
||||
[[ -f "$profdir/$prof/Packages-Live" ]] && LIVE_LIST="$profdir/$prof/Packages-Live"
|
||||
[[ -d "$profdir/$prof/live-overlay" ]] && LIVE_OVERLAY="$profdir/$prof/live-overlay"
|
||||
}
|
||||
|
||||
show_profile(){
|
||||
msg2 "iso_file: %s" "${iso_file}"
|
||||
msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}"
|
||||
@@ -39,15 +24,18 @@ show_profile(){
|
||||
}
|
||||
|
||||
load_profile(){
|
||||
local prof="$1"
|
||||
local profdir="${DATADIR}/iso-profiles"
|
||||
[[ -d ${WORKSPACE_DIR}/iso-profiles ]] && profdir=${WORKSPACE_DIR}/iso-profiles
|
||||
local profile_dir="${DATADIR}/iso-profiles"
|
||||
[[ -d ${WORKSPACE_DIR}/iso-profiles ]] && profile_dir=${WORKSPACE_DIR}/iso-profiles
|
||||
|
||||
init_profile "$profdir" "$prof"
|
||||
ROOT_LIST="$profile_dir/${PROFILE}/Packages-Root"
|
||||
ROOT_OVERLAY="$profile_dir/${PROFILE}/root-overlay"
|
||||
|
||||
[[ -f $profdir/$prof/profile.conf ]] || return 1
|
||||
[[ -f "$profile_dir/${PROFILE}/Packages-Live" ]] && LIVE_LIST="$profile_dir/${PROFILE}/Packages-Live"
|
||||
[[ -d "$profile_dir/${PROFILE}/live-overlay" ]] && LIVE_OVERLAY="$profile_dir/${PROFILE}/live-overlay"
|
||||
|
||||
[[ -r $profdir/$prof/profile.conf ]] && . $profdir/$prof/profile.conf
|
||||
[[ -f $profile_dir/${PROFILE}/profile.conf ]] || return 1
|
||||
|
||||
[[ -r $profile_dir/${PROFILE}/profile.conf ]] && . $profile_dir/${PROFILE}/profile.conf
|
||||
|
||||
DISPLAYMANAGER=${DISPLAYMANAGER:-'none'}
|
||||
|
||||
@@ -63,13 +51,13 @@ load_profile(){
|
||||
ADDGROUPS=${ADDGROUPS:-"video,power,optical,network,lp,scanner,wheel,users,log"}
|
||||
|
||||
if [[ -z ${SERVICES[@]} ]];then
|
||||
SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'NetworkManager')
|
||||
SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'connman')
|
||||
fi
|
||||
|
||||
if [[ ${DISPLAYMANAGER} != "none" ]];then
|
||||
case "${INITSYS}" in
|
||||
'openrc') SERVICES+=('xdm') ;;
|
||||
'runit') SERVICES+=("${DISPLAYMANAGER}") ;;
|
||||
'runit'|'s6') SERVICES+=("${DISPLAYMANAGER}") ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
@@ -13,9 +13,6 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
error_function() {
|
||||
if [[ -p $logpipe ]]; then
|
||||
rm "$logpipe"
|
||||
fi
|
||||
local func="$1"
|
||||
# first exit all subshells, then print the error
|
||||
if (( ! BASH_SUBSHELL )); then
|
||||
@@ -134,6 +131,8 @@ make_rootfs() {
|
||||
|
||||
copy_overlay "${ROOT_OVERLAY}" "${rootfs}"
|
||||
|
||||
[[ -z ${LIVE_LIST} ]] && configure_image "${rootfs}"
|
||||
|
||||
clean_up_image "${rootfs}"
|
||||
|
||||
: > ${work_dir}/rootfs.lock
|
||||
@@ -155,7 +154,7 @@ make_livefs() {
|
||||
|
||||
copy_overlay "${LIVE_OVERLAY}" "${livefs}"
|
||||
|
||||
configure_live_image "${livefs}"
|
||||
configure_image "${livefs}"
|
||||
|
||||
umount_overlay
|
||||
|
||||
@@ -198,9 +197,12 @@ make_grub(){
|
||||
if [[ ! -e ${work_dir}/grub.lock ]]; then
|
||||
msg "Prepare [/iso/boot/grub]"
|
||||
|
||||
prepare_grub "${work_dir}/rootfs" "${work_dir}/livefs" "${iso_root}"
|
||||
local layer=${work_dir}/rootfs
|
||||
[[ -n ${LIVE_LIST} ]] && layer=${work_dir}/livefs
|
||||
|
||||
configure_grub "${iso_root}"
|
||||
prepare_grub "${work_dir}/rootfs" "$layer"
|
||||
|
||||
configure_grub
|
||||
|
||||
: > ${work_dir}/grub.lock
|
||||
msg "Done [/iso/boot/grub]"
|
||||
@@ -218,7 +220,7 @@ prepare_images(){
|
||||
local timer=$(get_timer)
|
||||
load_pkgs "${ROOT_LIST}" "${INITSYS}"
|
||||
run_safe "make_rootfs"
|
||||
if [[ -f ${LIVE_LIST} ]]; then
|
||||
if [[ -n ${LIVE_LIST} ]]; then
|
||||
load_pkgs "${LIVE_LIST}" "${INITSYS}"
|
||||
run_safe "make_livefs"
|
||||
fi
|
||||
|
@@ -149,6 +149,7 @@ get_artix_tree(){
|
||||
$(get_cases ruby)) tree=packages-ruby ;;
|
||||
$(get_cases openrc)) tree=packages-openrc ;;
|
||||
$(get_cases runit)) tree=packages-runit ;;
|
||||
$(get_cases s6)) tree=packages-s6 ;;
|
||||
$(get_cases media)) tree=packages-media ;;
|
||||
$(get_cases xorg)) tree=packages-xorg ;;
|
||||
$(get_cases qt5)) tree=packages-qt5 ;;
|
||||
@@ -159,6 +160,7 @@ get_artix_tree(){
|
||||
$(get_cases kde)) tree=packages-kde ;;
|
||||
$(get_cases gnome)) tree=packages-gnome ;;
|
||||
$(get_cases mate)) tree=packages-mate ;;
|
||||
$(get_cases xfce)) tree=packages-xfce ;;
|
||||
*) tree=$artix_tree
|
||||
esac"
|
||||
echo $tree
|
||||
|
Reference in New Issue
Block a user