From 3ffb848024ced8a2eea2f14d81a7ce51a216f47d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 18 Apr 2010 20:41:53 +0200 Subject: [PATCH] Adding upstream version 1.132.1. --- Makefile | 6 +++- bin/live-snapshot | 46 +++++++++++++++---------- contrib/languagelist | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/CREDITS | 1 + docs/ChangeLog.casper | 31 +++++++++++++++++ hooks/live | 7 ++-- scripts/live | 42 ++++++++++++----------- scripts/live-functions | 2 +- scripts/live-helpers | 54 +++++++++++++++++++---------- 9 files changed, 222 insertions(+), 60 deletions(-) create mode 100644 contrib/languagelist diff --git a/Makefile b/Makefile index c377644..30af16d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ install: test build cp bin/live-getty bin/live-login bin/live-new-uuid bin/live-snapshot $(DESTDIR)/sbin mkdir -p $(DESTDIR)/usr/share/live-initramfs - cp bin/live-preseed bin/live-reconfigure $(DESTDIR)/usr/share/live-initramfs + cp bin/live-preseed bin/live-reconfigure contrib/languagelist $(DESTDIR)/usr/share/live-initramfs mkdir -p $(DESTDIR)/usr/share/initramfs-tools cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools @@ -120,6 +120,10 @@ update: $$FILE; \ done + # Update language list + wget -O "contrib/languagelist" \ + "http://svn.debian.org/viewsvn/*checkout*/d-i/trunk/packages/localechooser/languagelist" + clean: distclean: diff --git a/bin/live-snapshot b/bin/live-snapshot index 12c79b8..dc1fa6d 100755 --- a/bin/live-snapshot +++ b/bin/live-snapshot @@ -2,11 +2,11 @@ # live-snapshot - utility to manage Debian Live systems snapshots # -# This program mount a device (fallback to /tmpfs under /mnt/snapshot -# and save the /live/cow (or a different dir) filesystem in it for reusing +# This program mounts a device (fallback to /tmpfs under $MOUNTP +# and saves the /live/cow (or a different dir) filesystem in it for reuse # in another live-initramfs session. Look at manpage for more info. # -# Copyright (C) 2006 Marco Amadori +# Copyright (C) 2006-2008 Marco Amadori # Copyright (C) 2008 Chris Lamb # # This program is free software; you can redistribute it and/or modify @@ -34,9 +34,12 @@ set -eu export USERNAME USERFULLNAME HOSTNAME PROGRAM="$(basename $0)" -VERSION=0.0.2 -MOUNTP="/mnt/live-snapshot" +# Needs to be available at run and reboot time +SAFE_TMPDIR="/live" + +# Permits multiple runs +MOUNTP="$(mktemp -d -p ${SAFE_TMPDIR} live-snapshot-mnt.XXXXXX)" SNAP_COW="/live/cow" SNAP_DEV="" DEST="${MOUNTP}/live-sn.cpio.gz" @@ -92,13 +95,13 @@ Usage () exit 0 } - Version () { - echo "${PROGRAM}, version ${VERSION}" + echo "${PROGRAM}" echo echo "Copyright (C) 2006 Marco Amadori " + echo "Copyright (C) 2008 Chris Lamb " echo echo "This program is free software; you can redistribute it and/or modify" echo "it under the terms of the GNU General Public License as published by" @@ -194,7 +197,6 @@ Parse_args () esac done - } Defaults () @@ -226,7 +228,6 @@ Defaults () Error "unrecognized resync string" ;; esac - else # Set target file based on image case "${SNAP_TYPE}" in @@ -243,14 +244,14 @@ Defaults () ;; esac fi - } Validate_input () { - case "${SNAP_TYPE}" in + case "${SNAP_TYPE}" in cpio|squashfs|jffs2|ext2|ext3) ;; + *) Error "invalid filesystem type \"${SNAP_TYPE}\"" ;; @@ -276,6 +277,7 @@ Mount_device () # create a temp mount -t tmpfs -o rw tmpfs "${MOUNTP}" ;; + *) if [ -b "${SNAP_DEV}" ] then @@ -289,10 +291,13 @@ Do_snapshot () { case "${SNAP_TYPE}" in squashfs) - echo "./tmp/exclude_list" > /tmp/exclude_list - ( cd "${SNAP_COW}" && find . -name '*.wh.*' >> /tmp/exclude_list ) - mksquashfs "${SNAP_COW}" "${DEST}" -ef /tmp/exclude_list - rm /tmp/exclude_list + EXCLUDE_LIST="$(mktemp -p ${SAFE_TMPDIR} live-snapshot-exclude-list.XXXXXX)" + echo "./${EXCLUDE_LIST}" > "${EXCLUDE_LIST}" + cd "${SNAP_COW}" + find . -name '*.wh.*' >> "${EXCLUDE_LIST}" + cd "${OLDPWD}" + mksquashfs "${SNAP_COW}" "${DEST}" -ef "${EXCLUDE_LIST}" + rm -f "${EXCLUDE_LIST}" ;; cpio) @@ -313,8 +318,13 @@ Do_snapshot () Clean () { - umount "${MOUNTP}" - rmdir "${MOUNTP}" + if echo "${DEST}" | grep -q "${MOUNTP}" + then + echo "${DEST} is present on ${MOUNTP}, therefore no automatic unmounting the latter." > /dev/null 1>&2 + else + umount "${MOUNTP}" + rmdir "${MOUNTP}" + fi } Main () @@ -322,7 +332,7 @@ Main () Parse_args "${@}" Defaults Validate_input - trap 'Clean' EXIT + trap 'Clean' EXIT Mount_device Do_snapshot } diff --git a/contrib/languagelist b/contrib/languagelist new file mode 100644 index 0000000..2d2a4f1 --- /dev/null +++ b/contrib/languagelist @@ -0,0 +1,93 @@ +# +# This is the complete list of languages (locales) to choose from. +# langcode;language (en);language (orig);supported_environments;countrycode;fallbacklocale;langlist;console-data +sq;Albanian;Shqip;2;AL;sq_AL.UTF-8;;kbd=lat0-sun16(utf8) +am;Amharic;አማርኛ;4;ET;am_ET;; +ar;Arabic;عربي;3;EG;ar_EG.UTF-8;;console-setup +eu;Basque;Euskaraz;1;ES;eu_ES.UTF-8;;kbd=lat0-sun16(utf8) +be;Belarusian;Беларуская;2;BY;be_BY.UTF-8;;console-setup +bn;Bengali;বাংলা;4;BD;bn_BD;; +bs;Bosnian;Bosanski;2;BA;bs_BA.UTF-8;;kbd=Lat2-Terminus16(utf8) +bg;Bulgarian;Български;2;BG;bg_BG.UTF-8;;console-setup +# For C locale, set language to 'en' to make sure questions are "translated" +# to English instead of showing codes. +C;C;No localization;0;;C;en; +ca;Catalan;Català;1;ES;ca_ES.UTF-8;;kbd=lat0-sun16(utf8) +# Special case for Chinese as the two flavours share the same ISO 639 code +# Both will trigger countrychooser. Each will be the backup for the other +# one +zh_CN;Chinese (Simplified);中文(简体);3;CN;zh_CN.UTF-8;zh_CN:zh; +zh_TW;Chinese (Traditional);中文(繁體);3;TW;zh_TW.UTF-8;zh_TW:zh; +hr;Croatian;Hrvatski;2;HR;hr_HR.UTF-8;;kbd=lat2-sun16(utf8) +cs;Czech;Čeština;2;CZ;cs_CZ.UTF-8;;kbd=lat2-sun16(utf8) +da;Danish;Dansk;1;DK;da_DK.UTF-8;;kbd=lat0-sun16(utf8) +nl;Dutch;Nederlands;1;NL;nl_NL.UTF-8;;kbd=lat0-sun16(utf8) +dz;Dzongkha;རྫོང་ཁ།;4;BT;dz_BT;; +en;English;English;0;US;en_US.UTF-8;;kbd=lat0-sun16(utf8) +# The Esperanto locale *is* (or will be as of 1/11/2006) eo.UTF-8 +# so no country on purpose. The default country is Antarctica because... +# ...why not..:-) +eo;Esperanto;Esperanto;2;AQ;eo.UTF-8;;console-setup +et;Estonian;Eesti;2;EE;et_EE.UTF-8;;kbd=lat0-sun16(utf8) +fi;Finnish;Suomi;1;FI;fi_FI.UTF-8;;kbd=lat0-sun16(utf8) +fr;French;Français;1;FR;fr_FR.UTF-8;;console-setup +gl;Galician;Galego;1;ES;gl_ES.UTF-8;;kbd=lat0-sun16(utf8) +ka;Georgian;ქართული;4;GE;ka_GE.UTF-8;;console-setup +de;German;Deutsch;1;DE;de_DE.UTF-8;;kbd=lat0-sun16(utf8) +el;Greek;Ελληνικά;2;GR;el_GR.UTF-8;;console-setup +gu;Gujarati;ગુજરાતી;4;IN;gu_IN;; +he;Hebrew;עברית;3;IL;he_IL.UTF-8;;console-setup +hi;Hindi;हिन्दी ;4;IN;hi_IN;; +hu;Hungarian;Magyar;2;HU;hu_HU.UTF-8;;kbd=lat2-sun16(utf8) +#X is;Icelandic;Íslenska;1;IS;is_IS.UTF-8;;kbd=lat9u-16(utf8) +id;Indonesian;Bahasa Indonesia;1;ID;id_ID.UTF-8;;kbd=lat0-sun16(utf8) +#X ga;Irish;Gaeilge;1;IE;ga_IE.UTF-8;;kbd=lat0-sun16(utf8) +it;Italian;Italiano;1;IT;it_IT.UTF-8;;kbd=lat0-sun16(utf8) +ja;Japanese;日本語;3;JP;ja_JP.UTF-8;; +#X kn;Kannada;ಕನ್ನಡ;4;IN;kn_IN;; +#X ks;Kashmiri;कोशुर;4;IN;ks_IN;; +#X kk;Kazakh;Қазақ;2;KZ;kk_KZ.UTF-8;;console-setup +km;Khmer;ខ្មែរ;4;KH;km_KH;; +ko;Korean;한국어;3;KR;ko_KR.UTF-8;; +ku;Kurdish;Kurdî;2;TR;ku_TR.UTF-8;;kbd=Lat15-Terminus16(utf8) +#X lo;Lao;ລາວ;4;LA;lo_LA;;console-setup +lv;Latvian;Latviski;2;LV;lv_LV.UTF-8;;kbd=lat7-14(utf8) +lt;Lithuanian;Lietuviškai;2;LT;lt_LT.UTF-8;;kbd=LatArCyrHeb-16(utf8) +#X mg;Malagasy;Malagasy;1;MG;mg_MG.UTF-8;mg_MG:fr_FR:fr:en;kbd=lat0-sun16(utf8) +#X ms;Malay;Bahasa Malaysia;1;MY;ms_MY.UTF-8;;kbd=lat0-sun16(utf8) +ml;Malayalam;മലയാളഠ;4;IN;ml_IN;; +mr;Marathi;मराठी;4;IN;mr_IN;; +mk;Macedonian;Македонски;2;MK;mk_MK.UTF-8;;console-setup +ne;Nepali;नेपाली ;4;NP;ne_NP;; +# The Sami translation is really incomplete. We however keep Sami on request +# of Skolelinux as a kind of reward to them..:-). They need to be able to +# choose Sami as an option so that the Sami locale is set as default +se_NO;Northern Sami;Sámegillii;1;NO;se_NO.UTF-8;se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en;kbd=lat0-sun(utf8) +nb_NO;Norwegian Bokmaal;Norsk bokmål;1;NO;nb_NO.UTF-8;nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en;kbd=lat0-sun16(utf8) +nn_NO;Norwegian Nynorsk;Norsk nynorsk;1;NO;nn_NO.UTF-8;nn_NO:nn:no_NO:no:nb_NO:nb:da:sv:en;kbd=lat0-sun16(utf8) +#X fa;Persian;فارسی;3;IR;fa_IR;;console-setup +pl;Polish;Polski;2;PL;pl_PL.UTF-8;;kbd=lat2-sun16(utf8) +pt;Portuguese;Português;1;PT;pt_PT.UTF-8;pt:pt_BR:en;kbd=lat0-sun16(utf8) +pt_BR;Portuguese (Brazil);Português do Brasil;1;BR;pt_BR.UTF-8;pt_BR:pt:en;kbd=lat1-16(utf8) +pa;Punjabi (Gurmukhi);ਪੰਜਾਬੀ;4;IN;pa_IN;; +ro;Romanian;Română;2;RO;ro_RO.UTF-8;;kbd=Lat2-Terminus16(utf8) +ru;Russian;Русский;2;RU;ru_RU.UTF-8;;console-setup +#X sa;Sanskrit;संस्कृत;4;IN;sa_IN;; +# Serbian commented for consistency: too incomplete +#X sr;Serbian;Српски;2;CS;sr_YU.UTF-8@cyrillic;;console-setup +sk;Slovak;Slovenčina;2;SK;sk_SK.UTF-8;;kbd=lat2-sun16(utf8) +sl;Slovenian;Slovenščina;2;SI;sl_SI.UTF-8;;kbd=lat2-sun16(utf8) +es;Spanish;Español;1;ES;es_ES.UTF-8;;kbd=lat0-sun16(utf8) +sv;Swedish;Svenska;1;SE;sv_SE.UTF-8;;kbd=lat0-sun16(utf8) +tl;Tagalog;Tagalog;1;PH;tl_PH.UTF-8;;kbd=lat0-sun16(utf8) +ta;Tamil;தமிழ்;4;IN;ta_IN;; +#X te;Telugu;తెలుగు;4;IN;te_IN;; +th;Thai;ภาษาไทย;4;TH;th_TH.UTF-8;;console-setup +tr;Turkish;Türkçe;2;TR;tr_TR.UTF-8;;kbd=Lat15-Terminus16(utf8) +uk;Ukrainian;Українська;2;UA;uk_UA.UTF-8;;console-setup +#X ur;Urdu;اردو;3;PK;ur_PK.UTF-8;;console-setup +#X ca@valencia;Valencian-Catalan;Valencià-Català;1;ES;ca_ES.UTF-8@valencia;;kbd=lat0-sun16(utf8) +vi;Vietnamese;Tiếng Việt;3;VN;vi_VN.UTF-8;;console-setup +#X cy;Welsh;Cymraeg;2;GB;cy_GB.UTF-8;;kbd=iso14.f16(utf8) +wo;Wolof;Wolof;2;SN;wo_SN;wo:fr:en; +#X xh;Xhosa;Xhosa;2;ZA;xh_ZA.UTF-8;;kbd=lat0-sun16(utf8) diff --git a/docs/CREDITS b/docs/CREDITS index 1738f00..495d6eb 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -14,6 +14,7 @@ Patches (alphabetical order): * Malcom Gilles * Marco Amadori * Mathieu Geli + * Michal Suchanek * Oliver Osburg * Otavio Salvador * Sebastian Raveau diff --git a/docs/ChangeLog.casper b/docs/ChangeLog.casper index 6bc93d9..4e17e6c 100644 --- a/docs/ChangeLog.casper +++ b/docs/ChangeLog.casper @@ -1,3 +1,34 @@ +casper (1.132) intrepid; urgency=low + + [ Colin Watson ] + * Switch default unionfs implementation to aufs. + + [ Agostino Russo ] + * Do not scan only vfat volumes when looking for cow devices (LP: #230703) + * Allow casper to use a squashfs filesystem within an arbitrary path (LP: + #230716, #207137) + + -- Evan Dandrea Wed, 28 May 2008 15:01:30 -0400 + +casper (1.131) hardy; urgency=low + + [ Luke Yelavich ] + * scripts/casper-bottom/30accessibility: Set gconf and orca config values as + root in automatic-ubiquity, only-ubiquity, and debug-ubiquity modes. + * ubiquity-hooks/30accessibility: Remove unneeded gconf call to disable esd. + + [ Colin Watson ] + * Ensure that the live CD user's Desktop directory is owned by them, not + by root (LP: #218576). + * Duplicate a chunk of console-setup logic into the keyboard script so + that we can deal with non-Latin keymaps and the like without having to + have gfxboot-theme-ubuntu help us; the previous approach broke other + uses of console-setup, and thus the alternate install CD (LP: #218754). + This should later be replaced by just running console-setup, and I'll + open another bug for this. + + -- Colin Watson Mon, 21 Apr 2008 14:52:05 +0100 + casper (1.130) hardy; urgency=low * Handle use of debian-installer/language for locale selection diff --git a/hooks/live b/hooks/live index 3552f3a..b85f646 100755 --- a/hooks/live +++ b/hooks/live @@ -47,9 +47,12 @@ cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts cp /usr/share/initramfs-tools/scripts/live-helpers "${DESTDIR}"/scripts # klibc dependencies -for hidden_klibc_dep_library in libacl libblkid libuuid libdevmapper libattr +for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr* do - cp -a /lib/${hidden_klibc_dep_library}.so.* "${DESTDIR}"/lib + if [ ! -e "${DESTDIR}"/"${FILE}" ] + then + cp -a "${FILE}" "${DESTDIR}"/"${FILE}" + fi done # Handling other stuff diff --git a/scripts/live b/scripts/live index 240691a..0d84533 100755 --- a/scripts/live +++ b/scripts/live @@ -498,7 +498,7 @@ get_backing_device () { case "${1}" in *.squashfs|*.ext2|*.ext3|*.jffs2) - echo $(setup_loop "${1}" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}") + echo $(setup_loop "${1}" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}" "${2}") ;; *.dir) @@ -556,20 +556,6 @@ is_nice_device () return 1 } -is_supported_fs () -{ - # FIXME: do something better like the scan of supported filesystems - fstype="${1}" - - case ${fstype} in - vfat|iso9660|udf|ext2|ext3|ntfs|jffs2) - return 0 - ;; - esac - - return 1 -} - copy_live_to () { copyfrom="${1}" @@ -629,7 +615,7 @@ copy_live_to () cd "${copyto}" tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})" rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})" - mount -r --move "${copyto}" "${rootmnt}" + mount -r -o move "${copyto}" "${rootmnt}" cd "${OLDPWD}" else if [ -n "${MODULETORAMFILE}" ] @@ -641,7 +627,7 @@ copy_live_to () livefs_root umount ${copyfrom} - mount -r --move ${copyto} ${copyfrom} + mount -r -o move ${copyto} ${copyfrom} fi rmdir ${copyto} @@ -979,7 +965,7 @@ setup_unionfs () rofslist="${image} ${rofslist}" elif [ -f "${image}" ] then - backdev=$(get_backing_device "${image}") + backdev=$(get_backing_device "${image}" "-r") fstype=$(get_fstype "${backdev}") if [ "${fstype}" = "unknown" ] @@ -1136,7 +1122,7 @@ setup_unionfs () ;; *) - mount --move "${d}" "${rootmnt}/live/${d##*/}" + mount -o move "${d}" "${rootmnt}/live/${d##*/}" ;; esac done @@ -1164,6 +1150,19 @@ check_dev () devname="${loopdevname}" fi + if [ -d "${devname}" ] + then + mount -o bind "${devname}" $mountpoint || continue + + if is_live_path $mountpoint + then + echo $mountpoint + return 0 + else + umount $mountpoint + fi + fi + fstype=$(get_fstype "${devname}") if is_supported_fs ${fstype} @@ -1211,7 +1210,7 @@ find_livefs () fi # or do the scan of block devices - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v 'dm-') + for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v 'dm-' | grep -v fd ) do devname=$(sys2dev "${sysblock}") fstype=$(get_fstype "${devname}") @@ -1267,6 +1266,8 @@ mountroot () exec 7>&2 exec > live.log exec 2>&1 + tail -f live.log >&7 & + tailpid="${!}" Arguments @@ -1348,5 +1349,6 @@ mountroot () exec 1>&6 6>&- exec 2>&7 7>&- + kill ${tailpid} cp live.log "${rootmnt}/var/log/" } diff --git a/scripts/live-functions b/scripts/live-functions index b6d04fb..c5055a0 100644 --- a/scripts/live-functions +++ b/scripts/live-functions @@ -34,7 +34,7 @@ lang2locale() { langpart="${1%%_*}" if [ "$1" != "C" ]; then # Match the language code with 3rd field in languagelist - line=$(grep -v "^#" /root/usr/share/localechooser/languagelist | cut -f3,4,5 -d\; | grep -v ';C$' | grep "^$langpart;") + line=$(grep -v "^#" /root/usr/share/live-initramfs/languagelist | cut -f3,4,5 -d\; | grep -v ';C$' | grep "^$langpart;") if [ -n "$line" ]; then if [ "$(echo "$line" | grep -c '')" -gt 1 ]; then # More than one match; try matching the diff --git a/scripts/live-helpers b/scripts/live-helpers index b0ad4b6..02c3e55 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -29,6 +29,20 @@ subdevices () echo ${r} } +is_supported_fs () +{ + # FIXME: do something better like the scan of supported filesystems + fstype="${1}" + + case ${fstype} in + vfat|iso9660|udf|ext2|ext3|ntfs|jffs2) + return 0 + ;; + esac + + return 1 +} + get_fstype () { local FSTYPE @@ -153,6 +167,7 @@ setup_loop () local pattern=${3} local offset=${4} local encryption=${5} + local readonly=${6} modprobe -q -b "${module}" udevsettle @@ -164,6 +179,11 @@ setup_loop () dev=$(sys2dev "${loopdev}") options='' + if [ -n ${readonly} ] + then + options="${options} -r" + fi + if [ 0 -lt "${offset}" ] then options="${options} -o ${offset}" @@ -234,7 +254,7 @@ find_cow_device () pers_label="${1}" cow_backing="/${pers_label}-backing" - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram) + for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) do for dev in $(subdevices "${sysblock}") do @@ -274,31 +294,29 @@ find_files () filenames="${1}" snap_backing="/snap-backing" - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram) + for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd) do for dev in $(subdevices "${sysblock}") do devname=$(sys2dev "${dev}") devfstype="$(get_fstype ${devname})" - case "${devfstype}" in - vfat|ext2|ext3|jffs2) - # FIXME: all supported block devices should be scanned - mkdir -p "${snap_backing}" - try_mount "${devname}" "${snap_backing}" "ro" + if is_supported_fs ${devfstype} + then + mkdir -p "${snap_backing}" + try_mount "${devname}" "${snap_backing}" "ro" - for filename in ${filenames} + for filename in ${filenames} do - if [ -f "${snap_backing}/${filename}" ] - then - echo "${devname} ${snap_backing} ${filename}" - return 0 - fi - done - - umount ${snap_backing} - ;; - esac + if [ -f "${snap_backing}/${filename}" ] + then + echo "${devname} ${snap_backing} ${filename}" + return 0 + fi + done + + umount ${snap_backing} + fi done done } -- 2.1.4