mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-20 22:01:11 +02:00
pentoo-livecd: fix some typos and script header left over from editing
This commit is contained in:
parent
ac33085421
commit
9f78206c20
4 changed files with 253 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
AUX binary-driver-handler.initd-2014.3-r5 7875 SHA256 4611d47211f7ff5de4dc1f90e3b8e46e1e086473b8f336007ebb1d374a89f3b7 SHA512 6caa2824c85a4efbeadd407eac35a9f4b230095da9992eca9ab029475166bf081e7113e441f3d69089efcf92fa9b8528c9110f2681184653b4d49bdc3078bebd WHIRLPOOL 85ed5978936bf6feecbfa41c5d88c00b8d478a1bcf7b082eabea52c31de4844b140c758e71f16688ea874e0d859b616a0363d927f1b5054e962a9d55ccde4360
|
||||
AUX binary-driver-handler.initd-2014.3-r6 7824 SHA256 79a06ebca02b4152aec9a1dfbc7c74add6cdb6a15deab90b1b9a88fd9d97e08a SHA512 8c0b129a26534eb1922e997bd3a31b654111b881f34b1cd032c7a8c552b9720b094c06890dc059906723a962b1d520311932a5ba41d96959a9e7aff23b6b1573 WHIRLPOOL 9de9cf953d38b71ecbf78f15d5065efb26a975f38c5a7ec2be7017844186cfe6db9ef91c37999c787a8a29e182d25072fcce56107b3dfbbef6f1c01e8f7a6c89
|
||||
AUX flushchanges-2014.3-r5 1874 SHA256 0a229f43ccd2c158cb872c8f1f6efd5f177d199ad77a807657cfb83e95a19d62 SHA512 72816d6f157bfcd92138f47cc54d114ea2572e85d383f3b423c5ab77a6535e1ac3c259ace3258d3a9c49c332677be6408bc96610914a4abff8f62780c6fec7ed WHIRLPOOL 1bf74ccdf9c203e943ad5a8fd98a1c56fe1ede1ba9b44171e700fd2a40fa08973bfeff315d79a8efa0ca1d6af7e88cc94022e8bebf9fd06cf3ab95d9d1178a96
|
||||
AUX makemo-2014.3-r5 2140 SHA256 44814912e990baa7c6f4c62ac027e01d3e31777ea9350452a1063f6efb6c4270 SHA512 808859dcb33143171275b5cae965efbadb7bf15d28e53981a38e472cba714e866ea71dc8e7fbce364197c0ed6e5f59e0c365d42fa59759da96de42d3ef05b1c8 WHIRLPOOL 8d3041667a3546d96bc7145f77772b4ba35c625745aa010e37c257a397c5d993c4f65ed60014d9073b5d1ee8f4aefc8f7ed639c09379ca01c5729adcc37d4a87
|
||||
EBUILD pentoo-livecd-2014.3-r5.ebuild 934 SHA256 806ab579a0eac3ee0e2ae1daa4c6314fdf01c9bd4598e5b4f25f442866a508ac SHA512 30e4693c3487cc1cef744e9957484d51a2718c39e9813cb286458b7c5adf7cfbadc0d1f9b544a4bfd1c420fdb47b14597ff712ca1c623bad40020e34a5fe807e WHIRLPOOL 09bc8ef275d87c8372b4c807cf8623b5e9a8a277a85f2394ac50d5b753c091503944c5eefc706f72ace83c5966a1661385983fefc16d08cdef8eb8a869befe82
|
||||
AUX makemo-2014.3-r6 2146 SHA256 2fb8dd7114cc0235b4fc45e9cea718073c0df97bb91a54f69a27290a5e50c896 SHA512 1624d910c0856eca51323ca2355318c0f06eb0fb206e0c599a23fc132e6e5d6d4e893b32c5c158b6387e72013d5d06de5ac061d8d2112f763fe5af122a987641 WHIRLPOOL a1fb0cb6afc420b50cd32f0fb88414e6a9876cc0f700beb3805cf019e121939b6e13c7da64ca04ff54c939ad8632555ead2a7037b8865e47b7b0a952cfe1badc
|
||||
EBUILD pentoo-livecd-2014.3-r6.ebuild 936 SHA256 7720245e0183fccff65a14cd65f4fa103a5a324d0bbe4291ce4190372c1a36c1 SHA512 df9c41b86057ae3171775887083ff84df3efb95a84e268cf39d3c3ad777d4916e243de2cb27d66aa21ba186b15aa03a08a522c35e6750c3e592004a4db4bd2eb WHIRLPOOL c60d7d15a5cd442749162e31ecca31e1f1d002317e36ea91ac2e48d29a8fc2e07f3cb1aa026c4f8c540dd873d02c0ef3ea3be351951e2dafe692dbb6436b7f9f
|
||||
|
|
|
|||
247
pentoo/pentoo-livecd/files/binary-driver-handler.initd-2014.3-r6
Normal file
247
pentoo/pentoo-livecd/files/binary-driver-handler.initd-2014.3-r6
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
#!/sbin/runscript
|
||||
#seriously, fuck you AMD and Nvidia. Write a sane license that permits redistribution, we just want your shitty hardware to work
|
||||
|
||||
#todo: detect if the drivers should work *BEFORE* building and switching to them.
|
||||
|
||||
extra_commands="aufs_module"
|
||||
|
||||
depend() {
|
||||
before xdm
|
||||
}
|
||||
|
||||
start() {
|
||||
BLACKLIST_FILE="/etc/modprobe.d/blacklist.conf"
|
||||
|
||||
blacklist() {
|
||||
grep -q "${1}" "${BLACKLIST_FILE}" || \
|
||||
echo "blacklist ${1}" >> "${BLACKLIST_FILE}"
|
||||
}
|
||||
|
||||
unblacklist() {
|
||||
sed -i "/${1}/d" "${BLACKLIST_FILE}"
|
||||
}
|
||||
|
||||
switch_to_nvidia() {
|
||||
#remove oss
|
||||
if $(lsmod | grep -iq nouveau) ; then
|
||||
modprobe -r nouveau || eerror "Unable to unload nouveau driver."
|
||||
fi
|
||||
|
||||
if [ ! -f /lib/modules/$(uname -r)/video/nvidia.ko ]; then
|
||||
einfo "Building evil binary nvidia driver..."
|
||||
eval ${run_merge} --nodeps nvidia-drivers
|
||||
fi
|
||||
|
||||
modprobe nvidia || NVIDIA_FAILURE=yes
|
||||
if [ "${NVIDIA_FAILURE}" = "yes" ]; then
|
||||
eerror "Nvidia drivers failed to load, something went wrong. Please try open source drivers."
|
||||
eend 1
|
||||
else
|
||||
einfo "Enabling evil binary nvidia driver..."
|
||||
#blacklist the open drivers
|
||||
#check for nvidia in the blacklist and remove it
|
||||
unblacklist nvidia
|
||||
#check for nouveau in the blacklist and add it
|
||||
blacklist nouveau
|
||||
fi
|
||||
|
||||
#check for intel gpu
|
||||
if $(lspci -d8086: | grep -q VGA); then
|
||||
ewarn "nvidia and intel are both detected, using intel for video"
|
||||
eend 0
|
||||
elif [ "${NVIDIA_FAILURE}" != "yes" ]; then
|
||||
/opt/bin/nvidia-xconfig
|
||||
#eselect opengl set nvidia
|
||||
[ "$(eselect opengl show)" != "xorg-x11" ] && eselect opengl set xorg-x11
|
||||
eselect opencl set nvidia
|
||||
einfo "Enabled evil NVIDIA binary GPU driver"
|
||||
eend 0
|
||||
fi
|
||||
}
|
||||
|
||||
switch_to_nouveau() {
|
||||
modprobe nouveau || NOUVEAU_FAILURE=yes
|
||||
if [ "${NOUVEAU_FAILURE}" = "yes" ]; then
|
||||
eerror "Nouveau drivers failed to load, something went wrong. Please try the binary nvidia driver."
|
||||
eend 1
|
||||
else
|
||||
einfo "Enabling open source nouveau driver..."
|
||||
#blacklist the binary drivers
|
||||
#check for nouveau in the blacklist and remove it
|
||||
unblacklist nouveau
|
||||
#check for nvidia in the blacklist and add it
|
||||
blacklist nvidia
|
||||
eend 0
|
||||
fi
|
||||
}
|
||||
|
||||
handle_nvidia() {
|
||||
einfo "Detected: nvidia gpu, please stand by..."
|
||||
if [ "${NOBINDRIVERS}" = 1 ]; then
|
||||
|
||||
#remove the binary driver and insert oss
|
||||
if $(lsmod | grep -iq nvidia) ; then
|
||||
modprobe -r nvidia || eerror "Unable to unload nvidia driver."
|
||||
fi
|
||||
if $(lspci -d8086: | grep -q VGA); then
|
||||
ewarn "Intel GPU detected, if you wish to use nouveau please disable optimus or manually setup bumblebee."
|
||||
einfo "Using Intel GPU."
|
||||
eend 0
|
||||
else
|
||||
switch_to_nouveau
|
||||
fi
|
||||
else
|
||||
#first we detect if the nvidia binary driver can actually support the hardware
|
||||
NV_TARBALL="$(FETCHCOMMAND="false" RESUMECOMMAND="false" emerge --color=n -f nvidia-drivers --nodeps 2> /dev/zero | \
|
||||
grep "SHA256 SHA512 WHIRLPOOL size ;-) ..." | awk '{print $2}')"
|
||||
|
||||
if [ -n "${NV_TARBALL}" ]; then
|
||||
cd $(mktemp -d -t nvidia-detectXXXX)
|
||||
|
||||
#stolen from unpacker.eclass
|
||||
exe="tail -n +$(grep -a ^skip= "$(portageq envvar DISTDIR)/${NV_TARBALL}" | cut -d= -f2) '$(portageq envvar DISTDIR)/${NV_TARBALL}'"
|
||||
eval ${exe} | pixz -d | tar --no-same-owner -xf - --wildcards --no-anchored 'README.txt'
|
||||
|
||||
if [ -f README.txt ]; then
|
||||
#stolen from debian's nvidia-detect rules file
|
||||
sed -e '0,/A. Supported\|APPENDIX A: SUPPORTED/d' \
|
||||
-e '0,/Appendix A. Supported\|APPENDIX A: SUPPORTED/d' \
|
||||
-e '0,/^Below\|APPENDIX B/{/ 0x/s/.* 0x\([0-9a-fA-F]\{4\}\).*/10de\1/p};d' \
|
||||
README.txt \
|
||||
| tr a-f A-F | sort -u > list.txt
|
||||
|
||||
if [ -f list.txt ]; then
|
||||
#stolen from nvidia-detect code
|
||||
NVIDIA_VGA=$(sudo lspci -mmn -d 10de: | awk '{ gsub("\"",""); print $3 $4 }')
|
||||
|
||||
for pciid in ${NVIDIA_VGA^^}
|
||||
do
|
||||
if $(grep -q ${pciid} list.txt) ; then
|
||||
switch_to_nvidia
|
||||
else
|
||||
eerror "NVIDIA binary driver requested but doesn't support this hardware, trying nouveau"
|
||||
switch_to_nouveau
|
||||
fi
|
||||
done
|
||||
else
|
||||
eerror "Failed to extract or sort PCIIDs from NVIDIA README.txt, please report this."
|
||||
eend 1
|
||||
fi
|
||||
else
|
||||
eerror "Failed to unpack README from NVIDIA drivers, please report this."
|
||||
eend 1
|
||||
fi
|
||||
|
||||
else
|
||||
eerror "Missing nvidia-drivers distfile, please download it first or run \"/etc/init.d/binary-driver-handler aufs-module\""
|
||||
eerror "before making the livecd to create an aufs-module which contains the needed distfiles."
|
||||
eend
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_amd() {
|
||||
einfo "Detected: amd gpu, please stand by..."
|
||||
if [ "${NOBINDRIVERS}" = 1 ]; then
|
||||
#remove binary and insert oss
|
||||
if $(lsmod | grep -iq radeon) ; then
|
||||
modprobe -r fglrx || eerror "Unable to unload fglrx."
|
||||
fi
|
||||
modprobe radeon || RADEON_FAILURE=yes
|
||||
if [ "${RADEON_FAILURE}" = "yes" ]; then
|
||||
eerror "Radeon drivers failed to load, something went wrong. Please try the binary drivers."
|
||||
eend 1
|
||||
else
|
||||
einfo "Enabling open source radeon driver..."
|
||||
#blacklist the binary driver
|
||||
#check for radeon in the blacklist and remove it
|
||||
unblacklist radeon
|
||||
#check for fglrx in the blacklist and add it
|
||||
blacklist fglrx
|
||||
eend 0
|
||||
fi
|
||||
else
|
||||
#remove oss
|
||||
if $(lsmod | grep -iq radeon) ; then
|
||||
modprobe -r radeon || eerror "Unable to unload radeon"
|
||||
fi
|
||||
|
||||
if [ ! -f /lib/modules/$(uname -r)/video/fglrx.ko ]; then
|
||||
einfo "Building evil binary AMD driver..."
|
||||
eval ${run_merge} --nodeps ati-drivers
|
||||
fi
|
||||
modprobe fglrx || FGLRX_FAILURE=yes
|
||||
if [ "${FGLRX_FAILURE}" = "yes" ]; then
|
||||
eerror "FGLRX drivers failed to load, something went wrong. Please try open source drivers."
|
||||
eend 1
|
||||
else
|
||||
einfo "Enabling evil binary ati driver..."
|
||||
#blacklist the open drivers
|
||||
#check for fglrx in the blacklist and remove it
|
||||
unblacklist fglrx
|
||||
#check for radeon in the blacklist and add it
|
||||
blacklist radeon
|
||||
|
||||
/opt/bin/aticonfig --initial
|
||||
#eselect opengl set ati
|
||||
[ "$(eselect opengl show)" != "xorg-x11" ] && eselect opengl set xorg-x11
|
||||
eselect opencl set amd
|
||||
einfo "Successfully switched to AMD binary GPU driver"
|
||||
eend 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#parse kernel commandline to see what we are doing
|
||||
if grep -q nobindrivers /proc/cmdline; then
|
||||
NOBINDRIVERS=1
|
||||
else
|
||||
NOBINDRIVERS=0
|
||||
fi
|
||||
|
||||
if [ ! -w /mnt/cdrom/modules ]; then
|
||||
#something is horribly wrong, even if it should be rw, /mnt/cdrom is remounted ro
|
||||
#the lazyiest hack way to handle this is to just try and remount it rw
|
||||
mount -o remount,rw /mnt/cdrom > /dev/zero 2>&1
|
||||
fi
|
||||
#check environment to see if we can make modules or not
|
||||
if [ -w /mnt/cdrom/modules ] && [ -x /usr/sbin/makemo ]; then
|
||||
run_merge="echo y | makemo --jobs=2"
|
||||
else
|
||||
run_merge="emerge --jobs=2"
|
||||
fi
|
||||
|
||||
ebegin "Setting up GPU drivers requested by user, this may take a few minutes"
|
||||
|
||||
#check for nvidia GPU
|
||||
#lspci | grep -iq "VGA.*NVIDIA"
|
||||
if $(lspci -d10de: | grep -q VGA); then
|
||||
handle_nvidia
|
||||
#check for AMD GPU
|
||||
#lspci | grep -iq "VGA.*Radeon"
|
||||
elif $(lspci -d1002: | grep -q VGA); then
|
||||
handle_amd
|
||||
else
|
||||
[ "$(eselect opengl show)" != "xorg-x11" ] && eselect opengl set xorg-x11
|
||||
eend 0
|
||||
fi
|
||||
|
||||
eend 0
|
||||
}
|
||||
|
||||
aufs_module() {
|
||||
ebegin "Making aufs module with needed distfiles for binary drivers"
|
||||
#temp dir
|
||||
T="/dev/shm"
|
||||
#target dir
|
||||
DEST=/usr/src/pentoo/livecd/trunk/isoroot/modules
|
||||
|
||||
mkdir -p "${T}"/distfiles/rootfs/usr/portage/distfiles/
|
||||
DISTDIR="${T}"/distfiles/ emerge -FO ati-drivers
|
||||
DISTDIR="${T}"/dev/shm/distfiles/ emerge -FO nvidia-drivers
|
||||
cp "${T}"/distfiles/{*[Ll]inux*,xvba*} "${T}"/distfiles/rootfs/usr/portage/distfiles
|
||||
chown portage.portage -R "${T}"/distfiles/rootfs/usr/portage
|
||||
mksquashfs "${T}"/distfiles/rootfs/ "${DEST}"/zdistfiles-`date "+%Y%m%d"`.lzm -comp xz -b 1048576 -Xdict-size 1048576 -no-recovery -noappend
|
||||
|
||||
eend 0
|
||||
}
|
||||
|
|
@ -50,8 +50,8 @@ do
|
|||
mkdir -p "${TMPDIR}"
|
||||
# remove slot from version since portage doesn't include slot in tarball name
|
||||
[[ ! -e /usr/portage/packages/"${x%:*}".tbz2 ]] && eerror "Build failed" && exit 1
|
||||
tar -I lbzip2 -xf /usr/portage/packages/"${x}".tbz2 -C "${TMPDIR}"
|
||||
mkdir -p "${TMPDIR}"/var/db/pkg/"${x}"
|
||||
tar -I lbzip2 -xf /usr/portage/packages/"${x%:*}".tbz2 -C "${TMPDIR}"
|
||||
mkdir -p "${TMPDIR}"/var/db/pkg/"${x%:*}"
|
||||
# remove slot again since it's not in the vdb folder version number
|
||||
cp -a /var/db/pkg/"${x%:*}"/* "${TMPDIR}"/var/db/pkg/"${x%:*}"/
|
||||
MOFILE=$(echo ${x%:*} | sed -e 's/.*\///g')
|
||||
|
|
@ -32,7 +32,7 @@ pkg_setup() {
|
|||
|
||||
src_install() {
|
||||
#/usr/sbin
|
||||
newsbin "${FILESDIR}"/flushchanges-${PVR} flushchanges
|
||||
newsbin "${FILESDIR}"/flushchanges-${PV}-r5 flushchanges
|
||||
newsbin "${FILESDIR}"/makemo-${PVR} makemo
|
||||
|
||||
newinitd "${FILESDIR}"/binary-driver-handler.initd-${PVR} binary-driver-handler
|
||||
Loading…
Reference in a new issue