diff options
Diffstat (limited to 'scripts')
23 files changed, 140 insertions, 59 deletions
diff --git a/scripts/casper b/scripts/casper index dba4b4a..6f7bbb0 100644 --- a/scripts/casper +++ b/scripts/casper @@ -29,28 +29,28 @@ fi # looking for casper specifics options as kernel parameters for x in $(cat /proc/cmdline); do case $x in - userfullname*) - export USERFULLNAME=${x#userfullname=} - export CASPERCONF="changed" - ;; - host*) - export HOST=${x#host=} - export CASPERCONF="changed" - ;; - username*) - export USERNAME=${x#username=} - export CASPERCONF="changed" - ;; + userfullname*) + export USERFULLNAME=${x#userfullname=} + export CASPERCONF="changed" + ;; + host*) + export HOST=${x#host=} + export CASPERCONF="changed" + ;; + username*) + export USERNAME=${x#username=} + export CASPERCONF="changed" + ;; netboot*) export NETBOOT=${x#netboot=} ;; toram) export TORAM=1 ;; - hide-cow) - export HIDECOW=1 ;; + showmounts) + export SHOWMOUNTS=1 ;; persistent) export PERSISTENT=1 ;; ip*) - STATICIP=${x#ip=} + STATICIP=${x#ip=} if [ "${STATICIP}" == "" ]; then STATICIP="frommedia" fi @@ -228,7 +228,7 @@ copy_to_ram() { size=$(expr ${size} + ${size}/20 ) # Fixme: 5% more to be sure needed_space=$(expr ${size} * 1024) freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - )) - + if [ ! ${freespace} -lt ${needed_space} ] ; then [ "$quiet" != "y" ] && log_begin_msg "Not enough free memory to copy to ram" [ "$quiet" != "y" ] && log_end_msg @@ -288,7 +288,7 @@ do_netmount() { fi [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}" - + if [ "${NETBOOT}" != "nfs" ] && do_cifsmount ; then rc=0 elif do_nfsmount ; then @@ -342,9 +342,12 @@ setup_unionfs() { modprobe "${MP_QUIET}" -b unionfs - # run-init can't deal with this, but we're going to move all of these - # away before it runs anyway. - croot="/casper" + # run-init can't deal with images in a subdir, but we're going to + # move all of these away before it runs anyway. No, we're not, + # put them in / since move-mounting them into / breaks mono and + # some other apps. + + croot="/" # Let's just mount the read-only file systems first rofsstring="" @@ -393,20 +396,9 @@ setup_unionfs() { mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount $cowdevice on /cow" - # Look for a snapshot to copy - - mount -t unionfs -o dirs=/cow=rw:$rofsstring unionfs "$rootmnt" || panic "Unionfs mount failed" - for d in ${rofslist}; do - mkdir -p "${rootmnt}/casper/${d##*/}" - case d in - *.dir) # do nothing # mount -o bind "${d}" "${rootmnt}/casper/${d##*/}" - ;; - *) mount -o move "${d}" "${rootmnt}/casper/${d##*/}" - ;; - esac - done + # Look for a snapshot to copy # Adding other custom mounts if [ ! -z "${PERSISTENT}" ]; then @@ -418,10 +410,21 @@ setup_unionfs() { fi fi - if [ -z "${HIDECOW}" ]; then - mkdir -p "$rootmnt/cow" - mount -o bind /cow "$rootmnt/cow" + if [ ! -z "${SHOWMOUNTS}" ]; then + for d in ${rofslist}; do + mkdir -p "${rootmnt}/casper/${d##*/}" + case d in + *.dir) # do nothing # mount -o bind "${d}" "${rootmnt}/casper/${d##*/}" + ;; + *) mount -o move "${d}" "${rootmnt}/casper/${d##*/}" + ;; + esac + done fi + + # shows cow fs on /cow for use by casper-snapshot + mkdir -p "$rootmnt/cow" + mount -o bind /cow "$rootmnt/cow" } is_usb_device() { @@ -463,11 +466,11 @@ find_livefs() { done elif [ "${fstype}" = "squashfs" || \ "${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. - + ln -s "${devname}" "${devname}.${fstype}" echo "${devname}.${fstype}" return @@ -475,6 +478,12 @@ find_livefs() { done } +pulsate() { + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "PULSATE" + fi +} + set_usplash_timeout() { if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "TIMEOUT 120" @@ -486,9 +495,10 @@ mountroot() { exec 7>&2 exec > casper.log exec 2>&1 - + set_usplash_timeout [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-premount" + pulsate run_scripts /scripts/casper-premount [ "$quiet" != "y" ] && log_end_msg @@ -515,7 +525,7 @@ mountroot() { if [ "$?" -gt 0 ]; then panic "Unable to find a medium containing a live file system" fi - + if [ ! -z "${TORAM}" ]; then copy_to_ram "${livefs_root}" fi @@ -529,6 +539,7 @@ mountroot() { maybe_break casper-bottom [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-bottom" + pulsate run_scripts /scripts/casper-bottom [ "$quiet" != "y" ] && log_end_msg diff --git a/scripts/casper-bottom/05mountpoints b/scripts/casper-bottom/05mountpoints index 20a28fd..be76755 100755 --- a/scripts/casper-bottom/05mountpoints +++ b/scripts/casper-bottom/05mountpoints @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Moving mount points..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/10adduser b/scripts/casper-bottom/10adduser index e85f947..af7754b 100755 --- a/scripts/casper-bottom/10adduser +++ b/scripts/casper-bottom/10adduser @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Adding live session user..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/12fstab b/scripts/casper-bottom/12fstab index 00e5c50..ac39396 100755 --- a/scripts/casper-bottom/12fstab +++ b/scripts/casper-bottom/12fstab @@ -4,7 +4,7 @@ PREREQ="" DESCRIPTION="Configuring fstab..." FSTAB=/root/etc/fstab -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/13swap b/scripts/casper-bottom/13swap index 44d73f3..986b079 100755 --- a/scripts/casper-bottom/13swap +++ b/scripts/casper-bottom/13swap @@ -4,7 +4,7 @@ PREREQ="" DESCRIPTION="Setting up swap..." FSTAB=/root/etc/fstab -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales index f69fa0f..4297a58 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Setting up locales..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/15autologin b/scripts/casper-bottom/15autologin index ff88721..cdaa038 100755 --- a/scripts/casper-bottom/15autologin +++ b/scripts/casper-bottom/15autologin @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Setting up automatic login..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/18hostname b/scripts/casper-bottom/18hostname index 7ac5b00..19ac61f 100755 --- a/scripts/casper-bottom/18hostname +++ b/scripts/casper-bottom/18hostname @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Setting hostname..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/19keyboard b/scripts/casper-bottom/19keyboard index d738faf..1d833ad 100755 --- a/scripts/casper-bottom/19keyboard +++ b/scripts/casper-bottom/19keyboard @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Setting up keyboard..." -. /scripts/functions +. /scripts/casper-functions prereqs() { @@ -39,7 +39,7 @@ for x in $(cat /proc/cmdline); do done if [ "$cslayout" ] && [ -x /root/bin/setupcon ] && \ - [ -f /etc/default/console-setup ]; then + [ -f /root/etc/default/console-setup ]; then chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \ /etc/default/console-setup if [ "$csvariant" ]; then diff --git a/scripts/casper-bottom/20xconfig b/scripts/casper-bottom/20xconfig index b8a4552..3916f41 100755 --- a/scripts/casper-bottom/20xconfig +++ b/scripts/casper-bottom/20xconfig @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring X..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/22gnome_panel_data b/scripts/casper-bottom/22gnome_panel_data index 5509ce1..4dd5d9d 100755 --- a/scripts/casper-bottom/22gnome_panel_data +++ b/scripts/casper-bottom/22gnome_panel_data @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring gnome-panel-data..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/22screensaver b/scripts/casper-bottom/22screensaver index ff3ec81..e5965e8 100755 --- a/scripts/casper-bottom/22screensaver +++ b/scripts/casper-bottom/22screensaver @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring screensaver..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/23etc_modules b/scripts/casper-bottom/23etc_modules index 622d96e..754a832 100755 --- a/scripts/casper-bottom/23etc_modules +++ b/scripts/casper-bottom/23etc_modules @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Preconfiguring /etc/modules..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking index 8f4b698..f410321 100755 --- a/scripts/casper-bottom/23networking +++ b/scripts/casper-bottom/23networking @@ -4,7 +4,7 @@ PREREQ="" DESCRIPTION="Preconfiguring networking..." IFFILE="/root/etc/network/interfaces" -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/24preseed b/scripts/casper-bottom/24preseed index 98a9864..cd52467 100755 --- a/scripts/casper-bottom/24preseed +++ b/scripts/casper-bottom/24preseed @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Loading preseed file..." -. /scripts/functions +. /scripts/casper-functions prereqs () { @@ -26,6 +26,9 @@ for x in $(cat /proc/cmdline); do preseed/file=*) location="${x#preseed/file=}" ;; + file=*) + location="${x#file=}" + ;; */*=*) question="${x%%=*}" value="${x#*=}" diff --git a/scripts/casper-bottom/25configure_init b/scripts/casper-bottom/25configure_init index 84fa741..573b2a6 100755 --- a/scripts/casper-bottom/25configure_init +++ b/scripts/casper-bottom/25configure_init @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Setting up init..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/30accessibility b/scripts/casper-bottom/30accessibility index e8e7e8a..cc64832 100755 --- a/scripts/casper-bottom/30accessibility +++ b/scripts/casper-bottom/30accessibility @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring accessibility options..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/31disable_update_notifier b/scripts/casper-bottom/31disable_update_notifier index 082b818..10b86a2 100755 --- a/scripts/casper-bottom/31disable_update_notifier +++ b/scripts/casper-bottom/31disable_update_notifier @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Disabling update-notifier..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/32disable_hibernation b/scripts/casper-bottom/32disable_hibernation index badcef6..47344fa 100755 --- a/scripts/casper-bottom/32disable_hibernation +++ b/scripts/casper-bottom/32disable_hibernation @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring power management..." -. /scripts/functions +. /scripts/casper-functions prereqs() { diff --git a/scripts/casper-bottom/33disable_binary_drivers b/scripts/casper-bottom/33disable_binary_drivers index 6bc2279..971ce8e 100755 --- a/scripts/casper-bottom/33disable_binary_drivers +++ b/scripts/casper-bottom/33disable_binary_drivers @@ -3,7 +3,7 @@ PREREQ="" DESCRIPTION="Configuring some drivers..." -. /scripts/functions +. /scripts/casper-functions prereqs() { @@ -23,3 +23,5 @@ log_begin_msg "$DESCRIPTION" if [ -e /root/etc/default/linux-restricted-modules-common ]; then echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common fi + +log_end_msg
\ No newline at end of file diff --git a/scripts/casper-bottom/34disable_kwallet b/scripts/casper-bottom/34disable_kwallet new file mode 100755 index 0000000..add7cca --- /dev/null +++ b/scripts/casper-bottom/34disable_kwallet @@ -0,0 +1,25 @@ +#! /bin/sh + +PREREQ="" +DESCRIPTION="Disabling kwallet..." + +. /scripts/casper-functions + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +log_begin_msg "$DESCRIPTION" + +rm -f /root/usr/share/services/kded/kwalletd.desktop + +log_end_msg
\ No newline at end of file diff --git a/scripts/casper-bottom/35fix_language_selector b/scripts/casper-bottom/35fix_language_selector new file mode 100755 index 0000000..96a1d6c --- /dev/null +++ b/scripts/casper-bottom/35fix_language_selector @@ -0,0 +1,28 @@ +#! /bin/sh + +PREREQ="" +DESCRIPTION="Fixing language selector..." + +. /scripts/casper-functions + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +log_begin_msg "$DESCRIPTION" + +if [ -e /root/usr/share/applications/language-selector.desktop ]; then + sed -i '/^Exec/ s|/usr/bin/gnome-language-selector|"& -n"|' /root/usr/share/applications/language-selector.desktop + +fi + +log_end_msg diff --git a/scripts/casper-functions b/scripts/casper-functions new file mode 100644 index 0000000..9e36db7 --- /dev/null +++ b/scripts/casper-functions @@ -0,0 +1,12 @@ + +. /scripts/functions + +# Override this so we don't call PROGRESS +log_end_msg() +{ + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "SUCCESS ok" + fi + _log_msg "Done." +} + |
