Commit 1502845b authored by udeved's avatar udeved

simplify mhwd-live scripts

parent 2e0c57ae
......@@ -3,13 +3,8 @@
[[ -r @libdir@/util-live.sh ]] && source @libdir@/util-live.sh
DRIVER="$(kernel_cmdline driver nonfree)"
MODULES_DIR='/etc/calamares/modules'
echo "Setting MHWD nonfree driver: ${DRIVER} ..." >> /var/log/mhwd-live.log
if [[ "${DRIVER}" == "nonfree" ]]; then
sed -e "s|^.*driver:.*|driver: nonfree|" -i "${MODULES_DIR}/mhwdcfg.conf"
else
sed -e "s|^.*driver:.*|driver: free|" -i "${MODULES_DIR}/mhwdcfg.conf"
fi
echo "Setting MHWD driver: ${DRIVER} ..." >> /var/log/mhwd-live.log
sed -e "s|^.*driver:.*|driver: ${DRIVER}|" -i "${MODULES_DIR}/mhwdcfg.conf"
echo "MHWD DONE" >> /var/log/mhwd-live.log
......@@ -8,52 +8,34 @@ VIDEO="$(kernel_cmdline xdriver no)"
REPO_PATH='/opt'
PAC_CONF="${REPO_PATH}/pacman-mhwd.conf"
if [[ -d /opt/livecd ]];then
REPO_PATH='/opt/livecd'
PAC_CONF="${REPO_PATH}/pacman-gfx.conf"
elif [[ -d /opt/live ]];then
REPO_PATH='/opt/live'
PAC_CONF="${REPO_PATH}/pacman-gfx.conf"
fi
# In a live session we should never have a database lock at boot, this is a bug!
# In the past pamac caused issues about that.
# Fixed here: https://github.com/manjaro/manjaro-tools/commit/57a039088ae4485bc5dc411e36a90c0753e670f1
seconds="0"
while [ -e "/var/lib/pacman/db.lck" ];
do
echo 'Pacman is not ready yet. Will try again in 10 seconds.' >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
ps -ef >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
seconds=$(($seconds + 10))
sleep 10
if [[ "$seconds" == "30" ]]; then
echo 'Warning: removing pacman db.lck!' >> /var/log/mhwd-live.log
rm /var/lib/pacman/db.lck
fi
echo 'Pacman is not ready yet. Will try again in 10 seconds.' >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
ps -ef >> /var/log/mhwd-live.log
echo '----' >> /var/log/mhwd-live.log
seconds=$(($seconds + 10))
sleep 10
if [[ "$seconds" == "30" ]]; then
echo 'Warning: removing pacman db.lck!' >> /var/log/mhwd-live.log
rm /var/lib/pacman/db.lck
fi
done
# hwdetect_graphics
if [[ -e "${PAC_CONF}" ]]; then
MODULES_DIR='/etc/calamares/modules'
echo "Running MHWD..." >> /var/log/mhwd-live.log
if [[ "${DRIVER}" == "nonfree" ]]; then
sed -e "s|^.*driver:.*|driver: nonfree|" -i "${MODULES_DIR}/mhwdcfg.conf"
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
else
mhwd --auto pci nonfree 0300 --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
fi
else
sed -e "s|^.*driver:.*|driver: free|" -i "${MODULES_DIR}/mhwdcfg.conf"
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
else
mhwd --auto pci free 0300 --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
fi
fi
MODULES_DIR='/etc/calamares/modules'
echo "Running MHWD..." >> /var/log/mhwd-live.log
sed -e "s|^.*driver:.*|driver: ${DRIVER}|" -i "${MODULES_DIR}/mhwdcfg.conf"
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
else
mhwd --auto pci ${DRIVER} 0300 --pmconfig "${PAC_CONF}" >> /var/log/mhwd-live.log
fi
fi
echo "MHWD DONE" >> /var/log/mhwd-live.log
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment