Browse Source

mrege upstream

master
Alf Gaida 6 years ago
parent
commit
fc95dc44c9

+ 2
- 1
Makefile View File

@@ -1,4 +1,5 @@
DIRS := bin man
INIT := $(notdir $(wildcard debian/*.init))

all: $(DIRS:%=all-%)
all-%:
@@ -10,7 +11,7 @@ clean-%:

distclean: clean

test:
test: $(INIT:%=test-%)
test-%:
$(info checking $* ...)
@dash -n debian/$*

+ 28
- 8
bin/fll_fstab_generator.c View File

@@ -142,14 +142,14 @@ static int device_devtype_disk(struct udev_device *device)

static int device_devmapper(struct udev_device *device)
{
const char *devnode;
struct udev_list_entry *props;
struct udev_list_entry *prop;

devnode = udev_device_get_devnode(device);
if (devnode != NULL)
return strncmp(devnode, "/dev/mapper/",
strlen("/dev/mapper/")) == 0;
else
return 0;
props = udev_device_get_properties_list_entry(device);
prop = udev_list_entry_get_by_name (props, "DM_UUID");
if (prop != NULL)
return 1;
return 0;
}

static char* device_vfstype(struct udev_device *device)
@@ -278,7 +278,27 @@ static char* device_spec(struct udev_device *device, char *fstype, int disk)
}
}

if (!disk || value == NULL) {
if (!disk) {
udev_list_entry_foreach(u_list_ent, u_first_list_ent) {
devnode = udev_list_entry_get_name(u_list_ent);
if (strncmp(devnode, "/dev/mapper",
strlen("/dev/mapper")) == 0) {
if (value != NULL)
free(value);
len = strlen(devnode) + 1;
value = malloc(len);
if (value == NULL)
return NULL;
res = snprintf(value, len, "%s", devnode);
if (res < 0 || (size_t) res >= len)
return NULL;
else
value[len - 1] = '\0';
}
}
}

if (value == NULL) {
devnode = udev_device_get_devnode(device);
if (devnode == NULL)
return NULL;

+ 6
- 0
debian/changelog View File

@@ -1,3 +1,9 @@
fll-live-initscripts (2014.12.10) unstable; urgency=medium

* merge upstream

-- Alf Gaida <agaida@siduction.org> Wed, 10 Dec 2014 22:54:50 +0100

fll-live-initscripts (2014.11.06) unstable; urgency=medium

* setlxdelanguages -> setlxdekblanguages

+ 0
- 130
fixes/umountfs View File

@@ -1,130 +0,0 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: umountfs
# Required-Start:
# Required-Stop: umountroot
# Default-Start:
# Default-Stop: 0 6
# Short-Description: Turn off swap and unmount all local file systems.
# Description:
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh

. /lib/lsb/init-functions

umask 022

do_stop () {
PROTECTED_MOUNTS="$(sed -n '0,/^\/[^ ]* \/ /p' /proc/mounts)"
WEAK_MTPTS="" # be gentle, don't use force
REG_MTPTS=""
TMPFS_MTPTS=""
while read -r DEV MTPT FSTYPE REST
do
echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV $MTPT " && continue
case "$MTPT" in
/|/proc|/dev|/.dev|/dev/pts|/dev/shm|/dev/.static/dev|/proc/*|/sys|/sys/*|/run|/run/*)
continue
;;
esac
case "$FSTYPE" in
proc|procfs|linprocfs|sysfs|usbfs|usbdevfs|devpts)
continue
;;
tmpfs)
TMPFS_MTPTS="$MTPT $TMPFS_MTPTS"
;;
*)
if echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV "; then
WEAK_MTPTS="$MTPT $WEAK_MTPTS"
else
REG_MTPTS="$MTPT $REG_MTPTS"
fi
;;
esac
done < /proc/mounts

#
# Make sure tmpfs file systems are umounted before turning off
# swap, to avoid running out of memory if the tmpfs filesystems
# use a lot of space.
#
if [ "$TMPFS_MTPTS" ]
then
if [ "$VERBOSE" = no ]
then
log_action_begin_msg "Unmounting temporary filesystems"
fstab-decode umount $TMPFS_MTPTS
log_action_end_msg $?
else
log_daemon_msg "Will now unmount temporary filesystems"
fstab-decode umount -v $TMPFS_MTPTS
log_end_msg $?
fi
fi

#
# Deactivate swap
#
if [ "$VERBOSE" = no ]
then
log_action_begin_msg "Deactivating swap"
swapoff -a >/dev/null
log_action_end_msg $?
else
log_daemon_msg "Will now deactivate swap"
swapoff -a -v
log_end_msg $?
fi

#
# Unmount local filesystems
#
if [ "$WEAK_MTPTS" ]; then
# Do not use -f umount option for WEAK_MTPTS
if [ "$VERBOSE" = no ]
then
log_action_begin_msg "Unmounting weak filesystems"
fstab-decode umount -r -d $WEAK_MTPTS
log_action_end_msg $?
else
log_daemon_msg "Will now unmount weak filesystems"
fstab-decode umount -v -r -d $WEAK_MTPTS
log_end_msg $?
fi
fi
if [ "$REG_MTPTS" ]
then
if [ "$VERBOSE" = no ]
then
log_action_begin_msg "Unmounting local filesystems"
fstab-decode umount -f -r -d $REG_MTPTS
log_action_end_msg $?
else
log_daemon_msg "Will now unmount local filesystems"
fstab-decode umount -f -v -r -d $REG_MTPTS
log_end_msg $?
fi
fi
}

case "$1" in
start)
# No-op
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac

:

+ 0
- 48
networking/000fll View File

@@ -1,48 +0,0 @@
#!/bin/sh
#
# ifup hook script for fll
#
# This file is part of the fll-live-initscripts package
#
# Copyright © 2012 Niall Walsh <niallwalsh@users.berlios.de>
# License: GPLv2+

grep -q nonetwork /proc/cmdline && exit 0

# no-op when lo or "--all" come up, we want a real iface up
( [ "${IFACE}" = "lo" ] || [ "${IFACE}" = "--all" ] ) && exit 0

if [ -e "/run/fll/ifup" ]; then
exit 0
else
# make sure no other iface manages to race in
echo ${IFACE} >> /run/fll/ifup
ifirst=$(head -n 1 /run/fll/ifup)
if [ "${ifirst}" != "${IFACE}" ] ; then
sed -i '/'${IFACE}'/d' /run/fll/ifup
exit 0
fi
fi

# check if our net.agent added this interface
ifours() {
[ -e "/run/fll/ifup.${1}" ] && grep -q fll /run/fll/ifup.${1} && return 0
return 1
}

# drop the interface and remove it's allow-hotplug if we added it
ifdel() {
ifours ${1} && sed -i '/iface '${1}' inet dhcp/d' /etc/network/interfaces
ip link set ${1} down && rm /run/fll/ifup.${1}
}

ifours ${IFACE} && \
sed -i -e 's|iface '${IFACE}' inet dhcp|allow-hotplug '${IFACE}'\n&|' /etc/network/interfaces

# stop other attempts made by our udev agent to ifup
for d in /run/fll/ifup.* ; do
[ -e "${d}" ] && [ "${d}" != "/run/fll/ifup.${IFACE}" ] && ifdel ${d##*/ifup\.}
done

:


+ 0
- 121
networking/fll.net.agent View File

@@ -1,121 +0,0 @@
#!/bin/sh -e
#
# put attached devices in interfaces
# bring them up if nothing has come up yet
#
# Copyright (C) 2012 Niall Walsh <niallwalsh@users.berlios.de>
#
# fll.net.agent is based on udev's net.agent
# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
# Copyright (C) 2004,2005 Kay Sievers <kay.sievers@vrfy.org>
# udev is licensed under the GNU GPL version 2 or newer.

[ -e /run/fll/netup ] || exit 0

grep -q nonetwork /proc/cmdline && exit 0

. /lib/udev/hotplug.functions

if [ -e /run/fll/ifup ]; then
debug_mesg "Not ifup-ing interface $INTERFACE as we have brought one up already"
exit 0
fi

if [ -z "$INTERFACE" ]; then
mesg "Bad fll.net.agent invocation: \$INTERFACE is not set"
exit 1
fi

check_program() {
[ -x $1 ] && return 0

mesg "ERROR: $1 not found. You need to install the ifupdown package."
mesg "fll.net.agent $ACTION event for $INTERFACE not handled."
exit 1
}

wait_for_interface() {
local interface=$1

while :; do
local state="$(cat /sys/class/net/$interface/operstate 2>/dev/null || true)"
if [ "$state" != down ]; then
return 0
fi
sleep 1
done
}

net_ifup() {
check_program /sbin/ifup

if ps -C ifup ho args | grep -q "$INTERFACE"; then
debug_mesg "Already ifup-ing interface $INTERFACE"
exit 0
fi

if [ ! -d /run/fll ]; then
mkdir /run/fll
fi

if [ ! -e /etc/network/interfaces ]; then
printf "auto lo\niface lo inet loopback\n" > /etc/network/interfaces
fi

# don't create anything if we have "iface $iface" or "mapping $iface"
if ! grep -q -e 'iface[[:space::]\+$INTERFACE[[:space::]\+' \
-e 'mapping[[:space::]\+$INTERFACE[[:space:]]*$' \
/etc/network/interfaces; then
printf "fll\n" > "/run/fll/ifup.${INTERFACE}"
printf "\niface $INTERFACE inet dhcp\n" >> /etc/network/interfaces
else
touch "/run/fll/ifup.${INTERFACE}"
fi

wait_for_interface lo
if [ -d /run/systemd/system ]; then
systemctl start ifup@${INTERFACE}.service
fi
ifup $INTERFACE
}

net_ifdown() {
check_program /sbin/ifdown

if ps -C ifdown ho args | grep -q $INTERFACE; then
debug_mesg "Already ifdown-ing interface $INTERFACE"
exit 0
fi

exec ifdown $INTERFACE
}

do_everything() {
case "$ACTION" in
add)
# these interfaces generate hotplug events *after* they are brought up
case $INTERFACE in
ppp*|ippp*|isdn*|plip*|lo|irda*|ipsec*)
exit 0
;;
esac

