Kaydet (Commit) e218dccf authored tarafından sulincix's avatar sulincix

configure added

üst ca6eb8d2
all: buildmo
all: clean build
build: @buildmo@
mkdir -p build@prefix@/lib/ || true
cp -prfv live-installer build@prefix@/lib/
#set parmissions
chmod 755 -R build
chown root -R build
buildmo:
mkdir -p build@prefix@/share/ || true
@echo "Building the mo files"
# WARNING: the second sed below will only works correctly with the languages that don't contain "-"
for file in `ls po/*.po`; do \
lang=`echo $$file | sed 's@po/@@' | sed 's/\.po//' | sed 's/live-installer-//'`; \
install -d usr/share/locale/$$lang/LC_MESSAGES/; \
msgfmt -o usr/share/locale/$$lang/LC_MESSAGES/live-installer.mo $$file; \
install -d build@prefix@/share/live-installer/locale/$$lang/LC_MESSAGES/; \
msgfmt -o build@prefix@/share/live-installer/locale/$$lang/LC_MESSAGES/live-installer.mo $$file; \
done \
install:
cp -prfv build/* $(DESTDIR)/
clean:
rm -rf usr/share/locale
rm -rf build
# Live-installer
Customized lmde installer
#!/bin/bash
is_exists(){
echo -ne "Checking $1 "
p=$(which "$1")
if [ "$p" == "" ] ; then
echo "(not found)"
exit 1
else
echo "(yes)"
fi
}
helpmsg(){
echo "Usage ./configure [options]"
echo " --prefix : Use custom prefix location (default /usr)"
echo " --clear : Remove alt fles"
echo " --disable-nsl : Do not build locale files"
echo " --help : Show this message"
}
#defaults
export prefix="/usr"
export nsl=true
cp Makefile.in Makefile.ac
for arg in $*
do
if echo $arg | grep "^--clear" &>/dev/null ; then
[ -f Makefile.ac ] && rm -f Makefile.ac
[ -f Makefile ] && rm -f Makefile
[ -d build ] && rm -rf build
exit 0
elif echo $arg | grep "^--help" &>/dev/null ; then
helpmsg
exit 0
elif echo $arg | grep "^--prefix=" &>/dev/null; then
export prefix=$(echo "$arg" | sed "s/^.*=//g")
elif echo $arg | grep "^--disable-nsl" &>/dev/null; then
export nsl="false"
fi
done
#Checking program
for item in msgfmt install python3 chown chmod
do
is_exists $item
done
if [ "$nsl" == "false" ] ; then
sed -i "s|@buildmo@||g" Makefile.ac
else
sed -i "s|@buildmo@|buildmo|g" Makefile.ac
fi
sed -i "s|@prefix@|$prefix|g" Makefile.ac
echo -e " Prefix: $prefix"
echo -e " Locale-Support: $nsl"
mv Makefile.ac Makefile
This diff is collapsed.
Source: live-installer
Section: admin
Priority: optional
Maintainer: Clement Lefebvre <root@linuxmint.com>
Build-Depends: debhelper (>= 9),
python
X-Python-Version: >= 2.7
Standards-Version: 3.9.5
Vcs-Git: git://github.com/linuxmint/live-installer.git
Vcs-Browser: https://github.com/linuxmint/live-installer
Package: live-installer
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, gir1.2-webkit2-4.0
, python (>= 2.7), python (<< 3)
, python-parted, parted, gparted
, python-gi-cairo
, python-pyqt5
, python-pil
, imagemagick
, isoquery
, desktop-file-utils
, shared-mime-info
, sysv-rc
, menu
, gdisk
, isoquery, iso-codes, locales
, adduser
, rsync
Description: Live Installer
A live installer
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: livemaker
Upstream-Contact: Clement Lefebvre <root@linuxmint.com>
Source: <http://github.com/linuxmint/live-installer>
Files: *
Copyright: 2010 Clement Lefebvre <root@linuxmint.com>
License: GPL-2+
Files: debian/*
Copyright: 2010 Clement Lefebvre <root@linuxmint.com>
Ikey Doherty <contactjfreak@gmail.com>
License: GPL-2+
License: GPL-2+
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 package 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/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
#! /bin/sh
### BEGIN INIT INFO
# Provides: live-installer
# Should-Start: console-screen acpid bootlogs dbus hal network-manager
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Live Installer
# Description: Provides a dedicated operating mode for Live Installer
# without a DE or DM
### END INIT INFO
# Author: Ikey Doherty <contactjfreak@gmail.com>
#
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Live Installer"
NAME=live-installer-dm
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="--options args"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/live-installer
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $DAEMON
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
#!/bin/sh
set -e
case "$1" in
configure)
if which systemctl >/dev/null 2>&1
then
systemctl daemon-reload || true
systemctl enable live-installer.service || true
systemctl enable install-live-drivers.service || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
triggered)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
exit 0
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
%:
dh $@ --with=python2
[Desktop Entry]
Encoding=UTF-8
Name=Bump Virtualbox Resolution
Comment=Increase resolution to 1024x768 if it's below that value
Icon=virtualbox
Exec=bump-virtualbox-resolution
Terminal=false
Type=Application
StartupNotify=false
[Unit]
Description=Installing Live Drivers
Before=lightdm.service
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=oneshot
Restart=no
Before=lightdm.service
ExecStart=/usr/bin/install-live-drivers
StandardOutput=tty
TTYPath=/dev/tty1
[Install]
WantedBy=multi-user.target
[Unit]
Description=Shuts down the "live" preinstalled system cleanly
DefaultDependencies=no
Before=final.target
After=shutdown.target umount.target
[Service]
Type=oneshot
ExecStart=/sbin/live-installer-stop
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
TTYReset=yes
[Install]
WantedBy=final.target
This diff is collapsed.
......@@ -7,7 +7,7 @@ class Dialog(Gtk.MessageDialog):
def __init__(self, style, buttons, title, text, text2=None, parent=None):
Gtk.MessageDialog.__init__(self, parent, 0, style, buttons)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_icon_from_file("/usr/share/icons/live-installer.png")
self.set_icon_from_file("./icons/live-installer.png")
self.set_title(title)
self.set_markup(text)
self.desc = text[:30] + ' ...' if len(text) > 30 else text
......
......@@ -20,7 +20,7 @@ from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, Pango, GLib
gettext.install("live-installer", "/usr/share/locale")
LOADING_ANIMATION = '/usr/share/live-installer/loading.gif'
LOADING_ANIMATION = './resources/loading.gif'
# Used as a decorator to run things in the background
def asynchronous(func):
......@@ -61,7 +61,7 @@ class InstallerWindow:
self.setup = Setup()
self.installer = InstallerEngine(self.setup)
self.resource_dir = '/usr/share/live-installer/'
self.resource_dir = './resources/'
glade_file = os.path.join(self.resource_dir, 'interface.ui')
self.builder = Gtk.Builder()
self.builder.add_from_file(glade_file)
......@@ -517,7 +517,7 @@ class InstallerWindow:
from utils import memoize
language=None
flag = memoize(lambda ccode: GdkPixbuf.Pixbuf.new_from_file(flag_path(ccode)))
for locale in subprocess.getoutput("awk -F'[@ .]' '/UTF-8/{ print $1 }' /usr/share/i18n/SUPPORTED | uniq").split('\n'):
for locale in subprocess.getoutput("cat ./resources/locales").split('\n'):
if '_' in locale:
lang, ccode = locale.split('_')
language = lang
......
......@@ -553,7 +553,7 @@ class InstallerEngine:
print("Failed to install Broadcom drivers")
# NVIDIA
driver = "/usr/share/live-installer/nvidia-driver.tar.gz"
driver = "./resources/nvidia-driver.tar.gz"
if os.path.exists(driver):
if "install-nvidia" in subprocess.getoutput("cat /proc/cmdline"):
print(" --> Installing NVIDIA driver")
......@@ -564,7 +564,6 @@ class InstallerEngine:
except Exception as e:
print(("Failed to install NVIDIA driver: ", e))
os.system("rm -f /target/usr/share/live-installer/nvidia-driver.tar.gz")
# set the keyboard options..
print(" --> Setting the keyboard")
......
......@@ -48,7 +48,7 @@ def path_exists(*args):
return os.path.exists(os.path.join(*args))
TMP_MOUNTPOINT = '/tmp/live-installer/tmpmount'
RESOURCE_DIR = '/usr/share/live-installer/'
RESOURCE_DIR = './resources/'
EFI_MOUNT_POINT = '/boot/efi'
SWAP_MOUNT_POINT = 'swap'
......@@ -56,7 +56,7 @@ SWAP_MOUNT_POINT = 'swap'
def get_disks():
disks = []
exclude_devices = ['/dev/sr0', '/dev/sr1', '/dev/cdrom', '/dev/dvd', '/dev/fd0']
exclude_devices = ['/dev/sr0', '/dev/sr1', '/dev/cdrom', '/dev/dvd', '/dev/fd0', '/dev/nullb0']
live_device = subprocess.getoutput("findmnt -n -o source /run/live/medium").split('\n')[0]
live_device = re.sub('[0-9]+$', '', live_device) # remove partition numbers if any
if live_device is not None and live_device.startswith('/dev/'):
......