diff options
author | 2011-06-15 16:59:54 +0000 | |
---|---|---|
committer | 2011-06-15 16:59:54 +0000 | |
commit | 2590d96369d0217e31dc2812690dde61dac417b5 (patch) | |
tree | 82276f787b08a28548e342c7921486f1acefab9f /liveinst | |
parent | first commit (diff) | |
download | anaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.gz anaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.bz2 anaconda-2590d96369d0217e31dc2812690dde61dac417b5.zip |
Initial import from Sabayon (ver 0.9.9.56)
Diffstat (limited to 'liveinst')
-rw-r--r-- | liveinst/.gitignore | 1 | ||||
-rw-r--r-- | liveinst/Makefile.am | 55 | ||||
-rw-r--r-- | liveinst/README | 1 | ||||
-rw-r--r-- | liveinst/console.apps/Makefile.am | 26 | ||||
-rw-r--r-- | liveinst/console.apps/liveinst | 6 | ||||
-rwxr-xr-x | liveinst/liveinst | 125 | ||||
-rwxr-xr-x | liveinst/liveinst-update | 23 | ||||
-rw-r--r-- | liveinst/liveinst-update-quick | 27 | ||||
-rw-r--r-- | liveinst/liveinst.desktop.in | 11 | ||||
-rw-r--r-- | liveinst/pam.d/Makefile.am | 25 | ||||
-rw-r--r-- | liveinst/pam.d/liveinst | 4 | ||||
-rwxr-xr-x | liveinst/zz-liveinst.sh | 14 |
12 files changed, 318 insertions, 0 deletions
diff --git a/liveinst/.gitignore b/liveinst/.gitignore new file mode 100644 index 0000000..48d183f --- /dev/null +++ b/liveinst/.gitignore @@ -0,0 +1 @@ +liveinst.desktop diff --git a/liveinst/Makefile.am b/liveinst/Makefile.am new file mode 100644 index 0000000..025aab4 --- /dev/null +++ b/liveinst/Makefile.am @@ -0,0 +1,55 @@ +# liveinst/Makefile.am for anaconda +# +# Copyright (C) 2009 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# Author: David Cantrell <dcantrell@redhat.com> + +SUBDIRS = console.apps pam.d + +if IS_LIVEINST_ARCH +dist_sbin_SCRIPTS = liveinst liveinst-update liveinst-update-quick + +desktopdir = $(datadir)/applications +desktop_DATA = liveinst.desktop + +xinitdir = /etc/X11/xinit/xinitrc.d +dist_xinit_SCRIPTS = zz-liveinst.sh +endif + +EXTRA_DIST = README liveinst.desktop.in + +CLEANFILES = liveinst.desktop *.h + +MAINTAINERCLEANFILES = Makefile.in + +intltool_merge_verbose = $(intltool_merge_verbose_$(V)) +intltool_merge_verbose_ = $(intltool_merge_verbose_$(AM_DEFAULT_VERBOSITY)) +intltool_merge_verbose_0 = @echo " MERGE "$@; + +liveinst.desktop: liveinst.desktop.in + $(intltool_merge_verbose)LC_ALL=C intltool-merge -q -d -u $(top_srcdir)/po liveinst.desktop.in liveinst.desktop + +install-exec-local: + mkdir -p $(DESTDIR)$(bindir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/liveinst + for d in $(DESTDIR)$(bindir) ; do + while [ ! -z "$$d" ]; do \ + rmdir $$d 2>/dev/null ; \ + d="`dirname $$d`" ; \ + done ; \ + done diff --git a/liveinst/README b/liveinst/README new file mode 100644 index 0000000..afa64e0 --- /dev/null +++ b/liveinst/README @@ -0,0 +1 @@ +Simple wrapper around anaconda to kick off an install from a live CD diff --git a/liveinst/console.apps/Makefile.am b/liveinst/console.apps/Makefile.am new file mode 100644 index 0000000..f153902 --- /dev/null +++ b/liveinst/console.apps/Makefile.am @@ -0,0 +1,26 @@ +# liveinst/console.apps/Makefile.am for anaconda +# +# Copyright (C) 2009 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# Author: David Cantrell <dcantrell@redhat.com> + +if IS_LIVEINST_ARCH +consoledir = /etc/security/console.apps +dist_console_DATA = liveinst +endif + +CLEANFILES = *.h +MAINTAINERCLEANFILES = Makefile.in diff --git a/liveinst/console.apps/liveinst b/liveinst/console.apps/liveinst new file mode 100644 index 0000000..7c31081 --- /dev/null +++ b/liveinst/console.apps/liveinst @@ -0,0 +1,6 @@ +USER=root +PROGRAM=/usr/sbin/liveinst +SESSION=true +# has to be here otherwise consolehelper switches off the waiting cursor too early +STARTUP_NOTIFICATION_NAME="Starting Install to Hard Drive" +DOMAIN=anaconda
\ No newline at end of file diff --git a/liveinst/liveinst b/liveinst/liveinst new file mode 100755 index 0000000..28f5378 --- /dev/null +++ b/liveinst/liveinst @@ -0,0 +1,125 @@ +#!/bin/sh +# +# Simple script to kick off an install from a live CD +# +# Copyright (C) 2007 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +# load modules that would get loaded by the loader... (#230945) +for i in raid0 raid1 raid5 raid6 raid456 raid10 dm-mod dm-zero dm-mirror dm-snapshot dm-multipath dm-round-robin vfat dm-crypt cbc sha256 lrw xts ; do /sbin/modprobe $i 2>/dev/null ; done + +# NOTE (switches): +# --text => ncurses based installer +# --cmdline => cmdline based installer +# <no arguments> => autodetection + +for arg in $*; do + if [ "${arg}" = "--text" ]; then + DO_TEXT="1" + TEXT_OPT_PASSED="1" + fi +done +[[ -z "${DISPLAY}" ]] && DO_TEXT="1" + +export ANACONDA_PRODUCTNAME="Sabayon" +export ANACONDA_PRODUCTVERSION="$(cat /etc/sabayon-release | cut -d' ' -f 4)" +export ANACONDA_PRODUCTPATH="/mnt/livecd" +export ANACONDA_CHROOTPATH="/mnt/sysimage" +export ANACONDA_PRODUCTARCH="$(cat /etc/sabayon-release | cut -d' ' -f 3)" +export ANACONDA_BUGURL="http://bugs.sabayon.org" +export PIXMAPPATH="/usr/share/anaconda/pixmaps" + +function kill_mounts() { + # devkit-disks is now mounting lots of stuff. for now, let's just try to unmount it all + umount /media/* &> /dev/null + if [ -d "${ANACONDA_CHROOTPATH}/dev" ]; then + tmpdir=$(mktemp) + rm -f $tmpdir + mkdir $tmpdir + mount --move ${ANACONDA_CHROOTPATH}/dev $tmpdir &> /dev/null + umount -l $tmpdir &> /dev/null + fi + tac /proc/mounts | grep ^/dev | grep -v live | while read dev mntpoint rest; do + umount $mntpoint 2>/dev/null + done + + /sbin/swapoff -a + sleep 2 + /sbin/lvm vgchange -an --ignorelockingfailure + for i in /dev/md*; do + if [ ! -b $i ]; then + continue + fi + + case "$i" in + /dev/md*p*) + ;; + *) + mdadm --stop $i >/dev/null 2>&1 + ;; + esac + done + + # close any luks device + cryptsetup luksClose /dev/mapper/luks-* &> /dev/null + +} + +function setup_vbox() { + if [ -x /usr/bin/VBoxClient-all ]; then + /usr/bin/VBoxClient-all &> /dev/null + fi +} + +if [ -n "$DISPLAY" -a -n "$LANG" ]; then + INSTLANG="--lang $LANG" +fi + +if [ -x /usr/sbin/setenforce -a -e /selinux/enforce ]; then + current=$(cat /selinux/enforce) + /usr/sbin/setenforce 0 +fi + +ANACONDA="anaconda --liveinst --method=hd://://${ANACONDA_PRODUCTPATH}" +[[ -n "${DO_TEXT}" ]] && [[ -z "${TEXT_OPT_PASSED}" ]] && \ + ANACONDA="${ANACONDA} --text" +[[ ! -e /selinux/load ]] && ANACONDA="$ANACONDA --noselinux" + +kill_mounts +setup_vbox + +/sbin/udevadm control --env=ANACONDA=1 + +if [ -x /usr/bin/udisks ] && [ -z "${SABAYON_DEBUG}" ]; then + /usr/bin/udisks --inhibit -- $ANACONDA $* +else + $ANACONDA $* +fi + +ANACONDA_RC="$?" + +if [ -n "$current" ]; then + /usr/sbin/setenforce $current +fi + +kill_mounts + +[[ -n "${DO_TEXT}" ]] && reset + +if [ "${ANACONDA_RC}" = "100" ] || [ -f "/tmp/__anaconda_reboot__" ]; then + # reboot + reboot -f +fi diff --git a/liveinst/liveinst-update b/liveinst/liveinst-update new file mode 100755 index 0000000..41829e1 --- /dev/null +++ b/liveinst/liveinst-update @@ -0,0 +1,23 @@ +#!/bin/sh + +_fetch_ver="5" +[[ -f "/etc/sabayon-edition" ]] && _fetch_ver=$(cat /etc/sabayon-edition | cut -d" " -f 3) + +FETCH_VER=${FETCH_VER:-${_fetch_ver}} +FETCH_FN="anaconda-${FETCH_VER}-$(uname -m).tar.bz2" +FETCH_URL=${FETCH_URL:-"http://www.sabayon.org/sabayon/installer/${FETCH_FN}"} + +cd /tmp +rm -rf "/tmp/${FETCH_FN}"* +echo "Fetching Sabayon Anaconda Installer from ${FETCH_URL}..." +wget ${FETCH_WGET_ARGS} "${FETCH_URL}" "${FETCH_URL}.md5" +if [ "${?}" = "0" ]; then + md5sum -c "${FETCH_FN}.md5" || ( echo "OUCH, md5 does not match" && exit 1 ) + tar xjf "${FETCH_FN}" -C / + echo "ALL FINE, respawn the installer" + exit 0 +else + echo "OUCH, something bad happened" + exit 1 +fi + diff --git a/liveinst/liveinst-update-quick b/liveinst/liveinst-update-quick new file mode 100644 index 0000000..863076e --- /dev/null +++ b/liveinst/liveinst-update-quick @@ -0,0 +1,27 @@ +#!/bin/sh + +_fetch_ver="5" +[[ -f "/etc/sabayon-edition" ]] && _fetch_ver=$(cat /etc/sabayon-edition | cut -d" " -f 3) + +FETCH_VER=${FETCH_VER:-${_fetch_ver}} +FETCH_FN="pyanaconda-${FETCH_VER}.tar.bz2" +FETCH_URL=${FETCH_URL:-"http://www.sabayon.org/sabayon/installer/${FETCH_FN}"} + +cd /tmp +rm -rf "/tmp/${FETCH_FN}"* +echo "Fetching Sabayon Anaconda Installer from ${FETCH_URL}..." +wget ${FETCH_WGET_ARGS} "${FETCH_URL}" "${FETCH_URL}.md5" +if [ "${?}" = "0" ]; then + md5sum -c "${FETCH_FN}.md5" || ( echo "OUCH, md5 does not match" && exit 1 ) + find /usr/lib/python?.?/site-packages/pyanaconda -name "*.py*" | xargs rm + tar xjf "${FETCH_FN}" -C /tmp + cp /tmp/pyanaconda/* /usr/lib/python?.?/site-packages/pyanaconda/ -Rp + rm /tmp/pyanaconda -rf + rm "${FETCH_FN}*" -rf + echo "ALL FINE, respawn the installer" + exit 0 +else + echo "OUCH, something bad happened" + exit 1 +fi + diff --git a/liveinst/liveinst.desktop.in b/liveinst/liveinst.desktop.in new file mode 100644 index 0000000..5397868 --- /dev/null +++ b/liveinst/liveinst.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +_Name=Install to Hard Drive +_GenericName=Install +_Comment=Install the live CD to your hard disk +Categories=System;Utility;X-Red-Hat-Base;X-Fedora;GNOME;GTK; +Exec=liveinst +Terminal=false +Type=Application +Icon=media-optical +Encoding=UTF-8 +StartupNotify=true diff --git a/liveinst/pam.d/Makefile.am b/liveinst/pam.d/Makefile.am new file mode 100644 index 0000000..9b2bf06 --- /dev/null +++ b/liveinst/pam.d/Makefile.am @@ -0,0 +1,25 @@ +# liveinst/pam.d/Makefile.am for anaconda +# +# Copyright (C) 2009 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# Author: David Cantrell <dcantrell@redhat.com> + +if IS_LIVEINST_ARCH +pamdir = /etc/pam.d +dist_pam_DATA = liveinst +endif + +MAINTAINERCLEANFILES = Makefile.in diff --git a/liveinst/pam.d/liveinst b/liveinst/pam.d/liveinst new file mode 100644 index 0000000..c7d67e3 --- /dev/null +++ b/liveinst/pam.d/liveinst @@ -0,0 +1,4 @@ +#%PAM-1.0 +auth include config-util +account include config-util +session include config-util diff --git a/liveinst/zz-liveinst.sh b/liveinst/zz-liveinst.sh new file mode 100755 index 0000000..c141290 --- /dev/null +++ b/liveinst/zz-liveinst.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Set up a launcher on the desktop for the live installer if we're on +# a live CD + +# don't run on geode (olpc) +if [ `grep -c Geode /proc/cpuinfo` -eq 0 ]; then + if [ -b /dev/mapper/live-osimg-min ]; then + test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + cp /usr/share/applications/liveinst.desktop "${XDG_DESKTOP_DIR:-$HOME/Desktop}" + elif [ -f /.livecd-configured ]; then # FIXME: old way... this should go away + test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + cp /usr/share/applications/liveinst.desktop "${XDG_DESKTOP_DIR:-$HOME/Desktop}" + fi +fi |