forked from artix/artools
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
13f63047a2 | ||
![]() |
7cc0c0c86a | ||
![]() |
327be3b735 | ||
![]() |
6e20fc6d07 | ||
![]() |
8436f0cafb | ||
![]() |
1ded762a78 | ||
![]() |
f3ac8b8679 | ||
![]() |
622f426686 | ||
![]() |
07ee48ff72 | ||
![]() |
1728682147 | ||
![]() |
710d615cbb | ||
![]() |
a305eac6ce | ||
![]() |
b964b729cc | ||
![]() |
6d5b4d45dd | ||
![]() |
a98a7b5100 | ||
![]() |
3c80f711da | ||
![]() |
501272464b | ||
![]() |
c6ddda2773 | ||
![]() |
2bed948636 | ||
![]() |
98c1d950f8 | ||
![]() |
6941b3ce3b | ||
![]() |
1972ee936e | ||
![]() |
01e45fd5fd | ||
![]() |
a795484c7b | ||
![]() |
e099003b31 | ||
![]() |
dbec8ba9ad | ||
![]() |
b35754ecce | ||
![]() |
91cdece50d |
7
Makefile
7
Makefile
@@ -49,13 +49,10 @@ PATCHES = \
|
||||
|
||||
BIN_ISO = \
|
||||
bin/buildiso \
|
||||
bin/deployiso \
|
||||
bin/buildyaml
|
||||
bin/deployiso
|
||||
|
||||
LIBS_ISO = \
|
||||
$(wildcard lib/util-iso*.sh) \
|
||||
$(wildcard lib/util-yaml*.sh) \
|
||||
lib/util-profile.sh
|
||||
$(wildcard lib/util-iso*.sh)
|
||||
|
||||
SHARED_ISO = \
|
||||
data/mkinitcpio.conf \
|
||||
|
@@ -24,6 +24,8 @@ prepare_build(){
|
||||
|
||||
load_profile "${profile}"
|
||||
|
||||
netgroups=${netgroups_url}/netgroups-${initsys}.yaml
|
||||
|
||||
local pac_arch='default' pacman_conf pac_conf
|
||||
[[ "${target_arch}" == 'x86_64' ]] && pac_arch='lib32'
|
||||
|
||||
@@ -54,7 +56,7 @@ show_profile(){
|
||||
if ${verbose};then
|
||||
msg2 "autologin: %s" "${autologin}"
|
||||
|
||||
msg2 "netgroups: %s" "$(get_yaml)"
|
||||
msg2 "netgroups: %s" "${netgroups}"
|
||||
|
||||
msg2 "hostname: %s" "${hostname}"
|
||||
msg2 "username: %s" "${username}"
|
||||
|
@@ -25,8 +25,11 @@ display_settings(){
|
||||
show_config
|
||||
|
||||
msg "REPOS:"
|
||||
msg2 "repo_tree_arch: %s" "${repo_tree_arch[*]}"
|
||||
msg2 "repo_tree_artix: %s" "${repo_tree_artix[*]}"
|
||||
msg2 "repo_tree_arch: %s" "${repo_tree_arch[*]}"
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "repository: %s" "${repository}"
|
||||
|
||||
msg "ARGS:"
|
||||
msg2 "artix: %s" "${artix}"
|
||||
@@ -38,7 +41,7 @@ display_settings(){
|
||||
msg "PATHS:"
|
||||
msg2 "tree_dir_artix: %s" "${tree_dir_artix}"
|
||||
msg2 "tree_dir_arch: %s" "${tree_dir_arch}"
|
||||
msg2 "patches_dir: %s" "${patches_dir}"
|
||||
msg2 "patches_dir: %s" "${patches_dir}/${repository}"
|
||||
}
|
||||
|
||||
load_user_info
|
||||
@@ -51,11 +54,13 @@ artix=false
|
||||
compare=false
|
||||
import_arch=false
|
||||
gitpush=false
|
||||
repository='system' #${PWD##*/}
|
||||
|
||||
rsync_args=(-aWxv --progress --delete-before --no-R --no-implied-dirs)
|
||||
rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -r <repo> Repository [default:${repository}]"
|
||||
echo " -a Sync arch tree"
|
||||
echo " -s Sync artix tree"
|
||||
echo " -c Compare artix and arch versions"
|
||||
@@ -70,10 +75,11 @@ usage() {
|
||||
|
||||
orig_argv=("$0" "$@")
|
||||
|
||||
opts='aipscqh'
|
||||
opts='r:aipscqh'
|
||||
|
||||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
r) repository="$OPTARG" ;;
|
||||
a) arch=true ;;
|
||||
s) artix=true ;;
|
||||
c) compare=true ;;
|
||||
@@ -89,7 +95,7 @@ shift $(($OPTIND - 1))
|
||||
|
||||
prepare_dir "${tree_dir_artix}"
|
||||
prepare_dir "${tree_dir_arch}"
|
||||
prepare_dir "${patches_dir}"
|
||||
prepare_dir "${patches_dir}/${repository}"
|
||||
|
||||
${pretend} && display_settings && exit 1
|
||||
|
||||
@@ -97,6 +103,6 @@ ${artix} && sync_tree_artix
|
||||
|
||||
${arch} && sync_tree_arch
|
||||
|
||||
${compare} && show_version_table
|
||||
${compare} && show_version_table "${repository}"
|
||||
|
||||
${import_arch} && import_from_arch ${gitpush}
|
||||
${import_arch} && import_from_arch "${repository}" "${gitpush}"
|
||||
|
107
bin/buildyaml.in
107
bin/buildyaml.in
@@ -1,107 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
version=@version@
|
||||
|
||||
LIBDIR='@libdir@'
|
||||
DATADIR='@datadir@'
|
||||
SYSCONFDIR='@sysconfdir@'
|
||||
|
||||
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
|
||||
import ${LIBDIR}/util.sh
|
||||
import ${LIBDIR}/util-yaml-check.sh
|
||||
import ${LIBDIR}/util-profile.sh
|
||||
|
||||
show_profile(){
|
||||
msg2 "yaml_dir: %s" "${yaml_dir}"
|
||||
msg2 "autologin: %s" "${autologin}"
|
||||
|
||||
msg2 "netgroups: %s" "$(get_yaml)"
|
||||
|
||||
msg2 "hostname: %s" "${hostname}"
|
||||
msg2 "username: %s" "${username}"
|
||||
msg2 "password: %s" "${password}"
|
||||
msg2 "addgroups: %s" "${addgroups}"
|
||||
|
||||
msg2 "enable_live: %s" "${enable_live[*]}"
|
||||
msg2 "openrc_boot: %s" "${openrc_boot[*]}"
|
||||
msg2 "openrc_default: %s" "${openrc_default[*]}"
|
||||
}
|
||||
|
||||
display_settings(){
|
||||
show_version
|
||||
show_config
|
||||
|
||||
msg "OPTIONS:"
|
||||
msg2 "profile: %s" "${profile}"
|
||||
msg2 "arch: %s" "${target_arch}"
|
||||
msg2 "initsys: %s" "${initsys}"
|
||||
msg2 "kernel: %s" "${kernel}"
|
||||
|
||||
msg "ARGS:"
|
||||
msg2 "group: %s" "${group}"
|
||||
msg2 "calamares: %s" "${calamares}"
|
||||
|
||||
msg "BUILD:"
|
||||
show_profile
|
||||
}
|
||||
|
||||
load_user_info
|
||||
|
||||
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
|
||||
|
||||
pretend=false
|
||||
group=false
|
||||
cache_dir_netinstall="${workspace_dir}/netinstall"
|
||||
calamares=false
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -p <profile> Buildset or profile [default: ${profile}]"
|
||||
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 ' -g Enable pacman group accepted for -p'
|
||||
echo ' -c Check also calamares yaml files generated for the profile'
|
||||
echo ' -q Query settings'
|
||||
echo ' -h This help'
|
||||
echo ''
|
||||
echo ''
|
||||
exit $1
|
||||
}
|
||||
|
||||
orig_argv=("$0" "$@")
|
||||
|
||||
opts='p:a:i:k:gcqh'
|
||||
|
||||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
p) profile="$OPTARG" ;;
|
||||
a) target_arch="$OPTARG" ;;
|
||||
i) initsys="$OPTARG" ;;
|
||||
k) kernel="$OPTARG" ;;
|
||||
g) group=true ;;
|
||||
c) calamares=true ;;
|
||||
q) pretend=true ;;
|
||||
h|?) usage 0 ;;
|
||||
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
prepare_build
|
||||
|
||||
${pretend} && display_settings && exit 1
|
||||
|
||||
${group} && write_pacman_group_yaml "${profile}" && exit 0
|
||||
|
||||
build
|
@@ -78,7 +78,7 @@ opts='p:l:uvtqh'
|
||||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
p) profile="$OPTARG" ;;
|
||||
l) limit="$OPTARG" ;;
|
||||
l) uplimit="$OPTARG" ;;
|
||||
u) update=true; rsync_args+=(-u) ;;
|
||||
t) torrent=true ;;
|
||||
v) verbose=true; rsync_args+=(-v --stats) ;;
|
||||
|
@@ -19,29 +19,6 @@ import ${LIBDIR}/util-chroot.sh
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
init_variables() {
|
||||
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
||||
makepkg_args=("${default_makepkg_args[@]}")
|
||||
keepbuilddir=false
|
||||
update_first=false
|
||||
clean_first=false
|
||||
run_namcap=false
|
||||
temp_chroot=false
|
||||
chrootdir=
|
||||
passeddir=
|
||||
makepkg_user=
|
||||
declare -ga install_pkgs
|
||||
declare -gi ret=0
|
||||
|
||||
bindmounts_ro=()
|
||||
bindmounts_rw=()
|
||||
|
||||
copy=$USER
|
||||
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
||||
[[ -z "$copy" || $copy = root ]] && copy=copy
|
||||
src_owner=${SUDO_USER:-$USER}
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
||||
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
||||
@@ -293,7 +270,26 @@ move_products() {
|
||||
orig_argv=("$0" "$@")
|
||||
|
||||
main() {
|
||||
init_variables
|
||||
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
||||
makepkg_args=("${default_makepkg_args[@]}")
|
||||
keepbuilddir=false
|
||||
update_first=false
|
||||
clean_first=false
|
||||
run_namcap=false
|
||||
temp_chroot=false
|
||||
chrootdir=
|
||||
passeddir=
|
||||
makepkg_user=
|
||||
declare -ga install_pkgs
|
||||
declare -gi ret=0
|
||||
|
||||
bindmounts_ro=()
|
||||
bindmounts_rw=()
|
||||
|
||||
copy=$USER
|
||||
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
||||
[[ -z "$copy" || $copy = root ]] && copy=copy
|
||||
src_owner=${SUDO_USER:-$USER}
|
||||
|
||||
local opts='hcur:I:l:nTD:d:U:'
|
||||
|
||||
|
@@ -18,8 +18,6 @@ import ${LIBDIR}/util.sh
|
||||
|
||||
load_user_info
|
||||
|
||||
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
|
||||
|
||||
load_vars "${PAC_USERCONFDIR}/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
||||
load_vars /etc/makepkg.conf
|
||||
|
||||
@@ -34,9 +32,5 @@ msg2 "Signing [%s] with key %s" "${file_to_sign##*/}" "${GPGKEY}..."
|
||||
if [[ -n "${BUILDBOT_GPGP}" ]]; then
|
||||
gpg --batch --passphrase "${BUILDBOT_GPGP}" --detach-sign "$file_to_sign"
|
||||
else
|
||||
if [[ -f /usr/bin/hellhound ]]; then
|
||||
gpg --batch --passphrase $(hellhound retrieve) --detach-sign "$file_to_sign"
|
||||
else
|
||||
gpg --detach-sign --use-agent -u "${GPGKEY}" "$file_to_sign"
|
||||
fi
|
||||
gpg --detach-sign --use-agent -u "${GPGKEY}" "$file_to_sign"
|
||||
fi
|
||||
|
@@ -11,16 +11,18 @@
|
||||
# openrc_boot=('elogind')
|
||||
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
||||
|
||||
# unset defaults to given values
|
||||
# default values
|
||||
# addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
|
||||
|
||||
# netgroups_url="https://raw.githubusercontent.com/artix-linux/netgroups/master"
|
||||
|
||||
################# live-session #################
|
||||
|
||||
# unset defaults to given value
|
||||
# default value
|
||||
# hostname="artix"
|
||||
|
||||
# unset defaults to given value
|
||||
# default value
|
||||
# username="artix"
|
||||
|
||||
# unset defaults to given value
|
||||
# default value
|
||||
# password="artix"
|
||||
|
@@ -10,3 +10,11 @@ libsodium
|
||||
zeromq
|
||||
jansson
|
||||
libnewt
|
||||
libsass
|
||||
sassc
|
||||
libx86emu
|
||||
hwinfo
|
||||
yaml-cpp
|
||||
libbson
|
||||
libmongoc
|
||||
cmocka
|
||||
|
@@ -68,7 +68,6 @@ libqmi
|
||||
glib-networking
|
||||
gsettings-desktop-schemas
|
||||
slang
|
||||
dhcp
|
||||
dbus-python
|
||||
lirc
|
||||
qt5-3d
|
||||
@@ -180,6 +179,9 @@ python-packaging
|
||||
python-pyparsing
|
||||
python-setuptools
|
||||
python-six
|
||||
pyalpm
|
||||
python-pyelftools
|
||||
python-numpy
|
||||
randrproto
|
||||
recordproto
|
||||
renderproto
|
||||
@@ -230,3 +232,99 @@ poppler
|
||||
bc
|
||||
xdg-utils
|
||||
xf86-input-libinput
|
||||
assimp
|
||||
cdparanoia
|
||||
cifs-utils
|
||||
ffmpeg
|
||||
flac
|
||||
gamin
|
||||
gcab
|
||||
giblib
|
||||
gsm
|
||||
gst-plugins-base
|
||||
gstreamer
|
||||
gtk2
|
||||
hunspell
|
||||
hyphen
|
||||
imlib2
|
||||
iniparser
|
||||
iso-codes
|
||||
jack
|
||||
lame
|
||||
ldb
|
||||
libass
|
||||
libavc1394
|
||||
libbluray
|
||||
libbsd
|
||||
libevdev
|
||||
libgee
|
||||
libid3tag
|
||||
libiec61883
|
||||
libmng
|
||||
libmodplug
|
||||
libndp
|
||||
libnotify
|
||||
libogg
|
||||
libraw1394
|
||||
libsamplerate
|
||||
libsigsegv
|
||||
libsndfile
|
||||
libsoup
|
||||
libsoxr
|
||||
libsrtp
|
||||
libssh
|
||||
libteam
|
||||
libtheora
|
||||
libva
|
||||
libvdpau
|
||||
libvisual
|
||||
libvorbis
|
||||
libvpx
|
||||
libxss
|
||||
libxv
|
||||
libxvmc
|
||||
libyaml
|
||||
ocl-icd
|
||||
openal
|
||||
opencore-amr
|
||||
openjpeg2
|
||||
opus
|
||||
orc
|
||||
perl-file-which
|
||||
potrace
|
||||
protobuf
|
||||
scrnsaverproto
|
||||
sdl2
|
||||
snappy
|
||||
speex
|
||||
t1lib
|
||||
talloc
|
||||
tdb
|
||||
tevent
|
||||
texlive-bin
|
||||
texlive-core
|
||||
texlive-latexextra
|
||||
ttf-dejavu
|
||||
usbmuxd
|
||||
videoproto
|
||||
vid.stab
|
||||
webrtc-audio-processing
|
||||
x265
|
||||
xorg-xauth
|
||||
xorg-xset
|
||||
xvidcore
|
||||
zita-alsa-pcmi
|
||||
zita-resampler
|
||||
zziplib
|
||||
xmlto
|
||||
namcap
|
||||
unzip
|
||||
zip
|
||||
gperf
|
||||
gperftools
|
||||
double-conversion
|
||||
lapack
|
||||
texlive-formatsextra
|
||||
texlive-pictures
|
||||
texlive-science
|
||||
nasm
|
||||
|
@@ -102,7 +102,7 @@ _mnt_dev() {
|
||||
_verify_checksum() {
|
||||
local _status
|
||||
cd "/run/artix/bootmnt/${artixbasedir}/${arch}"
|
||||
md5sum -c $1.md5 > /tmp/checksum.log 2>&1
|
||||
sha512sum -c $1.sha512 > /tmp/checksum.log 2>&1
|
||||
_status=$?
|
||||
cd "${OLDPWD}"
|
||||
return ${_status}
|
||||
@@ -160,7 +160,7 @@ artix_mount_handler() {
|
||||
if [[ "${checksum}" == "y" ]]; then
|
||||
for fs in rootfs desktopfs livefs;do
|
||||
if [[ -f "/run/artix/bootmnt/${artixbasedir}/${arch}/${fs}.sfs" ]]; then
|
||||
if [[ -f "/run/artix/bootmnt/${artixbasedir}/${arch}/${fs}.md5" ]]; then
|
||||
if [[ -f "/run/artix/bootmnt/${artixbasedir}/${arch}/${fs}.sha512" ]]; then
|
||||
msg -n ":: Self-test requested, please wait..."
|
||||
if _verify_checksum "${fs}"; then
|
||||
msg "done. Checksum is OK, continue booting."
|
||||
@@ -170,7 +170,7 @@ artix_mount_handler() {
|
||||
launch_interactive_shell
|
||||
fi
|
||||
else
|
||||
echo "ERROR: checksum=y option specified but ${artixbasedir}/${arch}/${fs}.md5 not found"
|
||||
echo "ERROR: checksum=y option specified but ${artixbasedir}/${arch}/${fs}.sha512 not found"
|
||||
launch_interactive_shell
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,118 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
add_svc_rc(){
|
||||
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 $rlvl &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
set_xdm(){
|
||||
if [[ -f $1/etc/conf.d/xdm ]];then
|
||||
local conf='DISPLAYMANAGER="'${displaymanager}'"'
|
||||
sed -i -e "s|^.*DISPLAYMANAGER=.*|${conf}|" $1/etc/conf.d/xdm
|
||||
fi
|
||||
}
|
||||
|
||||
configure_hosts(){
|
||||
sed -e "s|localhost.localdomain|localhost.localdomain ${hostname}|" -i $1/etc/hosts
|
||||
}
|
||||
|
||||
configure_logind(){
|
||||
local conf=$1/etc/$2/logind.conf
|
||||
if [[ -e $conf ]];then
|
||||
msg2 "Configuring logind ..."
|
||||
sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' "$conf"
|
||||
sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' "$conf"
|
||||
sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' "$conf"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_services(){
|
||||
local mnt="$1"
|
||||
info "Configuring [%s]" "${initsys}"
|
||||
case ${initsys} in
|
||||
'openrc')
|
||||
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" "default"
|
||||
done
|
||||
for svc in ${enable_live[@]}; do
|
||||
add_svc_rc "$mnt" "$svc" "default"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
info "Done configuring [%s]" "${initsys}"
|
||||
}
|
||||
|
||||
configure_system(){
|
||||
local mnt="$1"
|
||||
case ${initsys} in
|
||||
'openrc')
|
||||
configure_logind "$mnt" "elogind"
|
||||
;;
|
||||
esac
|
||||
echo ${hostname} > $mnt/etc/hostname
|
||||
}
|
||||
|
||||
clean_iso_root(){
|
||||
local dest="$1"
|
||||
msg "Deleting isoroot [%s] ..." "${dest##*/}"
|
||||
rm -rf --one-file-system "$dest"
|
||||
}
|
||||
|
||||
clean_up_image(){
|
||||
local path mnt="$1"
|
||||
msg2 "Cleaning [%s]" "${mnt##*/}"
|
||||
|
||||
default_locale "reset" "$mnt"
|
||||
path=$mnt/boot
|
||||
if [[ -d "$path" ]]; then
|
||||
find "$path" -name 'initramfs*.img' -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/lib/pacman/sync
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/cache/pacman/pkg
|
||||
if [[ -d $path ]]; then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/log
|
||||
if [[ -d $path ]]; then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/tmp
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -mindepth 1 -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/tmp
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -mindepth 1 -delete &> /dev/null
|
||||
fi
|
||||
|
||||
if [[ ${mnt##*/} == 'livefs' ]];then
|
||||
rm -rf "$mnt/etc/pacman.d/gnupg"
|
||||
fi
|
||||
|
||||
find "$mnt" -name *.pacnew -name *.pacsave -name *.pacorig -delete
|
||||
if [[ -f "$mnt/boot/grub/grub.cfg" ]]; then
|
||||
rm $mnt/boot/grub/grub.cfg
|
||||
fi
|
||||
if [[ -f "$mnt/etc/machine-id" ]]; then
|
||||
rm $mnt/etc/machine-id
|
||||
fi
|
||||
}
|
@@ -46,6 +46,15 @@ prepare_boot_extras(){
|
||||
cp $src/usr/share/licenses/common/GPL2/license.txt $dest/memtest.COPYING
|
||||
}
|
||||
|
||||
configure_grub(){
|
||||
local conf="$1"
|
||||
|
||||
sed -e "s|@arch@|${target_arch}|g" \
|
||||
-e "s|@iso_label@|${iso_label}|" \
|
||||
-e "s|@iso_name@|${iso_name}|g" \
|
||||
-i $conf
|
||||
}
|
||||
|
||||
prepare_grub(){
|
||||
local platform=i386-pc img='core.img' grub=$3/boot/grub efi=$3/efi/boot \
|
||||
lib=$1/usr/lib/grub prefix=/boot/grub theme=$2/usr/share/grub data=$1/usr/share/grub
|
||||
|
@@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
track_img() {
|
||||
info "mount: [%s]" "$2"
|
||||
mount "$@" && IMG_ACTIVE_MOUNTS=("$2" "${IMG_ACTIVE_MOUNTS[@]}")
|
||||
}
|
||||
|
||||
mount_img() {
|
||||
IMG_ACTIVE_MOUNTS=()
|
||||
mkdir -p "$2"
|
||||
track_img "$1" "$2"
|
||||
}
|
||||
|
||||
umount_img() {
|
||||
if [[ -n ${IMG_ACTIVE_MOUNTS[@]} ]];then
|
||||
info "umount: [%s]" "${IMG_ACTIVE_MOUNTS[@]}"
|
||||
umount "${IMG_ACTIVE_MOUNTS[@]}"
|
||||
unset IMG_ACTIVE_MOUNTS
|
||||
rm -r "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
track_fs() {
|
||||
info "overlayfs mount: [%s]" "$5"
|
||||
mount "$@" && FS_ACTIVE_MOUNTS=("$5" "${FS_ACTIVE_MOUNTS[@]}")
|
||||
}
|
||||
|
||||
mount_overlay(){
|
||||
FS_ACTIVE_MOUNTS=()
|
||||
local lower= upper="$1" work="$2" pkglist="$3"
|
||||
local fs=${upper##*/}
|
||||
local rootfs="$work/rootfs" desktopfs="$work/desktopfs" livefs="$work/livefs"
|
||||
mkdir -p "${mnt_dir}/work"
|
||||
mkdir -p "$upper"
|
||||
case $fs in
|
||||
desktopfs) lower="$rootfs" ;;
|
||||
livefs)
|
||||
lower="$rootfs"
|
||||
[[ -f $pkglist ]] && lower="$desktopfs":"$rootfs"
|
||||
;;
|
||||
bootfs)
|
||||
lower="$livefs":"$rootfs"
|
||||
[[ -f $pkglist ]] && lower="$livefs":"$desktopfs":"$rootfs"
|
||||
;;
|
||||
esac
|
||||
track_fs -t overlay overlay -olowerdir="$lower",upperdir="$upper",workdir="${mnt_dir}/work" "$upper"
|
||||
}
|
||||
|
||||
umount_overlay(){
|
||||
if [[ -n ${FS_ACTIVE_MOUNTS[@]} ]];then
|
||||
info "overlayfs umount: [%s]" "${FS_ACTIVE_MOUNTS[@]}"
|
||||
umount "${FS_ACTIVE_MOUNTS[@]}"
|
||||
unset FS_ACTIVE_MOUNTS
|
||||
rm -rf "${mnt_dir}/work"
|
||||
fi
|
||||
}
|
@@ -59,7 +59,7 @@ load_profile(){
|
||||
|
||||
enable_live=('artix-live' 'pacman-init')
|
||||
|
||||
[[ -z ${netgroups} ]] && netgroups="https://raw.githubusercontent.com/artix-linux/netgroups/master"
|
||||
[[ -z ${netgroups_url} ]] && netgroups_url="https://raw.githubusercontent.com/artix-linux/netgroups/master"
|
||||
|
||||
return 0
|
||||
}
|
@@ -10,7 +10,7 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
get_preset(){
|
||||
local p=${tmp_dir}/${kernel}.preset
|
||||
local p=/tmp/${kernel}.preset
|
||||
cp ${DATADIR}/linux.preset $p
|
||||
sed -e "s|@kernel@|$kernel|g" \
|
||||
-e "s|@arch@|${target_arch}|g"\
|
||||
@@ -83,7 +83,7 @@ write_netinstall_conf(){
|
||||
local conf="$1/netinstall.conf"
|
||||
msg2 "Writing %s ..." "${conf##*/}"
|
||||
echo "---" > "$conf"
|
||||
echo "groupsUrl: ${netgroups}/netgroups-${initsys}.yaml" >> "$conf"
|
||||
echo "groupsUrl: ${netgroups}" >> "$conf"
|
||||
}
|
||||
|
||||
configure_calamares(){
|
204
lib/util-iso.sh
204
lib/util-iso.sh
@@ -10,11 +10,64 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
import ${LIBDIR}/util-chroot.sh
|
||||
import ${LIBDIR}/util-iso-chroot.sh
|
||||
import ${LIBDIR}/util-iso-grub.sh
|
||||
import ${LIBDIR}/util-yaml.sh
|
||||
import ${LIBDIR}/util-iso-mount.sh
|
||||
import ${LIBDIR}/util-profile.sh
|
||||
import ${LIBDIR}/util-iso-yaml.sh
|
||||
import ${LIBDIR}/util-iso-profile.sh
|
||||
|
||||
track_img() {
|
||||
info "mount: [%s]" "$2"
|
||||
mount "$@" && IMG_ACTIVE_MOUNTS=("$2" "${IMG_ACTIVE_MOUNTS[@]}")
|
||||
}
|
||||
|
||||
mount_img() {
|
||||
IMG_ACTIVE_MOUNTS=()
|
||||
mkdir -p "$2"
|
||||
track_img "$1" "$2"
|
||||
}
|
||||
|
||||
umount_img() {
|
||||
if [[ -n ${IMG_ACTIVE_MOUNTS[@]} ]];then
|
||||
info "umount: [%s]" "${IMG_ACTIVE_MOUNTS[@]}"
|
||||
umount "${IMG_ACTIVE_MOUNTS[@]}"
|
||||
unset IMG_ACTIVE_MOUNTS
|
||||
rm -r "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
track_fs() {
|
||||
info "overlayfs mount: [%s]" "$5"
|
||||
mount "$@" && FS_ACTIVE_MOUNTS=("$5" "${FS_ACTIVE_MOUNTS[@]}")
|
||||
}
|
||||
|
||||
mount_overlay(){
|
||||
FS_ACTIVE_MOUNTS=()
|
||||
local lower= upper="$1" work="$2" pkglist="$3"
|
||||
local fs=${upper##*/}
|
||||
local rootfs="$work/rootfs" desktopfs="$work/desktopfs" livefs="$work/livefs"
|
||||
mkdir -p "${mnt_dir}/work"
|
||||
mkdir -p "$upper"
|
||||
case $fs in
|
||||
desktopfs) lower="$rootfs" ;;
|
||||
livefs)
|
||||
lower="$rootfs"
|
||||
[[ -f $pkglist ]] && lower="$desktopfs":"$rootfs"
|
||||
;;
|
||||
bootfs)
|
||||
lower="$livefs":"$rootfs"
|
||||
[[ -f $pkglist ]] && lower="$livefs":"$desktopfs":"$rootfs"
|
||||
;;
|
||||
esac
|
||||
track_fs -t overlay overlay -olowerdir="$lower",upperdir="$upper",workdir="${mnt_dir}/work" "$upper"
|
||||
}
|
||||
|
||||
umount_overlay(){
|
||||
if [[ -n ${FS_ACTIVE_MOUNTS[@]} ]];then
|
||||
info "overlayfs umount: [%s]" "${FS_ACTIVE_MOUNTS[@]}"
|
||||
umount "${FS_ACTIVE_MOUNTS[@]}"
|
||||
unset FS_ACTIVE_MOUNTS
|
||||
rm -rf "${mnt_dir}/work"
|
||||
fi
|
||||
}
|
||||
|
||||
error_function() {
|
||||
if [[ -p $logpipe ]]; then
|
||||
@@ -33,9 +86,9 @@ error_function() {
|
||||
|
||||
# $1: function
|
||||
run_log(){
|
||||
local func="$1"
|
||||
local func="$1" log_dir='/var/log/artools'
|
||||
local logfile=${log_dir}/$(gen_iso_fn).$func.log
|
||||
logpipe=$(mktemp -u "${tmp_dir}/$func.pipe.XXXXXXXX")
|
||||
logpipe=$(mktemp -u "/tmp/$func.pipe.XXXXXXXX")
|
||||
mkfifo "$logpipe"
|
||||
tee "$logfile" < "$logpipe" &
|
||||
local teepid=$!
|
||||
@@ -78,6 +131,114 @@ prepare_traps(){
|
||||
# trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR
|
||||
}
|
||||
|
||||
add_svc_rc(){
|
||||
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 $rlvl &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
set_xdm(){
|
||||
if [[ -f $1/etc/conf.d/xdm ]];then
|
||||
local conf='DISPLAYMANAGER="'${displaymanager}'"'
|
||||
sed -i -e "s|^.*DISPLAYMANAGER=.*|${conf}|" $1/etc/conf.d/xdm
|
||||
fi
|
||||
}
|
||||
|
||||
configure_hosts(){
|
||||
sed -e "s|localhost.localdomain|localhost.localdomain ${hostname}|" -i $1/etc/hosts
|
||||
}
|
||||
|
||||
configure_logind(){
|
||||
local conf=$1/etc/$2/logind.conf
|
||||
if [[ -e $conf ]];then
|
||||
msg2 "Configuring logind ..."
|
||||
sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' "$conf"
|
||||
sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' "$conf"
|
||||
sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' "$conf"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_services(){
|
||||
local mnt="$1"
|
||||
info "Configuring [%s]" "${initsys}"
|
||||
case ${initsys} in
|
||||
'openrc')
|
||||
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" "default"
|
||||
done
|
||||
for svc in ${enable_live[@]}; do
|
||||
add_svc_rc "$mnt" "$svc" "default"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
info "Done configuring [%s]" "${initsys}"
|
||||
}
|
||||
|
||||
configure_system(){
|
||||
local mnt="$1"
|
||||
case ${initsys} in
|
||||
'openrc')
|
||||
configure_logind "$mnt" "elogind"
|
||||
;;
|
||||
esac
|
||||
echo ${hostname} > $mnt/etc/hostname
|
||||
}
|
||||
|
||||
clean_iso_root(){
|
||||
local dest="$1"
|
||||
msg "Deleting isoroot [%s] ..." "${dest##*/}"
|
||||
rm -rf --one-file-system "$dest"
|
||||
}
|
||||
|
||||
clean_up_image(){
|
||||
local path mnt="$1"
|
||||
msg2 "Cleaning [%s]" "${mnt##*/}"
|
||||
|
||||
default_locale "reset" "$mnt"
|
||||
path=$mnt/boot
|
||||
if [[ -d "$path" ]]; then
|
||||
find "$path" -name 'initramfs*.img' -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/lib/pacman/sync
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/cache/pacman/pkg
|
||||
if [[ -d $path ]]; then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/log
|
||||
if [[ -d $path ]]; then
|
||||
find "$path" -type f -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/var/tmp
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -mindepth 1 -delete &> /dev/null
|
||||
fi
|
||||
path=$mnt/tmp
|
||||
if [[ -d $path ]];then
|
||||
find "$path" -mindepth 1 -delete &> /dev/null
|
||||
fi
|
||||
|
||||
if [[ ${mnt##*/} == 'livefs' ]];then
|
||||
rm -rf "$mnt/etc/pacman.d/gnupg"
|
||||
fi
|
||||
|
||||
find "$mnt" -name *.pacnew -name *.pacsave -name *.pacorig -delete
|
||||
if [[ -f "$mnt/boot/grub/grub.cfg" ]]; then
|
||||
rm $mnt/boot/grub/grub.cfg
|
||||
fi
|
||||
if [[ -f "$mnt/etc/machine-id" ]]; then
|
||||
rm $mnt/etc/machine-id
|
||||
fi
|
||||
}
|
||||
|
||||
configure_live_image(){
|
||||
local fs="$1"
|
||||
msg "Configuring [livefs]"
|
||||
@@ -101,9 +262,9 @@ make_sig () {
|
||||
|
||||
make_checksum(){
|
||||
local idir="$1" file="$2"
|
||||
msg2 "Creating md5sum ..."
|
||||
msg2 "Creating sha512sum ..."
|
||||
cd $idir
|
||||
md5sum $file.sfs > $file.md5
|
||||
sha512sum $file.sfs > $file.sha512
|
||||
cd ${OLDPWD}
|
||||
}
|
||||
|
||||
@@ -121,8 +282,8 @@ make_sfs() {
|
||||
msg "Generating SquashFS image for %s" "${src}"
|
||||
if [[ -f "${sfs}" ]]; then
|
||||
local has_changed_dir=$(find ${src} -newer ${sfs})
|
||||
msg2 "Possible changes for %s ..." "${src}" >> ${tmp_dir}/buildiso.debug
|
||||
msg2 "%s" "${has_changed_dir}" >> ${tmp_dir}/buildiso.debug
|
||||
msg2 "Possible changes for %s ..." "${src}" >> /tmp/buildiso.debug
|
||||
msg2 "%s" "${has_changed_dir}" >> /tmp/buildiso.debug
|
||||
if [[ -n "${has_changed_dir}" ]]; then
|
||||
msg2 "SquashFS image %s is not up to date, rebuilding..." "${sfs}"
|
||||
rm "${sfs}"
|
||||
@@ -198,14 +359,11 @@ assemble_iso(){
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
|
||||
-eltorito-alt-boot \
|
||||
-append_partition 2 0xef ${iso_root}/efi.img \
|
||||
-e --interval:appended_partition_2:all:: \
|
||||
-e --interval:appended_partition_2:all:: -iso_mbr_part_type 0x00 \
|
||||
-no-emul-boot \
|
||||
-iso-level 3 \
|
||||
-o ${iso_dir}/${iso_file} \
|
||||
${iso_root}/
|
||||
|
||||
# arg to add with xorriso-1.4.7
|
||||
# -iso_mbr_part_type 0x00
|
||||
}
|
||||
|
||||
# Build ISO
|
||||
@@ -344,23 +502,6 @@ make_bootfs() {
|
||||
fi
|
||||
}
|
||||
|
||||
configure_grub(){
|
||||
local conf="$1"
|
||||
local default_args="artixbasedir=${iso_name} artixlabel=${iso_label}" boot_args=('quiet')
|
||||
|
||||
sed -e "s|@DIST_NAME@|${iso_name}|g" \
|
||||
-e "s|@ARCH@|${target_arch}|g" \
|
||||
-e "s|@DEFAULT_ARGS@|${default_args}|g" \
|
||||
-e "s|@BOOT_ARGS@|${boot_args[*]}|g" \
|
||||
-e "s|@PROFILE@|${profile}|g" \
|
||||
-i $conf
|
||||
}
|
||||
|
||||
configure_grub_theme(){
|
||||
local conf="$1"
|
||||
sed -e "s|@DIST@|${iso_name}|" -i "$conf"
|
||||
}
|
||||
|
||||
make_grub(){
|
||||
if [[ ! -e ${work_dir}/grub.lock ]]; then
|
||||
msg "Prepare [/iso/boot/grub]"
|
||||
@@ -368,7 +509,6 @@ make_grub(){
|
||||
prepare_grub "${work_dir}/rootfs" "${work_dir}/livefs" "${iso_root}"
|
||||
|
||||
configure_grub "${iso_root}/boot/grub/kernels.cfg"
|
||||
configure_grub_theme "${iso_root}/boot/grub/variable.cfg"
|
||||
|
||||
: > ${work_dir}/grub.lock
|
||||
msg "Done [/iso/boot/grub]"
|
||||
|
@@ -8,61 +8,22 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
export LC_MESSAGES=C
|
||||
# export LC_MESSAGES=C
|
||||
export LANG=C
|
||||
|
||||
declare ALL_OFF='' BOLD='' BLUE='' GREEN='' RED='' YELLOW=''
|
||||
source /usr/share/makepkg/util.sh
|
||||
|
||||
if [[ -t 2 ]]; then
|
||||
# prefer terminal safe colored and bold text when tput is supported
|
||||
if tput setaf 0 &>/dev/null; then
|
||||
ALL_OFF="$(tput sgr0)"
|
||||
BOLD="$(tput bold)"
|
||||
RED="${BOLD}$(tput setaf 1)"
|
||||
GREEN="${BOLD}$(tput setaf 2)"
|
||||
YELLOW="${BOLD}$(tput setaf 3)"
|
||||
BLUE="${BOLD}$(tput setaf 4)"
|
||||
else
|
||||
ALL_OFF="\e[0m"
|
||||
BOLD="\e[1m"
|
||||
RED="${BOLD}\e[31m"
|
||||
GREEN="${BOLD}\e[32m"
|
||||
YELLOW="${BOLD}\e[33m"
|
||||
BLUE="${BOLD}\e[34m"
|
||||
fi
|
||||
colorize
|
||||
else
|
||||
declare -gr ALL_OFF='' BOLD='' BLUE='' GREEN='' RED='' YELLOW=''
|
||||
fi
|
||||
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||
|
||||
plain() {
|
||||
local mesg=$1; shift
|
||||
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
msg() {
|
||||
local mesg=$1; shift
|
||||
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
msg2() {
|
||||
local mesg=$1; shift
|
||||
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
info() {
|
||||
local mesg=$1; shift
|
||||
printf "${YELLOW} -->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
warning() {
|
||||
local mesg=$1; shift
|
||||
printf "${YELLOW}==> WARNING:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
error() {
|
||||
local mesg=$1; shift
|
||||
printf "${RED}==> ERROR:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
stat_busy() {
|
||||
local mesg=$1; shift
|
||||
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2
|
||||
|
@@ -52,6 +52,13 @@ move_to_repo(){
|
||||
|
||||
add_to_repo(){
|
||||
local repo="$1" destarch="$2" pkg="$3" ver pkgfile result
|
||||
if [[ $pkg == 'llvm' ]];then
|
||||
if [[ ${repo#*-} == 'testing' ]];then
|
||||
repo='world-testing'
|
||||
else
|
||||
repo='world'
|
||||
fi
|
||||
fi
|
||||
local repo_path=${repos_root}/$repo/os/$destarch
|
||||
source $pkg/PKGBUILD
|
||||
local dest=$pkg
|
||||
|
@@ -22,35 +22,6 @@ is_dirty() {
|
||||
return 0
|
||||
}
|
||||
|
||||
show_version_table(){
|
||||
declare -A UPDATES
|
||||
msg_table_header "%-30s %-30s %-30s %-30s" "Repository" "Package" "Artix version" "Arch version"
|
||||
for repo in ${repo_tree_artix[@]}; do
|
||||
for pkg in ${tree_dir_artix}/$repo/*; do
|
||||
if [[ -f $pkg/PKGBUILD ]];then
|
||||
source $pkg/PKGBUILD 2>/dev/null
|
||||
package=${pkg##*/}
|
||||
artixver=$(get_full_version $package)
|
||||
set_import_path "$repo" "$package"
|
||||
if [[ -f $src/PKGBUILD ]];then
|
||||
source $src/PKGBUILD 2>/dev/null
|
||||
archver=$(get_full_version $package)
|
||||
fi
|
||||
if [ $(vercmp $artixver $archver) -lt 0 ];then
|
||||
UPDATES[$package]="$pkg/PKGBUILD $src/PKGBUILD"
|
||||
msg_row_update "%-30s %-30s %-30s %-30s" "$repo" "$package" "$artixver" "$archver"
|
||||
fi
|
||||
fi
|
||||
unset pkgver epoch pkgrel artixver archver package
|
||||
done
|
||||
done
|
||||
rm ${patches_dir}/*.patch
|
||||
for upd in "${!UPDATES[@]}"; do
|
||||
msg "Writing %s update patch ..." "$upd"
|
||||
diff -u ${UPDATES[$upd]} > ${patches_dir}/"$upd"-archlinux.patch
|
||||
done
|
||||
}
|
||||
|
||||
sync_tree(){
|
||||
local branch="master" repo="$1"
|
||||
git checkout $branch
|
||||
@@ -80,6 +51,7 @@ clone_tree(){
|
||||
}
|
||||
|
||||
sync_tree_arch(){
|
||||
local repo="$1"
|
||||
cd ${tree_dir_arch}
|
||||
for repo in ${repo_tree_arch[@]};do
|
||||
if [[ -d ${repo} ]];then
|
||||
@@ -94,6 +66,7 @@ sync_tree_arch(){
|
||||
}
|
||||
|
||||
sync_tree_artix(){
|
||||
local repo="$1"
|
||||
cd ${tree_dir_artix}
|
||||
for repo in ${repo_tree_artix[@]};do
|
||||
if [[ -d ${repo} ]];then
|
||||
@@ -149,36 +122,23 @@ set_import_path(){
|
||||
local repo="$1" pkg="$2"
|
||||
case $repo in
|
||||
system|world)
|
||||
if [[ "$repo" == 'system' ]];then
|
||||
arch_repo=core
|
||||
arch_dir=packages
|
||||
fi
|
||||
if [[ "$repo" == 'world' ]];then
|
||||
arch_repo=extra
|
||||
arch_dir=packages
|
||||
fi
|
||||
arch_dir=packages
|
||||
[[ "$repo" == 'system' ]] && arch_repo=core
|
||||
[[ "$repo" == 'world' ]] && arch_repo=extra
|
||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos
|
||||
src=$import_path/$arch_repo-x86_64
|
||||
if [[ -d $import_path/$arch_repo-any ]];then
|
||||
src=$import_path/$arch_repo-any
|
||||
elif [[ -d $import_path/testing-x86_64 ]];then
|
||||
src=$import_path/testing-x86_64
|
||||
elif [[ -d $import_path/testing-any ]];then
|
||||
src=$import_path/testing-any
|
||||
fi
|
||||
[[ -d $import_path/testing-x86_64 ]] && src=$import_path/testing-x86_64
|
||||
[[ -d $import_path/$arch_repo-any ]] && src=$import_path/$arch_repo-any
|
||||
[[ -d $import_path/testing-any ]] && src=$import_path/testing-any
|
||||
;;
|
||||
galaxy)
|
||||
arch_repo=community
|
||||
arch_dir=$arch_repo
|
||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos/$arch_repo
|
||||
src=$import_path-x86_64
|
||||
if [[ -d $import_path-any ]];then
|
||||
src=$import_path-any
|
||||
elif [[ -d $import_path-testing-x86_64 ]];then
|
||||
src=$import_path-testing-x86_64
|
||||
elif [[ -d $import_path-testing-any ]];then
|
||||
src=$import_path-testing-any
|
||||
fi
|
||||
[[ -d $import_path-testing-x86_64 ]] && src=$import_path-testing-x86_64
|
||||
[[ -d $import_path-any ]] && src=$import_path-any
|
||||
[[ -d $import_path-testing-any ]] && src=$import_path-testing-any
|
||||
;;
|
||||
lib32)
|
||||
if [[ "$pkg" == 'llvm' ]];then
|
||||
@@ -186,51 +146,70 @@ set_import_path(){
|
||||
arch_dir=packages
|
||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos
|
||||
src=$import_path/extra-x86_64
|
||||
if [[ -d $import_path/testing-x86_64 ]];then
|
||||
src=$import_path/testing-x86_64
|
||||
fi
|
||||
[[ -d $import_path/testing-x86_64 ]] && src=$import_path/testing-x86_64
|
||||
else
|
||||
arch_repo=multilib
|
||||
arch_dir=community
|
||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos
|
||||
src=$import_path/$arch_repo-x86_64
|
||||
if [[ -d $import_path/$arch_repo-testing-x86_64 ]];then
|
||||
src=$import_path/$arch_repo-testing-x86_64
|
||||
fi
|
||||
[[ -d $import_path/$arch_repo-testing-x86_64 ]] && src=$import_path/$arch_repo-testing-x86_64
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# info "src: %s" "$src"
|
||||
}
|
||||
|
||||
show_version_table(){
|
||||
local repo="$1"
|
||||
declare -A UPDATES
|
||||
msg_table_header "%-30s %-30s %-30s %-30s" "Repository" "Package" "Artix version" "Arch version"
|
||||
for pkg in ${tree_dir_artix}/$repo/*; do
|
||||
if [[ -f $pkg/PKGBUILD ]];then
|
||||
source $pkg/PKGBUILD 2>/dev/null
|
||||
package=${pkg##*/}
|
||||
artixver=$(get_full_version $package)
|
||||
set_import_path "$repo" "$package"
|
||||
if [[ -f $src/PKGBUILD ]];then
|
||||
source $src/PKGBUILD 2>/dev/null
|
||||
archver=$(get_full_version $package)
|
||||
fi
|
||||
if [ $(vercmp $artixver $archver) -lt 0 ];then
|
||||
UPDATES[$package]="$pkg/PKGBUILD $src/PKGBUILD"
|
||||
msg_row_update "%-30s %-30s %-30s %-30s" "$repo" "$package" "$artixver" "$archver"
|
||||
fi
|
||||
fi
|
||||
unset pkgver epoch pkgrel artixver archver package
|
||||
done
|
||||
find "${patches_dir}/$repo/" -name *.patch -delete
|
||||
for upd in "${!UPDATES[@]}"; do
|
||||
msg "Writing %s update patch ..." "$upd"
|
||||
diff -u ${UPDATES[$upd]} > ${patches_dir}/$repo/"$upd"-archlinux.patch
|
||||
done
|
||||
}
|
||||
|
||||
import_from_arch(){
|
||||
local timer=$(get_timer) branch='testing' push="$1"
|
||||
for repo in ${repo_tree_artix[@]};do
|
||||
read_import_list "$repo"
|
||||
if [[ -n ${import_list[@]} ]];then
|
||||
cd ${tree_dir_artix}/$repo
|
||||
git checkout $branch &> /dev/null
|
||||
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
|
||||
git pull origin "$branch"
|
||||
msg "Import into [%s]" "$repo"
|
||||
for pkg in ${import_list[@]};do
|
||||
source $pkg/PKGBUILD 2>/dev/null
|
||||
local ver=$(get_full_version $pkg)
|
||||
msg2 "package: %s-%s" "$pkg" "$ver"
|
||||
set_import_path "$repo" "$pkg"
|
||||
rsync "${rsync_args[@]}" $src/ ${tree_dir_artix}/$repo/$pkg/
|
||||
if $(is_dirty) || $(is_untracked); then
|
||||
patch_pkg "$pkg"
|
||||
${push} && git add "$pkg"
|
||||
msg2 "Archlinux import: [%s]" "$pkg-$ver"
|
||||
if ${push};then
|
||||
git commit -m "Archlinux import: $pkg-$ver"
|
||||
sleep 10
|
||||
git push origin "$branch"
|
||||
fi
|
||||
fi
|
||||
unset pkgver epoch pkgrel ver
|
||||
done
|
||||
fi
|
||||
done
|
||||
local timer=$(get_timer) branch='testing' repo="$1" push="$2"
|
||||
read_import_list "$repo"
|
||||
if [[ -n ${import_list[@]} ]];then
|
||||
cd ${tree_dir_artix}/$repo
|
||||
git checkout $branch &> /dev/null
|
||||
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
|
||||
git pull origin "$branch"
|
||||
for pkg in ${import_list[@]};do
|
||||
set_import_path "$repo" "$pkg"
|
||||
source $src/PKGBUILD 2>/dev/null
|
||||
local ver=$(get_full_version $pkg)
|
||||
msg "Package: %s-%s" "$pkg" "$ver"
|
||||
rsync "${rsync_args[@]}" $src/ ${tree_dir_artix}/$repo/$pkg/
|
||||
patch_pkg "$pkg"
|
||||
if ${push};then
|
||||
git add "$pkg"
|
||||
git commit -m "$pkg-$ver"
|
||||
sleep 10
|
||||
git push origin "$branch"
|
||||
fi
|
||||
unset pkgver epoch pkgrel ver
|
||||
done
|
||||
fi
|
||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||
}
|
||||
|
@@ -9,15 +9,6 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
in_array() {
|
||||
local needle=$1; shift
|
||||
local item
|
||||
for item in "$@"; do
|
||||
[[ $item = $needle ]] && return 0 # Found
|
||||
done
|
||||
return 1 # Not Found
|
||||
}
|
||||
|
||||
# $1: sofile
|
||||
# $2: soarch
|
||||
process_sofile() {
|
||||
@@ -45,30 +36,6 @@ pkgver_equal() {
|
||||
fi
|
||||
}
|
||||
|
||||
get_full_version() {
|
||||
# set defaults if they weren't specified in buildfile
|
||||
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||
epoch=${epoch:-0}
|
||||
if [[ -z $1 ]]; then
|
||||
if [[ $epoch ]] && (( ! $epoch )); then
|
||||
echo $pkgver-$pkgrel
|
||||
else
|
||||
echo $epoch:$pkgver-$pkgrel
|
||||
fi
|
||||
else
|
||||
for i in pkgver pkgrel epoch; do
|
||||
local indirect="${i}_override"
|
||||
eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
|
||||
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
|
||||
done
|
||||
if (( ! $epoch_override )); then
|
||||
echo $pkgver_override-$pkgrel_override
|
||||
else
|
||||
echo $epoch_override:$pkgver_override-$pkgrel_override
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
find_cached_package() {
|
||||
local searchdirs=("$PWD" "$PKGDEST") results=()
|
||||
local targetname=$1 targetver=$2 targetarch=$3
|
||||
|
@@ -1,54 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
import ${LIBDIR}/util-yaml.sh
|
||||
|
||||
write_netgroup_yaml(){
|
||||
local name="$1" yaml="$2"
|
||||
msg2 "Writing %s ..." "${yaml##*/}"
|
||||
echo "---" > "$yaml"
|
||||
echo "- name: '$name'" >> "$yaml"
|
||||
echo " description: '$name'" >> "$yaml"
|
||||
echo " selected: false" >> "$yaml"
|
||||
echo " hidden: false" >> "$yaml"
|
||||
echo " critical: false" >> "$yaml"
|
||||
echo " packages:" >> "$yaml"
|
||||
for p in ${packages[@]};do
|
||||
echo " - $p" >> "$yaml"
|
||||
done
|
||||
}
|
||||
|
||||
write_pacman_group_yaml(){
|
||||
local group="$1"
|
||||
packages=$(pacman -Sgq "$group")
|
||||
prepare_dir "${cache_dir_netinstall}/pacman"
|
||||
write_netgroup_yaml "$group" "${cache_dir_netinstall}/pacman/$group.yaml"
|
||||
}
|
||||
|
||||
gen_fn(){
|
||||
echo "${yaml_dir}/$1-${target_arch}-${initsys}.yaml"
|
||||
}
|
||||
|
||||
prepare_build(){
|
||||
load_profile "${profile}"
|
||||
yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch}
|
||||
prepare_dir "${yaml_dir}"
|
||||
}
|
||||
|
||||
build(){
|
||||
load_pkgs "${root_list}" "${target_arch}" "${initsys}" "${kernel}"
|
||||
write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Root")"
|
||||
if [[ -f "${desktop_list}" ]]; then
|
||||
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
|
||||
write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Desktop")"
|
||||
fi
|
||||
${calamares} && configure_calamares "${yaml_dir}"
|
||||
}
|
@@ -58,10 +58,6 @@ init_artools_base(){
|
||||
|
||||
[[ -z ${chroots_dir} ]] && chroots_dir='/var/lib/artools'
|
||||
|
||||
log_dir='/var/log/artools'
|
||||
|
||||
tmp_dir='/tmp'
|
||||
|
||||
[[ -z ${workspace_dir} ]] && workspace_dir=/home/${OWNER}/artools-workspace
|
||||
|
||||
prepare_dir "${workspace_dir}"
|
||||
|
Reference in New Issue
Block a user