manjaro-tools/scripts/mhwd-live

41 lines
1.3 KiB
Text
Raw Normal View History

2014-12-15 03:50:58 +01:00
#!/bin/sh
2015-01-29 13:50:22 +01:00
[[ -r /opt/livecd/util.sh ]] && source /opt/livecd/util.sh
2015-03-01 17:24:27 +01:00
[[ -r /opt/livecd/util-livecd.sh ]] && source /opt/livecd/util-livecd.sh
2014-12-15 03:50:58 +01:00
USENONFREE="$(kernel_cmdline nonfree no)"
VIDEO="$(kernel_cmdline xdriver no)"
2015-01-25 23:27:15 +01:00
seconds="0"
while [ -e "/var/lib/pacman/db.lck" ];
do
echo 'Pacman is not ready yet. Will try again in 5 seconds.' >> /var/log/livecd.log
2015-01-25 23:27:15 +01:00
seconds=$(($seconds + 5))
sleep 5
if [[ "$seconds" == "15" ]]; then
# remove database lock after 15s
# this might be related to https://github.com/manjaro/pamac/issues/25
rm /var/lib/pacman/db.lck
fi
done
2014-12-15 03:50:58 +01:00
# hwdetect_graphics
2015-01-25 23:27:15 +01:00
if [[ -e "/opt/livecd/pacman-gfx.conf" ]]; then
echo "run mhwd" >> /var/log/livecd.log
2015-01-25 23:27:15 +01:00
if [[ "${USENONFREE}" == "yes" ]] || [[ "${USENONFREE}" == "true" ]]; then
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "/opt/livecd/pacman-gfx.conf" >> /var/log/livecd.log
2014-12-15 03:50:58 +01:00
else
mhwd --auto pci nonfree 0300 --pmconfig "/opt/livecd/pacman-gfx.conf" >> /var/log/livecd.log
2014-12-15 03:50:58 +01:00
fi
else
2015-01-25 23:27:15 +01:00
if [[ "${VIDEO}" == "vesa" ]]; then
mhwd --install pci video-vesa --pmconfig "/opt/livecd/pacman-gfx.conf" >> /var/log/livecd.log
2014-12-15 03:50:58 +01:00
else
mhwd --auto pci free 0300 --pmconfig "/opt/livecd/pacman-gfx.conf" >> /var/log/livecd.log
2014-12-15 03:50:58 +01:00
fi
fi
fi
echo "MHWD DONE" >> /var/log/livecd.log