# ignore wireless interfaces
if [ -d "/sys/class/net/$INTERFACE/phy80211" ] || \
( [ -x /sbin/iwgetid ] && \
/sbin/iwgetid --protocol $INTERFACE | grep -q "^$INTERFACE" ); then
exit 0
fi

net_ifup
;;
esac
}

# When udev_log="debug" stdout and stderr are pipes connected to udevd.
# They need to be closed or udevd will wait for this process which will
# deadlock with udevsettle until the timeout.
do_everything > /dev/null 2> /dev/null &

exit 0


+ 0
- 129
share/fll-live-initscripts/fll-fstab View File

@@ -1,129 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-fstab
# Required-Start: mountdevsubfs
# Required-Stop:
# Should-Start: lvm2
# X-Start-Before: mountall
# Default-Start: S
# Default-Stop:
# Short-Description: generates /etc/fstab
# Description: The purpose of fll-fstab is to generate /etc/fstab via
# fll_fstab_generator(8).
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2007 - 2010 Kel Modderman <kel@otaku42.de>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-fstab"

if [ ! -x /usr/sbin/fll_fstab_generator ]; then
exit 0
fi

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
exit 0
fi

###
# VERBOSE setting and other rcS variables
###
#. /lib/init/vars.sh

###
# source lsb functions
###
. /lib/lsb/init-functions

###
# source fll functions
###
. /lib/init/fll

###
# ensure this is clean variable
###
NOSWAP=""

###
# cheatcode handling
###
if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
nofstab|fstab=no)
exit 0
;;
noswap|swap=no)
NOSWAP="--noswap"
;;
esac
done
fi

