From 7ca499d0effeec3119587f68bdd5e33e97367c1d Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Fri, 4 Mar 2011 00:18:00 +0100 Subject: start kdm only in runlevel 5 --- config/chroot_local-includes/etc/insserv/overrides/kdm | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/chroot_local-includes/etc/insserv/overrides/kdm diff --git a/config/chroot_local-includes/etc/insserv/overrides/kdm b/config/chroot_local-includes/etc/insserv/overrides/kdm new file mode 100644 index 0000000..d64f863 --- /dev/null +++ b/config/chroot_local-includes/etc/insserv/overrides/kdm @@ -0,0 +1,11 @@ +### BEGIN INIT INFO +# Provides: kdm +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Should-Start: console-screen kbd acpid dbus hal krb5-kdc +# Should-Stop: console-screen kbd +# Default-Start: 5 +# Default-Stop: 0 1 2 3 4 6 +# Short-Description: X display manager for KDE +# Description: KDM manages a collection of X servers, which may be on the local host or remote machines. +### END INIT INFO -- cgit v1.0 From c7965bfd207b8ae3f4f563f6eceec00734f7bafc Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Fri, 4 Mar 2011 00:18:40 +0100 Subject: pcidetect + gfxoverlay --- .../usr/share/initramfs-tools/hooks/pcidetect | 24 ++++++++++ .../initramfs-tools/scripts/init-top/pcidetect | 53 ++++++++++++++++++++++ .../scripts/live-bottom/01gfxoverlay | 14 ++++++ .../scripts/live-bottom/02blacklist | 6 +++ 4 files changed, 97 insertions(+) create mode 100755 config/chroot_local-includes/usr/share/initramfs-tools/hooks/pcidetect create mode 100755 config/chroot_local-includes/usr/share/initramfs-tools/scripts/init-top/pcidetect create mode 100755 config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/01gfxoverlay create mode 100755 config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/02blacklist diff --git a/config/chroot_local-includes/usr/share/initramfs-tools/hooks/pcidetect b/config/chroot_local-includes/usr/share/initramfs-tools/hooks/pcidetect new file mode 100755 index 0000000..0af110b --- /dev/null +++ b/config/chroot_local-includes/usr/share/initramfs-tools/hooks/pcidetect @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +PREREQ="" + +prereqs() +{ + echo "${PREREQ}" +} + +case "${1}" in + prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +copy_exec /lib/libresolv* /lib +copy_exec /usr/lib/libpci.so.* /lib +copy_exec /usr/bin/lspci /bin + diff --git a/config/chroot_local-includes/usr/share/initramfs-tools/scripts/init-top/pcidetect b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/init-top/pcidetect new file mode 100755 index 0000000..743c4a4 --- /dev/null +++ b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/init-top/pcidetect @@ -0,0 +1,53 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ "$gfx" = "auto" -o "$gfx" = "on" ]; then +lspci -n | while read x class card x +do + VENDOR=${card%:*} + DEVICE=${card#*:} + case $class in + 0300:) + case $VENDOR in + 1002) + case $DEVICE in + 6700|6701|6702|6703|6704|6705|6706|6707|6708|6709|6718|6719|671c|671d|6720|6721|6722|6723|6724|6725|6726|6727|6728|6729|6738|6739|6740|6741|6742|6743|6744|6745|6746|6747|6748|6749|6750|6758|6759|6760|6761|6762|6763|6764|6765|6766|6767|6768|6770|6779|6880|6888|6889|688a|688c|688d|6890|6898|6899|689c|689d|689e|68a0|68a1|68a8|68a9|68b0|68b1|68b8|68b9|68ba|68be|68bf|68c0|68c1|68c7|68c8|68c9|68d0|68d1|68d8|68d9|68da|68de|68e0|68e1|68e4|68e5|68e8|68e9|68f0|68f1|68f2|68f8|68f9|68fe|9400|9401|9402|9403|9405|940a|940b|940f|9440|9441|9442|9443|9444|9446|9447|944a|944b|944c|944e|944f|9450|9451|9452|9456|945a|945b|945e|9460|9462|946a|946b|947a|947b|9480|9487|9488|9489|948a|948f|9490|9491|9495|9498|949c|949e|949f|94a0|94a1|94a3|94b1|94b3|94b4|94b5|94c0|94c1|94c3|94c4|94c5|94c6|94c7|94c8|94c9|94cb|94cc|9500|9501|9504|9505|9506|9507|9508|9509|950f|9511|9513|9515|9517|9519|9540|9541|9542|954e|954f|9552|9553|9555|9557|955f|9580|9581|9583|9586|9587|9588|9589|958a|958b|958c|958d|958e|958f|9590|9591|9593|9595|9596|9597|9598|9599|959b|95c0|95c2|95c4|95c5|95c6|95c7|95c9|95cc|95cd|95ce|95cf|9610|9611|9612|9613|9614|9615|9616|9640|9641|9642|9643|9644|9645|9647|9648|9649|964a|964b|964c|964e|964f|9710|9711|9712|9713|9714|9715|9802|9803|9804|9805) + echo "blacklist radeon" >> /etc/modprobe.d/pcidetect.conf + echo "fglrx" > /etc/gfxoverlay + break + ;; + esac + ;; + 10de|12d2) + case $DEVICE in + 0008|0009|0010|0018|0019) continue;; + 0020|0028|0029|002c|002d|00a0|0100|0101|0103|0150|0151|0152|0153) continue;; + 0110|0111|0112|0113|0170|0171|0172|0173|0174|0175|0176|0177|0178|0179|017a|017c|017d|0181|0182|0183|0185|0188|018a|018b|018c|01a0|01f0|0200|0201|0202|0203|0250|0251|0253|0258|0259|025b|0280|0281|0282|0286|0288|0289|028c) continue;; + 00fa|00fb|00fc|00fd|00fe|0301|0302|0308|0309|0311|0312|0314|031a|031b|031c|0320|0321|0322|0323|0324|0325|0326|0327|0328|032a|032b|032c|032d|0330|0331|0332|0333|0334|0338|033f|0341|0342|0343|0344|0347|0348|034c|034e) continue;; + *) + echo "blacklist nouveau" >> /etc/modprobe.d/pcidetect.conf + echo "nvidia" > /etc/gfxoverlay + break + ;; + esac + ;; + esac + ;; + esac +done +fi + diff --git a/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/01gfxoverlay b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/01gfxoverlay new file mode 100755 index 0000000..d648beb --- /dev/null +++ b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/01gfxoverlay @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ -e /etc/gfxoverlay ]; then + overlay="$(echo /root/live/image/gfxoverlay/$(cat /etc/gfxoverlay).*)" + if [ -f "$overlay" ]; then + #overlay_dev="$(losetup -f)" + #losetup "$overlay_dev" "$overlay" + mkdir -p /live/gfxoverlay /root/live/gfxoverlay + mount -o loop "$overlay" /live/gfxoverlay + mount -o remount,add:1:/live/gfxoverlay /root + mount -n -o move /live/gfxoverlay /root/live/gfxoverlay + fi +fi + diff --git a/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/02blacklist b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/02blacklist new file mode 100755 index 0000000..1312363 --- /dev/null +++ b/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/02blacklist @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ -e /etc/modprobe.d/initramfs.conf ]; then + cp /etc/modprobe.d/initramfs.conf /root/etc/modprobe.d/initramfs.conf +fi + -- cgit v1.0 From c78afd40e7abd52f363c763421f35a07e90bdc10 Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Fri, 4 Mar 2011 04:06:32 +0100 Subject: added gfxoverlay build script --- .gitignore | 1 + build_gfxoverlay.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100755 build_gfxoverlay.sh diff --git a/.gitignore b/.gitignore index 396f14c..e14197f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ /config/chroot /config/common /config/source +/overlay* diff --git a/build_gfxoverlay.sh b/build_gfxoverlay.sh new file mode 100755 index 0000000..050c8ac --- /dev/null +++ b/build_gfxoverlay.sh @@ -0,0 +1,83 @@ +#!/bin/bash +if ((UID)); then + echo "Error: You must be root to run this script" + exit 2 +fi +case "$1" in +nvidia|fglrx) drv=$1;; +*) + echo "Usage: $(basename "$0") " + exit 3 + ;; +esac +case "$2" in +?*) ver="$2";; +*) + echo "Usage: $(basename "$0") " + exit 3 + ;; +esac +if [ ! -x chroot/bin/bash ]; then + echo "Error: something is wrong with \"chroot/\" - maybe you are in the wrong directory or haven't built it yet?" + exit 4 +fi +bit="$(file chroot/bin/true | grep -q 'ELF 64-bit' && echo 64 || echo 32)" +if [ -d "overlay$bit-$drv-$ver" -a -z "$OVERWRITE" ]; then + echo "Error: overlay \"overlay$bit-$drv-$ver\" already exists." + exit 5 +fi +mkdir -p overlay root +umount root/proc root/sys root/dev root &>/dev/null +rm -rf overlay/* overlay/.??* +mount -t aufs -o br:overlay:chroot/ none root/ +if [ -d cache ]; then + mkdir -p overlay/usr/src + for i in cache/NVIDIA-Linux* cache/ati-driver-installer* + do + [ -f $i ] && ln $i overlay/usr/src/ + done +fi +cd root/ +mount --bind /proc proc/ +mount --bind /sys sys/ +mount --bind /dev dev/ +cp /etc/resolv.conf etc/resolv.conf +cat <<"eof" > usr/sbin/update-initramfs +#!/bin/sh +echo "update-initramfs is disabled for overlay-build" +exit 0 +eof +cat <<"eof" > overlay.sh +#!/bin/sh + +export LC_ALL=C LANG= DISPLAY= + +uname() +{ +case $1 in +-m) + file /bin/true | grep -q 'ELF 64-bit' && echo x86_64 || echo x86 + ;; +-r) + basename /lib/modules/* + ;; +esac +} + +eof +cat usr/local/bin/install-$drv-debian.sh >> overlay.sh +sed -i '/exit 3/d' overlay.sh +chmod +x overlay.sh +chroot . /overlay.sh -v $ver -z +cd .. +umount root/proc root/sys root/dev root &>/dev/null +rm -rf root +if [ -d cache ]; then + mv -f overlay/usr/src/NVIDIA-Linux* cache/ 2>/dev/null + mv -f overlay/usr/src/ati-driver-installer* cache/ 2>/dev/null +fi +cd overlay +rm -rf usr/sbin/update-initramfs etc/resolv.conf usr/src/NVIDIA-Linux* usr/src/ati-driver-installer* overlay.sh tmp var/log .??* +cd .. +mv overlay "overlay$bit-$drv-$ver" + -- cgit v1.0 From 7f27ceef2c084d6c57d784ab258c517ef2d6d021 Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Fri, 4 Mar 2011 04:32:52 +0100 Subject: separate bootstap-cache for 32 and 64 bit --- auto/build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/auto/build b/auto/build index 376a80d..733e76c 100755 --- a/auto/build +++ b/auto/build @@ -30,11 +30,17 @@ prebuild() # make current build configuration available for hooks inside chroot mkdir -p config/chroot_local-includes/root cat config/* 2>/dev/null | grep ^LB_ > config/chroot_local-includes/root/build.conf + + if [ -d cache/stages_bootstrap ]; then + bsbit=$(file cache/stages_bootstrap/bin/true | grep -q "ELF 64-bit" && echo 64 || echo 32) + mv cache/stages_bootstrap cache/stages_bootstrap$bsbit + fi + [ -d cache/stages_bootstrap$bit ] && mv cache/stages_bootstrap$bit cache/stages_bootstrap } postbuild() { - : + [ -d cache/stages_bootstrap ] && mv cache/stages_bootstrap cache/stages_bootstrap$bit } if [ "$LB_KANOTIX_TMPFS" = "true" ]; then -- cgit v1.0 From 4b0deb206a6497ab090190fbbdb0086645301b4f Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Fri, 4 Mar 2011 04:57:25 +0100 Subject: added error handling --- build_gfxoverlay.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_gfxoverlay.sh b/build_gfxoverlay.sh index 050c8ac..a494fbc 100755 --- a/build_gfxoverlay.sh +++ b/build_gfxoverlay.sh @@ -76,6 +76,10 @@ if [ -d cache ]; then mv -f overlay/usr/src/NVIDIA-Linux* cache/ 2>/dev/null mv -f overlay/usr/src/ati-driver-installer* cache/ 2>/dev/null fi +if [ -z "$(find overlay/ -name '*.ko')" ]; then + echo "Error: Something went wrong while building the overlay (no *.ko module has been built)" + exit 6 +fi cd overlay rm -rf usr/sbin/update-initramfs etc/resolv.conf usr/src/NVIDIA-Linux* usr/src/ati-driver-installer* overlay.sh tmp var/log .??* cd .. -- cgit v1.0