diff options
Diffstat (limited to 'config/chroot_local-hooks')
-rwxr-xr-x | config/chroot_local-hooks/01-macbook | 6 | ||||
-rwxr-xr-x | config/chroot_local-hooks/02-skype | 5 | ||||
-rwxr-xr-x | config/chroot_local-hooks/03-distro | 17 | ||||
-rwxr-xr-x | config/chroot_local-hooks/04-cleanup | 36 | ||||
-rwxr-xr-x | config/chroot_local-hooks/04-cleanup.orig | 36 | ||||
-rwxr-xr-x | config/chroot_local-hooks/05-ndis | 3 | ||||
-rwxr-xr-x | config/chroot_local-hooks/06-bluetooth | 3 | ||||
-rwxr-xr-x | config/chroot_local-hooks/fix-kanotix-graphics.sh | 63 | ||||
-rwxr-xr-x | config/chroot_local-hooks/hotfixes.sh | 57 | ||||
-rwxr-xr-x | config/chroot_local-hooks/update-initramfs.sh | 15 |
10 files changed, 241 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/01-macbook b/config/chroot_local-hooks/01-macbook new file mode 100755 index 0000000..3526bc6 --- /dev/null +++ b/config/chroot_local-hooks/01-macbook @@ -0,0 +1,6 @@ +#!/bin/sh +mkdir -p /etc/skel/.kde/Autostart +cat >/etc/skel/.kde/Autostart/macbook.sh <<MAC +grep -q "Apple.*Keyboard" /proc/bus/input/devices && setxkbmap -model macbook79 +MAC +chmod +x /etc/skel/.kde/Autostart/macbook.sh diff --git a/config/chroot_local-hooks/02-skype b/config/chroot_local-hooks/02-skype new file mode 100755 index 0000000..6f46433 --- /dev/null +++ b/config/chroot_local-hooks/02-skype @@ -0,0 +1,5 @@ +#!/bin/sh +if [ -f /usr/share/applications/skype.desktop ]; then +sed -i 's|\(Exec\)=.*|\1=LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype|' /usr/share/applications/skype.desktop || true +[ -r /usr/lib32/libv4l/v4l1compat.so ] && sed -i 's|\(Exec\)=.*|\1=LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype|' /usr/share/applications/skype.desktop || true +fi diff --git a/config/chroot_local-hooks/03-distro b/config/chroot_local-hooks/03-distro new file mode 100755 index 0000000..ef7ff98 --- /dev/null +++ b/config/chroot_local-hooks/03-distro @@ -0,0 +1,17 @@ +#!/bin/sh +sed -i 's/^\(FLL_DISTRO_MODE=\).*/\1"live"/' /etc/default/distro||true +rsync -Ha --ignore-existing /usr/share/kanotix/profile/ /etc/skel/ +sed -i 's|^\(exclude=media/cdrom_unmounted\).*|\1,media/hdd_unmounted|' /etc/skel/.kde/share/config/kdesktoprc||true +rm -f /etc/skel/.kde4/share/config/kxkbrc +#rm -f /etc/skel/.kde/share/config/kdeglobals.tmp +#mv /etc/skel/.kde/share/config/kdeglobals /etc/skel/.kde/share/config/kdeglobals.tmp +#sed -ne '/\[Locale\]/ { n; :c; /^\[/! { n; b c; }; }; p;' /etc/skel/.kde/share/config/kdeglobals.tmp > /etc/skel/.kde/share/config/kdeglobals +#rm -f /etc/skel/.kde/share/config/kdeglobals.tmp +rm -f /etc/skel/Desktop/kanotix-irc.desktop.tmp +if [ -f /etc/skel/Desktop/kanotix-irc.desktop ]; then + echo '#!/usr/bin/env xdg-open' > /etc/skel/Desktop/kanotix-irc.desktop.tmp + grep -v xdg-open /etc/skel/Desktop/kanotix-irc.desktop >> /etc/skel/Desktop/kanotix-irc.desktop.tmp + rm -f /etc/skel/Desktop/kanotix-irc.desktop + mv /etc/skel/Desktop/kanotix-irc.desktop.tmp /etc/skel/Desktop/kanotix-irc.desktop + chmod +x /etc/skel/Desktop/kanotix-irc.desktop +fi diff --git a/config/chroot_local-hooks/04-cleanup b/config/chroot_local-hooks/04-cleanup new file mode 100755 index 0000000..cae7860 --- /dev/null +++ b/config/chroot_local-hooks/04-cleanup @@ -0,0 +1,36 @@ +#!/bin/sh +#apt-get remove --yes --purge aptitude dselect nano vim-tiny libdiscover1 resolvconf +apt-get remove --yes --purge nano vim-tiny libdiscover1 resolvconf +/usr/sbin/remove-orphans || true +# Removing unused files +find . -name *~ | xargs rm -f +# Cleaning apt lists +rm -rf /var/lib/apt/lists +mkdir -p /var/lib/apt/lists/partial +# Cleaning apt cache +rm -rf /var/cache/apt +mkdir -p /var/cache/apt/archives/partial +# Truncating logs +for FILE in $(find /var/log/ -type f) +do + : > ${FILE} +done +# custom cleanup +rm -f /var/lib/apt/lists/* || true +rm -f /var/cache/apt/*.bin +dpkg --clear-avail +apt-cache gencaches +update-pciids || true +rm -f /usr/share/misc/pci.ids.* +update-usbids || true +rm -f /var/lib/usbutils/usb.ids.* +# Force old autologin +rm -rf /etc/default/kdm.d +# Some application defaults +update-alternatives --set pager /usr/bin/most || true +update-alternatives --set x-window-manager /usr/bin/openbox || true +update-alternatives --set x-window-manager /usr/bin/kwin || true +update-alternatives --set x-www-browser /usr/bin/iceweasel || true +update-alternatives --set x-session-manager /usr/bin/startlxde || true +update-alternatives --set x-session-manager /usr/bin/startkde || true +update-alternatives --set editor /usr/bin/vim.basic || true diff --git a/config/chroot_local-hooks/04-cleanup.orig b/config/chroot_local-hooks/04-cleanup.orig new file mode 100755 index 0000000..ca5ef0f --- /dev/null +++ b/config/chroot_local-hooks/04-cleanup.orig @@ -0,0 +1,36 @@ +#!/bin/sh +#apt-get remove --yes --purge aptitude dselect nano vim-tiny libdiscover1 resolvconf +apt-get remove --yes --purge nano vim-tiny libdiscover1 resolvconf +/usr/sbin/remove-orphans || true +# Removing unused files +find . -name *~ | xargs rm -f +# Cleaning apt lists +rm -rf /var/lib/apt/lists +mkdir -p /var/lib/apt/lists/partial +# Cleaning apt cache +rm -rf /var/cache/apt +mkdir -p /var/cache/apt/archives/partial +# Truncating logs +for FILE in $(find /var/log/ -type f) +do + : > ${FILE} +done +# custom cleanup +rm -f /var/lib/apt/lists/* || true +rm -f /var/cache/apt/*.bin +dpkg --clear-avail +apt-cache gencaches +update-pciids || true +rm -f /usr/share/misc/pci.ids.* +update-usbids || true +rm -f /var/lib/usbutils/usb.ids.* +# Force old autologin +rm -rf /etc/default/kdm.d +# Some application defaults +update-alternatives --set pager /usr/bin/most || true +update-alternatives --set x-window-manager /usr/bin/openbox || true +update-alternatives --set x-window-manager /usr/bin/kwin || true +update-alternatives --set x-www-browser /usr/bin/iceweasel || true +update-alternatives --set x-session-manager /usr/bin/startlxde || true +update-alternatives --set x-session-manager /usr/bin/startkde || true +update-alternatives --set editor /usr/bin/mcedit-debian || true diff --git a/config/chroot_local-hooks/05-ndis b/config/chroot_local-hooks/05-ndis new file mode 100755 index 0000000..306c6d5 --- /dev/null +++ b/config/chroot_local-hooks/05-ndis @@ -0,0 +1,3 @@ +#!/bin/sh +wget -qO- http://kanotix.com/files/fix/ndiswrapper/ndiswrapper64-fwlan64.tar.gz|tar zxC /etc +ndiswrapper -ma diff --git a/config/chroot_local-hooks/06-bluetooth b/config/chroot_local-hooks/06-bluetooth new file mode 100755 index 0000000..98f422e --- /dev/null +++ b/config/chroot_local-hooks/06-bluetooth @@ -0,0 +1,3 @@ +#!/bin/sh +sed -i 's/^\(HIDD_ENABLED\)=.*/\1=1/' /etc/default/bluetooth +#sed -i 's/\(^HIDD_OPTIONS\)=.*/\1="--master --server --search"/' /etc/default/bluetooth diff --git a/config/chroot_local-hooks/fix-kanotix-graphics.sh b/config/chroot_local-hooks/fix-kanotix-graphics.sh new file mode 100755 index 0000000..b9e8eb7 --- /dev/null +++ b/config/chroot_local-hooks/fix-kanotix-graphics.sh @@ -0,0 +1,63 @@ +#!/bin/sh +if test $(id -u) != 0; then + echo Error: You must be root to run this script! + exit 1 +fi +# reinstall grub +if [ -w /boot/grub/menu.lst ] && false; then + OLDGRUB=$(awk -F= '/^# groot/{print $2}' /boot/grub/menu.lst) + if [ -n "$OLDGRUB" ]; then + grub-install --recheck --no-floppy "$OLDGRUB" &>/dev/null + grub-install --recheck --no-floppy "$OLDGRUB" + fi + # add quiet option if not there + KOPT=$(awk '/# kopt/' /boot/grub/menu.lst) + if [ -n "$KOPT" ]; then + case $KOPT in + *quiet*) ;; + *) + perl -pi -e "s|^$KOPT|$KOPT quiet|" /boot/grub/menu.lst + update-grub + ;; + esac + fi +fi +# use new message file +if [ -f /boot/message.hd ]; then + rm -f /boot/message + ln -s message.hd /boot/message +fi +# activate splashy +FROZEN= +[ -f /etc/frozen-rc.d ] && FROZEN=1 +[ -r /etc/default/distro ] && . /etc/default/distro +if [ -x /etc/init.d/splashy-init -a "$FLL_DISTRO_MODE" != "live" ]; then + [ -x /usr/sbin/unfreeze-rc.d ] && /usr/sbin/unfreeze-rc.d + update-rc.d -f splashy-init remove + update-rc.d splashy-init start 03 S . stop 01 0 6 . + [ -n "$FROZEN" -a -x /usr/sbin/freeze-rc.d ] && /usr/sbin/freeze-rc.d +fi +# config splashy +# fix ksplash +if [ -d /usr/share/apps/ksplash/Themes/KanotixClouds ]; then + for x in /root/.kde/share/config/ksplashrc /home/*/.kde/share/config/ksplashrc; do + [ -w "$x" ] && perl -pi -e 's/Theme=.*/Theme=KanotixClouds/' "$x" + done +fi +[ -d /etc/splashy/themes/KanotixPenguins ] && splashy_config -s KanotixPenguins +[ -d /etc/splashy/themes/Kanotix64Penguins ] && splashy_config -s Kanotix64Penguins +# fix kdm +rm -f /etc/kde3/kdm/Xservers +perl -pi -e 's/^(MinShowUID)=.*/\1=500/' /etc/kde3/kdm/kdmrc +if [ -d /usr/share/apps/kdm/themes/KanotixPenguins ]; then + perl -pi -e 's/^#*(UseTheme)=.*/\1=true/' /etc/kde3/kdm/kdmrc + perl -pi -e 's|^(Theme)=.*|\1=/usr/share/apps/kdm/themes/KanotixPenguins|' /etc/kde3/kdm/kdmrc +fi +if [ -d /usr/share/apps/kdm/themes/Kanotix64Penguins ]; then + perl -pi -e 's/^#*(UseTheme)=.*/\1=true/' /etc/kde3/kdm/kdmrc + perl -pi -e 's|^(Theme)=.*|\1=/usr/share/apps/kdm/themes/Kanotix64Penguins|' /etc/kde3/kdm/kdmrc +fi +# kdm background +[ -r /usr/share/wallpapers/kanotix.png ] && perl -pi -e 's|^(Wallpaper)=.*|\1=/usr/share/wallpapers/kanotix.png|' /etc/kde3/kdm/backgroundrc +# fix udev +rm -f /etc/udev/rules.d/40-prism2.rule diff --git a/config/chroot_local-hooks/hotfixes.sh b/config/chroot_local-hooks/hotfixes.sh new file mode 100755 index 0000000..f5d006e --- /dev/null +++ b/config/chroot_local-hooks/hotfixes.sh @@ -0,0 +1,57 @@ +#!/bin/sh +if [ "$(id -u)" != 0 ]; then + echo Error: You must be root to run this script! + exit 1 +fi + +# re-enable powerbutton +if [ -f /etc/powersave/events ]; then + sed -i 's/^\(EVENT_BUTTON_POWER=\).*/\1"wm_shutdown"/' /etc/powersave/events + pidof powersaved >/dev/null && /etc/init.d/powersaved restart +fi + +# vim tuning +if [ -d /etc/vim ]; then + rm -f /etc/vim/vimrc.local +cat <<EOT > /etc/vim/vimrc.local +syntax on +set background=dark +set showmatch " Show matching brackets. +set pastetoggle=<F10> +EOT +fi + +# fix kdm/gdm/xdm/wdm startup +for x in kdm gdm xdm wdm; do + if [ -x /etc/init.d/$x ]; then + update-rc.d -f $x remove + update-rc.d $x start 99 5 . stop 01 0 1 2 3 4 6 . + fi +done + +# init 5 as default +sed -i s/id:.:initdefault:/id:5:initdefault:/ /etc/inittab + +# enable textlogins for runlevel 4/5 +sed -i 's/\([1-6]:23\):/\145:/' /etc/inittab + +insserv live-config + +# workarounds to fix old kanotix installs +rm -f /etc/profile /etc/environment +cp /usr/share/base-files/profile /etc +rm -rf /etc/sysconfig + +# rm/cp/mv aliases and bash completion for login shell +cat <<EOT >> /etc/profile + +# enable bash completion in interactive shells +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +# Some more alias to avoid making mistakes: +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' +EOT diff --git a/config/chroot_local-hooks/update-initramfs.sh b/config/chroot_local-hooks/update-initramfs.sh new file mode 100755 index 0000000..5179f77 --- /dev/null +++ b/config/chroot_local-hooks/update-initramfs.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# This is a hook for live-helper(7) to rebuild the initramfs image. +# To enable it, copy or symlink this hook into your config/chroot_local-hooks +# directory. +# +# Note: You only want to use this hook if you have modified any initramfs-script +# during the build and need to refresh the initrd.img for that purpose. + +for KERNEL in /boot/vmlinuz-* +do + VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')" + + update-initramfs -k ${VERSION} -t -u +done |