do_start() {
if [ -d /sys/firmware/efi ] && [ /sys/fs/pstore/ ]; then
log_daemon_msg "${NAME}"; log_action_begin_msg " clean pstore"
mount -t pstore -o kmsg_bytes=8000 pstore /sys/fs/pstore && \
find /sys/fs/pstore/ -type f -delete
log_end_msg "${?}"
umount /sys/fs/pstore 2>/dev/null || \
umount -l /sys/fs/pstore 2>/dev/null || :
fi

log_daemon_msg "${NAME}"; log_action_begin_msg " generating /etc/fstab"
/usr/sbin/fll_fstab_generator --file /etc/fstab --mkdir --nomounts ${NOSWAP}
log_end_msg "${?}"

if which column >/dev/null; then
column -t < /etc/fstab > /etc/fstab.pretty &&
mv -f /etc/fstab.pretty /etc/fstab
fi
}

case "${1}" in
start)
log_daemon_msg "${NAME}"
do_start
log_msg_end "${?}"
;;
stop)
;;
restart|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop}" >&2
exit 3
;;
esac

:

+ 0
- 642
share/fll-live-initscripts/fll-locales View File

@@ -1,642 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-locales
# Required-Start: mountdevsubfs
# Required-Stop:
# X-Start-Before: keyboard-setup
# X-Interactive: true
# Default-Start: S
# Default-Stop:
# Short-Description: live media locale autoconfigurator
# Description: The purpose of fll-locales is to calculate required
# strings to configure the locale settings of system
# according to given lang= string.
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2007 - 2008 Kel Modderman <kel@otaku42.de>
# (C) 2008 Michael Deelwater <michael.deelwater@googlemail.com>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-locales"

if [ "${1}" = "list" ]; then
sed -n 's![ \t]\+\([a-z-]\+\)|\?\([a-z]\+\)\?).*### [A-Z][A-Z] \(.\+\) kb:\(.\+\) ###!\1, \3,\4!p' "${0}"
exit 0
fi

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"
FLL_DISTRO_NAME="siduction"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
[ -n "${FLL_LANG}" ] || exit 0
fi

###
# VERBOSE setting and other rcS variables
###
#. /lib/init/vars.sh

###
# source lsb functions
###
. /lib/lsb/init-functions

###
# source fll functions
###
. /lib/init/fll

###
# source LANG functions
###
. /usr/share/fll-live-initscripts/locales

###
# some console-setup defaults
###
CHARMAP="UTF-8"
CODESET="Uni2"
# Debian agrees that Terminus doesn't look great enough to be default
# http://bugs.debian.org/497331
FONTFACE="VGA"
# Keep the default size of 16 here to avoid clearing VT 1/2 way through
# bootup sequence
FONTSIZE="16"

###
# some keyboard-configuration defaults
###
XKBMODEL="linux"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="lv3:ralt_switch,compose:lwin,grp:alt_shift_toggle"

###
# cheatcode handling
###
if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
lang=*)
LANGUAGE=$(awk 'BEGIN{ print tolower("'"${param#lang=}"'") }')
;;
utc=yes)
UTC="yes"
;;
utc|gmt)
CUSTOM_TZ="Etc/UTC"
;;
tz=*)
CUSTOM_TZ="${param#tz=}"
;;
noaptlang)
NOAPTLANG="yes"
;;
image_dir=*)
FLL_IMAGE_DIR="${param#image_dir=}"
FLL_IMAGE_LOCATION="${FLL_IMAGE_DIR}/${FLL_IMAGE_FILE}"
;;
image_name=*)
FLL_IMAGE_FILE="${param#image_name=}"
FLL_IMAGE_LOCATION="${FLL_IMAGE_DIR}/${FLL_IMAGE_FILE}"
;;
xkboptions=*)
KBOPTIONS="${param#xkboptions=}"
;;
keytable=*)
KEYTABLE="${param#keytable=}"
;;
xkbmodel=*)
KBMODEL="${param#xkbmodel=}"
;;
xkbvariant=*)
KBVARIANT="${param#xkbvariant=}"
;;
esac
done
fi

###
# allow FLL_LANG environment variable to trump
###
if [ -n "${FLL_LANG}" ]; then
LANGUAGE="${FLL_LANG}"
fi

###
# lang cheatcode can optionally be made of two dash-separated parts ll-cc
# ll -> language code
# cc -> demographic code
###
LANG_CODE=${LANGUAGE%%[-_]*}
DEMO_CODE="$(echo ${LANGUAGE##*[-_]} | awk '{print toupper($1)}')"

LANGS=$(locale -a)
LANG=""

# First check if they entered a built in lang
for LOCALE in ${LANGS}; do
[ "${LOCALE}" = "${LANG_CODE}_${DEMO_CODE}.utf8" ] && LANG="${LOCALE}" && break
# match the language to find the default and possible locales
case "${LOCALE}" in
${LANG_CODE}_*)
[ -z "${LANG_POSS}" ] && LANG_POSS="${LOCALE}"
fll_locale_default ${LOCALE} && LANG_DEF="${LOCALE}"
;;
esac
done
# See if we have some knowledge on how to setup the requested locale
if [ -z "${LANG}" ]; then
for LOCALE in fll_locale_cheats; do
[ "${LOCALE}" = "${LANG_CODE}_${DEMO_CODE}.utf8" ] && \
fll_locale_lang ${LOCALE} && break
done
fi
# Ok just fallback to the default language, or whatever we know about or en_US
if [ -z "$LANG" ]; then
if [ -n "${LANG_DEF}" ]; then
LANG="${LANG_DEF}"
else
if [ -n "${LANG_POSS}" ]; then
LANG="${LANG_POSS}"
else
LANG="en_US.utf8"
fi
fi
fi
export LANG
###
# if demographic code was ommitted, extract default demo_code from LANG
###
if [ -z "${DEMO_CODE}" ]; then
LANG_CHECK="${LANG%%.*}"
DEMO_CODE="${LANG_CHECK##*_}"
fi

