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_extra_umount() {
|
||||||
chroot_mount "/etc/resolv.conf" "$1/etc/resolv.conf" -B
|
chroot_mount "/etc/resolv.conf" "$1/etc/resolv.conf" -B
|
||||||
chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -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
|
chroot_mount "$cache_dir" "$1${cache_dir}" -Br
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -n ${mountargs_ro[@]} ]];then
|
if [[ -n ${mountargs_ro[@]} ]];then
|
||||||
local IFS=','
|
local IFS=','
|
||||||
for m in ${mountargs_ro[@]}; do
|
for m in ${mountargs_ro[@]}; do
|
||||||
chroot_mount "${m%%:*}" "$1${m##*:}" -Br
|
chroot_mount "${m%%:*}" "$1${m##*:}" -Br
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n ${mountargs_rw[@]} ]];then
|
if [[ -n ${mountargs_rw[@]} ]];then
|
||||||
local IFS=','
|
local IFS=','
|
||||||
for m in ${mountargs_rw[@]}; do
|
for m in ${mountargs_rw[@]}; do
|
||||||
chroot_mount "${m%%:*}" "$1${m##*:}" -B
|
chroot_mount "${m%%:*}" "$1${m##*:}" -B
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
|
@ -12,3 +12,4 @@ lxqt
|
||||||
mate
|
mate
|
||||||
netbook
|
netbook
|
||||||
pantheon
|
pantheon
|
||||||
|
openbox
|
||||||
|
|
|
@ -21,7 +21,7 @@ squash_image_dir() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
local timer=$(get_timer) path=${work_dir}/iso/${iso_name}/${arch}
|
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}
|
mkdir -p ${path}
|
||||||
msg "Generating SquashFS image for '${1}'"
|
msg "Generating SquashFS image for '${1}'"
|
||||||
if [[ -f "${sq_img}" ]]; then
|
if [[ -f "${sq_img}" ]]; then
|
||||||
|
@ -40,7 +40,7 @@ squash_image_dir() {
|
||||||
[[ "${iso_compression}" != "xz" ]] && highcomp=""
|
[[ "${iso_compression}" != "xz" ]] && highcomp=""
|
||||||
msg2 "Creating SquashFS image. This may take some time..."
|
msg2 "Creating SquashFS image. This may take some time..."
|
||||||
local used_kernel=$(echo ${kernel} | cut -c 6)
|
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 ..."
|
mksquashfs "${1}" "${sq_img}" -noappend -comp lz4 || die "Exit ..."
|
||||||
else
|
else
|
||||||
mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..."
|
mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..."
|
||||||
|
@ -83,8 +83,8 @@ make_iso() {
|
||||||
touch "${work_dir}/iso/.miso"
|
touch "${work_dir}/iso/.miso"
|
||||||
for d in $(find "${work_dir}" -maxdepth 1 -type d -name '[^.]*'); do
|
for d in $(find "${work_dir}" -maxdepth 1 -type d -name '[^.]*'); do
|
||||||
if [[ "$d" != "${work_dir}/iso" ]] && \
|
if [[ "$d" != "${work_dir}/iso" ]] && \
|
||||||
[[ "$(basename "$d")" != "iso" ]] && \
|
[[ "${d##*/}" != "iso" ]] && \
|
||||||
[[ "$(basename "$d")" != "efiboot" ]] && \
|
[[ "${d##*/}" != "efiboot" ]] && \
|
||||||
[[ "$d" != "${work_dir}" ]]; then
|
[[ "$d" != "${work_dir}" ]]; then
|
||||||
squash_image_dir "$d"
|
squash_image_dir "$d"
|
||||||
fi
|
fi
|
||||||
|
|
25
lib/util.sh
25
lib/util.sh
|
@ -100,17 +100,9 @@ prepare_dir(){
|
||||||
}
|
}
|
||||||
|
|
||||||
version_gen(){
|
version_gen(){
|
||||||
local y=$(date +%Y) m=$(date +%m)
|
local y=$(date +%Y) m=$(date +%m) ver
|
||||||
dist_release=${y:2}.$m
|
ver=${y:2}.$m
|
||||||
}
|
echo $ver
|
||||||
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init_common(){
|
init_common(){
|
||||||
|
@ -142,8 +134,6 @@ init_buildpkg(){
|
||||||
|
|
||||||
sets_dir_pkg="${SYSCONFDIR}/pkg.d"
|
sets_dir_pkg="${SYSCONFDIR}/pkg.d"
|
||||||
|
|
||||||
prepare_dir "${sets_dir_pkg}"
|
|
||||||
|
|
||||||
[[ -d ${USERCONFDIR}/pkg.d ]] && sets_dir_pkg=${USERCONFDIR}/pkg.d
|
[[ -d ${USERCONFDIR}/pkg.d ]] && sets_dir_pkg=${USERCONFDIR}/pkg.d
|
||||||
|
|
||||||
[[ -z ${buildset_pkg} ]] && buildset_pkg='default'
|
[[ -z ${buildset_pkg} ]] && buildset_pkg='default'
|
||||||
|
@ -156,8 +146,6 @@ init_buildiso(){
|
||||||
|
|
||||||
sets_dir_iso="${SYSCONFDIR}/iso.d"
|
sets_dir_iso="${SYSCONFDIR}/iso.d"
|
||||||
|
|
||||||
prepare_dir "${sets_dir_iso}"
|
|
||||||
|
|
||||||
[[ -d ${USERCONFDIR}/iso.d ]] && sets_dir_iso=${USERCONFDIR}/iso.d
|
[[ -d ${USERCONFDIR}/iso.d ]] && sets_dir_iso=${USERCONFDIR}/iso.d
|
||||||
|
|
||||||
[[ -z ${buildset_iso} ]] && buildset_iso='default'
|
[[ -z ${buildset_iso} ]] && buildset_iso='default'
|
||||||
|
@ -166,11 +154,7 @@ init_buildiso(){
|
||||||
|
|
||||||
##### iso settings #####
|
##### iso settings #####
|
||||||
|
|
||||||
if [[ -z ${dist_release} ]];then
|
[[ -z ${dist_release} ]] && dist_release=$(version_gen)
|
||||||
# source /etc/lsb-release
|
|
||||||
# dist_release=${DISTRIB_RELEASE}
|
|
||||||
version_gen
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z ${dist_codename} ]];then
|
if [[ -z ${dist_codename} ]];then
|
||||||
source /etc/lsb-release
|
source /etc/lsb-release
|
||||||
|
@ -181,7 +165,6 @@ init_buildiso(){
|
||||||
|
|
||||||
[[ -z ${dist_name} ]] && dist_name="Manjaro"
|
[[ -z ${dist_name} ]] && dist_name="Manjaro"
|
||||||
|
|
||||||
# [[ -z ${iso_name} ]] && iso_name="manjaro"
|
|
||||||
iso_name=${dist_name,,}
|
iso_name=${dist_name,,}
|
||||||
|
|
||||||
iso_label="${dist_branding}${dist_release//.}"
|
iso_label="${dist_branding}${dist_release//.}"
|
||||||
|
|
Loading…
Reference in a new issue