Sync with Debian 1.154.4-1; some config/script updates v1.154.4-1grml.01
authorMichael Prokop <mika@grml.org>
Thu, 8 Jan 2009 19:07:25 +0000 (20:07 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 8 Jan 2009 19:07:25 +0000 (20:07 +0100)
debian/changelog
debian/control
debian/rules
docs/AUTHORS
docs/ChangeLog.casper
grml/23networking [new file with mode: 0755]
grml/live.conf
scripts/live
scripts/live-bottom/19keyboard
scripts/live-bottom/21xdriver
scripts/live-bottom/21xvidemode

index 89afa3a..78b2462 100644 (file)
@@ -1,3 +1,34 @@
+live-initramfs (1.154.4-1grml.01) unstable; urgency=low
+
+  * Disable several configuration options in /etc/live.conf as we don't
+    install most of the scripts at all.
+  * Install /usr/share/initramfs-tools/scripts/live-bottom/23networking
+    which hopefully addresses the /etc/resolv.conf issue when booting via
+    network.
+  * Update VCS-headers in debian/control so they point to grml's repository.
+  * Sync with Debian 1.154.4-1:
+    [ Rene Mayrhofer ]
+    * Support further checks on loopback image and support skipping union
+      mounts (Closes: #509446).
+    [ Daniel Baumann ]
+    * Updating authors file.
+    [ Marco Amadori ]
+    * Reworked integrity-check (Closes: #507477).
+    * Cleaned the boot log a bit.
+    [ Daniel Baumann ]
+    * Sourcing live.vars in 21xdriver and 21xvidemode in order to be able
+      to set variables in previous bottom scripts.
+    * Merging casper 1.140-1.154.
+    * Add a warning message when no image can be found.
+    * Adding a panic message when we netboot and have no supported network
+      device (Closes: #496684).
+    * Turning 'no supported filesystem images found' into a panic message,
+      rather than a warning.
+    * Also adding ralink to network device check.
+    * Removing spurious 'livefs_root' in copy_live_to();.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 08 Jan 2009 19:06:31 +0100
+
 live-initramfs (1.139.1-4grml.03) unstable; urgency=low
 
   * Sync with Debian's git repository
index fa7cd46..367cde5 100644 (file)
@@ -6,8 +6,8 @@ Build-Depends: debhelper (>= 5), dpatch
 Build-Depends-Indep: asciidoc, docbook-xsl, xsltproc
 Standards-Version: 3.8.0
 Homepage: http://debian-live.alioth.debian.org/
-Vcs-Browser: http://git.debian.net/?p=live-initramfs.git
-Vcs-Git: git://git.debian.net/git/live-initramfs.git
+Vcs-Browser: http://git.grml.org/?p=live-initramfs-grml.git
+Vcs-Git: git://git.grml.org/live-initramfs-grml.git
 XS-Upstream-Depends: git-core
 
 Package: live-initramfs
@@ -29,3 +29,7 @@ Description: Debian Live initramfs hook
  although it will do no harm.
  .
  live-initramfs is a fork of casper <http://packages.ubuntu.com/casper/>.
+ .
+ Please notice that this package is maintained by the grml.org team.
+ This is NOT a fork of Debian's live-initramfs, it's just a customized
+ version to better fit grml's needs.
index 82e9fbf..7770018 100755 (executable)
@@ -39,7 +39,7 @@ unpatch:
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
        dh_installdirs
 
        # Installing package
@@ -56,6 +56,8 @@ install: build
          ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/05mountpoints
        install -m 755 grml/08persistence_excludes \
          ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/08persistence_excludes
+       install -m 755 grml/23networking \
+         ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/23networking
 
        # Removing double files
        rm -f debian/live-initramfs/usr/share/doc/live-initramfs/COPYING
index 57494a6..79bc320 100644 (file)
@@ -5,6 +5,7 @@ Main Authors:
 Main Contributors:
 
   * Chris Lamb <chris@chris-lamb.co.uk>
+  * Marco Amadori <marco.amadori@gmail.com>
 
 Original Authors:
 
index 97d667c..d366027 100644 (file)
@@ -1,3 +1,17 @@
+casper (1.154) jaunty; urgency=low
+
+  [ Evan Dandrea ]
+  * scripts/casper-bottom/02timezone:
+    - Remove as it's no longer needed and resets the timezone when
+      persistence is enabled (LP: #296855).
+
+  [ Colin Watson ]
+  * Preseed console-setup/optionscode and console-setup/codesetcode to the
+    empty string on boot to avoid debris from the live filesystem build
+    process getting in the way of installation (LP: #94177).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun, 23 Nov 2008 12:44:45 +0000
+
 casper (1.153) jaunty; urgency=low
 
   * scripts/casper-bottom/10adduser:
diff --git a/grml/23networking b/grml/23networking
new file mode 100755 (executable)
index 0000000..6a66996
--- /dev/null
@@ -0,0 +1,157 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NONETWORKING}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Preconfiguring networking"
+
+# live-initramfs script
+
+IFFILE="/root/etc/network/interfaces"
+
+if [ "${STATICIP}" = "frommedia" -a -e  "${IFFILE}" ]
+then
+       # will use existent /etc/network/interfaces
+       log_end_msg
+       exit 0
+fi
+
+cat > "${IFFILE}" << EOF
+auto lo
+iface lo inet loopback
+
+EOF
+
+if [ -x /sbin/udevadm ]
+then
+       # lenny
+       udevadm trigger
+       udevadm settle
+else
+       # etch
+       udevtrigger
+       udevsettle
+fi
+
+if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
+then
+       parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+
+       for ifline in ${parsed}
+       do
+               ifname="$(echo ${ifline} | cut -f1 -d ',')"
+               ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
+               ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
+               ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
+
+cat >> "${IFFILE}" << EOF
+auto ${ifname}
+iface ${ifname} inet static
+    address ${ifaddress}
+    netmask ${ifnetmask}
+    gateway ${ifgateway}
+
+EOF
+
+       done
+else
+       if [ -z "${NETBOOT}" ]
+       then
+               # default, dhcp assigned
+               method="dhcp"
+       else
+               # make sure that the preconfigured interface would not get reassigned by dhcp
+               # on startup by ifup script - otherwise our root fs might be disconnected!
+               method="manual"
+       fi
+
+       # iterate the physical interfaces and add them to the interfaces list
+       if [ "${method}" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ]
+       then
+               for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
+               do
+                       [ -e ${interface} ] || continue
+                       i="$(basename ${interface})"
+
+cat >> "${IFFILE}" << EOF
+auto ${i}
+iface ${i} inet ${method}
+
+EOF
+
+               done
+       fi
+
+       if [ ! -f /root/etc/resolv.conf ] || [ -z "$(cat /root/etc/resolv.conf)" ]
+       then
+               if [ -f /netboot.config ]
+               then
+                       # create a resolv.conf if it is not present or empty
+                       cp /netboot.config /root/var/log/netboot.config
+
+                       rc_search=$(cat netboot.config | awk '/domain/{print $3}')
+                       rc_server0=$(cat netboot.config | awk '/dns0/{print $5}')
+                       rc_server1=$(cat netboot.config | awk '/dns0/{print $8}')
+                       rc_server0="nameserver ${rc_server0}"
+
+                       if [ "${rc_server1}" = "0.0.0.0" ]
+                       then
+                               rc_server1=""
+                       else
+                               rc_server1="nameserver ${rc_server1}"
+                       fi
+
+cat > /root/etc/resolv.conf << EOF
+# /etc/resolv.conf
+# Autogenerated by live-initramfs
+search ${rc_search}
+domain ${rc_search}
+${rc_server0}
+${rc_server1}
+EOF
+
+                       cat /root/etc/resolv.conf >> /root/var/log/netboot.config
+               fi
+       fi
+fi
+
+#if [ ! -x /root/usr/sbin/NetworkManager ]
+#then
+#      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
+#fi
+
+log_end_msg
index b5055ee..638fb27 100644 (file)
@@ -8,44 +8,36 @@ export USERNAME="grml"
 export USERFULLNAME="grml user"
 export HOSTNAME="grml"
 
-# unionfs or aufs?
-export UNIONTYPE="aufs"
-# we do not want to have a modified /etc/initab:
-export NOAUTOLOGIN="Yes"
-# grml does not require /fastboot:
-export NOFASTBOOT="Yes"
 # disable "mount failed for selinuxfs on /selinux" warning message:
 export SELINUX_INIT="No"
-# do not touch /etc/sudoers:
-export NOSUDO="Yes"
-# do not touch anything inside passwd/shadow/group/gshadow:
-export NOUSER="Yes"
-# do not generate xorg.conf via dexconf - let's use grml-x instead:
-export NOXAUTOCONFIG="Yes"
-# do not modify /etc/fstab:
-export NOFSTAB="Yes"
-# do not modify /etc/hosts:
-export NOHOSTS="Yes"
-# permanently disable persistent feature?
-# export NOPERSISTENT="Yes"
+# unionfs or aufs?
+export UNIONTYPE="aufs"
 
-export NOACCESSIBILITY="Yes"
-export NOAPPARMOR="Yes"
-export NOAPTCDROM="Yes"
-export NOCONSOLEKEYBOARD="Yes"
-export NOGNOMEPANEL="Yes"
-export NOKPERSONALIZER="Yes"
-export NOKWALLET="Yes"
-export NOLANGUAGESELECTOR="Yes"
-export NOLOCALES="Yes"
-export NONETWORKING="Yes"
-export NOPOWERMANAGEMENT="Yes"
-export NOPRESEED="Yes"
-export NOPROGRAMCRASHES="Yes"
-export NORESTRICTEDMANAGER="Yes"
-export NOTIMEZONE="Yes"
-export NOUPDATENOTIFIER="Yes"
-export NOXAUTOLOGIN="Yes"
-export NOXSCREENSAVER="Yes"
+#export NOAUTOLOGIN="Yes"
+#export NOFASTBOOT="Yes"
+#export NOSUDO="Yes"
+#export NOUSER="Yes"
+#export NOXAUTOCONFIG="Yes"
+#export NOFSTAB="Yes"
+#export NOHOSTS="Yes"
+#export NOPERSISTENT="Yes"
+#export NOACCESSIBILITY="Yes"
+#export NOAPPARMOR="Yes"
+#export NOAPTCDROM="Yes"
+#export NOCONSOLEKEYBOARD="Yes"
+#export NOGNOMEPANEL="Yes"
+#export NOKPERSONALIZER="Yes"
+#export NOKWALLET="Yes"
+#export NOLANGUAGESELECTOR="Yes"
+#export NOLOCALES="Yes"
+#export NONETWORKING="Yes"
+#export NOPOWERMANAGEMENT="Yes"
+#export NOPRESEED="Yes"
+#export NOPROGRAMCRASHES="Yes"
+#export NORESTRICTEDMANAGER="Yes"
+#export NOTIMEZONE="Yes"
+#export NOUPDATENOTIFIER="Yes"
+#export NOXAUTOLOGIN="Yes"
+#export NOXSCREENSAVER="Yes"
 
 # EOF
index 389fc21..d06dd20 100755 (executable)
@@ -109,6 +109,11 @@ Arguments ()
                                export IGNORE_UUID
                                ;;
 
+                       integrity-check)
+                               INTEGRITY_CHECK="Yes"
+                               export INTEGRITY_CHECK
+                               ;;
+
                        ip=*)
                                STATICIP="${ARGUMENT#ip=}"
 
@@ -422,6 +427,11 @@ Arguments ()
                                export PLAIN_ROOT
                                ;;
 
+                       skipunion)
+                                SKIP_UNION_MOUNTS="Yes"
+                                export SKIP_UNION_MOUNTS
+                                ;;
+
                        root=*)
                                ROOT="${ARGUMENT#root=}"
                                export ROOT
@@ -1080,6 +1090,12 @@ setup_unionfs ()
        do
                imagename=$(basename "${image}")
 
+               export image devname
+               maybe_break live-realpremount
+               log_begin_msg "Running /scripts/live-realpremount"
+               run_scripts /scripts/live-realpremount
+               log_end_msg
+
                if [ -d "${image}" ]
                then
                        # it is a plain directory: do nothing
@@ -1237,8 +1253,12 @@ setup_unionfs ()
                mount --bind ${exposedrootfs} ${rootmnt} || \
                        panic "bind mount of ${exposedrootfs} failed"
 
-               cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool
-                       /home /var/lib/live'
+               if [ -z "${SKIP_UNION_MOUNTS}" ]
+               then
+                       cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool /home /var/lib/live'
+               else
+                       cow_dirs=''
+               fi
 
                for dir in ${cow_dirs}; do
                        mkdir -p /cow${dir}
@@ -1426,6 +1446,32 @@ set_usplash_timeout ()
        fi ; fi
 }
 