#set tz, mirror, xkb via fll_locale_demo
if [ "${LANG}" = "${LANG_CODE}_${DEMO_CODE}.utf8" ]; then
fll_locale_demo ${LANG}
else
# We've altered their LANG
fll_locale_cheats
for LOCALE in ${FLL_LOCALE_CHEATS} ; do
# if we have their locale
if [ "${LOCALE}" = "${LANG_CODE}_${DEMO_CODE}.utf8" ] ; then
DEMO="${LOCALE}"
break
fi
# if we have a locale in their country
if [ "${LOCALE#*_}" = "${DEMO_CODE}.utf8" ] ; then
[ -z "${DEMO_POSS}" ] && DEMO_POSS="${LOCALE}"
fi
done
# if it's not a country we know about fallback to default 00_00
if [ -z "${DEMO}" ]; then
if [ -n "${DEMO_POSS}" ]; then
DEMO="${DEMO_POSS}"
else
DEMO="00_00.utf8"
fi
fi
fll_locale_demo ${DEMO}
fi

###
# allow CUSTOM_TZ to override above TZ definitions
###
if [ -n "${CUSTOM_TZ}" ]; then
case "${CUSTOM_TZ}" in
utc|UTC)
CUSTOM_TZ="Etc/UTC"
;;
esac
[ -f "/usr/share/zoneinfo/${CUSTOM_TZ}" ] && TZ="${CUSTOM_TZ}"
fi

###
# allow KEYTABLE to update above XKBLAYOUT settings
###
if [ -n "${KEYTABLE}" ]; then

XKBLAYOUT="${KEYTABLE}"
fi

###
# allow KBOPTIONS to update above XKBOPTIONS settings
###
if [ -n "${KBOPTIONS}" ]; then
XKBOPTIONS="${KBOPTIONS}"
fi

###
# allow KBMODEL to update above XKBMODEL settings
###
if [ -n "${KBMODEL}" ]; then
XKBMODEL="${KBMODEL}"
fi

###
# allow KBVARIANT to update above XKBVARIANT settings
###
if [ -n "${KBVARIANT}" ]; then
XKBVARIANT="${KBVARIANT}"
fi

set_timezone()
{
###
# configure timezone, fallback to UTC
###
[ -f "/usr/share/zoneinfo/${TZ}" ] || TZ="Etc/UTC"
log_daemon_msg "${NAME}"; log_action_begin_msg " configuring timezone data for '${TZ}'"
echo "${TZ}" > /etc/timezone
rm -f /etc/localtime && cp -f "/usr/share/zoneinfo/${TZ}" /etc/localtime
log_end_msg "${?}"

###
# hack rcS, make localtime default, unless tz=Etc/UTC or utc=yes
###
if [ "${TZ}" = "Etc/UTC" ] || [ "${UTC}" = "yes" ]; then
printf "0.000000 0 0.000000\n0\nUTC\n" > /etc/adjtime
else
# debian defaults to UTC=yes, which is rumored to be dual-boot unfriendly
printf "0.000000 0 0.000000\n0\nLOCAL\n" > /etc/adjtime

# update the system clock a'la /lib/udev/rules.d/85-hwclock.rules
/sbin/hwclock --rtc=dev/rtc0 --systz --localtime
fi
}

set_locale()
{
###
# select default locale and configure console-data via debconf
###
log_daemon_msg "${NAME}"; log_action_begin_msg " configuring locales for '${LANG}'"
echo "locales locales/default_environment_locale select ${LANG}" | \
debconf-set-selections
update-locale "LANG=${LANG}"
log_end_msg "${?}"
# mod for lxde
if [ -f /usr/bin/setlxdekblanguages ]; then
echo "lxdekb-lang-set ${LANG}"
setlxdekblanguages
fi
# mod for rqt and lxqt
if [ -f /usr/bin/setqxkblanguages ]; then
echo "qxkb-lang-set: ${LANG}"
setqxkblanguages
find /home -name qxkb.cfg -exec cp /etc/skel/.config/qxkb.cfg {} \;
fi
}

set_console()
{
# write configuration: console-setup
cat > /etc/default/console-setup <<EOF
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="${CHARMAP}"
CODESET="${CODESET}"
FONTFACE="${FONTFACE}"
FONTSIZE="${FONTSIZE}"
EOF

# write configuration: keyboard-configuration
# only set one layout
# FIXME: investigate debconfsettings!
sed -i -e "s/^\(XKBMODEL\=\).*/\1\"${XKBMODEL}\"/" \
-e "s/^\(XKBLAYOUT\=\).*/\1\"${XKBLAYOUT%%,*}\"/" \
-e "s/^\(XKBVARIANT\=\).*/\1\"${XKBVARIANT}\"/" \
-e "s/^\(XKBOPTIONS\=\).*/\1\"${XKBOPTIONS}\"/" \
/etc/default/keyboard

setupcon -v
udevadm trigger --property-match=ID_INPUT_KEYBOARD=1
}

