first commit
This commit is contained in:
40
bin/mhwd-live.in
Executable file
40
bin/mhwd-live.in
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
[[ -r @libdir@/util-live.sh ]] && source @libdir@/util-live.sh
|
||||
|
||||
DRIVER="$(kernel_cmdline driver nonfree)"
|
||||
VIDEO="$(kernel_cmdline xdriver no)"
|
||||
|
||||
REPO_PATH='/opt/mhwd'
|
||||
PAC_CONF="${REPO_PATH}/pacman-mhwd.conf"
|
||||
|
||||
# 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
|
||||
done
|
||||
|
||||
# hwdetect_graphics
|
||||
if [[ -e "${PAC_CONF}" ]]; then
|
||||
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
|
||||
echo "MHWD DONE" >> /var/log/mhwd-live.log
|
||||
fi
|
||||
Reference in New Issue
Block a user