initcpio: try to fix shutdown unmounting

This commit is contained in:
udeved 2016-10-15 11:50:30 +02:00
parent a65f30569c
commit ab51b4be29
5 changed files with 16 additions and 3 deletions

View file

@ -210,12 +210,12 @@ miso_mount_handler() {
local src="/run/miso/bootmnt/${misobasedir}/${arch}" local src="/run/miso/bootmnt/${misobasedir}/${arch}"
local dest_sfs="/run/miso/sfs" dest_img="/run/miso/img" local dest_sfs="/run/miso/sfs" dest_img="/run/miso/img"
local lower_dir local lower_dir
mkdir -p ${dest_img}
for sfs in livefs mhwdfs desktopfs rootfs;do for sfs in livefs mhwdfs desktopfs rootfs;do
if [[ -f "${src}/${sfs}.sfs" ]]; then if [[ -f "${src}/${sfs}.sfs" ]]; then
_mnt_sfs "${src}/${sfs}.sfs" "${dest_sfs}/${sfs}" _mnt_sfs "${src}/${sfs}.sfs" "${dest_sfs}/${sfs}"
if [[ -f "${dest_sfs}/${sfs}/${sfs}.img" ]]; then if [[ -f "${dest_sfs}/${sfs}/${sfs}.img" ]]; then
mkdir -p ${dest_img}
lower_dir=${lower_dir:-}${lower_dir:+:}"${dest_img}/${sfs}" lower_dir=${lower_dir:-}${lower_dir:+:}"${dest_img}/${sfs}"
_mnt_dmsnapshot "${dest_sfs}/${sfs}/${sfs}.img" "${dest_img}/${sfs}" _mnt_dmsnapshot "${dest_sfs}/${sfs}/${sfs}.img" "${dest_img}/${sfs}"
else else

View file

@ -217,12 +217,12 @@ miso_mount_handler() {
local src="/run/miso/bootmnt/${misobasedir}/${arch}" local src="/run/miso/bootmnt/${misobasedir}/${arch}"
local dest_sfs="/run/miso/sfs" dest_img="/run/miso/img" local dest_sfs="/run/miso/sfs" dest_img="/run/miso/img"
mkdir -p ${dest_img}
for sfs in livefs mhwdfs desktopfs rootfs;do for sfs in livefs mhwdfs desktopfs rootfs;do
if [[ -f "${src}/${sfs}.sfs" ]]; then if [[ -f "${src}/${sfs}.sfs" ]]; then
_mnt_sfs "${src}/${sfs}.sfs" "${dest_sfs}/${sfs}" _mnt_sfs "${src}/${sfs}.sfs" "${dest_sfs}/${sfs}"
if [[ -f "${dest_sfs}/${sfs}/${sfs}.img" ]]; then if [[ -f "${dest_sfs}/${sfs}/${sfs}.img" ]]; then
mkdir -p ${dest_img}
_mnt_dmsnapshot "${dest_sfs}/${sfs}/${sfs}.img" "${dest_img}/${sfs}" _mnt_dmsnapshot "${dest_sfs}/${sfs}/${sfs}.img" "${dest_img}/${sfs}"
_mnt_overlayfs "${dest_img}/${sfs}" "${newroot}" "/" _mnt_overlayfs "${dest_img}/${sfs}" "${newroot}" "/"
else else

View file

@ -39,11 +39,16 @@ run_hook () {
# setup DNS resolver # setup DNS resolver
if [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then if [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then
echo "nameserver ${IPV4DNS0}" > /etc/resolv.conf echo "# added by miso_pxe_common hook" > /etc/resolv.conf
echo "nameserver ${IPV4DNS0}" >> /etc/resolv.conf
fi fi
if [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then if [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then
echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf
fi fi
if [[ -n "${DNSDOMAIN}" ]]; then
echo "search ${DNSDOMAIN}" >> /etc/resolv.conf
echo "domain ${DNSDOMAIN}" >> /etc/resolv.conf
fi
fi fi
} }

View file

@ -3,6 +3,10 @@
run_hook() { run_hook() {
if [[ -n "${ip}" && -n "${miso_http_srv}" ]]; then if [[ -n "${ip}" && -n "${miso_http_srv}" ]]; then
# booting with http is always copy-to-ram, so set here to make sure
# addresses are flushed and interface is set down
copytoram="y"
miso_http_srv=$(eval echo ${miso_http_srv}) miso_http_srv=$(eval echo ${miso_http_srv})
[[ -z "${miso_http_spc}" ]] && miso_http_spc="75%" [[ -z "${miso_http_spc}" ]] && miso_http_spc="75%"

View file

@ -20,6 +20,10 @@ done
# Unmount the space used to store *.cow. # Unmount the space used to store *.cow.
umount /oldrun/miso/cowspace umount /oldrun/miso/cowspace
if [[ -d /oldrun/miso/img ]];then
umount /oldrun/miso/img
fi
# Unmount boot device if needed (no copytoram=y used) # Unmount boot device if needed (no copytoram=y used)
if [[ ! -d /oldrun/miso/copytoram ]]; then if [[ ! -d /oldrun/miso/copytoram ]]; then
if [[ -d /oldrun/miso/img_dev ]]; then if [[ -d /oldrun/miso/img_dev ]]; then