apt_install_lang() {
###
# install debs for lang from deb archive on cd
###
if [ -n "$NOAPTLANG" ]; then
return
fi

LIVEAPT="$(fll_get_mnt)/i18n"
if [ ! -d "${LIVEAPT}" ]; then
return
fi

APTARCH=$(dpkg --print-architecture)
# e.g. try /fll/sr0/i18n/i386/de_AT then the first de_* found
if [ -f "${LIVEAPT}/${APTARCH}/${LANG%%[.]*}" ]; then
# we have the variant requested
LANGPACKS=$(cat "${LIVEAPT}/${APTARCH}/${LANG%%[.]*}")
elif [ "${LANG%%[_]*}" != 'en' ]; then
# try fll-locales to find one
for lf in ${LIVEAPT}/${APTARCH}/${LANG%[_]*}*; do
if [ -f "${lf}" ]; then
# we have a file for the language
LANGPACKS=$(cat "${lf}")
break
fi
done
[ -z "${LANGPACKS}" ] && return
else
# it's english and we don't have the variant requested
return
fi

log_daemon_msg "${NAME}"
log_action_begin_msg " installing language packages for '${LANG}'"

# don't touch apt if it has been used
if [ "/var/lib/dpkg/status" -nt "$(fll_get_mnt)/${FLL_IMAGE_LOCATION}" ]; then
log_failure_msg " dpkg already updated"
return
fi

LIVEAPTSOURCES=$(mktemp -d -t liveapt.XXXXXX)
APTGETBASE="apt-get -o Dir::Etc=$LIVEAPTSOURCES"
echo 'deb file://'${LIVEAPT}' sid main' > ${LIVEAPTSOURCES}/sources.list
mkdir ${LIVEAPTSOURCES}/preferences.d
if ! ${APTGETBASE} update > /dev/null; then
log_failure_msg " apt-get update for i18n packages from cd failed"
apt_install_lang_clean
return
fi

APTGETBASE="${APTGETBASE} --allow-unauthenticated --assume-yes --no-remove"

# do a dry-run to calculate size of packages and that will be used
APTUSESRAW=$(LANG=C ${APTGETBASE} --print-uris install ${LANGPACKS} | \
awk '/^After\ this\ operation\,\ /{print $4}')
APTUSES=${APTUSESRAW%%[.]*MB}
APTUSES=$(echo $APTUSESRAW | sed 's|MB$||;')

# lets assume it is <MB and ok if it's not in MB
if [ "${APTUSES}" != "${APTUSESRAW}" ]; then
APTUSES=$(echo $APTUSES | sed 's|\.[0-9]*$||;')
# get a free memory figure
FREEMEM=$(LANG=C free -m | awk '/\-\/\+\ buffers/{print $4}')
# check free - used > minspace (256M)
MEMAFTER=$(( ${FREEMEM} - ${APTUSES} ))
if [ ${MEMAFTER} -lt 256 ]; then
log_warning_msg " minimum 256MB free ram needed for i18n packages"
log_warning_msg " you would only have ${MEMAFTER}MB free, not installing"
apt_install_lang_clean
return
fi
# check used/free > minratio
USESRATIO=$(( ${FREEMEM} / ${APTUSES} ))
if [ ${USESRATIO} -lt 5 ]; then
log_warning_msg " i18n packages would use (${APTUSES}MB) more then 20% of available memory (${FREEMEM}MB), not installing."
apt_install_lang_clean
return
fi
fi

# install the packages
${APTGETBASE} install ${LANGPACKS} > /dev/null
# clean up
apt_install_lang_clean
}

apt_install_lang_clean() {
echo '' > ${LIVEAPTSOURCES}/sources.list
apt-get -o Dir::Etc=$LIVEAPTSOURCES update > /dev/null
apt-get -o Dir::Etc=$LIVEAPTSOURCES clean > /dev/null
rm -rf ${LIVEAPTSOURCES}
log_end_msg "${?}"
}

cleanup_sources_list() {
# deploy load balancing for siduction mirrors
# atm we these usable mirrors:
# 1) ftp.spline.de
# 2) ftp.uni-stuttgart.de
# 3) packages.siduction.org
# REPOS:
# 1) base
# 2) experimental - not provided
# 3) extra
# 4) fixes - provided directly via packages.siduction.org
# 4) razorqt
# 5) release - delete in any poss. way
# 5) user - not provided
# 6) xfcenext

case "$(mawk 'BEGIN{print int(9 * rand())}')" in
0|1|2|3) # Free University Berlin/ spline (Student Project LInux NEtwork), Germany
FLL_MIRROR="http://ftp.spline.de/pub/siduction/"
;;
3|4|5) # Universtity Stuttgart
FLL_MIRROR="http://ftp.uni-stuttgart.de/siduction/"
;;
*) # siduction main mirror
FLL_MIRROR="http://packages.siduction.org/"
;;
esac

target="/etc/apt/sources.list.d/debian.list"
echo "# debian loadbalancer" > ${target}
echo "deb http://http.debian.net/debian/ unstable main" >> ${target}
echo "#deb-src http://http.debian.net/debian/ unstable main" >> ${target}

target="/etc/apt/sources.list.d/siduction.list"
echo "# official siduction-lists" > ${target}
repository="/etc/apt/sources.list.d/base.list"
rm -f ${repository}
echo "deb ${FLL_MIRROR}base unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}base unstable main" >> ${target}
echo "" >> ${target}

repository="/etc/apt/sources.list.d/extra.list"
if [ -f ${repository} ]; then
rm -f ${repository}
echo "deb ${FLL_MIRROR}extra unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}extra unstable main" >> ${target}
echo "" >> ${target}
fi

repository="/etc/apt/sources.list.d/fixes.list"
if [ -f ${repository} ]; then
rm -f ${repository}
echo "deb ${FLL_MIRROR}fixes unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}fixes unstable main" >> ${target}
echo "" >> ${target}
fi
repository="/etc/apt/sources.list.d/razorqt.list"
if [ -f ${repository} ]; then
rm -f ${repository}
echo "deb ${FLL_MIRROR}razorqt unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}razorqt unstable main" >> ${target}
fi


# misc lists
target="/etc/apt/sources.list.d/misc.list"
echo "# misc. siduction-lists" > ${target}
repository="/etc/apt/sources.list.d/experimental.list"
rm -f ${repository}
echo "#deb ${FLL_MIRROR}experimental unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}experimental unstable main" >> ${target}
echo "" >> ${target}

repository="/etc/apt/sources.list.d/user.list"
rm -f ${repository}
echo "#deb ${FLL_MIRROR}user unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}user unstable main" >> ${target}
echo "" >> ${target}

