summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:37 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:25:54 +0100
commit3d52fbcb4fe70132ade14759d76573b471294800 (patch)
tree7ee8e69a62e032cb427e6b3ae96481ae4e8c9df8
parent9fc9e2a1a11b0edada38cb501fefe4f58aa414ac (diff)
downloadlive-boot-3d52fbcb4fe70132ade14759d76573b471294800.tar.gz
live-boot-3d52fbcb4fe70132ade14759d76573b471294800.zip
Adding live-initramfs 1.87.3-1.
-rw-r--r--Makefile131
-rw-r--r--bin/live-md5check/live-md5check.c34
-rw-r--r--bin/live-md5check/md5.h2
-rwxr-xr-xbin/live-snapshot16
-rw-r--r--conf/live.conf8
-rw-r--r--debian/changelog6
-rw-r--r--debian/control18
-rw-r--r--debian/dirs4
-rw-r--r--debian/examples1
-rw-r--r--debian/init57
-rw-r--r--debian/install7
-rw-r--r--debian/links2
-rw-r--r--debian/manpages1
-rwxr-xr-xdebian/rules32
-rw-r--r--doc/ChangeLog56
-rw-r--r--docs/AUTHORS12
-rw-r--r--docs/CREDITS17
-rw-r--r--docs/ChangeLog162
-rw-r--r--docs/ChangeLog.casper (renamed from doc/ChangeLog.casper)73
-rwxr-xr-xhooks/live133
-rw-r--r--manpages/live-initramfs.784
-rw-r--r--manpages/live-initramfs.en.795
-rw-r--r--manpages/live-snapshot.170
-rw-r--r--manpages/live-snapshot.en.171
-rwxr-xr-xscripts/live203
-rwxr-xr-xscripts/live-bottom/01integrity_check2
-rwxr-xr-xscripts/live-bottom/02etc_live_conf39
-rwxr-xr-xscripts/live-bottom/05mountpoints6
-rwxr-xr-xscripts/live-bottom/10adduser60
-rwxr-xr-xscripts/live-bottom/13swap7
-rwxr-xr-xscripts/live-bottom/14locales47
-rwxr-xr-xscripts/live-bottom/15autologin5
-rwxr-xr-xscripts/live-bottom/18hostname4
-rwxr-xr-xscripts/live-bottom/19keyboard37
-rwxr-xr-xscripts/live-bottom/20xconfig35
-rwxr-xr-xscripts/live-bottom/21xvidemode41
-rwxr-xr-xscripts/live-bottom/23networking18
-rwxr-xr-xscripts/live-bottom/24preseed33
-rwxr-xr-xscripts/live-bottom/25configure_init44
-rwxr-xr-xscripts/live-bottom/30accessibility10
-rwxr-xr-xscripts/live-bottom/40install_driver_updates2
-rw-r--r--scripts/live-functions14
-rw-r--r--scripts/live-helpers42
43 files changed, 1229 insertions, 512 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9bf8496
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,131 @@
+# Makefile
+
+CFLAGS = -Wall -g -O2
+BUILD_SYSTEM := $(shell lsb_release --short --id)
+
+TRANSLATIONS=""
+
+all: build
+
+test:
+ set -e; for SCRIPT in hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/*; \
+ do \
+ sh -n $$SCRIPT || exit 1; \
+ done
+
+build:
+ # Setting BUILD_SYSTEM
+ sed -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' conf/live.conf > live.conf
+
+ # Building live-md5check
+ CFLAGS="$(CFLAGS)" $(MAKE) -C bin/live-md5check
+
+install: test build
+ # Installing configuration
+ install -D -m 0644 live.conf $(DESTDIR)/etc/live.conf
+
+ # Installing live-md5check
+ install -D -m 0755 bin/live-md5check/live-md5check $(DESTDIR)/usr/lib/live-initramfs/live-md5check
+
+ # Installing executables
+ mkdir -p $(DESTDIR)/sbin
+ cp bin/live-getty bin/live-login bin/live-snapshot $(DESTDIR)/sbin
+
+ mkdir -p $(DESTDIR)/usr/share/live-initramfs
+ cp bin/live-preseed bin/live-reconfigure $(DESTDIR)/usr/share/live-initramfs
+
+ mkdir -p $(DESTDIR)/usr/share/initramfs-tools
+ cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
+
+ # Installing documentation
+ mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs
+ cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-initramfs
+
+ mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs/examples
+ cp -r conf/live.conf $(DESTDIR)/usr/share/doc/live-initramfs/examples
+
+ # Installing manpages
+ set -e; for MANPAGE in manpages/*.en.1; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
+ done
+
+ set -e; for MANPAGE in manpages/*.en.7; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
+ done
+
+ set -e; for TRANSLATIONS in $$TRANSLATIONS; \
+ do \
+ for MANPAGE in manpages/*.$$TRANSLATION.1; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
+ done; \
+ for MANPAGE in manpages/*.$$TRANSLATION.7; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
+ done; \
+ done
+
+ # Temporary symlinks
+ ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
+ ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-login.7.gz
+
+uninstall:
+ # Uninstalling configuration
+ rm -f $(DESTDIR)/etc/live.conf
+
+ # Uninstalling live-md5check
+ rm -f $(DESTDIR)/usr/lib/live-initramfs
+
+ # Uninstalling executables
+ rm -f $(DESTDIR)/sbin/live-getty $(DESTDIR)/sbin/live-login $(DESTDIR)/sbin/live-snapshot
+ rm -f $(DESTDIR)/usr/share/live-initramfs
+ rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
+ rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live*
+
+ # Uninstalling documentation
+ rm -rf $(DESTDIR)/usr/share/doc/live-initramfs
+
+ # Uninstalling manpages
+ set -e; for MANPAGE in manpages/*.en.1; \
+ do \
+ rm -f $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
+ done
+
+ set -e; for MANPAGE in manpages/*.en.7; \
+ do \
+ rm -f $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
+ done
+
+ set -e; for TRANSLATIONS in $$TRANSLATIONS; \
+ do \
+ for MANPAGE in manpages/*.$$TRANSLATION.1; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
+ done; \
+ for MANPAGE in manpages/*.$$TRANSLATION.7; \
+ do \
+ install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
+ done; \
+ done
+
+ # Temporary symlinks
+ rm -f $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
+ rm -f $(DESTDIR)/usr/share/man/man7/live-login.7.gz
+
+update:
+ set -e; for MANPAGE in manpages/*.en.*; \
+ do \
+ sed -i -e 's/2007\\-05\\-07/2007\\-05\\-14/' \
+ -e 's/1.87.2/1.87.3/' \
+ $$MANPAGE; \
+ done
+
+clean:
+ rm -f live.conf
+ $(MAKE) -C bin/live-md5check clean
+
+distclean:
+
+reinstall: uninstall install
diff --git a/bin/live-md5check/live-md5check.c b/bin/live-md5check/live-md5check.c
index 8dfd577..8bac6a0 100644
--- a/bin/live-md5check/live-md5check.c
+++ b/bin/live-md5check/live-md5check.c
@@ -6,12 +6,12 @@
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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -128,7 +128,7 @@ void usplash_success(int fd, char *format, ...) {
asprintf(&s1, "SUCCESS %s", s);
write_and_retry(fd, s1);
-
+
free(s);
free(s1);
}
@@ -161,10 +161,10 @@ int set_nocanonical_tty(int fd) {
}
int main(int argc, char **argv) {
-
+
int pipe_fd, check_fd;
int failed = 0;
-
+
FILE *md5_file;
md5_state_t state;
md5_byte_t digest[16];
@@ -180,20 +180,20 @@ int main(int argc, char **argv) {
fprintf(stderr,"%s <root directory> <md5sum file>\n", argv[0]);
exit(1);
}
-
+
if (chdir(argv[1]) != 0) {
perror("chdir");
exit(1);
}
-
+
pipe_fd = open(USPLASH_FIFO, O_WRONLY|O_NONBLOCK);
-
+
if (pipe_fd == -1) {
/* We can't really do anything useful here */
perror("Opening pipe");
exit(1);
}
-
+
usplash_progress(pipe_fd, 0);
usplash_urgent(pipe_fd, "Checking integrity, this may take some time");
@@ -218,18 +218,18 @@ int main(int argc, char **argv) {
char buf[BUFSIZ];
ssize_t rsize;
int i;
-
+
md5_init(&state);
-
+
usplash_text(pipe_fd, "Checking %s", checkfile);
-
+
check_fd = open(checkfile, O_RDONLY);
if (check_fd < 0) {
usplash_timeout(pipe_fd, 300);
usplash_failure(pipe_fd, "%s", strerror(errno));
sleep(10);
}
-
+
rsize = read(check_fd, buf, sizeof(buf));
while (rsize > 0) {
@@ -239,13 +239,13 @@ int main(int argc, char **argv) {
md5_append(&state, (const md5_byte_t *)buf, rsize);
rsize = read(check_fd, buf, sizeof(buf));
}
-
+
close(check_fd);
md5_finish(&state, digest);
-
+
for (i = 0; i < 16; i++)
sprintf(hex_output + i * 2, "%02x", digest[i]);
-
+
if (strncmp(hex_output, checksum, strlen(hex_output)) == 0) {
usplash_success(pipe_fd, "OK");
} else {
@@ -266,5 +266,5 @@ int main(int argc, char **argv) {
getchar();
reboot(LINUX_REBOOT_CMD_RESTART);
return 0;
-
+
}
diff --git a/bin/live-md5check/md5.h b/bin/live-md5check/md5.h
index 698c995..3baa4dc 100644
--- a/bin/live-md5check/md5.h
+++ b/bin/live-md5check/md5.h
@@ -71,7 +71,7 @@ typedef struct md5_state_s {
} md5_state_t;
#ifdef __cplusplus
-extern "C"
+extern "C"
{
#endif
diff --git a/bin/live-snapshot b/bin/live-snapshot
index e3e05fe..b803b15 100755
--- a/bin/live-snapshot
+++ b/bin/live-snapshot
@@ -1,10 +1,10 @@
#! /bin/bash
-# casper-snapshot - utility to manage Debian Live systems snapshots
+# live-snapshot - utility to manage Debian Live systems snapshots
#
# This program mount a device (fallback to /tmpfs under /mnt/snapshot
# and save the /cow (or a different dir) filesystem in it for reusing
-# in another casper session. Look at manpage for more info.
+# in another live-initramfs session. Look at manpage for more info.
#
# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
#
@@ -122,7 +122,7 @@ Version ()
echo "On Debian systems, the complete text of the GNU General Public License"
echo "can be found in /usr/share/common-licenses/GPL file."
echo
- echo "Homepage: <http://live.debian.net/>"
+ echo "Homepage: <http://debian-live.alioth.debian.org/>"
exit 0
}
@@ -234,7 +234,7 @@ Defaults ()
COW=$(echo "${SNAP_RSTRING}" | cut -f1 -d ':')
DEV=$(echo "${SNAP_RSTRING}" | cut -f2 -d ':')
DEST=$(echo "${SNAP_RSTRING}" | cut -f3 -d ':')
-
+
case "${DEST}" in
*.cpio.gz)
TYPE="cpio" ;;
@@ -255,7 +255,7 @@ Defaults ()
else
COW="${SNAP_COW}"
fi
-
+
case "${SNAP_TYPE}" in
"cpio"|"squashfs"|"ext2")
TYPE="${SNAP_TYPE}"
@@ -266,8 +266,8 @@ Defaults ()
Usage "Error: unrecognized snapshot type"
;;
esac
- #if [ -d
- #if Is_same_mount
+ #if [ -d
+ #if Is_same_mount
fi
# check vars
@@ -284,7 +284,7 @@ Clean ()
if [ -n "$DEV" ]; then
umount "${MOUNTP}"
rmdir "${MOUNTP}"
- rm
+ #rm
fi
}
diff --git a/conf/live.conf b/conf/live.conf
index 0b44894..fc85cc7 100644
--- a/conf/live.conf
+++ b/conf/live.conf
@@ -1,9 +1,9 @@
-# /etc/live.conf: configuration file for live-initramfs
+# /etc/live.conf - configuration file for live-initramfs
BUILD_SYSTEM="Debian"
USERNAME="user"
-USERFULLNAME="Live session user"
-HOST="debian"
+USERFULLNAME="Debian Live user"
+HOSTNAME="debian"
-export BUILD_SYSTEM USERNAME USERFULLNAME HOST
+export BUILD_SYSTEM USERNAME USERFULLNAME HOSTNAME
diff --git a/debian/changelog b/debian/changelog
index 1125793..55305fe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+live-initramfs (1.87.3-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org> Mon, 14 May 2007 00:00:00 +0200
+
live-initramfs (1.87.2-1) unstable; urgency=low
* New upstream release.
diff --git a/debian/control b/debian/control
index 4ddaa45..00b4e24 100644
--- a/debian/control
+++ b/debian/control
@@ -6,16 +6,24 @@ Uploaders: Daniel Baumann <daniel@debian.org>
Build-Depends: debhelper (>= 5), lsb-release
Standards-Version: 3.7.2
XS-Vcs-Svn: svn://svn.debian.org/debian-live/dists/trunk/live-initramfs/
+XS-VCS-Browse: http://svn.debian.org/wsvn/debian-live/dists/trunk/live-initramfs/
Package: live-initramfs
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, dmsetup, eject, file, initramfs-tools, sudo, user-setup
+Depends: ${shlibs:Depends}, ${misc:Depends}, eject, file, initramfs-tools, sudo, user-setup
+Suggests: genext2fs, squashfs-tools
Conflicts: casper, usplash (<< 0.4-43)
Replaces: casper
-Description: Debian Live (alternative) initramfs generator
- live-initramfs provides an initramfs generator suited for booting Debian Live
- systems from read-only media.
+Description: Debian Live initramfs generator
+ live-initramfs is a hook for the initramfs-tools, used to generate a initramfs
+ capable to boot live systems, such as those created by live-helper. This
+ includes the Debian Live isos, netboot tarballs, and usb stick images.
+ .
+ At boot time it will look for a (read-only) media containing a "/live"
+ directory where a root filesystems (often a compressed filesystem image like
+ squashfs) is stored. If found, it will create a writable environment, using
+ unionfs, for Debian like systems to boot from.
.
Homepage: <http://debian-live.alioth.debian.org/>
.
- live-initramfs is a fork of casper.
+ live-initramfs is a fork of casper <http://packages.ubuntu.com/casper/>.
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644
index f929f0c..0000000
--- a/debian/dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-/etc
-/usr/lib/live-initramfs
-/usr/share/initramfs-tools/hooks
-/usr/share/initramfs-tools/scripts
diff --git a/debian/examples b/debian/examples
deleted file mode 100644
index 63403a0..0000000
--- a/debian/examples
+++ /dev/null
@@ -1 +0,0 @@
-conf/live.conf
diff --git a/debian/init b/debian/init
index 7c0dbe9..a7274bd 100644
--- a/debian/init
+++ b/debian/init
@@ -1,20 +1,21 @@
-#! /bin/sh
+#!/bin/sh
+
### BEGIN INIT INFO
-# Provides: live-initramfs
-# Required-Start: $syslog
-# Required-Stop: $syslog
-# Should-Start: $local_fs
-# Should-Stop: $local_fs
-# Default-Start: 1 2 3 4 5
-# Default-Stop: 0 6
-# Short-Description: Casper init script
-# Description: Resyncs snapshots, evantually caches files in order
-# to let remove the media.
+# Provides: live-initramfs
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Should-Start: $local_fs
+# Should-Stop: $local_fs
+# Default-Start: 1 2 3 4 5
+# Default-Stop: 0 6
+# Short-Description: live-initramfs init script
+# Description: Resyncs snapshots, evantually caches files in order to
+# let remove the media.
### END INIT INFO
-# Author: Tollef Fog Heen <tfheen@canonical.com>
-# Marco Amadori <marco.amadori@gmail.com>
-#
+# Authors: Tollef Fog Heen <tfheen@canonical.com>
+# Marco Amadori <marco.amadori@gmail.com>
+
PATH=/usr/sbin:/usr/bin:/sbin:/bin
NAME=live-initramfs
SCRIPTNAME=/etc/init.d/${NAME}
@@ -71,17 +72,27 @@ do_stop ()
cache_path "$path"
done
- eject -p -m /cdrom >/dev/null 2>&1
+ for x in $(cat /proc/cmdline); do
+ case $x in
+ quickreboot)
+ QUICKREBOOT="Yes"
+ ;;
+ esac
+ done
+
+ if [ -z ${QUICKREBOOT} ]; then
+ eject -p -m /live_media >/dev/null 2>&1
- # XXX - i18n
- echo "Please remove the disc and close the tray (if any) then press ENTER: "
- if [ -x /sbin/usplash_write ]; then
- /sbin/usplash_write "TIMEOUT 86400"
- /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
- /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
- fi
+ # XXX - i18n
+ echo "Please remove the disc and close the tray (if any) then press ENTER: "
+ if [ -x /sbin/usplash_write ]; then
+ /sbin/usplash_write "TIMEOUT 86400"
+ /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
+ /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
+ fi
- read x < /dev/console
+ read x < /dev/console
+ fi
}
case "$1" in
diff --git a/debian/install b/debian/install
deleted file mode 100644
index fb597d4..0000000
--- a/debian/install
+++ /dev/null
@@ -1,7 +0,0 @@
-bin/live-getty sbin
-bin/live-login sbin
-bin/live-preseed usr/share/live-initramfs
-bin/live-reconfigure usr/share/live-initramfs
-bin/live-snapshot sbin
-hooks usr/share/initramfs-tools
-scripts usr/share/initramfs-tools
diff --git a/debian/links b/debian/links
deleted file mode 100644
index fa3fb68..0000000
--- a/debian/links
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/share/man/man7/casper.7.gz /usr/share/man/man7/live-getty.7.gz
-/usr/share/man/man7/casper.7.gz /usr/share/man/man7/live-login.7.gz
diff --git a/debian/manpages b/debian/manpages
deleted file mode 100644
index 96c4bf7..0000000
--- a/debian/manpages
+++ /dev/null
@@ -1 +0,0 @@
-manpages/*
diff --git a/debian/rules b/debian/rules
index 79117a9..b827a8f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,9 +11,6 @@ else
CFLAGS += -O2
endif
-# Looking in which build system we are
-BUILD_SYSTEM := $(shell lsb_release --short --id)
-
upstream:
# Needs: subversion
cd .. && svn co svn://svn.debian.org/debian-live/dists/trunk/live-initramfs || true
@@ -23,17 +20,8 @@ build: build-stamp
build-stamp:
dh_testdir
- # Checking scripts
- for SCRIPT in scripts/live scripts/live-bottom/*; \
- do \
- sh -n $$SCRIPT || exit 1; \
- done
-
- # Setting BUILD_SYSTEM in the binary package
- sed -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' conf/live.conf > live.conf
-
# Building package
- CFLAGS="$(CFLAGS)" $(MAKE) -C bin/live-md5check
+ CFLAGS="$(CFLAGS)" $(MAKE)
touch build-stamp
@@ -43,8 +31,7 @@ clean:
rm -f build-stamp
# Cleaning package
- $(MAKE) -C bin/live-md5check clean
- rm -f live.conf
+ $(MAKE) clean
dh_clean
@@ -55,21 +42,22 @@ install: build
dh_installdirs
# Installing package
- install -m 0755 bin/live-md5check/live-md5check debian/live-initramfs/usr/lib/live-initramfs
- install -m 0644 live.conf debian/live-initramfs/etc/live.conf
+ $(MAKE) install DESTDIR=$(CURDIR)/debian/live-initramfs
+
+ # Removing double files
+ rm -f debian/live-initramfs/usr/share/doc/live-initramfs/COPYING
+ rm -f debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog
+ mv debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog.casper debian/live-initramfs/usr/share/doc/live-initramfs/changelog.casper
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
- dh_installchangelogs doc/ChangeLog
- dh_installdocs doc/ChangeLog.casper
- dh_installexamples
+ dh_installchangelogs docs/ChangeLog
+ dh_installdocs
dh_install
dh_installinit --no-restart-on-upgrade --no-start -- start 89 0 6 .
- dh_installman
- dh_link
dh_strip
dh_compress
dh_fixperms
diff --git a/doc/ChangeLog b/doc/ChangeLog
deleted file mode 100644
index 087aa82..0000000
--- a/doc/ChangeLog
+++ /dev/null
@@ -1,56 +0,0 @@
-2007-05-06 Daniel Baumann <daniel@debian.org>
-
- * bin/casper-getty, casper-login, casper-preseed, casper-reconfigure,
- casper-snapshot:
- - Renamed to live-*.
- * casper-md5check:
- - Moved to bin.
- - Renamed to live-md5check.
- * casper.conf:
- - Moved to conf/live.conf.
- * caspermon:
- - Removed.
- * scripts/casper, casper-bottom, casper-functions, casper-helpers,
- casper-premount:
- - Renamed to live-*.
- * bin/live-getty, live-login, conf/live.conf:
- - Reformated.
- * bin/live-snapshot, debian/dirs, debian/install, debian/rules,
- hooks/live, scripts/live:
- - Replaces casper path names with live.
- * debian/manpage:
- - Moved to manpages.
- - Renamed casper.7 to live-initramfs.7.
- * debian/init:
- - Changed activation parameter from boot=casper to boot=live.
- * scripts/casper-bottom/02_timezone:
- - Fixed wrong script description.
-
-2007-04-30 Daniel Baumann <daniel@debian.org>
-
- * Forked casper 1.87.
- * COPYING:
- - Added.
- * debian/control, debian/ubiquity-casper.install, ubiquity-hooks:
- - Removed ubiquity support.
- * debian/changelog:
- - Moved old changelog to doc/ChangeLog.casper.
- - Added new changelog for live-initramfs.
- * debian/casper.dirs, casper.init, casper.install, casper.manpages,
- casper.postinst:
- - Renamed, removed packagename prefix from filename.
- * debian/compat, copyright, dirs, manpages:
- - Updated.
- * debian/examples, links:
- - Added.
- * debian/rules:
- - Updated.
- - Added upstream target.
- * debian/control:
- - Updated.
- - Added depends to file.
- - Added conflicts/replaces to casper.
- * debian/postinst:
- - Running 'update-initramfs' for all kernel versions instead of
- latest only.
- * Uploaded 1.87.1-1.
diff --git a/docs/AUTHORS b/docs/AUTHORS
new file mode 100644
index 0000000..dc44347
--- /dev/null
+++ b/docs/AUTHORS
@@ -0,0 +1,12 @@
+Main Authors:
+
+ * Daniel Baumann <daniel@debian.org>
+ * Marco Amadori <marco.amadori@gmail.com>
+
+Original Authors:
+
+ live-initramfs is a fork of casper <http://packages.ubuntu.com/casper/>.
+ casper was originally written by Tollef Fog Heen <tfheen@canonical.com>
+ and Matt Zimmerman <mdz@canonical.com>.
+
+ See the casper changelog for casper contributors.
diff --git a/docs/CREDITS b/docs/CREDITS
new file mode 100644
index 0000000..355eeab
--- /dev/null
+++ b/docs/CREDITS
@@ -0,0 +1,17 @@
+Patches (alphabetical order):
+
+ * Alexandre Garcia <ascii_77@yahoo.fr>
+ * Alex Owen <r.a.owen@qmul.ac.uk>
+ * Arnaud Cornet <arnaud.cornet@gmail.com>
+ * Bas Wijnen <wijnen@debian.org>
+ * Ben Armstrong <synrg@debian.org>
+ * Davide Natalini <davide.natalini@studio.unibo.it>
+ * Frederic Lehobey <Frederic.Lehobey@free.fr>
+ * Hadar Weiss <whadar@gmail.com>
+ * Jason D. Clinton <me@jasonclinton.com>
+ * Jonathan Hall <flimzy@flimzy.com>
+ * Malcom Gilles <live@ouabain.org>
+ * Mathieu Geli <mathieu.geli@gmail.com>
+ * Oliver Osburg <o.osburg@uni-jena.de>
+ * Otavio Salvador <otavio@debian.org>
+ * Sebastian Raveau <sebastien.raveau@epita.fr>
diff --git a/docs/ChangeLog b/docs/ChangeLog
new file mode 100644
index 0000000..9d2a4ee
--- /dev/null
+++ b/docs/ChangeLog
@@ -0,0 +1,162 @@
+2007-05-12 Daniel Baumann <daniel@debian.org>
+
+ * scripts/live:
+ - Renamed CASPERCONF to LIVECONF.
+ - Renamed CASPERGETTY to LIVE_GETTY.
+ - Renamed LIVEMEDIA_* to LIVE_MEDIA_*.
+ * Uploaded 1.87.3-1.
+
+2007-05-11 Daniel Baumann <daniel@debian.org>
+
+ * hooks/live:
+ - Reformated.
+ * scripts/live, scripts/live-bottom/13swap:
+ - Added check for swapoff bootparameter to disable usage of local swap
+ partitions.
+
+2007-05-09 Daniel Baumann <daniel@debian.org>
+
+ * manpages/*:
+ - Added language suffix.
+ - Partially rewritten and reformated.
+
+2007-05-08 Daniel Baumann <daniel@debian.org>
+
+ * Makefile, doc/AUTHORS, doc/CREDITS:
+ - Added.
+ * doc:
+ - Renamed to docs.
+
+2007-05-07 Daniel Baumann <daniel@debian.org>
+
+ * debian/control:
+ - Added suggests to genext2fs and squashfs-tools.
+ - Removed depends to dmsetup.
+ * scripts/live-bottom/10adduser:
+ - Added patch from Ben Armstrong <synrg@debian.org> to write
+ $HOME/.su-to-rootrc file.
+ * scripts/live, scripts/live-bottom/21xvideomode:
+ - Added patch from Mathieu Geli <mathieu.geli@gmail.com> to have the
+ ability to force X video mode from kernel append line.
+
+2007-05-06 Daniel Baumann <daniel@debian.org>
+
+ * Merging patches from casper 1.81+debian-4, see ChangeLog.casper.
+ * conf/live.conf:
+ - Renamed HOST to HOSTNAME.
+ * debian/init:
+ - Added quickreboot.
+ - Renamed /cdrom to /live_media.
+ * doc/ChangeLog.casper:
+ - Added missing debian uploads.
+ * manpages/live-initramfs.7:
+ - Updated.
+ * hooks/live:
+ - Reading live.conf earlier.
+ - Making some udev copies conditional for ubuntu.
+ - Allowing local keymap when using encrypted filesystems.
+ * scripts/live:
+ - Renamed HOST to HOSTNAME.
+ - Renamed /cdrom to /live_media.
+ - Added support for live-snapshot.
+ - Parsing commandline in one central place now.
+ - Added support for encrypted filesytem images.
+ - Added support for multiple filesystem images.
+ * scripts/live-bottom/01integrity_check:
+ - Renamed /cdrom to /live_media.
+ * scripts/live-bottom/02etc_live_conf:
+ - Added.
+ * scripts/live-bottom/05mountpoints:
+ - Renamed /cdrom to /live_media.
+ - Don't do anything if not required.
+ * scripts/live-bottom/10adduser:
+ - Changed default password.
+ - Disabling xscreensaver locking and copying ubiquity desktop only on
+ ubuntu.
+ * scripts/live-bottom/14locales:
+ - Added handling of locale bootparameter.
+ * scripts/live-bottom/15autologin:
+ - Added workaround for using gdm default config.
+ * scripts/live-bottom/18hostname:
+ - Renamed HOST to HOSTNAME.
+ * scripts/live-bottom/19keyboard:
+ - Added handling of keyboard bootparameter.
+ * scripts/live-bottom/20xconfig:
+ - Added handling of keyboard bootparameter.
+ - Added handling of locale bootparameter.
+ * scripts/live-bottom/23networking:
+ - Disabled loop over fixed network devices.
+ * scripts/live-bottom/24preseed:
+ - Added handling of multiple preseeding files.
+ - Removed locale handling.
+ * scripts/live-bottom/25configure_init:
+ - Added handling of serial ttys.
+ * scripts/live-bottom/30accessibility:
+ - Removed extra parsing of commandline.
+ * scripts/live-functions:
+ - Added function to really export variables.
+ * scripts/live-helpers:
+ - Added support for encrypted filesytem images.
+
+2007-05-06 Daniel Baumann <daniel@debian.org>
+
+ * bin/casper-getty, casper-login, casper-preseed, casper-reconfigure,
+ casper-snapshot:
+ - Renamed to live-*.
+ * casper-md5check:
+ - Moved to bin.
+ - Renamed to live-md5check.
+ * casper.conf:
+ - Moved to conf/live.conf.
+ * caspermon:
+ - Removed.
+ * hooks/casper, scripts/casper, casper-bottom, casper-functions,
+ casper-helpers, casper-premount:
+ - Renamed to live*.
+ * bin/live-getty, live-login:
+ - Reformated.
+ * conf/live.conf:
+ - Reformated.
+ - Setting Debian defaults.
+ * bin/live-snapshot, debian/dirs, debian/install, debian/rules,
+ hooks/live, scripts/live:
+ - Replaces casper directory and file names with live-initramfs
+ directory and file names.
+ * debian/manpage:
+ - Moved to manpages.
+ - Renamed casper.7 to live-initramfs.7.
+ - Renamed casper-snapshot.1 to live-snapshot.1.
+ * debian/init:
+ - Changed activation parameter from boot=casper to boot=live.
+ * scripts/live-bottom/02_timezone:
+ - Fixed wrong script description.
+ * Uploaded 1.87.2-1.
+
+2007-04-30 Daniel Baumann <daniel@debian.org>
+
+ * Forked casper 1.87.
+ * COPYING:
+ - Added.
+ * debian/control, debian/ubiquity-casper.install, ubiquity-hooks:
+ - Removed ubiquity support.
+ * debian/changelog:
+ - Moved old changelog to doc/ChangeLog.casper.
+ - Added new changelog for live-initramfs.
+ * debian/casper.dirs, casper.init, casper.install, casper.manpages,
+ casper.postinst:
+ - Renamed, removed packagename prefix from filename.
+ * debian/compat, copyright, dirs, manpages:
+ - Updated.
+ * debian/examples, links:
+ - Added.
+ * debian/rules:
+ - Updated.
+ - Added upstream target.
+ * debian/control:
+ - Updated.
+ - Added depends to file.
+ - Added conflicts/replaces to casper.
+ * debian/postinst:
+ - Running 'update-initramfs' for all kernel versions instead of latest
+ only.
+ * Uploaded 1.87.1-1.
diff --git a/doc/ChangeLog.casper b/docs/ChangeLog.casper
index 5e5f2c8..e308906 100644
--- a/doc/ChangeLog.casper
+++ b/docs/ChangeLog.casper
@@ -71,6 +71,46 @@ casper (1.82) feisty; urgency=low
-- Colin Watson <cjwatson@ubuntu.com> Mon, 5 Mar 2007 11:19:48 +0000
+casper (1.81+debian-4) unstable; urgency=low
+
+ * Added patch from Serkan Sakar <serkan.sakar@gmx.net> to allow local keymap
+ for use with encryption.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 11 Apr 2007 09:04:00 +0200
+
+casper (1.81+debian-3) unstable; urgency=low
+
+ * Added depends to eject.
+ * Removed recommends to live-package.
+
+ -- Daniel Baumann <daniel@debian.org> Wed, 21 Mar 2007 00:30:00 +0100
+
+casper (1.81+debian-2) unstable; urgency=low
+
+ [ Daniel Baumann ]
+ * Applied patch from Sebastian Raveau <sebastien.raveau@epita.fr> to
+ add support for filesystem images encrypted with loop-aes.
+
+ [ Marco Amadori ]
+ * Added a "quickreboot" boot parameter, that prevent casper to eject the
+ media, useful for remote rebooting of a casper system, thanks to
+ Jonathan Hall <flimzy@flimzy.com> for the patch.
+
+ -- Marco Amadori <marco.amadori@gmail.com> Fri, 16 Feb 2007 17:26:58 +0100
+
+casper (1.81+debian-1) unstable; urgency=low
+
+ * New upstream release.
+ * Some cleaning and renaming involved because most of the debian-only code
+ was merged in ubuntu sources, then back here.
+ * Extended manpage, thanks to Alex Owen <r.alex.owen@gmail.com> and
+ Jonathan Hall <flimzy@flimzy.com> (Closes: #409980).
+ * Included a slightly reworked and bug fixed version of "Allow specific
+ ordering of images" by Jonathan Hall <flimzy@flimzy.com> with a new boot
+ parameter: module=NAME.
+
+ -- Marco Amadori <marco.amadori@gmail.com> Thu, 15 Feb 2007 10:21:01 +0100
+
casper (1.81) feisty; urgency=low
* Merge in Debian's changes.
@@ -84,6 +124,28 @@ casper (1.80) feisty; urgency=low
-- Colin Watson <cjwatson@ubuntu.com> Thu, 1 Feb 2007 00:11:06 +0000
+casper (1.79+debian-3) unstable; urgency=low
+
+ * Fix DEFCONSOLE for autoserial console, thanks to
+ "Alex Owen" <r.alex.owen@gmail.com>.
+
+ -- Marco Amadori <marco.amadori@gmail.com> Sun, 4 Feb 2007 20:12:08 +0100
+
+casper (1.79+debian-2) unstable; urgency=low
+
+ * It now depends also on "file" (Closes: #409308).
+ * Fixed LIVEMEDIA_TIMEOUT values (Closes: #409300).
+ Thanks for both to Jonathan Hall <flimzy@flimzy.com>.
+
+ -- Marco Amadori <marco.amadori@gmail.com> Sat, 3 Feb 2007 18:29:20 +0100
+
+casper (1.79+debian-1) unstable; urgency=low
+
+ * New Upstream release.
+ * Reverted: "Mount the first squashfs as /rofs."
+
+ -- Marco Amadori <marco.amadori@gmail.com> Tue, 16 Jan 2007 12:12:34 +0100
+
casper (1.79) feisty; urgency=low
[ Colin Watson ]
@@ -113,6 +175,16 @@ casper (1.78) edgy; urgency=low
-- Colin Watson <cjwatson@ubuntu.com> Wed, 25 Oct 2006 12:46:05 +0100
+casper (1.77+debian-7) testing; urgency=medium
+
+ * Backported two 1 line fixes (both serious bugs) from casper-1.79+debian-1
+ and casper-1.79+debian-3:
+ - It now depends also on "file" (Closes: #409308).
+ - Fix DEFCONSOLE for autoserial console, thanks to
+ "Alex Owen" <r.alex.owen@gmail.com>.
+
+ -- Marco Amadori <marco.amadori@gmail.com> Thu, 8 Feb 2007 11:19:46 +0100
+
casper (1.77+debian-6) unstable; urgency=medium
* Improved snapshots features (even still experimental).
@@ -480,6 +552,7 @@ casper (1.61+debian-1) unstable; urgency=low
[ Marco Amadori ]
* New upstream release (Resynced with 1.61, bzr 258).
* Usb discover patch from Malcom Gilles <live@ouabain.org>.
+
-- Marco Amadori <marco.amadori@gmail.com> Tue, 18 Jul 2006 23:34:59 +0200
casper (1.61) edgy; urgency=low
diff --git a/hooks/live b/hooks/live
index 94383ca..402f7ca 100755
--- a/hooks/live
+++ b/hooks/live
@@ -1,75 +1,118 @@
-#!/bin/sh -e
-# initramfs hook for casper
+#!/bin/sh
-PREREQS=""
+# initramfs hook for live-initramfs (Debian Live)
+
+set -e
+
+# initramfs-tools header
+
+PREREQ=""
-# Output pre-requisites
prereqs()
{
- echo "$PREREQ"
+ echo "${PREREQ}"
}
-case "$1" in
- prereqs)
- prereqs
- exit 0
- ;;
+case "${1}" in
+ prereqs)
+ prereqs
+ exit 0
+ ;;
esac
. /usr/share/initramfs-tools/hook-functions
-manual_add_modules unionfs
+# live-initramfs hook
-# We need losetup
-copy_exec /sbin/losetup /sbin
+# Handling live-initramfs
+
+# Configuration
+if [ -r /etc/live.conf ]
+then
+ . /etc/live.conf
-# Casper hooks
-mkdir -p ${DESTDIR}/lib/live-initramfs
+ mkdir -p "${DESTDIR}"/etc
+ cp /etc/live.conf "${DESTDIR}"/etc
+fi
+
+# Directories
+mkdir -p "${DESTDIR}"/lib/live-initramfs
+
+# Executables
+copy_exec /usr/lib/live-initramfs/live-md5check /bin
copy_exec /usr/share/live-initramfs/live-reconfigure /bin
copy_exec /usr/share/live-initramfs/live-preseed /bin
-mkdir -p ${DESTDIR}/lib/udev
-copy_exec /lib/udev/cdrom_id /lib/udev
-copy_exec /lib/udev/vol_id /lib/udev
-copy_exec /lib/udev/path_id /lib/udev
-copy_exec /usr/bin/udevinfo /bin
+# Scripts
+cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts
+cp /usr/share/initramfs-tools/scripts/live-helpers "${DESTDIR}"/scripts
+
+# Handling binaries
+
+# losetup
+copy_exec /sbin/losetup /sbin
+
+# mount.cifs
+if [ -x /sbin/mount.cifs ]
+then
+ copy_exec /sbin/mount.cifs /sbin
+fi
+
+# eject
copy_exec /usr/bin/eject /bin
-# cifs boot
-if [ -x /sbin/mount.cifs ]; then
- copy_exec /sbin/mount.cifs /sbin
- for x in cifs; do
- manual_add_modules ${x}
- done
+# udev
+if [ "${BUILD_SYSTEM}" = "Ubuntu" ]
+then
+ mkdir -p "${DESTDIR}"/lib/udev
+
+ copy_exec /lib/udev/cdrom_id /lib/udev
+ copy_exec /lib/udev/path_id /lib/udev
+ copy_exec /lib/udev/vol_id /lib/udev
fi
-# squashfs
-manual_add_modules squashfs
-manual_add_modules loop
+copy_exec /sbin/udevtrigger /sbin
+copy_exec /sbin/udevsettle /sbin
+copy_exec /usr/bin/udevinfo /bin
-# random file system modules
-manual_add_modules vfat
+# Handling kernel modules
+
+# Filesystem: cifs
+if [ -x /sbin/mount.cifs ]
+then
+ manual_add_modules cifs
+fi
+
+# Filesystem: ext3
manual_add_modules ext3
-# needed for vfat. :-/
+
+# Filesystem: squashfs
+manual_add_modules loop
+manual_add_modules squashfs
+
+# Filesystem: unionfs
+manual_add_modules unionfs
+
+# Filesystem: vfat
manual_add_modules nls_cp437
-manual_add_modules nls_utf8
manual_add_modules nls_iso8859-1
+manual_add_modules nls_utf8
+manual_add_modules vfat
-# cdrom modules
-manual_add_modules sr_mod
+# Hardware: cdrom
manual_add_modules ide-cd
-manual_add_modules sbp2
manual_add_modules ohci1394
+manual_add_modules sbp2
+manual_add_modules sr_mod
-# integrity check
-copy_exec /usr/lib/live-initramfs/live-md5check /bin
-
-cp /usr/share/initramfs-tools/scripts/live-functions $DESTDIR/scripts
-cp /usr/share/initramfs-tools/scripts/live-helpers $DESTDIR/scripts
-
+# Hardware: network
auto_add_modules net
-if [ -e /etc/live.conf ]; then
- mkdir -p ${DESTDIR}/etc
- cp /etc/live.conf ${DESTDIR}/etc
+# Custom keymap (usefull when using encryption)
+if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
+then
+ copy_exec /bin/loadkeys /bin
+
+ mkdir -p "${DESTDIR}"/etc
+ cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
fi
diff --git a/manpages/live-initramfs.7 b/manpages/live-initramfs.7
deleted file mode 100644
index d35e018..0000000
--- a/manpages/live-initramfs.7
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH CASPER 7 "Thu, 28 Sep 2006" "1.69" "Initramfs-tools hook"
-
-.SH NAME
-casper \- a hook for initramfs-tools to boot live systems.
-
-.SH SYNOPSIS
-.B BOOT=casper
-As kernel parameter boot prompt.
-
-.SH DESCRIPTION
-Casper is a hook for initramfs-tools used to generate an initramfs capable to boot live systems as those created by make-live. This includes the Debian-Live isos, netboot tarballs, and usb stick images and Ubuntu live cds. At boot time it will look for a (read-only) media containing a "/casper" directory where a root filesystems (often a compressed squashfs) is stored. If found, it will create a writable environment, using unionfs, for debian like systems to boot from.
-
-.SH RECOGNIZED BOOT OPTIONS
-.TP
-.B live-getty
-This enables a special "serial" login shell (experimental).
-.TP
-.B xdebconf
-uses xdebconfigurator, if present on the rootfs, to configure X instead of the standard procedure (experimental).
-.TP
-.BI "hostname=" HOSTNAME " , userfullname=" USERFULLNAME " , username=" USERNAME
-Those parameters lets you override values read from the config file.
-.TP
-.BI "{keyb|kbd-chooser/method}=" KEYBOARD " , {klayout|console-setup/layoutcode}=" LAYOUT " , {kvariant|console-setup/variantcode}=" VARIANT " , {kmodel|console-setup/modelcode}=" CODE " , koptions=" OPTIONS
-Configure the running keyboard as specified, if this one misses casper behaves as if "keyb=us" was specified. It will be interfered from "locale=" if locale is only 2 lowecase letters as a special case. You could also specify console layout, variant, code, and options (no defaults).
-.TP
-.BI ip= IFACE,ADDRESS,NETMASK,GATEWAY [ :IFACE,ADDRESS,NETMASK,GATEWAY "]*"
-Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify this if you want to use dhcp (default).
-.TP
-.BR ip[= frommedia ]
-If this variable is set, dhcp and static configuration are just skipped and the system will use the (must be) media-preconfigured /etc/network/interfaces instead.
-.TP
-.BI "{live-media|bootfrom}=" DEVICE
-If you specify one of this two equivalent forms, casper will first try to find this device for the "/casper" directory where the read-only root filesystem should reside. If it did not find something usable, the normal scan for block devices is performed.
-.TP
-.BI "live-media-offset=" BYTES
-This way you could tell casper that your image starts at offset BYTES in the above specified or autodiscovered device, this could be useful to hide the debian-live iso or image inside another iso or image, to create "clean" images.
-.TP
-.BI "locale=" LOCALE " | debian-installer/locale=" LOCALE
-Configure the running locale as specified, if not present the live-media rootfs configured locale will be used and if also this one misses casper behave as "locale=en_US.UTF-8" was specified. If only 2 lowercase letter are specified (like "it"), the "maybe wanted" locale is generated (like it:IT.UTF-8), in this case if also "keyb=" is unspecified is set with those 2 lowercase letters (keyb=it).
-.TP
-.BR "netboot[=" nfs "|" cifs ]
-This tells casper to perform a network mount. The parameter "nfsroot=" (with optional "nfsopts="), should specify where is the location of the root filesystem. With no args, will try cifs first, and if it fails nfs.
-.TP
-.B persistent
-Casper will look for persistent and snapshot partitions or files labeled "casper-rw", "home-rw", and files called "casper-sn*", "home-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latter in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at live-snapshot(1) for more informations.
-.TP
-.B nopersistent
-disables the above mentioned "persistent" feature, useful if the bootloader (like syslinux) has been installed with persistent enabled.
-.TP
-.B "showmounts"
-This parameter will make casper to show on "/" the ro filesystems (mostly compressed) on /casper. This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation.
-.TP
-.BI "todisk=" DEVICE
-Adding this parameter, casper will try to copy the entire read-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live-media=DEVICE" boot parameter with the same DEVICE used this time.
-.TP
-.B toram
-Adding this parameter, casper will try to copy the whole read-only media to the computer's RAM before mounting the root filesystem. This could need a lot of ram, according to the space used by the read-only media.
-.TP
-.BI "{preseed/file|file}=" FILE
-A path to a file present on the rootfs could be used to preseed debconf database.
-.TP
-.BI "package/question=" VALUE
-All debian installed packages could be preseeded from command-line that way, beware of blanks spaces, they will interfere with parsing, use a preseed file in this case.
-
-.SH FILES
-.B /etc/live.conf
-some variables can be configured via this config file.
-
-.SH BUGS
-.B casper
-works fully on amd64, i386 and ppc, it should also run on other archs.
-
-.SH HOMEPAGE
-Debian Live project <http://live.debian.net/>
-
-.SH SEE ALSO
-.BR live-snapshot(1), initramfs-tools(8), make-live(8), make-live.conf(5)
-
-.SH AUTHOR
-casper was written by Tollen Fog Heen <tfheen@canonical.com>, Matt Zimmerman <mdz@canonical.com>, and Marco Amadori <marco.amadori@gmail.com>.
-.TP
-This manual page was written by Marco Amadori <marco.amadori@gmail.com>,
-for the Debian project (but may be used by others).
diff --git a/manpages/live-initramfs.en.7 b/manpages/live-initramfs.en.7
new file mode 100644
index 0000000..03a1e7e
--- /dev/null
+++ b/manpages/live-initramfs.en.7
@@ -0,0 +1,95 @@
+.TH LIVE\-INITRAMFS 7 "2007\-05\-14" "1.81.3" "live\-initramfs"
+
+.SH NAME
+live\-initramfs \- Debian Live initramfs generator
+
+.SH SYNOPSIS
+.B BOOT=live
+as kernel parameter at boot prompt.
+
+.SH DESCRIPTION
+live\-initramfs is a hook for the initramfs\-tools, used to generate a initramfs capable to boot live systems, such as those created by \fIlive\-helper\fR(7). This includes the Debian Live isos, netboot tarballs, and usb stick images.
+.PP
+At boot time it will look for a (read\-only) media containing a "/live" directory where a root filesystems (often a compressed filesystem image like squashfs) is stored. If found, it will create a writable environment, using unionfs, for Debian like systems to boot from.
+.PP
+live\-initramfs is a fork of casper <\fIhttp://packages.ubuntu.com/casper/\fR>. casper was originally written by Tollef Fog Heen <\fItfheen@canonical.com\fR> and Matt Zimmerman <\fImdz@canonical.com\fR>.
+
+.SH BOOT OPTIONS
+Here is the complete list of recognized boot parameters by live\-initramfs.
+.IP "\fBaccess=\fR\fIACCESS\fR" 4
+Set the accessibility level for physically or visually impared users. ACCESS must be one of v1, v2, v3, m1, or m2. v1=lesser visual impairment, v2=moderate visual impairment, v3=blindness, m1=minor motor difficulties, m2=moderate motor difficulties.
+.IP "\fBconsole=\fR\fITTY\fR,\fISPEED\fR" 4
+Set the default console to be used with the "live\-getty" option. Example: "console=ttyS0,115200"
+.IP "\fBhostname=\fR\fIHOSTNAME\fR, \fBusername=\fR\fIUSERFULLNAME\fR, \fBusername=\fR\fIUSERNAME\fR"4
+Those parameters lets you override values read from the config file.
+.IP "\fBintegrity\-check\fR" 4
+If specified, an MD5 sum is calculated on the live media during boot and compared to the value found in md5sum.txt found in the root directory of the live media.
+.IP "\fBip=\fR\fIIFACE,ADDRESS,NETMASK,GATEWAY [:IFACE,ADDRESS,NETMASK,GATEWAY]\fR*" 4
+Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify this if you want to use dhcp (default). It will be changed in a future release to mimick official kernel boot param specification.
+.IP "\fBip\fR[=frommedia]" 4
+If this variable is set, dhcp and static configuration are just skipped and the system will use the (must be) media\-preconfigured /etc/network/interfaces instead.
+.IP "\fB{keyb|kbd\-chooser/method}=\fR\fIKEYBOARD\fR, \fB{klayout|console\-setup/layoutcode}=\fR\fILAYOUT\fR, \fB{kvariant|console\-setup/variantcode}=\fR\fIVARIANT\fR, \fB{kmodel|console\-setup/modelcode}=\fR\fICODE\fR, \fBkoptions=\fR\fIOPTIONS\fR" 4
+Configure the running keyboard as specified, if this one misses live\-initramfs behaves as if "keyb=us" was specified. It will be interfered from "locale=" if locale is only 2 lowecase letters as a special case. You could also specify console layout, variant, code, and options (no defaults).
+.IP "\fBlive\-getty\fR" 4
+This changes the auto\-login on virtual terminals to use the (experimental) live\-getty code. With this option set the standard kernel argument "console=" is parsed and if a serial console is specified then live\-getty is used to autologin on the serial console.
+.IP "\fB{live\-media|bootfrom}=\fR\fIDEVICE\fR" 4
+If you specify one of this two equivalent forms, live\-initramfs will first try to find this device for the "/live" directory where the read\-only root filesystem should reside. If it did not find something usable, the normal scan for block devices is performed.
+.IP "\fB{live\-media\-encryption|encryption}=\fR\fITYPE\fR" 4
+live\-initramfs will mount the encrypted rootfs TYPE, asking the passphrase, useful to build paranoid live systems :\-). TYPE supported so far are "aes" for loop\-aes encryption type.
+.IP "\fBlive\-media\-offset=\fR\fIBYTES\fR" 4
+This way you could tell live\-initramfs that your image starts at offset BYTES in the above specified or autodiscovered device, this could be useful to hide the Debian Live iso or image inside another iso or image, to create "clean" images.
+.IP "\fBlive\-media\-timeout=\fR\fISECONDS\fR" 4
+Set the timeout in seconds for the device specified by "live\-media=" to become ready before giving up.
+.IP "\fBlocale=\fR\fILOCALE\fR | \fBdebian\-installer/locale=\fR\fILOCALE\fR" 4
+Configure the running locale as specified, if not present the live\-media rootfs configured locale will be used and if also this one misses live\-initramfs behave as "locale=en_US.UTF\-8" was specified. If only 2 lowercase letter are specified (like "it"), the "maybe wanted" locale is generated (like ien:EN.UTF\-8), in this case if also "keyb=" is unspecified is set with those 2 lowercase letters (keyb=us). Beside that facility, only UTF8 locales are supported by live\-initramfs.
+.IP "\fBmodule=\fR\fINAME\fR" 4
+Instead of using the default optional file "order.lst" (see below) another file could be specified without the extension ".lst"; it should be placed on "/live" directory of the live medium.
+.IP "\fBnetboot\fR[=nfs|cifs]" 4
+This tells live\-initramfs to perform a network mount. The parameter "nfsroot=" (with optional "nfsopts="), should specify where is the location of the root filesystem. With no args, will try cifs first, and if it fails nfs.
+.IP "\fBpersistent\fR" 4
+live\-initramfs will look for persistent and snapshot partitions or files labeled "live\-rw", "home\-rw", and files called "live\-sn*", "home\-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latter in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at \fIlive\-snapshot\fR(1) for more informations.
+.IP "\fBnopersistent\fR" 4
+disables the above mentioned "persistent" feature, useful if the bootloader (like syslinux) has been installed with persistent enabled.
+.IP "\fBquickreboot\fR" 4
+This option causes live\-initramfs to reboot without attempting to eject the media and without asking the user to remove the boot media.
+.IP "\fBshowmounts\fR" 4
+This parameter will make live\-initramfs to show on "/" the ro filesystems (mostly compressed) on "/live". This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation.
+.IP "\fBswapoff\fR" 4
+This parameter disables usage of local swap partitions.
+.IP "\fBtodisk=\fR\fIDEVICE" 4
+Adding this parameter, live\-initramfs will try to copy the entire read\-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live\-media=DEVICE" boot parameter with the same DEVICE used this time.
+.IP "\fBtoram\fR" 4
+Adding this parameter, live\-initramfs will try to copy the whole read\-only media to the computer's RAM before mounting the root filesystem. This could need a lot of ram, according to the space used by the read\-only media.
+.IP "\fB{preseed/file|file}=\fR\fIFILE\fR" 4
+A path to a file present on the rootfs could be used to preseed debconf database.
+.IP "\fBpackage/question=\fR\fIVALUE\fR" 4
+All debian installed packages could be preseeded from command\-line that way, beware of blanks spaces, they will interfere with parsing, use a preseed file in this case.
+.IP "\fBxdebconf\fR" 4
+uses xdebconfigurator, if present on the rootfs, to configure X instead of the standard procedure (experimental).
+.IP "\fBxvideomode=\fR\fIRESOLUTION\fR" 4
+doesn't do xorg autodetection, but enforces a given resolution.
+
+.SH FILES
+.B /etc/live.conf
+some variables can be configured via this config file (inside the live system).
+.TP
+.B /live/order.lst
+This optional file (inside the live media) contains a list of white\-space or carriage\-return\-separated file names corresponding to disk images in the "/live" directory. If this file exists, only images listed here will be merged into the root unionfs, and they will be loaded in the order listed here. The first entry in this file will be the "lowest" point in the unionfs, and the last file in this list will be on the "top" of the unionfs, directly below /cow. Without this file, any images in the "/live" directory are loaded in alphanumeric order.
+
+.SH SEE ALSO
+\fIlive\-snapshot\fR(1)
+.PP
+\fIlive\-helper\fR(7)
+.PP
+\fIinitramfs\-tools\fR(8)
+
+.SH BUGS
+Report bugs against live\-initramfs <\fIhttp://packages.qa.debian.org/live\-initramfs/\fR>.
+
+.SH HOMEPAGE
+More information about the Debian Live project can be found at <\fIhttp://debian\-live.alioth.debian.org/\fR> and <\fIhttp://wiki.debian.org/DebianLive/\fR>.
+
+.SH AUTHORS
+live\-initramfs is maintained by Daniel Baumann <\fIdaniel@debian.org\fR> and Marco Amadori <\fImarco.amadori@gmail.com\fR> for the Debian project.
+.PP
+live\-initramfs is a fork of casper <\fIhttp://packages.ubuntu.com/casper/\fR>. casper was originally written by Tollef Fog Heen <\fItfheen@canonical.com\fR> and Matt Zimmerman <\fImdz@canonical.com\fR>.
diff --git a/manpages/live-snapshot.1 b/manpages/live-snapshot.1
deleted file mode 100644
index 8f27412..0000000
--- a/manpages/live-snapshot.1
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH "CASPER-SNAPSHOT" 1 "Thu, 28 Sep 2006" "0.0.1" "User commands"
-
-.SH NAME
-casper-snapshot \- a simple script to ease persistence usage.
-
-.SH SYNOPSIS
-.B casper-snapshot
-.RB [\| \-c \||\| \-\-cow
-.IR DIRECTORY \|]
-.RB [\| \-d \||\| \-\-device
-.IR DEVICE \|]
-.RB [\| \-e \||\| \-\-exclude\-list
-.IR FILE \|]
-.RB [\| \-o \||\| \-\-output
-.IR FILE \|]
-.RB [\| \-t \||\| \-\-type
-.IR TYPE \|]
-.PP
-.B casper-snapshot
-.RB \-r \||\| \-\-resync\-string
-.IR STRING
-.br
-.B casper-snapshot
-.RB \-h \||\| \-\-help
-.br
-.B casper-snapshot
-.RB \-u \||\| \-\-usage
-.br
-.B casper-snapshot
-.RB \-v \||\| \-\-version
-
-.SH DESCRIPTION
-Casper-snapshot is a script which can be used to build the right types of persistent image files supported by casper. It is also used on exit by the casper init script to resync the boot-found snapshots devices.
-
-.SH OPTIONS
-.TP
-.BI "\-c, \-\-cow" DIRECTORY
-specifies the input directory to be cloned in the image file.
-Its default value "/cow" should be right for most uses. However it could be handy to specify "/home" and type ext2 for the type to prepare an image file suited to be directly mounted by casper as home.
-.TP
-.BI "\-d, \-\-device" DEVICE
-sets the device where the media which the snapshot/persistence file/partition will be put. If it is not specified, a tmpfs will be used and linked to the user's desktop to move it where it is needed. If the device has no filesystem, an ext2 fs will be automatically created and labelled according to the values specified after the "--output" value or with a sane default.
-.TP
-.BI "\-e, \-\-exclude\-list" FILE
-a file containing a list of filenames/paths that should not be saved. This exclude list will be remebered on the target snapshot media for reuse.
-.TP
-.BI "\-o, \-\-output" FILE
-the filename/label used for the output file/partition. If left blank, casper-snapshot will search for a proper file on the device or use the whole partition.
-.TP
-.BI "\-r, \-\-resync\-string" STRING
-internally used on resyncs.
-.TP
-.BI "\-t, \-\-type" TYPE
-Type could be one of "cpio", "squashfs" or "ext2".
-
-.SH BUGS
-.B casper-snapshot
-Time (and BTS) will tell.
-
-.SH HOMEPAGE
-Debian Live project <http://live.debian.net/>
-
-.SH SEE ALSO
-.BR casper(7)
-
-.SH AUTHOR
-casper-snapshot was written Marco Amadori <marco.amadori@gmail.com>.
-.TP
-This manual page was written by Marco Amadori <marco.amadori@gmail.com>,
-for the Debian project (but may be used by others).
diff --git a/manpages/live-snapshot.en.1 b/manpages/live-snapshot.en.1
new file mode 100644
index 0000000..e7995db
--- /dev/null
+++ b/manpages/live-snapshot.en.1
@@ -0,0 +1,71 @@
+.TH LIVE\-SNAPSHOT 1 "2007\-05\-14" "1.81.3" "live\-initramfs"
+
+.SH NAME
+live\-snapshot \- a simple script to ease persistence usage
+
+.SH SYNOPSIS
+.B live\-snapshot
+.RB [\| \-c \||\| \-\-cow
+.IR DIRECTORY ]
+.RB [\| \-d \||\| \-\-device
+.IR DEVICE \|]
+.RB [\| \-e \||\| \-\-exclude\-list
+.IR FILE \|]
+.RB [\| \-o \||\| \-\-output
+.IR FILE \|]
+.RB [\| \-t \||\| \-\-type
+.IR TYPE \|]
+.PP
+.B live\-snapshot
+.RB [\| \-r \||\| \-\-resync\-string
+.IR STRING \|]
+.PP
+.B live\-snapshot
+.RB [\| \-h \||\| \-\-help \|]
+.br
+.B live\-snapshot
+.RB [\| \-u \||\| \-\-usage \|]
+.br
+.B live-snapshot
+.RB [\| \-v \||\| \-\-version \|]
+
+.SH DESCRIPTION
+live\-snapshot is a script which can be used to build the right types of persistent image files supported by \fIlive\-initramfs\fR(7). It is also used on exit by the live\-initramfs init script to resync the boot-found snapshots devices.
+
+.SH OPTIONS
+.IP "\fB\-c, \-\-cow\fR \fIDIRECTORY\fR" 4
+specifies the input directory to be cloned in the image file.
+Its default value "/cow" should be right for most uses. However it could be handy to specify "/home" and type ext2 for the type to prepare an image file suited to be directly mounted by live-initramfs as home.
+.IP "\fB\-d, \-\-device\fR \fIDEVICE\fR" 4
+sets the device where the media which the snapshot/persistence file/partition will be put. If it is not specified, a tmpfs will be used and linked to the user's desktop to move it where it is needed. If the device has no filesystem, an ext2 fs will be automatically created and labelled according to the values specified after the "--output" value or with a sane default.
+.IP "\fB\-e, \-\-exclude\-list\fR \fIFILE\fR" 4
+a file containing a list of filenames/paths that should not be saved. This exclude list will be remebered on the target snapshot media for reuse.
+.IP "\fB\-o, \-\-output\fR \fIFILE\fR" 4
+the filename/label used for the output file/partition. If left blank, live-snapshot will search for a proper file on the device or use the whole partition.
+.IP "\fB\-r, \-\-resync\-string\fR \fISTRING\fR" 4
+internally used on resyncs.
+.IP "\fB\-t, \-\-type\fR \fITYPE\fR" 4
+Type could be one of "cpio", "squashfs" or "ext2".
+.PP
+.IP "\fB\-h, \-\-help\fR" 4
+display help and exit
+.IP "\fB\-u, \-\-usage\fR" 4
+show usage and exit
+.IP "\fB\-v, \-\-version\fR" 4
+output version information and exit
+
+.SH SEE ALSO
+\fIlive\-initramfs\fR(8)
+.PP
+This program is a part of live\-initramfs.
+
+.SH BUGS
+Report bugs against live\-initramfs <\fIhttp://packages.qa.debian.org/live\-initramfs/\fR>.
+
+.SH HOMEPAGE
+More information about the Debian Live project can be found at <\fIhttp://debian\-live.alioth.debian.org/\fR> and <\fIhttp://wiki.debian.org/DebianLive/\fR>.
+
+.SH AUTHORS
+live\-initramfs is maintained by Daniel Baumann <\fIdaniel@debian.org\fR> and Marco Amadori <\fImarco.amadori@gmail.com\fR> for the Debian project.
+.PP
+live\-initramfs is a fork of casper <\fIhttp://packages.ubuntu.com/casper/\fR>. casper was originally written by Tollef Fog Heen <\fItfheen@canonical.com\fR> and Matt Zimmerman <\fImdz@canonical.com\fR>.
diff --git a/scripts/live b/scripts/live
index 9ab1ac5..04243d7 100755
--- a/scripts/live
+++ b/scripts/live
@@ -7,17 +7,22 @@ export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin
echo "/root/lib" >> /etc/ld.so.conf
echo "/root/usr/lib" >> /etc/ld.so.conf
-mountpoint=/cdrom
+mountpoint=/live_media
+
+root_persistence="live-rw"
+home_persistence="home-rw"
+root_snapshot_label="live-sn"
+home_snapshot_label="home-sn"
USERNAME=user
-USERFULLNAME="Live session user"
-HOST=live
+USERFULLNAME="Live user"
+HOSTNAME=host
BUILD_SYSTEM=Custom
mkdir -p $mountpoint
[ -f /etc/live.conf ] && . /etc/live.conf
-export USERNAME USERFULLNAME HOST BUILD_SYSTEM
+export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
. /scripts/live-helpers
@@ -25,7 +30,103 @@ if [ ! -f /live.vars ]; then
touch /live.vars
fi
-is_casper_path() {
+parse_cmdline ()
+{
+ PRESEEDS=
+ # looking for live-initramfs specifics options as kernel parameters
+ for x in $(cat /proc/cmdline); do
+ case $x in
+ userfullname=*)
+ export USERFULLNAME=${x#userfullname=}
+ export LIVECONF="changed"
+ ;;
+ hostname=*)
+ export HOSTNAME=${x#hostname=}
+ export LIVECONF="changed"
+ ;;
+ username=*)
+ export USERNAME=${x#username=}
+ export LIVECONF="changed"
+ ;;
+ netboot*)
+ export NETBOOT=${x#netboot=} ;;
+ access=*)
+ export ACCESS=${x#access=} ;;
+ xdebconf)
+ export XDEBCONF="Yes" ;;
+ xvideomode=*)
+ export XVIDEOMODE="${x#xvideomode=}" ;;
+ toram)
+ export TORAM="Yes" ;;
+ todisk=*)
+ export TODISK=${x#todisk=} ;;
+ swapoff)
+ export SWAPOFF="Yes" ;;
+ showmounts)
+ export SHOWMOUNTS="Yes" ;;
+ persistent)
+ export PERSISTENT="Yes" ;;
+ nopersistent)
+ export PERSISTENT="" ;;
+ ip*)
+ STATICIP=${x#ip=}
+ if [ "${STATICIP}" == "" ]; then
+ STATICIP="frommedia"
+ fi
+ export STATICIP ;;
+ live-getty)
+ export LIVE_GETTY=1 ;;
+ bootfrom=*|live-media=*)
+ export LIVE_MEDIA=${x#*=} ;;
+ live-media-encryption=*|encryption=*)
+ export LIVE_MEDIA_ENCRYPTION=${x#*=} ;;
+ live-media-timeout=*)
+ export LIVE_MEDIA_TIMEOUT=${x#live-media-timeout=} ;;
+ live-media-offset=*)
+ export LIVE_MEDIA_OFFSET=${x#live-media-offset=} ;;
+ locale=*|debian-installer/locale=*)
+ export LOCALE=${x#*=} ;;
+ keyb=*|kbd-chooser/method=*)
+ export KBD=${x#*=} ;;
+ klayout=*|console-setup/layoutcode=*)
+ export KLAYOUT=${x#*=} ;;
+ koptions=*)
+ export KOPTIONS=${x#koptions=} ;;
+ kvariant=*|console-setup/variantcode=*)
+ export KVARIANT=${x#*=} ;;
+ kmodel=*|console-setup/modelcode=*)
+ export KMODEL=${x#*=} ;;
+ module=*)
+ export MODULE=${x#module=} ;;
+ preseed/file=*|file=*)
+ export LOCATION="${x#*=}" ;;
+ */*=*)
+ question="${x%%=*}"
+ value="${x#*=}"
+ PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
+ ;;
+ console=*)
+ export DEFCONSOLE="${x#*=}" ;;
+ esac
+ done
+
+ # sort of compatibility with netboot.h from linux docs
+ if [ -z "${NETBOOT}" ]; then
+ if [ "${ROOT}" == "/dev/nfs" ]; then
+ NETBOOT="nfs"
+ export NETBOOT
+ elif [ "${ROOT}" == "/dev/cifs" ]; then
+ NETBOOT="cifs"
+ export NETBOOT
+ fi
+ fi
+
+ if [ -z "${MODULE}" ]; then
+ MODULE=order
+ fi
+}
+
+is_live_path() {
path=$1
if [ -d "$path/live" ]; then
if [ "$(echo $path/live/*.squashfs)" != "$path/live/*.squashfs" ] ||
@@ -40,7 +141,7 @@ is_casper_path() {
get_backing_device() {
case "$1" in
*.squashfs|*.ext2)
- echo $(setup_loop "$1" "loop" "/sys/block/loop*")
+ echo $(setup_loop "$1" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
;;
*.dir)
echo "directory"
@@ -243,7 +344,7 @@ do_snap_copy ()
try_snap ()
{
# Look for $snap_label.* in block devices and copy the contents to $snap_mount
- # and remember the device and filename for resync on exit in casper.init
+ # and remember the device and filename for resync on exit in live-initramfs.init
snap_label="${1}"
snap_mount="${2}"
@@ -320,24 +421,40 @@ setup_unionfs() {
roopt="ro"
fi
- mkdir -p "${croot}"
- for image_type in "ext2" "squashfs" "dir" ; do
- for image in "${image_directory}"/*."${image_type}"; do
- imagename=$(basename "${image}")
- if [ -d "${image}" ]; then
- # it is a plain directory: do nothing
- rofsstring="${image}=${roopt}:${rofsstring}"
- rofslist="${image} ${rofslist}"
- elif [ -f "${image}" ]; then
- backdev=$(get_backing_device "$image")
- fstype=$(get_fstype "${backdev}")
- if [ "${fstype}" = "unknown" ]; then
- panic "Unknown file system type on ${backdev} (${image})"
- fi
- mkdir -p "${croot}/${imagename}"
- mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
- fi
+ # Read image names from ${MODULE}.lst if it exists
+ if [ -e "${image_directory}/${MODULE}.lst" ]; then
+ for image in $(cat "${image_directory}/${MODULE}.lst"); do
+ image_string="${image_string} ${image_directory}/${image}";
+ done
+ else
+ # If ${MODULE}.lst does not exist, create a list of images
+ for image_type in "ext2" "squashfs" "dir"; do
+ for image in "${image_directory}"/*."${image_type}"; do
+ if [ -e "${image}" ]; then
+ image_string="${image_string} ${image}";
+ fi
+ done
done
+ # Now sort the list
+ image_string=$(echo ${image_string} | sed -e 's/ /\n/g' | sort )
+ fi
+
+ mkdir -p "${croot}"
+ for image in ${image_string}; do
+ imagename=$(basename "${image}")
+ if [ -d "${image}" ]; then
+ # it is a plain directory: do nothing
+ rofsstring="${image}=${roopt}:${rofsstring}"
+ rofslist="${image} ${rofslist}"
+ elif [ -f "${image}" ]; then
+ backdev=$(get_backing_device "$image")
+ fstype=$(get_fstype "${backdev}")
+ if [ "${fstype}" = "unknown" ]; then
+ panic "Unknown file system type on ${backdev} (${image})"
+ fi
+ mkdir -p "${croot}/${imagename}"
+ mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ fi
done
rofsstring=${rofsstring%:}
@@ -386,17 +503,11 @@ setup_unionfs() {
;;
esac
done
- # shows cow fs on /cow for use by live-snapshot
- mkdir -p "${rootmnt}/cow"
- mount -o bind /cow "${rootmnt}/cow"
fi
- # move the first mount; no head in busybox-initramfs
- for d in $(mount -t squashfs | cut -d\ -f 3); do
- mkdir -p "${rootmnt}/rofs"
- mount -o move "${d}" "${rootmnt}/rofs"
- break
- done
+ # shows cow fs on /cow for use by live-snapshot
+ mkdir -p "${rootmnt}/cow"
+ mount -o bind /cow "${rootmnt}/cow"
}
check_dev ()
@@ -407,15 +518,15 @@ check_dev ()
devname=$(sys2dev "${sysdev}")
fi
- if [ -n "${LIVEMEDIA_OFFSET}" ]; then
- loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVEMEDIA_OFFSET}")
- devname="${loopdevname}"
+ if [ -n "${LIVE_MEDIA_OFFSET}" ]; then
+ loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVE_MEDIA_OFFSET}" '')
+ devname="${loopdevname}"
fi
fstype=$(get_fstype "${devname}")
if is_supported_fs ${fstype}; then
mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
- if is_casper_path $mountpoint; then
+ if is_live_path $mountpoint; then
echo $mountpoint
return 0
else
@@ -423,7 +534,7 @@ check_dev ()
fi
fi
- if [ -n "${LIVEMEDIA_OFFSET}" ]; then
+ if [ -n "${LIVE_MEDIA_OFFSET}" ]; then
losetup -d "${loopdevname}"
fi
return 1
@@ -432,14 +543,14 @@ check_dev ()
find_livefs() {
timeout="${1}"
# first look at the one specified in the command line
- if [ ! -z "${LIVEMEDIA}" ]; then
- if check_dev "null" "${LIVEMEDIA}"; then
+ if [ ! -z "${LIVE_MEDIA}" ]; then
+ if check_dev "null" "${LIVE_MEDIA}"; then
return 0
fi
fi
# don't start autodetection before timeout has expired
- if [ -n "${LIVEMEDIA_TIMEOUT}" ]; then
- if [ "${timeout}" -lt "${LIVEMEDIA_TIMEOUT}" ]; then
+ if [ -n "${LIVE_MEDIA_TIMEOUT}" ]; then
+ if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]; then
return 1
fi
fi
@@ -462,7 +573,7 @@ find_livefs() {
"${fstype}" = "ext2" ]; then
# This is an ugly hack situation, the block device has
# an image directly on it. It's hopefully
- # casper, so take it and run with it.
+ # live-initramfs, so take it and run with it.
ln -s "${devname}" "${devname}.${fstype}"
echo "${devname}.${fstype}"
return 0
@@ -489,6 +600,8 @@ mountroot() {
exec > live.log
exec 2>&1
+ parse_cmdline
+
set_usplash_timeout
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
pulsate
@@ -508,9 +621,9 @@ mountroot() {
fi
else
# Scan local devices for the image
- for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
livefs_root=$(find_livefs $i)
- if [ "${livefs_root}" ]; then
+ if [ -n "${livefs_root}" ]; then
break
fi
sleep 1
diff --git a/scripts/live-bottom/01integrity_check b/scripts/live-bottom/01integrity_check
index d5bc5fe..46a5790 100755
--- a/scripts/live-bottom/01integrity_check
+++ b/scripts/live-bottom/01integrity_check
@@ -15,4 +15,4 @@ prereqs)
;;
esac
-grep integrity-check /proc/cmdline && live-md5check /cdrom /cdrom/md5sum.txt < /dev/tty8
+grep integrity-check /proc/cmdline && live-md5check /live_media /live_media/md5sum.txt < /dev/tty8
diff --git a/scripts/live-bottom/02etc_live_conf b/scripts/live-bottom/02etc_live_conf
new file mode 100755
index 0000000..f0bbd96
--- /dev/null
+++ b/scripts/live-bottom/02etc_live_conf
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Copying config on real root fs..."
+
+. /scripts/live-functions
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if [ -f /etc/live.conf ] ; then
+ if [ ! -z "${LIVECONF}" ]; then
+ # Updating live.conf
+ sed -i -e 's/\(USERNAME="\).*"/\1'"${USERNAME}"'"/g' \
+ -e 's/\(USERFULLNAME="\).*"/\1'"${USERFULLNAME}"'"/g' \
+ -e 's/\(HOSTNAME="\).*"/\1'"${HOSTNAME}"'"/g' /etc/live.conf
+ fi
+ cp -p /etc/live.conf /root/etc/live.conf
+
+else
+ cat <<EOF >/root/etc/live.conf
+export USERNAME="$USERNAME"
+export USERFULLNAME="$USERFULLNAME"
+export HOSTNAME="$HOSTNAME"
+EOF
+
+fi
diff --git a/scripts/live-bottom/05mountpoints b/scripts/live-bottom/05mountpoints
index 411660d..36c2972 100755
--- a/scripts/live-bottom/05mountpoints
+++ b/scripts/live-bottom/05mountpoints
@@ -21,7 +21,9 @@ esac
log_begin_msg "$DESCRIPTION"
# Move to the new root filesystem so that programs there can get at it.
-mkdir -p /root/cdrom
-mount -n -o move /cdrom /root/cdrom
+if [ ! -d /root/live_media ]; then
+ mkdir -p /root/live_media
+ mount -n -o move /live_media /root/live_media
+fi
log_end_msg
diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser
index 9179f1b..394f007 100755
--- a/scripts/live-bottom/10adduser
+++ b/scripts/live-bottom/10adduser
@@ -20,16 +20,28 @@ esac
log_begin_msg "$DESCRIPTION"
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
+else
+ user_crypted="U6aMy0wojraho" # "ubuntu"
+fi
+
# U6aMy0wojraho is just a blank password
chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
set passwd/root-password-crypted *
-set passwd/user-password-crypted U6aMy0wojraho
-set passwd/user-fullname $USERFULLNAME
+set passwd/user-password-crypted ${user_crypted}
+set passwd/user-fullname $USERFULLNAME
set passwd/username $USERNAME
set passwd/user-uid 999
EOF
-chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ chroot /root /usr/bin/env -i HOME="/root" \
+ TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
+ /usr/lib/user-setup/user-setup-apply > /dev/null
+else
+ chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
+fi
# Clear out debconf database again to avoid confusing ubiquity later.
chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
@@ -41,22 +53,42 @@ set passwd/user-uid
EOF
if [ -f /root/etc/sudoers ]; then
- if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
+ if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
+
+ # XXX - awful hack to stop xscreensaver locking the screen (#7150)
+ echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
+
+ for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
+ if [ -f "/root/$file" ]; then
+ chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
+ break
+ fi
+ done
elif [ "${BUILD_SYSTEM}" = "Debian" ]; then
- echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
- fi
-fi
+ echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
+
+ chroot /root sudo -u "${USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${USERNAME}/.su-to-rootrc"
+
+ chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
+ chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
-# XXX - awful hack to stop xscreensaver locking the screen (#7150)
-echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
+chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/config && cat > /home/${USERNAME}/.kde/share/config/kdesurc" << EOF
+[super-user-command]
+super-user-command=sudo
+EOF
+
+ if [ -f /root/usr/share/apps/konsole/sumc.desktop ]
+ then
+ chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop"
+ fi
-for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
- if [ -f "/root/$file" ]; then
- chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
- break
+ if [ -f /root/usr/share/apps/konsole/su.desktop ]
+ then
+ chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop"
+ fi
fi
-done
+fi
if [ -L /root/home/$USERNAME/Examples ]; then
chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap
index fcef76c..9d762f4 100755
--- a/scripts/live-bottom/13swap
+++ b/scripts/live-bottom/13swap
@@ -21,6 +21,11 @@ esac
log_begin_msg "$DESCRIPTION"
+if [ -n "${SWAPOFF}" ]
+then
+ exit 0
+fi
+
devices=""
for device in /dev/[hs]d[a-z][0-9]*; do
if ! [ -b "$device" ]; then
@@ -28,7 +33,7 @@ for device in /dev/[hs]d[a-z][0-9]*; do
fi
magic=$(/bin/dd if="$device" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
-
+
if [ "$magic" = "SWAPSPACE2" -o "$magic" = "SWAP-SPACE" ]; then
# log "Found $device"
devices="$devices $device"
diff --git a/scripts/live-bottom/14locales b/scripts/live-bottom/14locales
index a03e0d1..2102569 100755
--- a/scripts/live-bottom/14locales
+++ b/scripts/live-bottom/14locales
@@ -33,19 +33,10 @@ else
grep_file=/root/etc/default/locale
fi
-# commandline
-for x in $(cat /proc/cmdline); do
- case $x in
- debian-installer/locale=*)
- locale=${x#debian-installer/locale=}
- set_locale="true"
- ;;
- locale=*)
- locale=${x#locale=}
- set_locale="true"
- ;;
- esac
-done
+if [ -n "${LOCALE}" ]; then
+ locale="${LOCALE}"
+ set_locale="true"
+fi
if [ -z "${locale}" ]; then
# Set a default one
@@ -54,10 +45,34 @@ if [ -z "${locale}" ]; then
fi
if [ "${set_locale}" ]; then
+ if echo "${locale}" | grep -sqE '^[[:lower:]]{2}$' ; then
+ # input is like "locale=it", so we will convert and setup also the keyboard if not already set
+ if [ -z "${KBD}" ]; then
+ # FIXME: look if this keyb is supported
+ KBD="${locale}"
+ really_export KBD
+ fi
+ uploc=$(echo "${locale}" | tr '[a-z]' '[A-Z]')
+ locale="${locale}_${uploc}.UTF-8"
+ fi
LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
- printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}"
- printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen
- chroot /root /usr/sbin/locale-gen "${LANG}"
+ if [ -z "${LANG}" ]; then
+ log_warning_message "Locale ${locale} is unsupported."
+ locale="en_US.UTF-8"
+ LANG="${locale}"
+ fi
+
+ really_export LANG
+
+ if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ printf 'LANG="%s"\n' "${LANG}" > "${grep_file}"
+ chroot /root /usr/sbin/locale-gen "${LANG}"
+ live-preseed /root debian-installer/locale "${locale}"
+ else
+ printf 'LANG=%s\n' "${LANG}" > "${grep_file}"
+ printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen
+ chroot /root /usr/sbin/locale-gen
+ fi
fi
log_end_msg
diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin
index 4b64dc7..6032437 100755
--- a/scripts/live-bottom/15autologin
+++ b/scripts/live-bottom/15autologin
@@ -27,6 +27,11 @@ else
fi
if chroot /root [ -f ${GDMCONF} ]; then
+ if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ # true hack ! -- nohar
+ chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
+ fi
+
# Configure GDM autologin
chroot /root sed -i \
-e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
diff --git a/scripts/live-bottom/18hostname b/scripts/live-bottom/18hostname
index 591e4ec..3a54e87 100755
--- a/scripts/live-bottom/18hostname
+++ b/scripts/live-bottom/18hostname
@@ -20,10 +20,10 @@ esac
log_begin_msg "$DESCRIPTION"
-echo "$HOST" > /root/etc/hostname
+echo "$HOSTNAME" > /root/etc/hostname
cat > /root/etc/hosts <<EOF
127.0.0.1 localhost
-127.0.1.1 $HOST
+127.0.1.1 $HOSTNAME
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
diff --git a/scripts/live-bottom/19keyboard b/scripts/live-bottom/19keyboard
index d43e329..31cdfaa 100755
--- a/scripts/live-bottom/19keyboard
+++ b/scripts/live-bottom/19keyboard
@@ -20,27 +20,29 @@ esac
log_begin_msg "$DESCRIPTION"
-kbd=us
+kbd=
cslayout=
csvariant=
csmodel=
-for x in $(cat /proc/cmdline); do
- case $x in
- kbd-chooser/method=*)
- kbd=${x#kbd-chooser/method=}
- ;;
- console-setup/layoutcode=*)
- cslayout=${x#console-setup/layoutcode=}
- ;;
- console-setup/variantcode=*)
- csvariant=${x#console-setup/variantcode=}
- ;;
- console-setup/modelcode=*)
- csmodel=${x#console-setup/modelcode=}
- ;;
- esac
-done
+# commandline
+if [ -n "${KBD}" ]; then
+ kbd="${KBD}"
+else
+ kbd=us
+fi
+
+really_export kbd
+
+if [ -n "${KLAYOUT}" ]; then
+ cslayout="${KLAYOUT}"
+fi
+if [ -n "${KVARIANT}" ]; then
+ csvariant="${KVARIANT}"
+fi
+if [ -n "${KMODEL}" ]; then
+ csmodel="${KMODEL}"
+fi
if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then
if [ "$cslayout" ]; then
@@ -66,5 +68,6 @@ if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then
else
chroot /root /usr/sbin/install-keymap $kbd
live-preseed /root debian-installer/keymap "$kbd"
+ live-preseed /root kbd-chooser/method "$kbd"
fi
log_end_msg
diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig
index 93c8722..a662333 100755
--- a/scripts/live-bottom/20xconfig
+++ b/scripts/live-bottom/20xconfig
@@ -28,17 +28,6 @@ fi
locale=en_US.UTF-8
-for x in $(cat /proc/cmdline); do
- case $x in
- debian-installer/locale=*)
- locale=${x#debian-installer/locale=}
- ;;
- locale=*)
- locale=${x#locale=}
- ;;
- esac
-done
-
mount -n -o bind /sys /root/sys
mount -n -o bind /proc /root/proc
mount -n -o bind /dev /root/dev
@@ -48,12 +37,32 @@ if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]; then
chroot /root /usr/sbin/xdebconfigurator
fi
-chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
+if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
set xserver-xorg/autodetect_keyboard true
fset xserver-xorg/autodetect_keyboard seen true
EOF
+else
+ # d-i code not present, so:
+ if [ -n "${KOPTIONS}" ]; then
+ setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
+ fi
+ if [ -n "${KVARIANT}" ]; then
+ setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
+ fi
+ if [ -n "${KMODEL}" ]; then
+ setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
+ fi
+
+ chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
+set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}
+${setvariant}
+${setmodel}
+${setoptions}
+EOF
+fi
-DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q) live-reconfigure /root xserver-xorg
+DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
umount /root/sys
umount /root/proc
umount /root/dev
diff --git a/scripts/live-bottom/21xvidemode b/scripts/live-bottom/21xvidemode
new file mode 100755
index 0000000..27d943e
--- /dev/null
+++ b/scripts/live-bottom/21xvidemode
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring X kludges..."
+
+. /scripts/live-functions
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if [ -n "$XVIDEOMODE" ]
+then
+ mount -n -o bind /sys /root/sys
+ mount -n -o bind /proc /root/proc
+ mount -n -o bind /dev /root/dev
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set xserver-xorg/config/monitor/mode-list ${XVIDEOMODE}
+set xserver-xorg/config/display/modes ${XVIDEOMODE}
+EOF
+
+ chroot /root dexconf
+
+ umount /root/sys
+ umount /root/proc
+ umount /root/dev
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking
index 988206e..ad7ac95 100755
--- a/scripts/live-bottom/23networking
+++ b/scripts/live-bottom/23networking
@@ -85,7 +85,7 @@ EOF
fi
cat > /root/etc/resolv.conf <<EOF
# /etc/resolv.conf
-# Autogenerated by casper
+# Autogenerated by live-initramfs
search ${rc_search}
domain ${rc_search}
${rc_server0}
@@ -95,13 +95,13 @@ EOF
fi
fi
-for i in eth0 eth1 eth2 ath0 wlan0; do
- grep -q "iface $i" $IFFILE && continue
- cat >> "$IFFILE" <<EOF
-auto $i
-iface $i inet dhcp
-
-EOF
-done
+#for i in eth0 eth1 eth2 ath0 wlan0; do
+# grep -q "iface $i" $IFFILE && continue
+# cat >> "$IFFILE" <<EOF
+#auto $i
+#iface $i inet dhcp
+#
+#EOF
+#done
log_end_msg
diff --git a/scripts/live-bottom/24preseed b/scripts/live-bottom/24preseed
index cd530ea..d71b441 100755
--- a/scripts/live-bottom/24preseed
+++ b/scripts/live-bottom/24preseed
@@ -20,29 +20,16 @@ esac
log_begin_msg "$DESCRIPTION"
-location=
-for x in $(cat /proc/cmdline); do
- case $x in
- preseed/file=*)
- location="${x#preseed/file=}"
- ;;
- file=*)
- location="${x#file=}"
- ;;
- */*=*)
- question="${x%%=*}"
- value="${x#*=}"
- live-preseed /root "$question" "$value"
- ;;
- locale=*)
- value="${x#*=}"
- live-preseed /root debian-installer/locale "$value"
- ;;
- esac
-done
-
-if [ "$location" ]; then
- chroot /root debconf-set-selections < "/root$location"
+if [ -f "/root/${LOCATION}" ]; then
+ chroot /root debconf-set-selections < "/root/${LOCATION}"
+fi
+
+if [ -n "${PRESEEDS}" ]; then
+ for preseed in ${PRESEEDS}; do
+ question="${preseed%%=*}"
+ value="${preseed#*=}"
+ live-preseed /root "${question}" "${value}"
+ done
fi
log_end_msg
diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init
index 1274990..b3f6ebf 100755
--- a/scripts/live-bottom/25configure_init
+++ b/scripts/live-bottom/25configure_init
@@ -23,14 +23,42 @@ log_begin_msg "$DESCRIPTION"
# Arrange for shells on virtual consoles, rather than login prompts
if [ -n "$USERNAME" ]; then
- if [ -f /root/etc/inittab ]; then
- sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
- fi
- if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]; then
- for f in /root/etc/event.d/tty*; do
- sed -i -e "s|^exec.*|exec /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
- done
- fi
+ if [ ! -z "${LIVE_GETTY}" ]; then
+ if echo "${DEFCONSOLE}" | grep -qs ttyS; then
+ # AUTOMATIC SERIAL CONSOLE #
+ PORT=$(echo "${DEFCONSOLE}" | \
+ sed -e 's%,.*%%')
+ SPEED=$(echo "${DEFCONSOLE}" | \
+ sed -e 's%ttyS[0-9]\+,%%' \
+ -e's%\([0-9]\+\).*%\1%')
+ if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) ; then
+ IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9"
+ for ID1 in $IDs; do
+ for ID2 in $IDs; do
+ ID="${ID1}${ID2}"
+ if ! grep "^${ID}:" /etc/inittab ; then
+ #make sure it is not already in use
+ break 2
+ fi
+ done
+ done
+ echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" \
+ >>/root/etc/inittab
+ fi
+ fi
+ if [ -f /root/etc/inittab ]; then
+ sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/live-getty%' /root/etc/inittab
+ fi
+ else
+ if [ -f /root/etc/inittab ]; then
+ sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
+ fi
+ if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]; then
+ for f in /root/etc/event.d/tty*; do
+ sed -i -e "s|^respawn.*|respawn /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
+ done
+ fi
+ fi
fi
# This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility
index 127c48f..d8286e6 100755
--- a/scripts/live-bottom/30accessibility
+++ b/scripts/live-bottom/30accessibility
@@ -34,8 +34,7 @@ kderc_addtoprefixes() {
fi
}
-for x in $(cat /proc/cmdline); do
- case $x in
+case ${ACCESS} in
# Lesser Visual Impairment
access=v1)
gct -s -t string /desktop/gnome/interface/gtk_theme HighContrastLargePrint
@@ -85,7 +84,7 @@ for x in $(cat /proc/cmdline); do
kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/
if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]; then
sed -i 's/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
- fi
+ fi
;;
# Motor Difficulties - pointing devices
access=m2)
@@ -99,8 +98,7 @@ for x in $(cat /proc/cmdline); do
kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/
if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]; then
sed -i '/Sticky/ s/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
- fi
+ fi
;;
- esac
-done
+esac
log_end_msg
diff --git a/scripts/live-bottom/40install_driver_updates b/scripts/live-bottom/40install_driver_updates
index 5822f8f..698ed02 100755
--- a/scripts/live-bottom/40install_driver_updates
+++ b/scripts/live-bottom/40install_driver_updates
@@ -30,7 +30,7 @@ mkdir "/root$install_dir"
cp -a /tmp/driver-updates/*.deb "/root$install_dir/"
# We cannot leave packages in a bad state. So if the install fails, remove
-# it. This will get caught in casper.log.
+# it. This will get caught in live.log.
for deb in "/root$install_dir"/*; do
if ! chroot /root dpkg -i "$install_dir/$deb"; then
chroot /root dpkg -P "${deb%%_*}"
diff --git a/scripts/live-functions b/scripts/live-functions
index 60721b4..7100603 100644
--- a/scripts/live-functions
+++ b/scripts/live-functions
@@ -1,5 +1,6 @@
. /scripts/functions
+. /live.vars
# Override this so we don't call PROGRESS
log_end_msg()
@@ -19,3 +20,16 @@ log_wait_msg()
fi
_log_msg "Waiting: $@ ..."
}
+
+really_export ()
+{
+ STRING="${1}"
+ VALUE="$(eval echo -n \${$STRING})"
+
+ if [ -f /live.vars ] && cat /live.vars | grep -sq "export ${STRING}" ; then
+ sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /live.vars
+ else
+ echo "export ${STRING}=\"${VALUE}\"" >> /live.vars
+ fi
+ eval export "${STRING}"="${VALUE}"
+}
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 8402d93..eac2175 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -1,4 +1,4 @@
-## Casper helper functions, used by casper on boot and by casper-snapshot
+## live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot
if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
MP_QUIET="-Q"
@@ -108,11 +108,20 @@ fs_size ()
echo "${size}"
}
+load_keymap()
+{
+ # Load custom keymap
+ if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
+ loadkeys /etc/boottime.kmap.gz
+ fi
+}
+
setup_loop() {
local fspath=$1
local module=$2
local pattern=$3
local offset=$4
+ local encryption=$5
modprobe ${MP_QUIET} -b "$module"
udevsettle
@@ -120,10 +129,35 @@ setup_loop() {
for loopdev in $pattern; do
if [ "$(cat $loopdev/size)" -eq 0 ]; then
dev=$(sys2dev "${loopdev}")
- if [ -n "$offset" ]; then
- losetup -o "$offset" "$dev" "$fspath"
+ options=''
+ if [ 0 -lt "${offset}" ]; then
+ options="${options} -o ${offset}"
+ fi
+ if [ -z "${encryption}" ]; then
+ losetup ${options} "${dev}" "${fspath}"
else
- losetup "$dev" "$fspath"
+ # Loop AES encryption
+ while true; do
+ load_keymap
+ echo -n "Enter passphrase for ${fspath}: " >&6
+ read -s passphrase
+ echo "${passphrase}" > /tmp/passphrase
+ exec 9</tmp/passphrase
+ /sbin/losetup ${options} -e "${encryption}" -p 9 "${dev}" "${fspath}"
+ error=$?
+ exec 9<&-
+ rm -f /tmp/passphrase
+ if [ 0 -eq ${error} ]; then
+ unset error
+ break
+ fi
+ echo -n "Something went wrong... Retry? [YES/no] " >&6
+ read answer
+ if [ 'no' = "${answer}" ]; then
+ unset answer
+ break
+ fi
+ done
fi
echo "$dev"
return 0