Compare commits

...

17 Commits
0.2 ... 0.3

Author SHA1 Message Date
artoo
fb19753286 Merge pull request #13 from artix-linux/devel
Devel
2017-07-25 22:31:45 +02:00
udeved
47f41e13ad util-pkg-tree: replace redundant code with functions 2017-07-22 16:08:42 +02:00
udeved
c292f457d6 util-pkg-tree: fix import time stamp 2017-07-21 19:42:37 +02:00
udeved
05266f6f57 deployiso: fix uplimit 2017-07-21 01:21:24 +02:00
udeved
a25b8646f9 util-profile: fix overlay copying 2017-07-20 21:49:29 +02:00
udeved
699f48b22e deployiso: cosmetic fix 2017-07-20 19:10:00 +02:00
udeved
6281af8301 deployiso: fix display 2017-07-20 19:04:27 +02:00
udeved
1c8eb7fb1f util-iso-chroot: add svc to proper runlevel 2017-07-20 12:32:48 +02:00
udeved
44a1b432f2 data: update system import list 2017-07-19 17:23:59 +02:00
udeved
19017c421c util-pkg-publish: remove old pkg 2017-07-19 15:17:49 +02:00
udeved
eebd17b623 util-pkg-tree: add to git before commit 2017-07-19 15:14:44 +02:00
udeved
470632e1dc util-yaml: rm postcfg.conf writing 2017-07-19 15:14:14 +02:00
udeved
1e4d2b7979 buildyaml: reenable calamares yaml writing 2017-07-19 00:56:13 +02:00
udeved
da454e7de3 rename buildyaml 2017-07-19 00:49:34 +02:00
udeved
84424c8093 buildiso, check-yaml: add separate service arrays for openrc runlevels 2017-07-19 00:44:15 +02:00
udeved
a5e43ae87f mkchroot: fix mirrorlist copying 2017-07-19 00:43:20 +02:00
udeved
0a7edac512 start 0.3 2017-07-19 00:42:39 +02:00
17 changed files with 104 additions and 120 deletions

View File

