forked from artix/artools
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb19753286 | ||
|
|
47f41e13ad | ||
|
|
c292f457d6 | ||
|
|
05266f6f57 | ||
|
|
a25b8646f9 | ||
|
|
699f48b22e | ||
|
|
6281af8301 | ||
|
|
1c8eb7fb1f | ||
|
|
44a1b432f2 | ||
|
|
19017c421c | ||
|
|
eebd17b623 | ||
|
|
470632e1dc | ||
|
|
1e4d2b7979 | ||
|
|
da454e7de3 | ||
|
|
84424c8093 | ||
|
|
a5e43ae87f | ||
|
|
0a7edac512 |
10
Makefile
10
Makefile
@@ -1,4 +1,4 @@
|
|||||||
Version=0.1
|
Version=0.3
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
SYSCONFDIR = /etc
|
SYSCONFDIR = /etc
|
||||||
@@ -80,12 +80,12 @@ MAN_XML = \
|
|||||||
buildiso.xml \
|
buildiso.xml \
|
||||||
deployiso.xml \
|
deployiso.xml \
|
||||||
deploypkg.xml \
|
deploypkg.xml \
|
||||||
check-yaml.xml \
|
buildyaml.xml \
|
||||||
artools.conf.xml \
|
artools.conf.xml \
|
||||||
profile.conf.xml
|
profile.conf.xml
|
||||||
|
|
||||||
BIN_YAML = \
|
BIN_YAML = \
|
||||||
bin/check-yaml
|
bin/buildyaml
|
||||||
|
|
||||||
LIBS_YAML = \
|
LIBS_YAML = \
|
||||||
$(wildcard lib/util-yaml*.sh) \
|
$(wildcard lib/util-yaml*.sh) \
|
||||||
@@ -195,7 +195,7 @@ install_yaml:
|
|||||||
install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/artools
|
install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/artools
|
||||||
|
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
|
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:
|
uninstall_base:
|
||||||
for f in ${SYSCONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/$$f; done
|
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 ${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 ${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
|
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
|
install: install_base install_pkg install_iso install_yaml
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ prepare_build(){
|
|||||||
|
|
||||||
iso_file=$(gen_iso_fn).iso
|
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}
|
work_dir=${chroots_iso}/${profile}/${target_arch}
|
||||||
|
|
||||||
iso_dir="${cache_dir_iso}/${profile}"
|
iso_dir="${cache_dir_iso}/${profile}"
|
||||||
@@ -72,7 +72,8 @@ show_profile(){
|
|||||||
msg2 "addgroups: %s" "${addgroups}"
|
msg2 "addgroups: %s" "${addgroups}"
|
||||||
|
|
||||||
msg2 "enable_live: %s" "${enable_live[*]}"
|
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
|
fi
|
||||||
reset_profile
|
reset_profile
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ show_profile(){
|
|||||||
msg2 "addgroups: %s" "${addgroups}"
|
msg2 "addgroups: %s" "${addgroups}"
|
||||||
|
|
||||||
msg2 "enable_live: %s" "${enable_live[*]}"
|
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
|
reset_profile
|
||||||
unset yaml_dir
|
unset yaml_dir
|
||||||
@@ -72,8 +73,7 @@ display_settings(){
|
|||||||
msg2 "kernel: %s" "${kernel}"
|
msg2 "kernel: %s" "${kernel}"
|
||||||
|
|
||||||
msg "ARGS:"
|
msg "ARGS:"
|
||||||
# msg2 "validate: %s" "${validate}"
|
msg2 "calamares: %s" "${calamares}"
|
||||||
# msg2 "calamares: %s" "${calamares}"
|
|
||||||
msg2 "group: %s" "${group}"
|
msg2 "group: %s" "${group}"
|
||||||
|
|
||||||
msg "CHECK QUEUE:"
|
msg "CHECK QUEUE:"
|
||||||
@@ -92,7 +92,6 @@ load_run_dir
|
|||||||
calamares=false
|
calamares=false
|
||||||
pretend=false
|
pretend=false
|
||||||
group=false
|
group=false
|
||||||
validate=false
|
|
||||||
cache_dir_netinstall="${workspace_dir}/netinstall"
|
cache_dir_netinstall="${workspace_dir}/netinstall"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
@@ -101,9 +100,8 @@ usage() {
|
|||||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||||
echo " -k <name> Kernel to use[default: ${kernel}]"
|
echo " -k <name> Kernel to use[default: ${kernel}]"
|
||||||
echo " -i <name> Init system to use [default: ${initsys}]"
|
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 ' -g Enable pacman group accepted for -p'
|
||||||
# echo ' -v Validate by schema'
|
|
||||||
echo ' -q Query settings'
|
echo ' -q Query settings'
|
||||||
echo ' -h This help'
|
echo ' -h This help'
|
||||||
echo ''
|
echo ''
|
||||||
@@ -113,9 +111,7 @@ usage() {
|
|||||||
|
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
# opts='p:a:i:k:gcvqh'
|
opts='p:a:i:k:gcqh'
|
||||||
|
|
||||||
opts='p:a:i:k:gqh'
|
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
@@ -123,9 +119,8 @@ while getopts "${opts}" arg; do
|
|||||||
a) target_arch="$OPTARG" ;;
|
a) target_arch="$OPTARG" ;;
|
||||||
i) initsys="$OPTARG" ;;
|
i) initsys="$OPTARG" ;;
|
||||||
k) kernel="$OPTARG" ;;
|
k) kernel="$OPTARG" ;;
|
||||||
# c) calamares=true ;;
|
c) calamares=true ;;
|
||||||
g) group=true ;;
|
g) group=true ;;
|
||||||
# v) validate=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 ;;
|
||||||
@@ -134,8 +129,6 @@ done
|
|||||||
|
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
#check_root
|
|
||||||
|
|
||||||
eval_build_list "${list_dir_iso}" "${build_list_iso}"
|
eval_build_list "${list_dir_iso}" "${build_list_iso}"
|
||||||
|
|
||||||
${pretend} && display_settings && exit 1
|
${pretend} && display_settings && exit 1
|
||||||
@@ -29,14 +29,9 @@ display_settings(){
|
|||||||
show_version
|
show_version
|
||||||
show_config
|
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:"
|
msg "OPTIONS:"
|
||||||
msg2 "limit: %s kB/s" "${limit}"
|
msg2 "uplimit: %s kB/s" "${uplimit}"
|
||||||
msg2 "dist_release: %s" "${dist_release}"
|
# msg2 "dist_release: %s" "${dist_release}"
|
||||||
|
|
||||||
msg "ARGS:"
|
msg "ARGS:"
|
||||||
msg2 "update: %s" "${update}"
|
msg2 "update: %s" "${update}"
|
||||||
@@ -55,8 +50,8 @@ display_settings(){
|
|||||||
msg2 "host: %s" "${host}"
|
msg2 "host: %s" "${host}"
|
||||||
msg2 "project: %s" "${project}"
|
msg2 "project: %s" "${project}"
|
||||||
|
|
||||||
msg "UPLOAD QUEUE:"
|
msg "UPLOAD:"
|
||||||
run show_profile "${build_list_iso}"
|
show_profile "${profile}"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_user_info
|
load_user_info
|
||||||
@@ -73,8 +68,8 @@ rsync_args=(-aP --progress -e ssh)
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo " -p Source folder to upload [default:${build_list_iso}]"
|
echo " -p Source folder to upload"
|
||||||
echo " -l Limit bandwidth in kB/s [default:${limit}]"
|
echo " -l Limit bandwidth in kB/s [default:${uplimit}]"
|
||||||
echo ' -u Update remote directory'
|
echo ' -u Update remote directory'
|
||||||
echo ' -t Create iso torrent'
|
echo ' -t Create iso torrent'
|
||||||
echo ' -q Query settings and pretend upload'
|
echo ' -q Query settings and pretend upload'
|
||||||
@@ -104,7 +99,7 @@ shift $(($OPTIND - 1))
|
|||||||
|
|
||||||
timer_start=$(get_timer)
|
timer_start=$(get_timer)
|
||||||
|
|
||||||
rsync_args+=(--bwlimit=${limit})
|
rsync_args+=(--bwlimit=${uplimit})
|
||||||
|
|
||||||
${pretend} && display_settings #&& exit 1
|
${pretend} && display_settings #&& exit 1
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
basestrap_args=(-Gcd ${pacman_conf:+-C "$pacman_conf"})
|
basestrap_args=(-Gcd ${pacman_conf:+-C "$pacman_conf"})
|
||||||
[[ -z ${mirror} ]] && basestrap_args+=(-M)
|
[[ -n ${mirror} ]] && basestrap_args+=(-M)
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
|
|||||||
@@ -144,4 +144,3 @@ wpa_actiond
|
|||||||
xfsprogs
|
xfsprogs
|
||||||
xz
|
xz
|
||||||
zd1211-firmware
|
zd1211-firmware
|
||||||
zlib
|
|
||||||
|
|||||||
@@ -23,12 +23,12 @@
|
|||||||
# configure calamares to use chrootcfg instead of unpackfs; default: unpackfs
|
# configure calamares to use chrootcfg instead of unpackfs; default: unpackfs
|
||||||
# chrootcfg="false"
|
# chrootcfg="false"
|
||||||
|
|
||||||
# unset defaults to given values,
|
# service runlevels
|
||||||
# names must match openrc service names
|
# openrc_boot=('elogind')
|
||||||
# enable_openrc=('acpid' 'bluetooth' 'elogind' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
||||||
|
|
||||||
# unset defaults to given values
|
# 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 #################
|
################# live-session #################
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>limit=</varname></term>
|
<term><varname>uplimit=</varname></term>
|
||||||
|
|
||||||
<listitem><para>Default upload bandwidth limit in kb/s.
|
<listitem><para>Default upload bandwidth limit in kb/s.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|||||||
@@ -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/>.
|
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>
|
<refentryinfo>
|
||||||
<title>check-yaml-+</title>
|
<title>buildyaml-+</title>
|
||||||
<productname>artools</productname>
|
<productname>artools</productname>
|
||||||
|
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
@@ -39,18 +39,18 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</refentryinfo>
|
</refentryinfo>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle>check-yaml</refentrytitle>
|
<refentrytitle>buildyaml</refentrytitle>
|
||||||
<manvolnum>1</manvolnum>
|
<manvolnum>1</manvolnum>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>check-yaml</refname>
|
<refname>buildyaml</refname>
|
||||||
<refpurpose>check-yaml is used to generate and validate yaml files used by calamares. </refpurpose>
|
<refpurpose>buildyaml is used to generate and validate yaml files used by calamares. </refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>check-yaml</command>
|
<command>buildyaml</command>
|
||||||
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
@@ -58,9 +58,9 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<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>
|
</refsect1>
|
||||||
|
|
||||||
@@ -128,10 +128,18 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>enable_openrc=</varname></term>
|
<term><varname>openrc_boot=</varname></term>
|
||||||
|
|
||||||
<listitem><para>Array of services that will be
|
<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>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
add_svc_rc(){
|
add_svc_rc(){
|
||||||
local mnt="$1" name="$2"
|
local mnt="$1" name="$2" rlvl="$3"
|
||||||
if [[ -f $mnt/etc/init.d/$name ]];then
|
if [[ -f $mnt/etc/init.d/$name ]];then
|
||||||
msg2 "Setting %s ..." "$name"
|
msg2 "Setting %s ..." "$name"
|
||||||
chroot $mnt rc-update add $name default &>/dev/null
|
chroot $mnt rc-update add $name $rlvl &>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,12 +52,15 @@ configure_services(){
|
|||||||
info "Configuring [%s]" "${initsys}"
|
info "Configuring [%s]" "${initsys}"
|
||||||
case ${initsys} in
|
case ${initsys} in
|
||||||
'openrc')
|
'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"
|
[[ $svc == "xdm" ]] && set_xdm "$mnt"
|
||||||
add_svc_rc "$mnt" "$svc"
|
add_svc_rc "$mnt" "$svc" "default"
|
||||||
done
|
done
|
||||||
for svc in ${enable_live[@]}; do
|
for svc in ${enable_live[@]}; do
|
||||||
add_svc_rc "$mnt" "$svc"
|
add_svc_rc "$mnt" "$svc" "default"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -39,9 +39,10 @@ prepare_transfer(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
sync_dir(){
|
sync_dir(){
|
||||||
prepare_transfer "$1"
|
prof="$1"
|
||||||
msg "Start upload [%s] ..." "$1"
|
prepare_transfer "$prof"
|
||||||
|
msg "Start upload [%s] ..." "$prof"
|
||||||
rsync "${rsync_args[@]}" ${src_dir} $(connect)${target_dir}
|
rsync "${rsync_args[@]}" ${src_dir} $(connect)${target_dir}
|
||||||
msg "Done upload [%s]" "$1"
|
msg "Done upload [%s]" "$prof"
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
repo_add_pkg(){
|
repo_add_pkg(){
|
||||||
local repo="$1" arch="$2" pkg="$3"
|
local repo="$1" arch="$2" pkg="$3"
|
||||||
# if [[ ! -f ${cache_dir_pkg}/$arch/$pkg{,.sig} ]];then
|
# 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
|
# 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(){
|
repo_del_pkg(){
|
||||||
|
|||||||
@@ -9,12 +9,20 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# 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(){
|
sync_tree_branches(){
|
||||||
local branches=(master artix archlinux testing)
|
local branches=(master artix archlinux)
|
||||||
for b in ${branches[@]};do
|
for b in ${branches[@]};do
|
||||||
git checkout $b &> /dev/null
|
git checkout $b &> /dev/null
|
||||||
local local_head=$(git log --pretty=%H ...refs/heads/$b^ | head -n 1)
|
local local_head=$(get_local_head "$b")
|
||||||
local remote_head=$(git ls-remote origin -h refs/heads/$b | cut -f1)
|
local remote_head=$(get_remote_head "$b")
|
||||||
local timer=$(get_timer) repo="$1"
|
local timer=$(get_timer) repo="$1"
|
||||||
msg "Checking [%s] (%s) ..." "$repo" "$b"
|
msg "Checking [%s] (%s) ..." "$repo" "$b"
|
||||||
msg2 "local: %s" "${local_head}"
|
msg2 "local: %s" "${local_head}"
|
||||||
@@ -32,17 +40,18 @@ sync_tree_branches(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
sync_tree(){
|
sync_tree(){
|
||||||
local master=$(git log --pretty=%H ...refs/heads/master^ | head -n 1)
|
local branch="master"
|
||||||
local master_remote=$(git ls-remote origin -h refs/heads/master | cut -f1)
|
local local_head=$(get_local_head "$branch")
|
||||||
|
local remote_head=$(get_remote_head "$branch")
|
||||||
local timer=$(get_timer) repo="$1"
|
local timer=$(get_timer) repo="$1"
|
||||||
msg "Checking [%s] ..." "$repo"
|
msg "Checking [%s] ..." "$repo"
|
||||||
msg2 "local: %s" "${master}"
|
msg2 "local: %s" "${local_head}"
|
||||||
msg2 "remote: %s" "${master_remote}"
|
msg2 "remote: %s" "${remote_head}"
|
||||||
if [[ "${master}" == "${master_remote}" ]]; then
|
if [[ "${local_head}" == "${remote_head}" ]]; then
|
||||||
info "nothing to do"
|
info "nothing to do"
|
||||||
else
|
else
|
||||||
info "needs sync"
|
info "needs sync"
|
||||||
git pull origin master
|
git pull origin $branch
|
||||||
fi
|
fi
|
||||||
msg "Done [%s]" "$repo"
|
msg "Done [%s]" "$repo"
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||||
@@ -96,6 +105,11 @@ is_dirty() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_pkgver(){
|
||||||
|
source PKGBUILD
|
||||||
|
echo $pkgver-$pkgrel
|
||||||
|
}
|
||||||
|
|
||||||
import_from_arch(){
|
import_from_arch(){
|
||||||
local timer=$(get_timer)
|
local timer=$(get_timer)
|
||||||
for repo in ${repo_tree_artix[@]};do
|
for repo in ${repo_tree_artix[@]};do
|
||||||
@@ -109,7 +123,10 @@ import_from_arch(){
|
|||||||
for pkg in ${import_list[@]};do
|
for pkg in ${import_list[@]};do
|
||||||
msg2 "Importing [%s] ..." "$pkg"
|
msg2 "Importing [%s] ..." "$pkg"
|
||||||
rsync "${rsync_args[@]}" ${tree_dir_arch}/$arch_dir/$pkg/trunk/ ${tree_dir_artix}/$repo/$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
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -50,17 +50,19 @@ load_profile(){
|
|||||||
[[ -z ${login_shell} ]] && login_shell='/bin/bash'
|
[[ -z ${login_shell} ]] && login_shell='/bin/bash'
|
||||||
|
|
||||||
if [[ -z ${addgroups} ]];then
|
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
|
fi
|
||||||
|
|
||||||
if [[ -z ${enable_openrc[@]} ]];then
|
if [[ -z ${openrc_boot[@]} ]];then
|
||||||
enable_openrc=('acpid' 'bluetooth' 'elogind' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
openrc_boot=('elogind')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${displaymanager} != "none" ]]; then
|
if [[ -z ${openrc_default[@]} ]];then
|
||||||
enable_openrc+=('xdm')
|
openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ ${displaymanager} != "none" ]] && openrc_default+=('xdm')
|
||||||
|
|
||||||
[[ -z ${netinstall} ]] && netinstall='false'
|
[[ -z ${netinstall} ]] && netinstall='false'
|
||||||
|
|
||||||
[[ -z ${chrootcfg} ]] && chrootcfg='false'
|
[[ -z ${chrootcfg} ]] && chrootcfg='false'
|
||||||
@@ -77,7 +79,7 @@ load_profile(){
|
|||||||
root_list=${run_dir}/shared/Packages-Root
|
root_list=${run_dir}/shared/Packages-Root
|
||||||
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/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"
|
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
|
||||||
|
|
||||||
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
|
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
|
||||||
@@ -86,7 +88,7 @@ load_profile(){
|
|||||||
live_list="${run_dir}/shared/Packages-Live"
|
live_list="${run_dir}/shared/Packages-Live"
|
||||||
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/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"
|
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
|
||||||
|
|
||||||
if ${netinstall};then
|
if ${netinstall};then
|
||||||
@@ -107,7 +109,8 @@ reset_profile(){
|
|||||||
unset username
|
unset username
|
||||||
unset password
|
unset password
|
||||||
unset addgroups
|
unset addgroups
|
||||||
unset enable_openrc
|
unset openrc_boot
|
||||||
|
unset openrc_default
|
||||||
unset enable_live
|
unset enable_live
|
||||||
unset login_shell
|
unset login_shell
|
||||||
unset netinstall
|
unset netinstall
|
||||||
|
|||||||
@@ -11,35 +11,6 @@
|
|||||||
|
|
||||||
import ${LIBDIR}/util-yaml.sh
|
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(){
|
write_netgroup_yaml(){
|
||||||
msg2 "Writing %s ..." "${2##*/}"
|
msg2 "Writing %s ..." "${2##*/}"
|
||||||
echo "---" > "$2"
|
echo "---" > "$2"
|
||||||
@@ -52,14 +23,12 @@ write_netgroup_yaml(){
|
|||||||
for p in ${packages[@]};do
|
for p in ${packages[@]};do
|
||||||
echo " - $p" >> "$2"
|
echo " - $p" >> "$2"
|
||||||
done
|
done
|
||||||
# ${validate} && check_yaml "$2"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_pacman_group_yaml(){
|
write_pacman_group_yaml(){
|
||||||
packages=$(pacman -Sgq "$1")
|
packages=$(pacman -Sgq "$1")
|
||||||
prepare_dir "${cache_dir_netinstall}/pacman"
|
prepare_dir "${cache_dir_netinstall}/pacman"
|
||||||
write_netgroup_yaml "$1" "${cache_dir_netinstall}/pacman/$1.yaml"
|
write_netgroup_yaml "$1" "${cache_dir_netinstall}/pacman/$1.yaml"
|
||||||
# ${validate} && check_yaml "${cache_dir_netinstall}/pacman/$1.yaml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_fn(){
|
gen_fn(){
|
||||||
@@ -74,7 +43,7 @@ make_profile_yaml(){
|
|||||||
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
|
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
|
||||||
write_netgroup_yaml "$1" "$(gen_fn "Packages-Desktop")"
|
write_netgroup_yaml "$1" "$(gen_fn "Packages-Desktop")"
|
||||||
fi
|
fi
|
||||||
# ${calamares} && write_calamares_yaml "$1"
|
${calamares} && configure_calamares "${yaml_dir}"
|
||||||
reset_profile
|
reset_profile
|
||||||
unset yaml_dir
|
unset yaml_dir
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ write_servicescfg_conf(){
|
|||||||
echo '' >> "$conf"
|
echo '' >> "$conf"
|
||||||
echo 'services:' >> "$conf"
|
echo 'services:' >> "$conf"
|
||||||
echo ' enabled:' >> "$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 " - name: $s" >> "$conf"
|
||||||
echo ' runlevel: default' >> "$conf"
|
echo ' runlevel: default' >> "$conf"
|
||||||
done
|
done
|
||||||
@@ -159,15 +163,6 @@ write_welcome_conf(){
|
|||||||
fi
|
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(){
|
write_umount_conf(){
|
||||||
local conf="${modules_dir}/umount.conf"
|
local conf="${modules_dir}/umount.conf"
|
||||||
msg2 "Writing %s ..." "${conf##*/}"
|
msg2 "Writing %s ..." "${conf##*/}"
|
||||||
@@ -255,7 +250,7 @@ write_settings_conf(){
|
|||||||
esac
|
esac
|
||||||
echo " - grubcfg" >> "$conf"
|
echo " - grubcfg" >> "$conf"
|
||||||
echo " - bootloader" >> "$conf" && write_bootloader_conf
|
echo " - bootloader" >> "$conf" && write_bootloader_conf
|
||||||
echo " - postcfg" >> "$conf" && write_postcfg_conf
|
echo " - postcfg" >> "$conf"
|
||||||
echo " - umount" >> "$conf" && write_umount_conf
|
echo " - umount" >> "$conf" && write_umount_conf
|
||||||
echo " - show:" >> "$conf"
|
echo " - show:" >> "$conf"
|
||||||
echo " - finished" >> "$conf" && write_finished_conf
|
echo " - finished" >> "$conf" && write_finished_conf
|
||||||
|
|||||||
Reference in New Issue
Block a user