+integrity_check ()
+{
+       media_mountpoint="${1}"
+
+       log_begin_msg "Checking media integrity"
+
+       cd ${media_mountpoint}
+       /bin/md5sum -c md5sum.txt < /dev/tty8 > /dev/tty8
+       RC="${?}"
+
+       log_end_msg
+
+       if [ "${RC}" -eq 0 ]
+       then
+               log_success_msg "Everything ok, will reboot in 10 seconds."
+               sleep 10
+               cd /
+               umount ${media_mountpoint}
+               sync
+               echo u > /proc/sysrq-trigger
+               echo b > /proc/sysrq-trigger
+       else
+               panic "Not ok, a media defect is likely, switch to VT8 for details."
+       fi
+}
+
 mountroot ()
 {
         if [ -x /scripts/local-top/cryptroot ]; then
@@ -1492,6 +1538,11 @@ mountroot ()
                panic "Unable to find a medium containing a live file system"
        fi
 
+       if [ "${INTEGRITY_CHECK}" ]
+       then
+               integrity_check "${livefs_root}"
+       fi
+
        if [ "${TORAM}" ]
        then
                live_dest="ram"
@@ -1519,7 +1570,7 @@ mountroot ()
        log_end_msg
 
        maybe_break live-bottom
-       log_begin_msg "Running /scripts/live-bottom"
+       log_begin_msg "Running /scripts/live-bottom\n"
 
        run_scripts /scripts/live-bottom
        log_end_msg
index 5f1d9e7..2bf0b1c 100755 (executable)
@@ -89,6 +89,9 @@ then
                live-preseed /root console-setup/modelcode '' false
        fi
 
+       live-preseed /root console-setup/optionscode '' false
+       live-preseed /root console-setup/codesetcode '' false
+
        sed -i 's/CONSOLE_SCREEN=$/CONSOLE_SCREEN=setupcon/; t END; b; : END; n; b END' /root/etc/init.d/usplash
 else
        chroot /root /usr/sbin/install-keymap ${kbd}
index 5232f5f..29ae78e 100755 (executable)
@@ -36,6 +36,8 @@ log_begin_msg "Configuring X video driver"
 
 # live-initramfs script
 
+. /live.vars
+
 if [ -n "$XDRIVER" ]
 then
        mount -o bind /sys /root/sys
index 23eb212..ead3a6c 100755 (executable)
@@ -36,6 +36,8 @@ log_begin_msg "Configuring X video modes"
 
 # live-initramfs script
 
+. /live.vars
+
 if [ -n "$XVIDEOMODE" ]
 then
        mount -o bind /sys /root/sys