#!/bin/bash ##################################################################### # The OBI is soley due to Nio Wiklund (sudous) (the 9w directory) # # # # This configures the OS # # # # # # Most of it is based off of: # # # # https://help.ubuntu.com/community/LiveCDCustomizationFromScratch # # # # except the LORD build the house, # # they labor in vain that build it # # # # ToriOS ISO builder copyright Israel 2014 # # GPL3 License (see COPYING) # # # ##################################################################### echolog() { echo "[ISOMAKER] $@" cat <<< "$@" 1>&2; } seamonkey(){ ## make seamonkey handle stuff sudo xdg-mime default seamonkey-mozilla-build.desktop text/xml text/html application/html x-scheme-handler/mailto x-scheme-handler/http x-scheme-handler/https x-scheme-handler/ftp x-scheme-handler/chrome video/webm application/x-xpinstall x-scheme-handler/mailto application/xhtml+xml application/xml application/rss+xml application/rdf+xml && echolog "seamonkey set for xdg-mime" sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/seamonkey/seamonkey 150 # sudo update-alternatives --config /etc/alternatives/ sudo -v } echolog "Second CHROOT begun" export HOME="/root" echolog "Home is exported as: $HOME" ln -s /tarballs "$HOME"/tarballs && echolog "linked /tarballs to /root/tarballs" ln -s /live/image/live/ /root/img && echolog "linked /live/image/live" ln -s /live/image/live/tarballs / && echolog "linked tarballs /" # Set the root password as torios echo root:torios | chpasswd && echolog "changed root password to torios" /bin/bash -c "export HOSTNAME=\"torios\"" /bin/bash -c "export HOME=\"/root\"" /bin/bash -c "export LC_ALL=\"C\"" /bin/bash -c "export USER=\"root\"" update-menus && echolog "updated menus the first time" ## make the real menu usermod -G $USER $USER && echolog "$USER Usermod successful" id $USER cp "${HOME}"/.jwmrc "${HOME}"/.jwmrc~ && echolog "copied jwmrc to backup file" cp "${HOME}"/.jwmrc /usr/share/jwm-settings-manager/themes/Default/Default echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf && echolog "blacklist floppy" update-initramfs -u && echolog "update initramfs" xdg-user-dirs-update && update-menus && echolog "created user dirs for places menu, and updated places menu" if [ -f "$HOME/.config/pcmanfm/default/pcmanfm.conf" ] then sed -i 's#show_wm_menu=0#show_wm_menu=1#' $HOME/.config/pcmanfm/default/pcmanfm.conf && echolog "set pcmanfm to use my menus on desktop" sed -i 's#wallpaper=.*#wallpaper=/usr/share/backgrounds/default.jpg#' $HOME/.config/pcmanfm/default/pcmanfm.conf && echolog "set pcmanfm to use my background" else if [ ! -d "$HOME/.config/pcmanfm" ] then mkdir "$HOME/.config/pcmanfm/" fi if [ ! -d "$HOME/.config/pcmanfm/default" ] then mkdir "$HOME/.config/pcmanfm/default" fi cp /etc/skel/.config/pcmanfm/default/pcmanfm.conf "$HOME/.config/pcmanfm/default/pcmanfm.conf" && echolog "PCmanFM conf didn't exist, so we copied it" fi sudo chsh --shell /bin/bash $USER && echolog "changed shell to bash for $USER" chown -R "$USER" "$HOME" && echolog "recursively chowned $HOME" dpkg-reconfigure xserver-xorg && echolog "reconfigure Xorg" # Clean up :) echolog "Begin cleanup of system" apt-get autoremove && echolog "apt-get autoremove" apt-get clean && echolog "cleaned Apt cache" apt-get autoclean && echolog "autocleaned Apt cache" sudo rm -f /var/lib/dbus/machine-id && echolog "removed /var/lib/dbus/machine-id" # reinstall nano and leave the deb file available for the live session apt-get --reinstall install nano -y # run this line after nano is installed, makes it reinstall in live session echo 'apt-get --reinstall install nano -y;/bin/nano $*'>/usr/bin/nano rm -rf /tmp/* && echolog "cleaned tmp" rm /sbin/initctl && echolog "removed /sbin/initctl" dpkg-divert --rename --remove /sbin/initctl && echolog "dpkg-divert --rename --remove /sbin/initctl" rm /etc/resolv.conf && echolog "removed /etc/resolv.conf" umount -lf /proc && umount -lf /sys && umount -lf /dev/pts && echolog "unmounted /proc /sys and /dev/pts"