Adding casper 1.61+debian-1.
[live-boot-grml.git] / debian / patches / 01-conglomeration.dpatch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 01-conglomeration.dpatch
3 ##
4 ## DP: Needs to be broken out.
5
6 @DPATCH@
7
8 diff -Naur casper-1.61+debian.orig/bin/casper-reconfigure casper-1.61+debian/bin/casper-reconfigure
9 --- casper-1.61+debian.orig/bin/casper-reconfigure      2006-05-11 19:03:29.000000000 +0000
10 +++ casper-1.61+debian/bin/casper-reconfigure   2006-07-19 17:38:18.000000000 +0000
11 @@ -47,6 +47,6 @@
12      exit 0
13  fi
14  
15 -runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package"
16 +runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package"
17  
18  exit 0
19 diff -Naur casper-1.61+debian.orig/casper.conf casper-1.61+debian/casper.conf
20 --- casper-1.61+debian.orig/casper.conf 2006-05-02 12:16:55.000000000 +0000
21 +++ casper-1.61+debian/casper.conf      2006-07-19 17:38:18.000000000 +0000
22 @@ -3,7 +3,7 @@
23  # Supported variables are:
24  # USERNAME, USERFULLNAME, HOST
25  
26 -export USERNAME="ubuntu"
27 -export USERFULLNAME="Custom LiveCD user"
28 -export HOST="ubuntu"
29 +export USERNAME="debian"
30 +export USERFULLNAME="Debian Live user"
31 +export HOST="debian"
32  
33 diff -Naur casper-1.61+debian.orig/hooks/casper casper-1.61+debian/hooks/casper
34 --- casper-1.61+debian.orig/hooks/casper        2006-06-15 09:04:08.000000000 +0000
35 +++ casper-1.61+debian/hooks/casper     2006-07-19 17:38:18.000000000 +0000
36 @@ -18,10 +18,17 @@
37  
38  . /usr/share/initramfs-tools/hook-functions
39  
40 -# cloop is needed
41 -manual_add_modules cloop
42 +
43  manual_add_modules unionfs
44  
45 +# Needed for devmapper
46 +if [ -e /sbin/dmsetup ]; then
47 +       manual_add_modules cloop
48 +       copy_exec /sbin/blockdev /sbin
49 +       copy_exec /sbin/dmsetup /sbin
50 +       manual_add_modules dm-snapshot
51 +fi
52 +
53  # We need losetup
54  copy_exec /sbin/losetup /sbin
55  
56 @@ -30,16 +37,25 @@
57  copy_exec /usr/share/casper/casper-reconfigure /bin
58  copy_exec /usr/share/casper/casper-preseed /bin
59  
60 -mkdir -p ${DESTDIR}/lib/udev
61 -copy_exec /lib/udev/cdrom_id /lib/udev
62 -copy_exec /lib/udev/vol_id /lib/udev
63 -copy_exec /lib/udev/path_id /lib/udev
64 +# Ubuntu or Debian test
65 +if [ -x /sbin/udevplug ]; then
66 +       mkdir -p ${DESTDIR}/lib/udev
67 +       copy_exec /lib/udev/cdrom_id /lib/udev
68 +       copy_exec /lib/udev/vol_id /lib/udev
69 +       copy_exec /lib/udev/path_id /lib/udev
70 +else
71 +       copy_exec /sbin/udevtrigger /sbin
72 +fi
73 +
74  copy_exec /usr/bin/udevinfo /bin
75  
76 -# Needed for devmapper
77 -copy_exec /sbin/blockdev /sbin
78 -copy_exec /sbin/dmsetup /sbin
79 -manual_add_modules dm-snapshot
80 +# cifs boot 
81 +if [ -x /sbin/mount.cifs ]; then
82 +       copy_exec /sbin/mount.cifs /sbin
83 +       for x in cifs; do
84 +               manual_add_modules ${x}
85 +       done
86 +fi
87  
88  # squashfs
89  manual_add_modules squashfs
90 diff -Naur casper-1.61+debian.orig/scripts/casper casper-1.61+debian/scripts/casper
91 --- casper-1.61+debian.orig/scripts/casper      2006-07-17 10:53:28.000000000 +0000
92 +++ casper-1.61+debian/scripts/casper   2006-07-19 17:38:18.000000000 +0000
93 @@ -4,7 +4,9 @@
94  
95  export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin
96  
97 -mountpoint=/cdrom
98 +mountpoint=/live_media
99 +root_persistence="casper-rw"
100 +home_persistence="home-rw"
101  
102  mkdir -p $mountpoint
103  
104 @@ -13,15 +15,15 @@
105      overlay_method=devmapper
106  fi
107  
108 -USERNAME=ubuntu
109 -USERFULLNAME="Ubuntu LiveCD user"
110 -HOST=ubuntu
111 +USERNAME=debian
112 +USERFULLNAME="Debian Live user"
113 +HOST=debian
114  
115  [ -f /etc/casper.conf ] && . /etc/casper.conf
116  
117  export USERNAME USERFULLNAME HOST
118  
119 -casper_path() {
120 +casper_path() { # Fixme: uglyness
121      path=$1
122      if [ -e "$path/casper/filesystem.cloop" ]; then
123          echo "$path/casper/filesystem.cloop"
124 @@ -29,6 +31,12 @@
125      elif [ -e "$path/casper/filesystem.squashfs" ]; then
126          echo "$path/casper/filesystem.squashfs"
127          return 0
128 +    elif [ -e "$path/casper/filesystem.ext2" ]; then
129 +        echo "$path/casper/filesystem.ext2"
130 +        return 0
131 +    elif [ -e "$path/casper/filesystem.xfs" ]; then
132 +        echo "$path/casper/filesystem.xfs"
133 +        return 0
134      fi
135      return 1
136  }
137 @@ -49,7 +57,7 @@
138              *.cloop)
139                  echo $(setup_loop "$1" "cloop" "/sys/block/cloop*")
140                         ;;
141 -            *.squashfs)
142 +            *.squashfs|*.ext2|*.xfs)
143                  echo $(setup_loop "$1" "loop" "/sys/block/loop*")
144                  ;;
145              *)
146 @@ -78,8 +86,12 @@
147      local module=$2
148      local pattern=$3
149  
150 -    modprobe -Qb "$module"
151 -    udevplug -W
152 +    modprobe -qb "$module"
153 +    if [ -x /sbin/udevplug ]; then
154 +        udevplug -W
155 +    else
156 +        udevtrigger
157 +    fi
158   
159      for loopdev in $pattern; do
160          if [ "$(cat $loopdev/size)" -eq 0 ]; then
161 @@ -107,7 +119,7 @@
162      backdev="$1"
163      rootmnt="$2"
164  
165 -    modprobe -Qb dm-mod
166 +    modprobe -qb dm-mod
167      COW_DEVICE=/dev/ram1
168      COW_NAME="casper-cow"
169  
170 @@ -143,82 +155,137 @@
171      return 1
172  }
173  
174 -find_cow_device() {
175 -    for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop); do
176 -        for dev in $(subdevices "${sysblock}"); do
177 -            devname=$(sys2dev "${dev}")
178 -            if [ "$(/lib/udev/vol_id -l $devname 2>/dev/null)" = "casper-rw" ]; then
179 -                echo "$devname"
180 -                return
181 -            elif [ "$(get_fstype ${devname})" = "vfat" ]; then
182 -                mkdir -p /cow-backing
183 -                if where_is_mounted ${devname} > /dev/null; then
184 -                    mount -o remount,rw ${devname} $(where_is_mounted ${devname}) || panic "Remounting failed"
185 -                    mount -o bind $(where_is_mounted ${devname}) /cow-backing || panic "Cannot bind-mount"
186 -                else
187 -                    mount -t $(get_fstype "${devname}") -o rw "${devname}" /cow-backing || panic "Cannot mount $devname on /cow-backing"
188 -                fi
189 +copy_to_ram() {
190 +       copyto="${mountpoint}_swap"
191  
192 -                if [ -e "/cow-backing/casper-rw" ]; then
193 -                    echo $(setup_loop "/cow-backing/casper-rw" "loop" "/sys/block/loop*")
194 -                    return 0
195 -                else
196 -                    umount /cow-backing
197 -                fi
198 -            fi
199 -            
200 -        done
201 -    done
202 -    return 1    
203 +       size=$(du -ks ${mountpoint} | cut -f1)
204 +       size=$(expr ${size} + ${size}/20 ) # Fixme: 5% more to be sure
205 +       needed_space=$(expr ${size} * 1024)
206 +       freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
207 +       
208 +       if [ ! ${freespace} -lt ${needed_space}  ] ; then
209 +               [ "$quiet" != "y" ] && log_begin_msg "Not enough free memory to copy to ram"
210 +               [ "$quiet" != "y" ] && log_end_msg
211 +               return
212 +       else
213 +               [ "$quiet" != "y" ] && log_begin_msg "Copying live media to ram..."
214 +               mkdir "${copyto}"
215 +               mount -t tmpfs -o size=${size}k /dev/shm ${copyto}
216 +               cp -a ${mountpoint}/* ${copyto}
217 +               umount ${mountpoint}
218 +               mount -r -o move ${copyto} ${mountpoint}
219 +               rmdir ${copyto}
220 +               [ "$quiet" != "y" ] && log_end_msg
221 +       fi
222 +}
223 +
224 +find_cow_device() {
225 +       pers_label="${1}"
226 +       cow_backing="/${pers_label}-backing"
227 +       for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop); do
228 +               for dev in $(subdevices "${sysblock}"); do
229 +                       devname=$(sys2dev "${dev}")
230 +                       if [ "$(/lib/udev/vol_id -l $devname 2>/dev/null)" = "${pers_label}" ]; then
231 +                               echo "$devname"
232 +                               return
233 +                       elif [ "$(get_fstype ${devname})" = "vfat" ]; then
234 +                               mkdir -p "${cow_backing}"
235 +                               if where_is_mounted ${devname} > /dev/null; then
236 +                                       mount -o remount,rw ${devname} $(where_is_mounted ${devname}) || panic "Remounting failed"
237 +                                       mount -o bind $(where_is_mounted ${devname}) ${cow_backing} || panic "Cannot bind-mount"
238 +                               else
239 +                                       mount -t $(get_fstype "${devname}") -o rw "${devname}" ${cow_backing} || panic "Cannot mount $devname on /cow-backing"
240 +                               fi
241 +
242 +                               if [ -e "${cow_backing}/${pers_label}" ]; then
243 +                                       echo $(setup_loop "${cow_backing}/${pers_label}" "loop" "/sys/block/loop*")
244 +                                       return 0
245 +                               else
246 +                                       umount ${cow_backing}
247 +                               fi
248 +                       fi
249 +               done
250 +       done
251 +}
252 +
253 +do_netmount() {
254 +       rofsmnt="$1"
255 +       # adapted from NFS filesystem mounting
256 +
257 +       modprobe -q cifs
258 +       # For DHCP
259 +       modprobe -q af_packet
260 +
261 +       ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf
262 +       if [ "x${NFSROOT}" = "xauto" ]; then
263 +               NFSROOT=${ROOTSERVER}:${ROOTPATH}
264 +       fi
265 +
266 +       NFSOPTS="-ouser=root,password="
267 +
268 +       [ "$quiet" != "y" ] && log_begin_msg "Mounting using mount.cifs with ${NFSROOT} ${rofsmnt} ${NFSOPTS}"
269 +       mount.cifs "${NFSROOT}" "${rofsmnt}" "${NFSOPTS}" 
270 +       [ "$quiet" != "y" ] && log_end_msg
271  }
272  
273  setup_unionfs() {
274         backdev="$1"
275         rootmnt="$2"
276 -        modprobe -Qb unionfs
277 -        mkdir -p /cow
278 +       modprobe -qb unionfs
279 +       mkdir -p /cow
280 +       cowdevice="tmpfs"
281 +       cow_fstype="tmpfs"
282 +       # Looking for "${root_persistence}" device or file
283 +       if grep -q persistent /proc/cmdline; then
284 +               cowprobe=$(find_cow_device "${root_persistence}")
285 +               if [ -b "${cowprobe}" ]; then
286 +                       cowdevice=${cowprobe}
287 +                       cow_fstype=$(get_fstype "${cowprobe}")
288 +               else
289 +                       [ "$quiet" != "y" ] &&  log_begin_msg "Unable to find the persistent medium"
290 +               fi
291 +       fi
292  
293 -        if grep -q persistent /proc/cmdline; then
294 -            i=0
295 -            # We love udev and the kernel!
296 -            while [ "$i" -lt 300 ]; do
297 -                cowdevice=$(find_cow_device) 
298 -                if [ -b "$cowdevice" ]; then
299 -                    mount -t $(get_fstype "$cowdevice") -o rw "$cowdevice" /cow || panic "Can not mount $cowdevice on /cow"
300 -                    break
301 -                fi
302 -                sleep 5
303 -#                sleep 0.1
304 -                i=$(( $i + 1 ))
305 -            done
306 -        else
307 -            mount -t tmpfs tmpfs /cow
308 -        fi
309 +       mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount $cowdevice on /cow"
310  
311         mkdir -p /rofs
312 -    if [ "$(get_fstype $backdev)" = "unknown" ]; then
313 -        panic "Unknown file system type on $backdev"
314 -    fi
315 -       mount -t $(get_fstype "$backdev") -o ro "$backdev" /rofs || panic "Can not mount $backdev on /rofs"
316 -
317 +       if grep -q netboot /proc/cmdline; then
318 +               do_netmount /rofs || panic "Can not mount netroot on /rofs"
319 +       else
320 +               if [ "$(get_fstype $backdev)" = "unknown" ]; then
321 +                       panic "Unknown file system type on $backdev"
322 +               fi
323 +               mount -t $(get_fstype "$backdev") -o ro "$backdev" /rofs || panic "Can not mount $backdev on /rofs"
324 +       fi
325 +       
326         mount -t unionfs -o dirs=/cow=rw:/rofs=ro unionfs "$rootmnt"
327 -        if grep -q show-cow /proc/cmdline; then
328 -            mkdir -p "$rootmnt/cow"
329 -            mount -o bind /cow "$rootmnt/cow"
330 -        fi
331 -        mkdir -p "$rootmnt/rofs"
332 -        mount -o bind /rofs "$rootmnt/rofs"
333 +       if grep -q show-cow /proc/cmdline; then
334 +               mkdir -p "$rootmnt/cow"
335 +               mount -o bind /cow "$rootmnt/cow"
336 +       fi
337 +       mkdir -p "$rootmnt/rofs"
338 +       mount -o bind /rofs "$rootmnt/rofs"
339 +
340 +       # Adding home persitence
341 +       if grep -q homepersistence /proc/cmdline; then
342 +               homecow=$(find_cow_device "${home_persistence}" )
343 +               if [ -b "${homecow}" ]; then
344 +                       mount ${homecow} -t $(get_fstype "${homecow}") -o rw "${rootmnt}/home"
345 +               else 
346 +                       [ "$quiet" != "y" ] &&  log_begin_msg "Unable to find the persistent home medium"
347 +               fi
348 +       fi
349  }
350  
351  is_usb_device() {
352      sysfs_path="${1#/sys}"
353 -    if /lib/udev/path_id "${sysfs_path}" | grep -q "ID_PATH=usb"; then
354 +    if /lib/udev/path_id "${sysfs_path}" | grep -q "ID_PATH=(usb|pci-[^-]*-usb)"; then
355          return 0
356      fi
357      return 1
358  }
359  
360 -find_cd() {
361 +find_live() {
362         mounted=
363          for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram); do
364              devname=$(sys2dev "${sysblock}")
365 @@ -283,18 +350,26 @@
366      set_usplash_timeout
367  
368      for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
369 -        live_image=$(find_cd)
370 +        live_image=$(find_live)
371          if [ "${live_image}" ]; then
372              break
373          fi
374          sleep 1
375      done
376      if [ "$?" -gt 0 ]; then
377 -        panic "Unable to find a CD-ROM containing a live file system"
378 +        panic "Unable to find a medium containing a live file system"
379      fi
380      
381 +       if grep -q toram /proc/cmdline; then
382 +               copy_to_ram
383 +       fi
384 +
385      setup_cow "$overlay_method" "$(get_backing_device $live_image)" "$rootmnt"
386  
387 +       # show it on new rootfs
388 +       mkdir ${rootmnt}/${mountpoint}
389 +       mount -o bind ${mountpoint} ${rootmnt}/${mountpoint}
390 +
391      log_end_msg
392  
393      maybe_break casper-bottom
394 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/01integrity_check casper-1.61+debian/scripts/casper-bottom/01integrity_check
395 --- casper-1.61+debian.orig/scripts/casper-bottom/01integrity_check     2006-04-21 14:08:09.000000000 +0000
396 +++ casper-1.61+debian/scripts/casper-bottom/01integrity_check  2006-07-19 17:38:18.000000000 +0000
397 @@ -15,4 +15,4 @@
398         ;;
399  esac
400  
401 -grep integrity-check /proc/cmdline && casper-md5check /cdrom /cdrom/md5sum.txt < /dev/tty8
402 +grep integrity-check /proc/cmdline && casper-md5check /live_media /live_media/md5sum.txt < /dev/tty8
403 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/10adduser casper-1.61+debian/scripts/casper-bottom/10adduser
404 --- casper-1.61+debian.orig/scripts/casper-bottom/10adduser     2006-05-11 11:35:21.000000000 +0000
405 +++ casper-1.61+debian/scripts/casper-bottom/10adduser  2006-07-19 17:38:18.000000000 +0000
406 @@ -28,7 +28,9 @@
407  set passwd/user-uid 999
408  EOF
409  
410 -chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
411 +chroot /root /usr/bin/env -i HOME="/root" \
412 +       TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
413 +       /usr/lib/user-setup/user-setup-apply > /dev/null
414  
415  # Clear out debconf database again to avoid confusing ubiquity later.
416  chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
417 @@ -40,18 +42,21 @@
418  EOF
419  
420  if [ -f /root/etc/sudoers ]; then
421 -    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
422 -fi
423 -
424 -# XXX - awful hack to stop xscreensaver locking the screen (#7150)
425 -echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
426 -
427 -for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
428 -    if [ -f "/root/$file" ]; then
429 -        chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
430 -        break
431 +       if [ -x /sbin/udevplug ]; then 
432 +               # FIXME: ugly hack, admin is not present in debian so we do here ubuntu stuff
433 +               # XXX - awful hack to stop xscreensaver locking the screen (#7150)
434 +               echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
435 +        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
436 +               for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
437 +                   if [ -f "/root/$file" ]; then
438 +                       chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
439 +                       break
440 +               fi
441 +               done
442 +    else # We are in debian :-)
443 +        echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers           
444      fi
445 -done
446 +fi
447  
448  if [ -L /root/home/$USERNAME/Examples ]; then
449      chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
450 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/14locales casper-1.61+debian/scripts/casper-bottom/14locales
451 --- casper-1.61+debian.orig/scripts/casper-bottom/14locales     2006-05-16 10:45:27.000000000 +0000
452 +++ casper-1.61+debian/scripts/casper-bottom/14locales  2006-07-19 17:38:18.000000000 +0000
453 @@ -20,18 +20,33 @@
454  
455  log_begin_msg "$DESCRIPTION"
456  
457 -locale=en_US.UTF-8
458 +if [ -e /root/etc/default/locale ]; then
459 +       grep_file=/root/etc/default/locale
460 +       locale=$(grep 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' ) 
461 +elif [ -e /root/etc/environment ]; then # Old locales policy
462 +       grep_file=/root/etc/environment
463 +fi
464 +
465 +# commandline
466  for x in $(cat /proc/cmdline); do
467 -                case $x in
468 -                        debian-installer/locale=*)
469 -                                locale=${x#debian-installer/locale=}
470 -                                ;;
471 -                esac
472 +       case $x in
473 +               debian-installer/locale=*)
474 +                       locale=${x#debian-installer/locale=}
475 +                       set_locale="true"
476 +                       ;;
477 +       esac
478  done
479  
480 -LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
481 +if [ -z "${locale}" ]; then
482 +       # Set a default one
483 +       locale=en_US.UTF-8
484 +       set_locale="true"
485 +fi
486  
487 -printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment
488 -chroot /root /usr/sbin/locale-gen "${LANG}"
489 +if [ ! -z "${set_locale}" ]; then
490 +       LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
491 +       printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}" 
492 +       chroot /root /usr/sbin/locale-gen "${LANG}"
493 +fi
494  
495  log_end_msg
496 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/15autologin casper-1.61+debian/scripts/casper-bottom/15autologin
497 --- casper-1.61+debian.orig/scripts/casper-bottom/15autologin   2006-05-11 10:06:07.000000000 +0000
498 +++ casper-1.61+debian/scripts/casper-bottom/15autologin        2006-07-19 17:48:50.000000000 +0000
499 @@ -27,6 +27,8 @@
500  fi
501  
502  if chroot /root [ -f ${GDMCONF} ]; then
503 +    # true hack ! -- nohar
504 +    chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
505      # Configure GDM autologin
506      chroot /root sed -i \
507          -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
508 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/22gnome_panel_data casper-1.61+debian/scripts/casper-bottom/22gnome_panel_data
509 --- casper-1.61+debian.orig/scripts/casper-bottom/22gnome_panel_data    2006-05-11 10:05:55.000000000 +0000
510 +++ casper-1.61+debian/scripts/casper-bottom/22gnome_panel_data 2006-07-19 17:38:18.000000000 +0000
511 @@ -20,8 +20,10 @@
512  
513  log_begin_msg "$DESCRIPTION"
514  
515 -if chroot /root /bin/sh -c laptop-detect; then
516 -    casper-reconfigure /root gnome-panel-data
517 +if [ -x /root/usr/sbin/laptop-detect ]; then
518 +       if chroot /root /bin/sh -c /usr/sbin/laptop-detect; then
519 +           casper-reconfigure /root gnome-panel-data
520 +       fi
521  fi
522  
523  panel_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-panel-data 2>/dev/null) || panel_version=""
524 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/23networking casper-1.61+debian/scripts/casper-bottom/23networking
525 --- casper-1.61+debian.orig/scripts/casper-bottom/23networking  2006-05-11 10:05:11.000000000 +0000
526 +++ casper-1.61+debian/scripts/casper-bottom/23networking       2006-07-19 17:38:18.000000000 +0000
527 @@ -27,7 +27,11 @@
528  
529  EOF
530  
531 -udevplug -Bpci -Iclass="0x02*"
532 +if [ -x /sbin/udevplug ]; then
533 +       udevplug -Bpci -Iclass="0x02*"
534 +else
535 +       udevtrigger
536 +fi
537  
538  for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
539      [ -e $interface ] || continue
540 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/25configure_init casper-1.61+debian/scripts/casper-bottom/25configure_init
541 --- casper-1.61+debian.orig/scripts/casper-bottom/25configure_init      2006-06-15 09:08:14.000000000 +0000
542 +++ casper-1.61+debian/scripts/casper-bottom/25configure_init   2006-07-19 17:38:18.000000000 +0000
543 @@ -28,9 +28,11 @@
544  
545  # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
546  # /etc/crontab remaining disabled, yet also not run by anacron
547 -for f in /root/etc/rc?.d/S??anacron; do
548 -    mv ${f} ${f%/*}/K00anacron
549 -done
550 +if [ -x /root/etc/init.d/anacron ]; then
551 +       for f in /root/etc/rc?.d/S??anacron; do
552 +       mv ${f} $(dirname ${f})/K00anacron
553 +       done
554 +fi
555  
556  # No point, really
557  rm -f /root/etc/rc?.d/[SK]??postfix
558 @@ -40,15 +42,8 @@
559  
560  # Disable readahead since it doesn't play well with squashfs + unionfs
561  # use chmod instead of mv to not trigger unionfs bugs.
562 -chmod -x /root/sbin/readahead-list
563 -
564 -# Install shutdown script
565 -cp -a /lib/casper/shutdown /root/etc/init.d/casper-shutdown
566 -if [ -f /root/etc/rc0.d/S90halt ]; then
567 -    ln -s ../init.d/casper-shutdown /root/etc/rc0.d/S89casper
568 -fi
569 -if [ -f /root/etc/rc6.d/S90reboot ]; then
570 -    ln -s ../init.d/casper-shutdown /root/etc/rc6.d/S89casper
571 +if [ -e /root/sbin/readahead-list ]; then
572 +       chmod -x /root/sbin/readahead-list
573  fi
574  
575  log_end_msg
576 diff -Naur casper-1.61+debian.orig/scripts/casper-bottom/33disable_binary_drivers casper-1.61+debian/scripts/casper-bottom/33disable_binary_drivers
577 --- casper-1.61+debian.orig/scripts/casper-bottom/33disable_binary_drivers      2006-05-13 08:13:22.000000000 +0000
578 +++ casper-1.61+debian/scripts/casper-bottom/33disable_binary_drivers   2006-07-19 17:38:18.000000000 +0000
579 @@ -20,4 +20,6 @@
580  
581  log_begin_msg "$DESCRIPTION"
582  
583 -echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common
584 +if [ -e /root/etc/default/linux-restricted-modules-common ]; then
585 +       echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common
586 +fi