Commit 14776de3 authored by amnesia's avatar amnesia

Migrate to live-boot / live-config instead of live-initramfs.

Tons of involved changes.

The $HOME files have been moved to /etc/skel in order to get rid of permissions
problems: we now let adduser deal with this.

New custom packages:
 - live-boot 2.0~a16-1+tails1.cb5e34 built from our Git repository. It
   integrates the changes our custom live-initramfs had.
 - live-config patched with xserver-xorg related fixes sent today on the Debian
   Live ML; hopefully this is only temporary...
parent f85fe5b1
......@@ -19,13 +19,11 @@ $RUN_LH_CONFIG \
--isohybrid-options "$AMNESIA_ISOHYBRID_OPTS" \
--bootappend-live "${AMNESIA_APPEND}" \
--archive-areas "main contrib non-free" \
--hostname="amnesia" \
--iso-application="The Amnesic Incognito Live System" \
--iso-publisher="https://amnesia.boum.org/" \
--iso-volume="TAILS ${AMNESIA_FULL_VERSION}" \
--memtest none \
--packages-lists="standard" \
--username="amnesia" \
--syslinux-menu vesamenu \
--syslinux-timeout 4 \
${@}
......
......@@ -63,39 +63,39 @@ for LANG_CODE in ${AMNESIA_SUPPORTED_LANGUAGES}; do
case "${LANG_CODE}" in
ar)
LANG_NAME='^Arabic'
LANG_APPEND='locale=ar_EG.UTF-8 timezone=Africa/Cairo'
LANG_APPEND='locales=ar_EG.UTF-8 timezone=Africa/Cairo'
;;
de)
LANG_NAME='^German'
LANG_APPEND='locale=de_DE.UTF-8 klayout=de timezone=Europe/Berlin'
LANG_APPEND='locales=de_DE.UTF-8 keyboard-layouts=de timezone=Europe/Berlin'
;;
en)
LANG_NAME='^English'
LANG_APPEND='locale=en_US.UTF-8 klayout=us timezone=America/Detroit'
LANG_APPEND='locales=en_US.UTF-8 keyboard-layouts=us timezone=America/Detroit'
;;
es)
LANG_NAME='^Spanish'
LANG_APPEND='locale=es klayout=es timezone=Europe/Madrid'
LANG_APPEND='locales=es keyboard-layouts=es timezone=Europe/Madrid'
;;
fr)
LANG_NAME='^French'
LANG_APPEND='locale=fr_FR.UTF-8 klayout=fr timezone=Europe/Paris'
LANG_APPEND='locales=fr_FR.UTF-8 keyboard-layouts=fr timezone=Europe/Paris'
;;
it)
LANG_NAME='^Italian'
LANG_APPEND='locale=it timezone=Europe/Rome'
LANG_APPEND='locales=it timezone=Europe/Rome'
;;
pt)
LANG_NAME='^Portuguese'
LANG_APPEND='locale=pt timezone=Europe/Lisbon'
LANG_APPEND='locales=pt timezone=Europe/Lisbon'
;;
ru)
LANG_NAME='^Russian'
LANG_APPEND='locale=ru timezone=Europe/Moscow'
LANG_APPEND='locales=ru timezone=Europe/Moscow'
;;
zh)
LANG_NAME='^Chinese'
LANG_APPEND='locale=zh_CN.UTF-8 klayout=zh timezone=Asia/Shangai'
LANG_APPEND='locales=zh_CN.UTF-8 keyboard-layouts=zh timezone=Asia/Shangai'
;;
*)
Echo_error "Language ${LANG_CODE} is not supported yet, ask amnesia developpers!"
......
......@@ -94,6 +94,18 @@ Package: live-build
Pin: release a=testing
Pin-Priority: 999
Package: live-config
Pin: release a=testing
Pin-Priority: 999
Package: live-config-sysvinit
Pin: release a=testing
Pin-Priority: 999
Package: live-initramfs
Pin: release a=testing
Pin-Priority: 999
Package: monkeysphere
Pin: release a=lenny-backports
Pin-Priority: 999
......
......@@ -7,5 +7,5 @@ echo "root:amnesia" | chpasswd
# Change the autogenerated user password to "amnesia"
plain_password="amnesia"
password=$(echo "${plain_password}" | mkpasswd -s)
sed -i -e 's/\(user_crypted=\)\(.*\)\( #.*\)/\1\"'${password}'\"\3/' /usr/share/initramfs-tools/scripts/live-bottom/10adduser
sed -i -e 's/\(_PASSWORD=\)\(.*\)/\1\"'${password}'\"/' /lib/live/config/002-user-setup
update-initramfs -tu -kall
#!/bin/sh
if [ ! -d /etc/X11 ]; then
mkdir /etc/X11
chmod 755 /etc/X11
fi
ln -s --force /usr/bin/Xorg /etc/X11/X
#!/bin/sh
chown -R 1000:1000 /home/amnesia
chmod go+rX /etc/apt/apt.conf /etc/apt/preferences /etc/apt/sources.list /etc/apt/sources.list.d/*
chmod go+rX /lib /lib/live /lib/live/config
......@@ -81,11 +81,6 @@
<pref name='show_notice' type='bool' value='1'/>
<pref name='activate_online' type='bool' value='1'/>
</pref>
<pref name='core-plugin_pack-autoaccept'>
<pref name='path' type='string' value='/home/amnesia/.purple/autoaccept'/>
<pref name='reject_stranger' type='bool' value='1'/>
<pref name='notify' type='bool' value='1'/>
</pref>
<pref name='core-plugin_pack-offlinemsg'>
<pref name='always' type='bool' value='0'/>
</pref>
......
#!/bin/sh
Boot_profile ()
{
# Only start profiler when "profile" appears on kernel command line
grep -qw "profile" /proc/cmdline || return 0
echo -n " boot-profile"
Start_boot_profile
}
Start_boot_profile ()
{
# Schedule stop script
cat <<EOF >"/home/${LIVE_USERNAME}/.config/autostart/end-profile.desktop"
[Desktop Entry]
Version=1.0
Name=EndProfile
GenericName=EndProfile
Exec=/usr/local/bin/end-profile
Terminal=false
Type=Application
EOF
echo 32768 >/proc/sys/fs/inotify/max_user_watches
/usr/local/sbin/boot-profile /var/log/boot-profile
# Put readahead list at the very begining
head -n 1 /usr/share/amnesia/readahead-list >/dev/null || true
# Creating state file
touch /var/lib/live/config/boot-profile
}
Boot_profile
#!/bin/sh
READAHEAD_LIST="/usr/share/amnesia/readahead-list"
BACKGROUND_AT="^usr/bin/Xorg$"
Readahead ()
{
# Do not readahead when "profile" appears on kernel command line
grep -qw "profile" /proc/cmdline && return 0
test -e "$READAHEAD_LIST" || return
echo " readahead"
Start_readahead
}
Start_readahead ()
{
FG_FILES="$(sed -n "\:$BACKGROUND_AT:q;p" "$READAHEAD_LIST")"
BG_FILES="$(sed -n "\:$BACKGROUND_AT:,\$p" "$READAHEAD_LIST")"
FG_SIZE=$(
cd /
echo "$FG_FILES" |
xargs du -c 2>/dev/null |
awk '$2 ~ /^total$/ { t = t + $1 } END { print t }')
(cd /
echo "$BG_FILES" |
xargs stat >/dev/null 2>/dev/null)
(cd /
echo "$FG_FILES" |
xargs cat 2>/dev/null |
pv -f -s ${FG_SIZE}k >/dev/null)
(cd /
echo "$BG_FILES" | xargs cat >/dev/null 2>&1) &
# Creating state file
touch /var/lib/live/config/readahead
}
Readahead
#!/bin/sh
Configure_resolv_conf ()
{
echo -n " resolv-conf"
rm -f /etc/resolv.conf
ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
# Creating state file
touch /var/lib/live/config/resolv-conf
}
Configure_resolv_conf
#!/bin/sh
Import_GnuPG_key ()
{
echo -n "import-gnupg-key"
sudo -H -u "${LIVE_USERNAME}" gpg --batch --import /usr/share/doc/amnesia/amnesia.asc
# Creating state file
touch /var/lib/live/config/import-gnupg-key
}
Import_GnuPG_key
#!/bin/sh
# List of at least 2000 possible nicknames
NICKS_LIST=/usr/share/amnesia/firstnames.txt
Configure_pidgin ()
{
echo -n " pidgin"
# 1 =< $NICK_NUMBER <= 2000
NICK_NUMBER="`/bin/bash -c 'echo $((${RANDOM} * 2000 / 32768 + 1))'`"
# 1 =< $NICK_SUFFIX <= 100
NICK_SUFFIX="`/bin/bash -c 'echo $((${RANDOM} * 100 / 32768 + 1))'`"
# Random nick picked from $NICKS_LIST, with $NICK_SUFFIX appended
NICK="`head -n ${NICK_NUMBER} ${NICKS_LIST} | tail -n 1 | tr '[:upper:]' '[:lower:]'`${NICK_SUFFIX}"
for file in accounts.xml blist.xml ; do
sudo -H -u "${LIVE_USERNAME}" sed -i'' "s,XXX_NICK_XXX,${NICK}," "/home/${LIVE_USERNAME}/.purple/${file}"
done
# Creating state file
touch /var/lib/live/config/pidgin
}
Configure_pidgin
#!/bin/sh
Localize ()
{
echo -n " localize"
# $LANG was set there by the FIXME live-config upstream script
. /etc/default/locale
LANGUAGE="`echo ${LANG} | head -c 2`"
### Nautilus wipe script
if [ ! -d "/home/${LIVE_USERNAME}/.gnome2/nautilus-scripts/" ] ; then
mkdir -p "/home/${LIVE_USERNAME}/.gnome2/nautilus-scripts/"
fi
case "${LANGUAGE}" in
es)
NAME="Eliminar_de_forma_segura"
;;
fr)
NAME="Effacer_definitivement"
;;
*)
NAME="Securely_erase"
;;
esac
if [ -x "/usr/local/bin/nautilus-wipe.${LANGUAGE}" ]; then
TARGET="/usr/local/bin/nautilus-wipe.${LANGUAGE}"
else
TARGET="/usr/local/bin/nautilus-wipe"
fi
ln -s "${TARGET}" "/home/${LIVE_USERNAME}/.gnome2/nautilus-scripts/${NAME}"
### Scroogle
if [ -r "/usr/share/amnesia/iceweasel/searchplugins/scroogle-ssl-${LANGUAGE}.xml" ]; then
cp "/usr/share/amnesia/iceweasel/searchplugins/scroogle-ssl-${LANGUAGE}.xml" \
/usr/share/iceweasel/searchplugins/
fi
# Creating state file
touch /var/lib/live/config/localize
}
Localize
#!/bin/sh
Fix_permissions ()
{
echo -n " permissions"
chown -R "${LIVE_USERNAME}":"${LIVE_USERNAME}" "/home/${LIVE_USERNAME}"
# Creating state file
touch /var/lib/live/config/permissions
}
Fix_permissions
......@@ -20,7 +20,7 @@ fi
### init variables
DEST_DIR="config/chroot_local-includes/home/amnesia"
DEST_DIR="config/chroot_local-includes/etc/skel"
if [ -z "$1" ]; then
SOURCE_DIR="${AMNESIA_REFRESH_HOME_SOURCE}"
else
......
#!/bin/sh
PREREQ=""
prereqs() {
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
if [ -n "${NOUSER}" ]; then
exit 0
fi
# Only start profiler when "profile" appears on kernel command line
grep -qw "profile" /proc/cmdline || exit 0
. /scripts/live-functions
log_begin_msg "Starting boot profiler"
# Schedule stop script
cat <<EOF >/root/home/${USERNAME}/.config/autostart/end-profile.desktop
[Desktop Entry]
Version=1.0
Name=EndProfile
GenericName=EndProfile
Exec=/usr/local/bin/end-profile
Terminal=false
Type=Application
EOF
echo 32768 >/proc/sys/fs/inotify/max_user_watches
chroot /root /usr/local/sbin/boot-profile /var/log/boot-profile
# Put readahead list at the very begining
head -n 1 /root/usr/share/amnesia/readahead-list >/dev/null || true
log_end_msg
#!/bin/sh
PREREQ=""
prereqs() {
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
# Do not readahead when "profile" appears on kernel command line
grep -qw "profile" /proc/cmdline && exit 0
READAHEAD_LIST="/root/usr/share/amnesia/readahead-list"
BACKGROUND_AT="^usr/bin/Xorg$"
test -e "$READAHEAD_LIST" || exit 0
. /scripts/live-functions
log_begin_msg "Starting reading ahead boot files"
FG_FILES="$(sed -n "\:$BACKGROUND_AT:q;p" "$READAHEAD_LIST")"
BG_FILES="$(sed -n "\:$BACKGROUND_AT:,\$p" "$READAHEAD_LIST")"
FG_SIZE=$(
cd /root
echo "$FG_FILES" |
xargs du -c 2>/dev/null |
awk '$2 ~ /^total$/ { t = t + $1 } END { print t }')
(cd /root
echo "$BG_FILES" |
xargs stat >/dev/null 2>/dev/null)
(cd /root
echo "$FG_FILES" |
xargs cat 2>/dev/null |
pv -f -s ${FG_SIZE}k >/dev/null)
(cd /root
echo "$BG_FILES" | xargs cat >/dev/null 2>&1) &
log_end_msg
#!/bin/sh
#set -e
# initramfs-tools header
PREREQ=""
prereqs()
{
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
# live-initramfs header
. /scripts/live-functions
log_begin_msg "Configuring /etc/resolv.conf"
# live-initramfs script
chroot /root rm -f /etc/resolv.conf
chroot /root ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
log_end_msg
#!/bin/sh
#set -e
# initramfs-tools header
PREREQ=""
prereqs()
{
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
# live-initramfs header
if [ -n "${NOUSER}" ]
then
exit 0
fi
. /scripts/live-functions
log_begin_msg "Importing amnesia's GnuPG key into the live session user's keyring"
# live-initramfs script
chroot /root sudo -H -u "${USERNAME}" gpg --batch --import /usr/share/doc/amnesia/amnesia.asc
log_end_msg
#!/bin/sh
#set -e
# initramfs-tools header
PREREQ=""
prereqs()
{
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
# live-initramfs header
if [ -n "${NOUSER}" ]
then
exit 0
fi
. /scripts/live-functions
log_begin_msg "Randomizing Pidgin IRC nickname"
# live-initramfs script
# List of at least 2000 possible nicknames
NICKS_LIST=/root/usr/share/amnesia/firstnames.txt
# 1 =< $NICK_NUMBER <= 2000
NICK_NUMBER="`chroot /root /bin/bash -c 'echo $((${RANDOM} * 2000 / 32768 + 1))'`"
# 1 =< $NICK_SUFFIX <= 100
NICK_SUFFIX="`chroot /root /bin/bash -c 'echo $((${RANDOM} * 100 / 32768 + 1))'`"
# Random nick picked from $NICKS_LIST, with $NICK_SUFFIX appended
NICK="`head -n ${NICK_NUMBER} ${NICKS_LIST} | tail -n 1 | chroot /root tr '[:upper:]' '[:lower:]'`${NICK_SUFFIX}"
for file in accounts.xml blist.xml ; do
chroot /root sudo -H -u "${USERNAME}" sed -i'' "s,XXX_NICK_XXX,${NICK}," "/home/${USERNAME}/.purple/${file}"
done