@@ -1,4 +1,4 @@
Version=0.1
Version=0.3
PREFIX = /usr/local
SYSCONFDIR = /etc
@@ -80,12 +80,12 @@ MAN_XML = \
buildiso.xml \
deployiso.xml \
deploypkg.xml \
check-yaml.xml \
buildyaml.xml \
artools.conf.xml \
profile.conf.xml
BIN_YAML = \
bin/check-yaml
bin/buildyaml
LIBS_YAML = \
$(wildcard lib/util-yaml*.sh) \
@@ -195,7 +195,7 @@ install_yaml:
install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/artools
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
gzip -c man/check-yaml.1 > $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz
gzip -c man/buildyaml.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildyaml.1.gz
uninstall_base:
for f in ${SYSCONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/$$f; done
@@ -232,7 +232,7 @@ uninstall_yaml:
for f in ${BIN_YAML}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${LIBS_YAML}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done
for f in ${SHARED_YAML}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/$$f; done
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildyaml.1.gz
install: install_base install_pkg install_iso install_yaml

View File

@@ -39,7 +39,7 @@ prepare_build(){
iso_file=$(gen_iso_fn).iso
mkchroot_args+=(-C ${pacman_conf} -U "${build_mirror}")
mkchroot_args+=(-C ${pacman_conf})
work_dir=${chroots_iso}/${profile}/${target_arch}
iso_dir="${cache_dir_iso}/${profile}"
@@ -72,7 +72,8 @@ show_profile(){
msg2 "addgroups: %s" "${addgroups}"
msg2 "enable_live: %s" "${enable_live[*]}"
msg2 "enable_openrc: %s" "${enable_openrc[*]}"
msg2 "openrc_boot: %s" "${openrc_boot[*]}"
msg2 "openrc_default: %s" "${openrc_default[*]}"
fi
reset_profile
}

View File

@@ -51,7 +51,8 @@ show_profile(){
msg2 "addgroups: %s" "${addgroups}"
msg2 "enable_live: %s" "${enable_live[*]}"
msg2 "enable_openrc: %s" "${enable_openrc[*]}"
msg2 "openrc_boot: %s" "${openrc_boot[*]}"
msg2 "openrc_default: %s" "${openrc_default[*]}"
reset_profile
unset yaml_dir
@@ -72,8 +73,7 @@ display_settings(){
msg2 "kernel: %s" "${kernel}"
msg "ARGS:"
# msg2 "validate: %s" "${validate}"
# msg2 "calamares: %s" "${calamares}"
msg2 "calamares: %s" "${calamares}"
msg2 "group: %s" "${group}"
msg "CHECK QUEUE:"
@@ -92,7 +92,6 @@ load_run_dir
calamares=false
pretend=false
group=false
validate=false
cache_dir_netinstall="${workspace_dir}/netinstall"
usage() {
@@ -101,9 +100,8 @@ usage() {
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -k <name> Kernel to use[default: ${kernel}]"
echo " -i <name> Init system to use [default: ${initsys}]"
# echo ' -c Check also calamares yaml files generated for the profile'
echo ' -c Check also calamares yaml files generated for the profile'
echo ' -g Enable pacman group accepted for -p'
# echo ' -v Validate by schema'
echo ' -q Query settings'
echo ' -h This help'
echo ''
@@ -113,9 +111,7 @@ usage() {
orig_argv=("$0" "$@")
# opts='p:a:i:k:gcvqh'
opts='p:a:i:k:gqh'
opts='p:a:i:k:gcqh'
while getopts "${opts}" arg; do
case "${arg}" in
@@ -123,9 +119,8 @@ while getopts "${opts}" arg; do
a) target_arch="$OPTARG" ;;
i) initsys="$OPTARG" ;;
k) kernel="$OPTARG" ;;
# c) calamares=true ;;
c) calamares=true ;;
g) group=true ;;
# v) validate=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
@@ -134,8 +129,6 @@ done
shift $(($OPTIND - 1))
#check_root
eval_build_list "${list_dir_iso}" "${build_list_iso}"
${pretend} && display_settings && exit 1

View File

@@ -29,14 +29,9 @@ display_settings(){
show_version
show_config
# msg "PROFILE:"
# msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
# msg2 "build_list_iso: %s" "${build_list_iso}"
msg2 "is_build_list: %s" "${is_build_list}"
msg "OPTIONS:"
msg2 "limit: %s kB/s" "${limit}"
msg2 "dist_release: %s" "${dist_release}"
msg2 "uplimit: %s kB/s" "${uplimit}"
# msg2 "dist_release: %s" "${dist_release}"
msg "ARGS:"
msg2 "update: %s" "${update}"
@@ -55,8 +50,8 @@ display_settings(){
msg2 "host: %s" "${host}"
msg2 "project: %s" "${project}"
msg "UPLOAD QUEUE:"
run show_profile "${build_list_iso}"
msg "UPLOAD:"
show_profile "${profile}"
}
load_user_info
@@ -73,8 +68,8 @@ rsync_args=(-aP --progress -e ssh)
usage() {
echo "Usage: ${0##*/} [options]"
echo " -p Source folder to upload [default:${build_list_iso}]"
echo " -l Limit bandwidth in kB/s [default:${limit}]"
echo " -p Source folder to upload"
echo " -l Limit bandwidth in kB/s [default:${uplimit}]"
echo ' -u Update remote directory'
echo ' -t Create iso torrent'
echo ' -q Query settings and pretend upload'
@@ -104,7 +99,7 @@ shift $(($OPTIND - 1))
timer_start=$(get_timer)
rsync_args+=(--bwlimit=${limit})
rsync_args+=(--bwlimit=${uplimit})
${pretend} && display_settings #&& exit 1

View File

@@ -72,7 +72,7 @@ else
fi
basestrap_args=(-Gcd ${pacman_conf:+-C "$pacman_conf"})
[[ -z ${mirror} ]] && basestrap_args+=(-M)
[[ -n ${mirror} ]] && basestrap_args+=(-M)
umask 0022

View File

@@ -144,4 +144,3 @@ wpa_actiond
xfsprogs
xz
zd1211-firmware
zlib

View File

@@ -23,12 +23,12 @@
# configure calamares to use chrootcfg instead of unpackfs; default: unpackfs
# chrootcfg="false"
# unset defaults to given values,
# names must match openrc service names
# enable_openrc=('acpid' 'bluetooth' 'elogind' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
# service runlevels
# openrc_boot=('elogind')
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
# unset defaults to given values
# addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel"
# addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
################# live-session #################

View File

@@ -263,7 +263,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
<term><varname>limit=</varname></term>
<term><varname>uplimit=</varname></term>
<listitem><para>Default upload bandwidth limit in kb/s.
</para></listitem>

View File

@@ -22,10 +22,10 @@ You should have received a copy of the GNU Lesser General Public License
along with artools; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="check-yaml" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentry id="buildyaml" xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>check-yaml-+</title>
<title>buildyaml-+</title>
<productname>artools</productname>
<authorgroup>
@@ -39,18 +39,18 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
</refentryinfo>
<refmeta>
<refentrytitle>check-yaml</refentrytitle>
<refentrytitle>buildyaml</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>check-yaml</refname>
<refpurpose>check-yaml is used to generate and validate yaml files used by calamares. </refpurpose>
<refname>buildyaml</refname>
<refpurpose>buildyaml is used to generate and validate yaml files used by calamares. </refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>check-yaml</command>
<command>buildyaml</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -58,9 +58,9 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
<refsect1>
<title>Description</title>
<para><command>check-yaml</command> is used to generate and validate yaml files used by calamares.</para>
<para><command>buildyaml</command> is used to generate and validate yaml files used by calamares.</para>
<para>check-yaml is a script to generate and validate yaml files by yaml schemas. Buildiso generates these files also, but check-yaml is a standalone version without the need to build the entire iso.</para>
<para>buildyaml is a script to generate and validate yaml files by yaml schemas. Buildiso generates these files also, but buildyaml is a standalone version without the need to build the entire iso.</para>
</refsect1>

View File

@@ -128,10 +128,18 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
<term><varname>enable_openrc=</varname></term>
<term><varname>openrc_boot=</varname></term>
<listitem><para>Array of services that will be
enabled in openrc systems.
enabled in openrc boot runlevel.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>openrc_default=</varname></term>
<listitem><para>Array of services that will be
enabled in openrc default runlevel.
</para></listitem>
</varlistentry>

View File

@@ -10,10 +10,10 @@
# GNU General Public License for more details.
add_svc_rc(){
local mnt="$1" name="$2"
local mnt="$1" name="$2" rlvl="$3"
if [[ -f $mnt/etc/init.d/$name ]];then
msg2 "Setting %s ..." "$name"
chroot $mnt rc-update add $name default &>/dev/null
chroot $mnt rc-update add $name $rlvl &>/dev/null
fi
}
@@ -52,12 +52,15 @@ configure_services(){
info "Configuring [%s]" "${initsys}"
case ${initsys} in
'openrc')
for svc in ${enable_openrc[@]}; do
for svc in ${openrc_boot[@]}; do
add_svc_rc "$mnt" "$svc" "boot"
done
for svc in ${openrc_default[@]}; do
[[ $svc == "xdm" ]] && set_xdm "$mnt"
add_svc_rc "$mnt" "$svc"
add_svc_rc "$mnt" "$svc" "default"
done
for svc in ${enable_live[@]}; do
add_svc_rc "$mnt" "$svc"
add_svc_rc "$mnt" "$svc" "default"
done
;;
esac

View File

@@ -39,9 +39,10 @@ prepare_transfer(){
}
sync_dir(){
prepare_transfer "$1"
msg "Start upload [%s] ..." "$1"
prof="$1"
prepare_transfer "$prof"
msg "Start upload [%s] ..." "$prof"
rsync "${rsync_args[@]}" ${src_dir} $(connect)${target_dir}
msg "Done upload [%s]" "$1"
msg "Done upload [%s]" "$prof"
show_elapsed_time "${FUNCNAME}" "${timer_start}"
}

View File

@@ -12,9 +12,9 @@
repo_add_pkg(){
local repo="$1" arch="$2" pkg="$3"
# if [[ ! -f ${cache_dir_pkg}/$arch/$pkg{,.sig} ]];then
ln -sv ${cache_dir_pkg}/$arch/$pkg{,.sig} ${repos_local}/$repo/os/$arch/
ln -s ${cache_dir_pkg}/$arch/$pkg{,.sig} ${repos_local}/$repo/os/$arch/
# fi
repo-add -R ${repos_local}/$repo/os/$arch/$repo.db.tar.xz ${cache_dir_pkg}/$arch/$pkg
repo-add -R ${repos_local}/$repo/os/$arch/$repo.db.tar.xz ${repos_local}/$repo/os/$arch/$pkg
}
repo_del_pkg(){

View File

@@ -9,12 +9,20 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
get_local_head(){
echo $(git log --pretty=%H ...refs/heads/$1^ | head -n 1)
}
get_remote_head(){
echo $(git ls-remote origin -h refs/heads/$1 | cut -f1)
}
sync_tree_branches(){
local branches=(master artix archlinux testing)
local branches=(master artix archlinux)
for b in ${branches[@]};do
git checkout $b &> /dev/null
local local_head=$(git log --pretty=%H ...refs/heads/$b^ | head -n 1)
local remote_head=$(git ls-remote origin -h refs/heads/$b | cut -f1)
local local_head=$(get_local_head "$b")
local remote_head=$(get_remote_head "$b")
local timer=$(get_timer) repo="$1"
msg "Checking [%s] (%s) ..." "$repo" "$b"
msg2 "local: %s" "${local_head}"
@@ -32,17 +40,18 @@ sync_tree_branches(){
}
sync_tree(){
local master=$(git log --pretty=%H ...refs/heads/master^ | head -n 1)
local master_remote=$(git ls-remote origin -h refs/heads/master | cut -f1)
local branch="master"
local local_head=$(get_local_head "$branch")
local remote_head=$(get_remote_head "$branch")
local timer=$(get_timer) repo="$1"
msg "Checking [%s] ..." "$repo"
msg2 "local: %s" "${master}"
msg2 "remote: %s" "${master_remote}"
if [[ "${master}" == "${master_remote}" ]]; then
msg2 "local: %s" "${local_head}"
msg2 "remote: %s" "${remote_head}"
if [[ "${local_head}" == "${remote_head}" ]]; then
info "nothing to do"
else
info "needs sync"
git pull origin master
git pull origin $branch
fi
msg "Done [%s]" "$repo"
show_elapsed_time "${FUNCNAME}" "${timer}"
@@ -96,6 +105,11 @@ is_dirty() {
return 0
}
get_pkgver(){
source PKGBUILD
echo $pkgver-$pkgrel
}
import_from_arch(){
local timer=$(get_timer)
for repo in ${repo_tree_artix[@]};do
@@ -109,7 +123,10 @@ import_from_arch(){
for pkg in ${import_list[@]};do
msg2 "Importing [%s] ..." "$pkg"
rsync "${rsync_args[@]}" ${tree_dir_arch}/$arch_dir/$pkg/trunk/ ${tree_dir_artix}/$repo/$pkg/
$(is_dirty) && git commit -m "Archlinux $pkg import $(date %Y%m%d)"
if $(is_dirty); then
git add $pkg
git commit -m "Archlinux $pkg-$(get_pkgver) import"
fi
done
fi
done

View File

@@ -50,17 +50,19 @@ load_profile(){
[[ -z ${login_shell} ]] && login_shell='/bin/bash'
if [[ -z ${addgroups} ]];then
addgroups="video,power,storage,optical,network,lp,scanner,wheel,sys"
addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
fi
if [[ -z ${enable_openrc[@]} ]];then
enable_openrc=('acpid' 'bluetooth' 'elogind' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
if [[ -z ${openrc_boot[@]} ]];then
openrc_boot=('elogind')
fi
if [[ ${displaymanager} != "none" ]]; then
enable_openrc+=('xdm')
if [[ -z ${openrc_default[@]} ]];then
openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
fi
[[ ${displaymanager} != "none" ]] && openrc_default+=('xdm')
[[ -z ${netinstall} ]] && netinstall='false'
[[ -z ${chrootcfg} ]] && chrootcfg='false'
@@ -77,7 +79,7 @@ load_profile(){
root_list=${run_dir}/shared/Packages-Root
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/Packages-Root"
root_overlay="${run_dir}/shared/${os_id}/root-overlay"
root_overlay="${run_dir}/shared/root-overlay"
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
@@ -86,7 +88,7 @@ load_profile(){
live_list="${run_dir}/shared/Packages-Live"
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/Packages-Live"
live_overlay="${run_dir}/shared/${os_id}/live-overlay"
live_overlay="${run_dir}/shared/live-overlay"
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
if ${netinstall};then
@@ -107,7 +109,8 @@ reset_profile(){
unset username
unset password
unset addgroups
unset enable_openrc
unset openrc_boot
unset openrc_default
unset enable_live
unset login_shell
unset netinstall

View File

@@ -11,35 +11,6 @@
import ${LIBDIR}/util-yaml.sh
# check_yaml(){
# msg2 "Checking validity [%s] ..." "${1##*/}"
# local name=${1##*/} data=$1 schema
# case ${name##*.} in
# yaml)
# name=netgroups
# # data=$1
# ;;
# conf)
# name=${name%.conf}
# # data=${tmp_dir}/$name.yaml
# # cp $1 $data
# ;;
# esac
# local schemas_dir=/usr/share/calamares/schemas
# schema=${schemas_dir}/$name.schema.yaml
# # pykwalify -d $data -s $schema
# kwalify -lf $schema $data
# }
# write_calamares_yaml(){
# configure_calamares "${yaml_dir}"
# if ${validate}; then
# for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do
# check_yaml "$conf"
# done
# fi
# }
write_netgroup_yaml(){
msg2 "Writing %s ..." "${2##*/}"
echo "---" > "$2"
@@ -52,14 +23,12 @@ write_netgroup_yaml(){
for p in ${packages[@]};do
echo " - $p" >> "$2"
done
# ${validate} && check_yaml "$2"
}
write_pacman_group_yaml(){
packages=$(pacman -Sgq "$1")
prepare_dir "${cache_dir_netinstall}/pacman"
write_netgroup_yaml "$1" "${cache_dir_netinstall}/pacman/$1.yaml"
# ${validate} && check_yaml "${cache_dir_netinstall}/pacman/$1.yaml"
}
gen_fn(){
@@ -74,7 +43,7 @@ make_profile_yaml(){
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
write_netgroup_yaml "$1" "$(gen_fn "Packages-Desktop")"
fi
# ${calamares} && write_calamares_yaml "$1"
${calamares} && configure_calamares "${yaml_dir}"
reset_profile
unset yaml_dir
}

View File

@@ -61,7 +61,11 @@ write_servicescfg_conf(){
echo '' >> "$conf"
echo 'services:' >> "$conf"
echo ' enabled:' >> "$conf"
for s in ${enable_openrc[@]};do
for s in ${openrc_boot[@]};do
echo " - name: $s" >> "$conf"
echo ' runlevel: boot' >> "$conf"
done
for s in ${openrc_default[@]};do
echo " - name: $s" >> "$conf"
echo ' runlevel: default' >> "$conf"
done
@@ -159,15 +163,6 @@ write_welcome_conf(){
fi
}
write_postcfg_conf(){
local conf="${modules_dir}/postcfg.conf"
msg2 "Writing %s ..." "${conf##*/}"
echo "---" > "$conf"
echo "keyrings:" >> "$conf"
echo " - archlinux" >> "$conf"
echo " - cromnix" >> "$conf"
}
write_umount_conf(){
local conf="${modules_dir}/umount.conf"
msg2 "Writing %s ..." "${conf##*/}"
@@ -255,7 +250,7 @@ write_settings_conf(){
esac
echo " - grubcfg" >> "$conf"
echo " - bootloader" >> "$conf" && write_bootloader_conf
echo " - postcfg" >> "$conf" && write_postcfg_conf
echo " - postcfg" >> "$conf"
echo " - umount" >> "$conf" && write_umount_conf
echo " - show:" >> "$conf"
echo " - finished" >> "$conf" && write_finished_conf