forked from mirrored-repos/manjaro-tools
format; clean up
This commit is contained in:
parent
d7e09a4b39
commit
94ff111a92
4 changed files with 17 additions and 33 deletions
|
@ -97,28 +97,28 @@ copy_hostconf () {
|
|||
}
|
||||
|
||||
chroot_extra_umount() {
|
||||
chroot_mount "/etc/resolv.conf" "$1/etc/resolv.conf" -B
|
||||
chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B
|
||||
chroot_mount "/etc/resolv.conf" "$1/etc/resolv.conf" -B
|
||||
chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B
|
||||
|
||||
for cache_dir in ${cache_dirs[@]:1}; do
|
||||
for cache_dir in ${cache_dirs[@]:1}; do
|
||||
chroot_mount "$cache_dir" "$1${cache_dir}" -Br
|
||||
done
|
||||
done
|
||||
|
||||
if [[ -n ${mountargs_ro[@]} ]];then
|
||||
if [[ -n ${mountargs_ro[@]} ]];then
|
||||
local IFS=','
|
||||
for m in ${mountargs_ro[@]}; do
|
||||
chroot_mount "${m%%:*}" "$1${m##*:}" -Br
|
||||
done
|
||||
unset IFS
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n ${mountargs_rw[@]} ]];then
|
||||
if [[ -n ${mountargs_rw[@]} ]];then
|
||||
local IFS=','
|
||||
for m in ${mountargs_rw[@]}; do
|
||||
chroot_mount "${m%%:*}" "$1${m##*:}" -B
|
||||
done
|
||||
unset IFS
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
umask 0022
|
||||
|
|
|
@ -12,3 +12,4 @@ lxqt
|
|||
mate
|
||||
netbook
|
||||
pantheon
|
||||
openbox
|
||||
|
|
|
@ -21,7 +21,7 @@ squash_image_dir() {
|
|||
return 1
|
||||
fi
|
||||
local timer=$(get_timer) path=${work_dir}/iso/${iso_name}/${arch}
|
||||
local sq_img="${path}/$(basename ${1}).sqfs"
|
||||
local sq_img="${path}/${1##*/}.sqfs"
|
||||
mkdir -p ${path}
|
||||
msg "Generating SquashFS image for '${1}'"
|
||||
if [[ -f "${sq_img}" ]]; then
|
||||
|
@ -40,7 +40,7 @@ squash_image_dir() {
|
|||
[[ "${iso_compression}" != "xz" ]] && highcomp=""
|
||||
msg2 "Creating SquashFS image. This may take some time..."
|
||||
local used_kernel=$(echo ${kernel} | cut -c 6)
|
||||
if [[ "$(basename "$1")" == "mhwd-image" && ${used_kernel} -ge "4" ]]; then
|
||||
if [[ "${1##*/}" == "mhwd-image" && ${used_kernel} -ge "4" ]]; then
|
||||
mksquashfs "${1}" "${sq_img}" -noappend -comp lz4 || die "Exit ..."
|
||||
else
|
||||
mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..."
|
||||
|
@ -83,8 +83,8 @@ make_iso() {
|
|||
touch "${work_dir}/iso/.miso"
|
||||
for d in $(find "${work_dir}" -maxdepth 1 -type d -name '[^.]*'); do
|
||||
if [[ "$d" != "${work_dir}/iso" ]] && \
|
||||
[[ "$(basename "$d")" != "iso" ]] && \
|
||||
[[ "$(basename "$d")" != "efiboot" ]] && \
|
||||
[[ "${d##*/}" != "iso" ]] && \
|
||||
[[ "${d##*/}" != "efiboot" ]] && \
|
||||
[[ "$d" != "${work_dir}" ]]; then
|
||||
squash_image_dir "$d"
|
||||
fi
|
||||
|
|
25
lib/util.sh
25
lib/util.sh
|
@ -100,17 +100,9 @@ prepare_dir(){
|
|||
}
|
||||
|
||||
version_gen(){
|
||||
local y=$(date +%Y) m=$(date +%m)
|
||||
dist_release=${y:2}.$m
|
||||
}
|
||||
|
||||
version_gen2(){
|
||||
local y=$(date +%Y) m=$(date +%m)
|
||||
case $month in
|
||||
01|04|07|10) dist_release=${y:2}.$m.1 ;;
|
||||
02|05|08|11) dist_release=${y:2}.$m.2 ;;
|
||||
*) dist_release=${y:2}.$m ;;
|
||||
esac
|
||||
local y=$(date +%Y) m=$(date +%m) ver
|
||||
ver=${y:2}.$m
|
||||
echo $ver
|
||||
}
|
||||
|
||||
init_common(){
|
||||
|
@ -142,8 +134,6 @@ init_buildpkg(){
|
|||
|
||||
sets_dir_pkg="${SYSCONFDIR}/pkg.d"
|
||||
|
||||
prepare_dir "${sets_dir_pkg}"
|
||||
|
||||
[[ -d ${USERCONFDIR}/pkg.d ]] && sets_dir_pkg=${USERCONFDIR}/pkg.d
|
||||
|
||||
[[ -z ${buildset_pkg} ]] && buildset_pkg='default'
|
||||
|
@ -156,8 +146,6 @@ init_buildiso(){
|
|||
|
||||
sets_dir_iso="${SYSCONFDIR}/iso.d"
|
||||
|
||||
prepare_dir "${sets_dir_iso}"
|
||||
|
||||
[[ -d ${USERCONFDIR}/iso.d ]] && sets_dir_iso=${USERCONFDIR}/iso.d
|
||||
|
||||
[[ -z ${buildset_iso} ]] && buildset_iso='default'
|
||||
|
@ -166,11 +154,7 @@ init_buildiso(){
|
|||
|
||||
##### iso settings #####
|
||||
|
||||
if [[ -z ${dist_release} ]];then
|
||||
# source /etc/lsb-release
|
||||
# dist_release=${DISTRIB_RELEASE}
|
||||
version_gen
|
||||
fi
|
||||
[[ -z ${dist_release} ]] && dist_release=$(version_gen)
|
||||
|
||||
if [[ -z ${dist_codename} ]];then
|
||||
source /etc/lsb-release
|
||||
|
@ -181,7 +165,6 @@ init_buildiso(){
|
|||
|
||||
[[ -z ${dist_name} ]] && dist_name="Manjaro"
|
||||
|
||||
# [[ -z ${iso_name} ]] && iso_name="manjaro"
|
||||
iso_name=${dist_name,,}
|
||||
|
||||
iso_label="${dist_branding}${dist_release//.}"
|
||||
|
|
Loading…
Reference in a new issue