repository="/etc/apt/sources.list.d/kdenext.list"
if [ -f ${repository} ]; then
rm -f ${repository}
echo "deb ${FLL_MIRROR}kdenext unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}kdenext unstable main" >> ${target}
echo "" >> ${target}
fi
repository="/etc/apt/sources.list.d/xfcenext.list"
if [ -f ${repository} ]; then
rm -f ${repository}
echo "deb ${FLL_MIRROR}xfcenext unstable main" >> ${target}
echo "#deb-src ${FLL_MIRROR}xfcenext unstable main" >> ${target}
echo "" >> ${target}
fi

# delete release.list
repository="/etc/apt/sources.list.d/release.list"
if [ -f ${repository} ]; then
rm -f ${repository}
fi
}

save_locale_variables() {
for var in FLL_MIRROR CHARMAP CODESET FONTFACE FONTSIZE \
XKBMODEL XKBLAYOUT XKBVARIANT XKBOPTIONS; do
val=$(eval echo \$${var})
echo "${var}=\"${val}\""
done > "/etc/default/${NAME}"
}

set_accepted_lang()
{
###
# set the prefered language for websites in iceweasel
###
log_daemon_msg "${NAME}"; log_action_begin_msg " configuring locales for websites "
case "${LANG}" in
"de_DE.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"de, en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"en_GB.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"en_US.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"en-us, en\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"it_IT.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"it, en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"pl_PL.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"pl, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"pt_BR.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"pt-br, en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"pt_PT.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"pt-pt, en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;
"ro_RO.utf8")
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"ro, en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;

*)
if [ -e "/etc/iceweasel/profile" ]; then
echo "user_pref(\"intl.accept_languages\", \"en, en-us\");\n" > /etc/iceweasel/profile/prefs.js
fi
;;

esac
log_end_msg "${?}"
}

case "${1}" in
start)
set_timezone
set_locale
set_console
apt_install_lang
cleanup_sources_list
save_locale_variables
set_accepted_lang
;;
stop)
# no-op
;;
restart|reload|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
localize)
# no output
log_daemon_msg() { :; }
log_action_begin_msg() { :; }
log_end_msg() { :; }
# localize
set_locale
set_console
apt_install_lang
localize_sources_list
save_locale_variables
set_accepted_lang
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop|list|localize}" >&2
exit 3
;;
esac

:

+ 0
- 115
share/fll-live-initscripts/fll-nbdclient View File

@@ -1,115 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-nbdclient
# Required-Start: mountdevsubfs
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: fix nbd-client handling of nbdroot=dhcp
# Description: The purpose of fll-nbdclient is to ensure sendsigs
# does not stop the nbd root process when nbdroot=dhcp
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2007 - 2008 Kel Modderman <kel@otaku42.de>
# 2010 Niall Walsh <niallwalsh@users.berlios.de>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-nbdclient"

if [ ! -x /sbin/nbd-client ] || [ ! -e /fll/nbd* ]; then
exit 0
fi

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
exit 0
fi

###
# VERBOSE setting and other rcS variables
###
#. /lib/init/vars.sh

###
# source lsb functions
###
. /lib/lsb/init-functions

###
# source fll functions
###
. /lib/init/fll

###
# ensure this is clean variable
###
NBD_DHCP=""

###
# cheatcode handling
###
if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
toram)
# toram means it's not root any more
exit 0
;;
nbdroot=dhcp)
NBD_DHCP="yes"
;;
esac
done
fi

[ "${NBD_DHCP}" = "yes" ] || exit 0

case "${1}" in
start)
log_daemon_msg "${NAME}"
log_action_begin_msg " adding nbdroot=dhcp to sendsigs"
FLL_MOUNT=$(fll_get_mnt)
FLL_DEV=$(mount | awk '$3 == "'${FLL_MOUNT}'" { print $1 }')
FLL_DEV=${FLL_DEV#/dev/}
/sbin/nbd-client -c ${FLL_DEV%p*} >> /run/sendsigs.omit.d/fll-live-initscripts
log_end_msg "${?}"
;;
stop)
;;
restart|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop}" >&2
exit 3
;;
esac

:

+ 0
- 319
share/fll-live-initscripts/fll-reboot View File

@@ -1,319 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-reboot
# Required-Start:
# Required-Stop: umountroot
# X-Stop-After: umountfs lvm2
# X-Interactive: true
# Default-Start:
# Default-Stop: 0 6
# Short-Description: shutdown and eject live media
# Description: This script provides the equivalent of umountfs,
# umountroot, reboot and halt on a standard debian system.
# It umounts live mounts and ejects the live media at
# shutdown/reboot.
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2007-2008, Kel Modderman <kel@otaku42.de>
# Copyright: (C) 2008-2014, Stefan Lippers-Hollmann <s.l-h@gmx.de>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-reboot"

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
exit 0
fi

###
# VERBOSE setting and other rcS variables
###
. /lib/init/vars.sh

###
# source lsb functions
###
. /lib/lsb/init-functions

###
# don't prompt for ejecting in a virtual machine, unless overriden
###
if [ -r /sys/devices/virtual/dmi/id/bios_vendor ]; then
case "$(head -n1 /sys/devices/virtual/dmi/id/bios_vendor)" in
"Bochs")
# qemu/ kvm
NOPROMPT="1"
;;
"innotek GmbH")
# VirtualBox
NOPROMPT="1"
;;
esac
fi

if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
noeject|toram)
NOEJECT="1"
;;
doprompt)
unset NOPROMPT
;;
noprompt)
NOPROMPT="1"
;;
esac
done
fi

###############################################################################
# Adapted from initscripts: /etc/init.d/umountfs (2.86.ds1-62)
###############################################################################
do_umount() {
exec 9<&0 < /proc/mounts

REG_MTPTS=""
TMPFS_MTPTS=""
while read -r DEV MTPT FSTYPE OPTS REST
do
case "$MTPT" in
#
# live hack
#
/fll/*)
case "$FSTYPE" in
iso9660)
[ "$MTPT" = /fll/fromiso ] && LIVE_MTPTS="$MTPT $LIVE_MTPTS"
;;
*)
LIVE_MTPTS="$MTPT $LIVE_MTPTS"
;;
esac
continue
;;
esac
case "$FSTYPE" in
aufs|unionfs)
UNION_MTPTS="$MTPT $UNION_MTPTS"
;;
squashfs)
SQUSH_MTPTS="$MTPT $SQUSH_MTPTS"
;;
esac
done

exec 0<&9 9<&-
#
# live hack: any command after this point must be prefixed with ${BINDIR}
#
UMOUNT_V=""
if [ "$VERBOSE" != no ] ; then
UMOUNT_V="-v"
fi
if [ "$UNION_MTPTS" ]
then
echo "Unmounting union filesystems."
for MTPT in $UNION_MTPTS ; do
case "$MTPT" in
/)
# umount / and it's game-over
mount -o remount,ro $MTPT
[ "$?" -eq 0 ] || echo "\"mount -o remount,ro $MTPT\" returned $?"
;;
*)
umount -l -n -f -d $UMOUNT_V $UNION_MTPTS
[ "$?" -eq 0 ] || echo "\"umount -l -n -f -d $UMOUNT_V $UNION_MTPTS\" returned $?"
;;
esac
done
fi

if [ "$SQSH_MTPTS" ]
then
echo "Unmounting squashfs filesystems."
umount -l -n -f -d $UMOUNT_V $SQSH_MTPTS
[ "$?" -eq 0 ] || echo "\"umount -l -n -f -d $UMOUNT_V $SQSH_MTPTS\" returned $?"
fi

if [ "$LIVE_MTPTS" ]
then
echo "Unmounting live filesystems."
umount -l -n -f -d $UMOUNT_V $LIVE_MTPTS
[ "$?" -eq 0 ] || echo "\"umount -l -n -f -d $UMOUNT_V $LIVE_MTPTS\" returned $?"
fi
}
###############################################################################
# Adapted from initramfs-tools hook-functions (0.87b)
###############################################################################
# $1 is source
# $2 is relative destination
copy_exec() {
verbose="${VERBOSE}"
final_destination=${DESTDIR}/${2}/$(basename ${1})
if [ -L "$final_destination" ]; then
if ! [ `readlink ${final_destination}` = "${1}" ]; then
return
fi
else
cp ${1} ${DESTDIR}/${2}
if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then
echo "Adding binary ${1}"
fi
fi

# Copy the dependant libraries
for x in $(ldd ${1} 2>/dev/null | sed -e '
/\//!d;
/linux-gate/d;
/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do

# Try to use non-optimised libraries where possible.
# We assume that all HWCAP libraries will be in tls.
nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#')

if [ -e ${nonoptlib} ]; then
x=${nonoptlib}
fi

libname=$(basename ${x})
dirname=$(dirname ${x})

mkdir -p ${DESTDIR}/${dirname}
if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then
cp ${x} ${DESTDIR}/${dirname}
if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then
echo "Adding library ${x}"
fi
fi
done
}
###############################################################################
# End adapted functions
###############################################################################

do_stop() {
# calculate runlevel
runlevel_pair="$(runlevel)"
runlevel="${runlevel_pair#* }"

# set sane defaults for /dev/console
stty sane < /dev/console

# prepare binaries for post-umount of live media
DESTDIR="$(mktemp -d -p / fll.XXXXX)"
mkdir -p ${DESTDIR}/bin
# cache utilities required for the final stages of shutdown
for path in $(which echo) $(which umount) $(which halt) \
$(which reboot) $(which eject); do
copy_exec "${path}" /bin
done
LD_LIBRARY_PATH="${DESTDIR}/lib"
if [ -e "${DESTDIR}/lib64" ]; then
LD_LIBRARY_PATH="${DESTDIR}/lib64:${LD_LIBRARY_PATH}"
fi
for path in $(awk '/^\/lib/ {print $1}' /etc/ld.so.conf.d/*) ; do
if [ -e "${DESTDIR}${path}" ] ; then
LD_LIBRARY_PATH="${DESTDIR}${path}:${LD_LIBRARY_PATH}"
fi
done
export LD_LIBRARY_PATH

LD_LINUX="${DESTDIR}/lib/ld-linux.so.2"
if [ -e "${DESTDIR}/lib64/ld-linux-x86-64.so.2" ]; then
LD_LINUX="${DESTDIR}/lib64/ld-linux-x86-64.so.2"
elif [ ! -e $LD_LINUX ]; then
LD_LINUX="${DESTDIR}/lib/ld.so.1"
if [ -e "${DESTDIR}/lib64/ld64.so.1" ]; then
LD_LINUX="${DESTDIR}/lib64/ld64.so.1"
fi
fi
export LD_LINUX

echo() { ${LD_LINUX} ${DESTDIR}/bin/echo "$@"; }
umount() { ${LD_LINUX} ${DESTDIR}/bin/umount "$@"; }
eject() { ${LD_LINUX} ${DESTDIR}/bin/eject "$@"; }

# umount the live media and other mount points
do_umount

case "${runlevel}" in
0)
echo "System halted." > /dev/console
command="${LD_LINUX} ${DESTDIR}/bin/halt"
options="-h -n -p -i -f"
;;
6)
echo "Preparing for reboot..." > /dev/console
command="${LD_LINUX} ${DESTDIR}/bin/reboot"
options="-n -i -f"
;;
*)
echo "${NAME}: attempted execution in invalid runlevel!"
exit 1
;;
esac

if [ -b /dev/fll-cdrom ] && [ -z "${NOEJECT}" ]; then
# disable kernel messages while ejecting cdrom (libata noise)
echo "0" > /proc/sys/kernel/printk

eject -m -p /dev/fll-cdrom

if [ -z "${NOPROMPT}" ]; then
echo "" > /dev/console
echo "Please remove CD, close cdrom drive then press enter." > /dev/console
echo "" > /dev/console
read x < /dev/console
fi
fi

# shutdown/reboot
exec ${command} ${options} > /dev/console 2>&1 < /dev/console
}

case "${1}" in
start)
log_daemon_msg "${NAME}"
# no-op
log_end_msg "${?}"
;;
restart|reload|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
stop)
# live-hack, umount and eject
do_stop
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop}" >&2
exit 3
;;
esac

+ 0
- 107
share/fll-live-initscripts/fll-shell View File

@@ -1,107 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-shell
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: configure shell
# Description: Populate /root/.bash* for a more comfortable root shell
# login. Preset some shell application settings.
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2007 - 2008 Kel Modderman <kel@otaku42.de>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-shell"

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
exit 0
fi

###
# VERBOSE setting and other rcS variables
###
#. /lib/init/vars.sh

###
# source lsb functions

###
. /lib/lsb/init-functions

###
# source fll functions
###
. /lib/init/fll

###
# cheatcode handling
###
if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
esac
done
fi

do_start() {
for file in '.bash_logout' '.bash_profile' '.bashrc' '.profile'; do
if [ -f /etc/skel/${file} ] && [ ! -f /root/${file} ]; then
cp /etc/skel/${file} /root/${file}
fi
done

:> /root/.hushlogin

if [ -w /etc/pam.d/login ]; then
sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /etc/pam.d/login
fi
}

case "${1}" in
start)
log_daemon_msg "${NAME}"
do_start
log_end_msg "${?}"
;;
stop)
;;
restart|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
exit 3
;;
esac

:

+ 0
- 99
share/fll-live-initscripts/fll-snakeoil-cert View File

@@ -1,99 +0,0 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: fll-snakeoil-cert
# Required-Start: mountdevsubfs
# Required-Stop:
# Should-Start: $network
# Should-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: generate unique SSL snakeoil certs
# Description: The purpose of fll-ssl-cert-snakeoil is to ensure unique
# (snakeoil) SSL certificates.
### END INIT INFO

###
# F.U.L.L.S.T.O.R.Y init script
#
# Copyright: (C) 2014, Stefan Lippers-Hollmann <s.l-h@gmx.de>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
###

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="fll-ssl-cert-snakeoil"

if [ ! -x /usr/sbin/make-ssl-cert ]; then
exit 0
fi

###
# source distro-defaults, no-op unless in live mode
###
FLL_DISTRO_MODE="installed"

if [ -r /etc/default/distro ]; then
. /etc/default/distro
fi

if [ "${FLL_DISTRO_MODE}" != "live" ]; then
exit 0
fi

###
# VERBOSE setting and other rcS variables
###
#. /lib/init/vars.sh

###
# source lsb functions
###
. /lib/lsb/init-functions

###
# source fll functions
###
. /lib/init/fll

###
# cheatcode handling
###
if [ -f /proc/cmdline ]; then
for param in $(cat /proc/cmdline); do
case "${param}" in
flldebug=*)
if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
fll_redirect
fi
;;
esac
done
fi

case "${1}" in
start)
log_daemon_msg "${NAME}"
log_action_begin_msg " generate unique SSL snakeoil certs"
make-ssl-cert generate-default-snakeoil --force-overwrite
log_end_msg "${?}"
;;
stop)
;;
restart|force-reload)
echo "Error: argument '${1}' not supported" >&2
exit 3
;;
status)
log_success_msg "${0} is no dæmon."
exit 0
;;
*)
echo "Usage: ${NAME} {start|stop}" >&2
exit 3
;;
esac

:

+ 0
- 10
system/fll-fstab.service View File

@@ -1,10 +0,0 @@
[Unit]
Description=Siduction systemd services for fll-live-initscripts
ConditionPathExists=/usr/share/fll-live-initscripts/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-fstab start

[Install]
WantedBy=basic.target

+ 0
- 11
system/fll-live-reboot.service View File

@@ -1,11 +0,0 @@
[Unit]
Description=Siduction live media reboot
ConditionPathExists=/usr/share/fll-live-initscripts/
DefaultDependencies=no
Requires=shutdown.target umount.target final.target
After=shutdown.target umount.target final.target

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-reboot start
ExecStop=/usr/share/fll-live-initscripts/fll-reboot stop

+ 0
- 11
system/fll-live-xorgconfig.service View File

@@ -1,11 +0,0 @@
[Unit]
Description=Generate xorg.conf when siduction cheatcodes for X are detected
Before=display-manager.service
ConditionPathExists=/usr/share/fll-live-xorgconfig/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-xorgconfig/fll-xorgconfig start

[Install]
WantedBy=graphical.target

+ 0
- 11
system/fll-locales.service View File

@@ -1,11 +0,0 @@
[Unit]
Description=Siduction systemd services for fll-live-initscripts
Before=getty.service
ConditionPathExists=/usr/share/fll-live-initscripts/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-locales start

[Install]
WantedBy=getty.target

+ 0
- 10
system/fll-ndbdclient.service View File

@@ -1,10 +0,0 @@
[Unit]
Description=Siduction systemd services for fll-live-initscripts
ConditionPathExists=/usr/share/fll-live-initscripts/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-nbdclient start

[Install]
WantedBy=basic.target

+ 0
- 10
system/fll-shell.service View File

@@ -1,10 +0,0 @@
[Unit]
Description=Siduction systemd services for fll-live-initscripts
ConditionPathExists=/usr/share/fll-live-initscripts/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-shell start

[Install]
WantedBy=basic.target

+ 0
- 10
system/fll-snakeoil-cert.service View File

@@ -1,10 +0,0 @@
[Unit]
Description=Siduction systemd services for fll-live-initscripts
ConditionPathExists=/usr/share/fll-live-initscripts/

[Service]
Type=oneshot
ExecStart=/usr/share/fll-live-initscripts/fll-snakeoil-cert start

[Install]
WantedBy=basic.target

Loading…
Cancel
Save