Adding live-initramfs 1.87.5-1.
[live-boot-grml.git] / scripts / live
1 #!/bin/sh
2
3 # set -e
4
5 export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin
6
7 echo "/root/lib" >> /etc/ld.so.conf
8 echo "/root/usr/lib" >> /etc/ld.so.conf
9
10 mountpoint=/live_media
11
12 root_persistence="live-rw"
13 home_persistence="home-rw"
14 root_snapshot_label="live-sn"
15 home_snapshot_label="home-sn"
16
17 USERNAME=user
18 USERFULLNAME="Live user"
19 HOSTNAME=host
20 BUILD_SYSTEM=Custom
21
22 mkdir -p $mountpoint
23
24 [ -f /etc/live.conf ] && . /etc/live.conf
25 export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM
26
27 . /scripts/live-helpers
28
29 if [ ! -f /live.vars ]; then
30     touch /live.vars
31 fi
32
33 parse_cmdline ()
34 {
35     PRESEEDS=
36     # looking for live-initramfs specifics options as kernel parameters
37     for x in $(cat /proc/cmdline); do
38         case $x in
39             userfullname=*)
40                 export USERFULLNAME=${x#userfullname=}
41                 export LIVECONF="changed"
42                 ;;
43             hostname=*)
44                 export HOSTNAME=${x#hostname=}
45                 export LIVECONF="changed"
46                 ;;
47             username=*)
48                 export USERNAME=${x#username=}
49                 export LIVECONF="changed"
50                 ;;
51             netboot*)
52                 export NETBOOT=${x#netboot=} ;;
53             access=*)
54                 export ACCESS=${x#access=} ;;
55             xdebconf)
56                 export XDEBCONF="Yes" ;;
57             xvideomode=*)
58                 export XVIDEOMODE="${x#xvideomode=}" ;;
59             toram)
60                 export TORAM="Yes" ;;
61             todisk=*)
62                 export TODISK=${x#todisk=} ;;
63             noswap)
64                 export NOSWAP="Yes" ;;
65             noautologin)
66                 export NOAUTOLOGIN="Yes" ;;
67             noxautologin)
68                 export NOXAUTOLOGIN="Yes" ;;
69             nosudo)
70                 export NOSUDO="Yes" ;;
71             showmounts)
72                 export SHOWMOUNTS="Yes" ;;
73             persistent)
74                 export PERSISTENT="Yes" ;;
75             nopersistent)
76                 export PERSISTENT="" ;;
77             ip*)
78                 STATICIP=${x#ip=}
79                 if [ "${STATICIP}" = "" ]; then
80                     STATICIP="frommedia"
81                 fi
82                 export STATICIP ;;
83             live-getty)
84                 export LIVE_GETTY=1 ;;
85             bootfrom=*|live-media=*)
86                 export LIVE_MEDIA=${x#*=} ;;
87             live-media-encryption=*|encryption=*)
88                 export LIVE_MEDIA_ENCRYPTION=${x#*=} ;;
89             live-media-timeout=*)
90                 export LIVE_MEDIA_TIMEOUT=${x#live-media-timeout=} ;;
91             live-media-offset=*)
92                 export LIVE_MEDIA_OFFSET=${x#live-media-offset=} ;;
93             locale=*|debian-installer/locale=*)
94                 export LOCALE=${x#*=} ;;
95             keyb=*|kbd-chooser/method=*)
96                 export KBD=${x#*=} ;;
97             klayout=*|console-setup/layoutcode=*)
98                 export KLAYOUT=${x#*=} ;;
99             koptions=*)
100                 export KOPTIONS=${x#koptions=} ;;
101             kvariant=*|console-setup/variantcode=*)
102                 export KVARIANT=${x#*=} ;;
103             kmodel=*|console-setup/modelcode=*)
104                 export KMODEL=${x#*=} ;;
105             module=*)
106                 export MODULE=${x#module=} ;;
107             preseed/file=*|file=*)
108                 export LOCATION="${x#*=}" ;;
109             upgrade)
110                 export UPGRADE="Yes" ;;
111             */*=*)
112                 question="${x%%=*}"
113                 value="${x#*=}"
114                 PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
115                 ;;
116             console=*)
117                 export DEFCONSOLE="${x#*=}" ;;
118         esac
119     done
120
121     # sort of compatibility with netboot.h from linux docs
122     if [ -z "${NETBOOT}" ]; then
123         if [ "${ROOT}" = "/dev/nfs" ]; then
124             NETBOOT="nfs"
125             export NETBOOT
126         elif [ "${ROOT}" = "/dev/cifs" ]; then
127             NETBOOT="cifs"
128             export NETBOOT
129         fi
130     fi
131
132     if [ -z "${MODULE}" ]; then
133         MODULE=order
134     fi
135 }
136
137 is_live_path() {
138     path=$1
139     if [ -d "$path/live" ]; then
140         if [ "$(echo $path/live/*.squashfs)" != "$path/live/*.squashfs" ] ||
141             [ "$(echo $path/live/*.ext2)" != "$path/live/*.ext2" ] ||
142             [ "$(echo $path/live/*.ext3)" != "$path/live/*.ext3" ] ||
143             [ "$(echo $path/live/*.dir)" != "$path/live/*.dir" ]; then
144             return 0
145         fi
146     fi
147     return 1
148 }
149
150 get_backing_device() {
151     case "$1" in
152         *.squashfs|*.ext2|*.ext3)
153             echo $(setup_loop "$1" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
154             ;;
155         *.dir)
156             echo "directory"
157             ;;
158         *)
159             panic "Unrecognized live filesystem: $1"
160             ;;
161     esac
162 }
163
164 match_files_in_dir() {
165     # Does any files match pattern $1 ?
166
167     local pattern="$1"
168     if [ "$(echo $pattern)" != "$pattern" ]; then
169         return 0
170     fi
171     return 1
172 }
173
174 mount_images_in_directory() {
175     directory="$1"
176     rootmnt="$2"
177     if match_files_in_dir "$directory/live/*.squashfs" ||
178         match_files_in_dir "$directory/live/*.ext2" ||
179         match_files_in_dir "$directory/live/*.ext3" ||
180         match_files_in_dir "$directory/live/*.dir"; then
181         setup_unionfs "$directory/live" "$rootmnt"
182     else
183         :
184     fi
185 }
186
187 is_nice_device() {
188     sysfs_path="${1#/sys}"
189     if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"; then
190         return 0
191     fi
192     return 1
193 }
194
195 is_supported_fs () {
196     # FIXME: do something better like the scan of supported filesystems
197     fstype="${1}"
198     case ${fstype} in
199         vfat|iso9660|udf|ext2|ext3|ntfs)
200             return 0
201             ;;
202     esac
203     return 1
204 }
205
206 copy_live_to() {
207     copyfrom="${1}"
208     copytodev="${2}"
209     copyto="${copyfrom}_swap"
210
211     size=$(fs_size "" ${copyfrom} "used")
212
213     if [ "${copytodev}" = "ram" ]; then
214         # copying to ram:
215         freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) )
216         mount_options="-o size=${size}k"
217         free_string="memory"
218         fstype="tmpfs"
219         dev="/dev/shm"
220     else
221         # it should be a writable block device
222         if [ -b "${copytodev}" ]; then
223             dev="${copytodev}"
224             free_string="space"
225             fstype=$(get_fstype "${dev}")
226             freespace=$(fs_size "${dev}")
227         else
228             [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device."
229             return 1
230         fi
231     fi
232     if [ "${freespace}" -lt "${size}" ] ; then
233         [ "$quiet" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k > ${size}k) to copy live media in ${copytodev}."
234         return 1
235     fi
236
237     # begin copying..
238     mkdir "${copyto}"
239     echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
240     mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
241     cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
242     umount ${copyfrom}
243     mount -r --move ${copyto} ${copyfrom}
244     rmdir ${copyto}
245     return 0
246 }
247
248 do_netmount() {
249     rc=1
250
251     modprobe "${MP_QUIET}" af_packet # For DHCP
252
253     udevtrigger
254     udevsettle
255
256     ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config
257
258     if [ "${NFSROOT}" = "auto" ]; then
259         NFSROOT=${ROOTSERVER}:${ROOTPATH}
260     fi
261
262     [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
263
264     if [ "${NETBOOT}" != "nfs" ] && do_cifsmount ; then
265         rc=0
266     elif do_nfsmount ; then
267         NETBOOT="nfs"
268         export NETBOOT
269         rc=0
270     fi
271
272     [ "$quiet" != "y" ] && log_end_msg
273     return ${rc}
274 }
275
276 do_nfsmount() {
277     rc=1
278     modprobe "${MP_QUIET}" nfs
279     if [ -z "${NFSOPTS}" ]; then
280         NFSOPTS=""
281     fi
282
283     [ "$quiet" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
284     # FIXME: This for loop is an ugly HACK round an nfs bug
285     for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
286         nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break
287         sleep 1
288     done
289     return ${rc}
290 }
291
292 do_cifsmount() {
293     rc=1
294     if [ -x "/sbin/mount.cifs" ]; then
295         if [ -z "${NFSOPTS}" ]; then
296             CIFSOPTS="-ouser=root,password="
297         else
298             CIFSOPTS="${NFSOPTS}"
299         fi
300
301         [ "$quiet" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
302         modprobe "${MP_QUIET}" cifs
303
304         if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" ; then
305             rc=0
306         fi
307     fi
308     return ${rc}
309 }
310
311 do_snap_copy ()
312 {
313     fromdev="${1}"
314     todir="${2}"
315     snap_type="${3}"
316
317     size=$(fs_size "${fromdev}" "" "used")
318
319     if [ -b "${fromdev}" ]; then
320         # look for free mem
321         if [ -n "${HOMEMOUNTED}" -a "${snap_type}" = "HOME" ]; then
322             todev=$(cat /proc/mounts | grep -s " $(base_path ${todir}) " | awk '{print $1}' )
323             freespace=$(df -k  | grep -s ${todev} | awk '{print $4}')
324         else
325             freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
326         fi
327
328         tomount="/mnt/tmpsnap"
329         if [ ! -d "${tomount}" ] ; then
330             mkdir -p "${tomount}"
331         fi
332
333         fstype=$(get_fstype "${fromdev}")
334         if [ -n "${fstype}" ]; then
335             # Copying stuff...
336             mount -t "${fstype}" -o ro "${fromdev}" "${tomount}"
337             cp -a "${tomount}"/* ${todir}
338             umount "${tomount}"
339         else
340             log_warning_msg "Unrecognized fstype: ${fstype} on ${fromdev}:${snap_type}"
341         fi
342
343         rmdir "${tomount}"
344         if echo ${fromdev} | grep -qs loop; then
345            losetup -d "${fromdev}"
346         fi
347         return 0
348     else
349         return 1
350         [ "$quiet" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
351     fi
352 }
353
354 try_snap ()
355 {
356     # Look for $snap_label.* in block devices and copy the contents to $snap_mount
357     #   and remember the device and filename for resync on exit in live-initramfs.init
358
359     snap_label="${1}"
360     snap_mount="${2}"
361     snap_type="${3}"
362
363     snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3")
364     if [ ! -z "${snapdata}" ]; then
365         snapdev="$(echo ${snapdata} | cut -f1 -d ' ')"
366         snapback="$(echo ${snapdata} | cut -f2 -d ' ')"
367         snapfile="$(echo ${snapdata} | cut -f3 -d ' ')"
368         if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\)'; then
369             # squashfs or ext2/ext3 snapshot
370             dev=$(get_backing_device "${snapback}/${snapfile}")
371             if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"; then
372                  log_warning_msg "Impossible to include the ${snapfile} Snapshot"
373                  return 1
374             fi
375         else
376             # cpio.gz snapshot
377             if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio -i -u -d 2>/dev/null) ; then
378                 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
379                 return 1
380             fi
381         fi
382         umount "${snapback}"
383     else
384         dev=$(find_cow_device "${snap_label}")
385         if [ -b ${dev} ]; then
386             if echo "${dev}" | grep -qs loop; then
387                 # strange things happens, user confused?
388                 snaploop=$( losetup ${dev} | awk '{print $3}' | tr -d '()' )
389                 snapfile=$(basename ${snaploop})
390                 snapdev=$(cat /proc/mounts | awk '{print $2,$1}' | grep -es "^$( dirname ${snaploop} )" | cut -f2 -d ' ')
391             else
392                 snapdev="${dev}"
393             fi
394             if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}" ; then
395                 log_warning_msg "Impossible to include the ${snap_label} Snapshot"
396                 return 1
397             else
398                 if [ -n "${snapfile}" ]; then
399                      # it was a loop device, user confused
400                      umount ${snapdev}
401                 fi
402             fi
403         else
404             log_warning_msg "Impossible to include the ${snap_label} Snapshot"
405             return 1
406         fi
407     fi
408     echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
409     return 0
410 }
411
412 setup_unionfs() {
413     image_directory="$1"
414     rootmnt="$2"
415
416     modprobe "${MP_QUIET}" -b unionfs
417
418     # run-init can't deal with images in a subdir, but we're going to
419     # move all of these away before it runs anyway.  No, we're not,
420     # put them in / since move-mounting them into / breaks mono and
421     # some other apps.
422
423     croot="/"
424
425     # Let's just mount the read-only file systems first
426     rofsstring=""
427     rofslist=""
428     if [ "${NETBOOT}" = "nfs" ] ; then
429         roopt="nfsro" # go aroung a bug in nfs-unionfs locking
430     else
431         roopt="ro"
432     fi
433
434     # Read image names from ${MODULE}.lst if it exists
435     if [ -e "${image_directory}/${MODULE}.lst" ]; then
436         for image in $(cat "${image_directory}/${MODULE}.lst"); do
437             image_string="${image_string} ${image_directory}/${image}";
438         done
439     else
440         # If ${MODULE}.lst does not exist, create a list of images
441         for image_type in "ext2" "ext3" "squashfs" "dir"; do
442             for image in "${image_directory}"/*."${image_type}"; do
443                 if [ -e "${image}" ]; then
444                     image_string="${image_string} ${image}";
445                 fi
446             done
447         done
448         # Now sort the list
449         image_string=$(echo ${image_string} | sed -e 's/ /\n/g' | sort )
450     fi
451
452     mkdir -p "${croot}"
453     for image in ${image_string}; do
454         imagename=$(basename "${image}")
455         if [ -d "${image}" ]; then
456             # it is a plain directory: do nothing
457             rofsstring="${image}=${roopt}:${rofsstring}"
458             rofslist="${image} ${rofslist}"
459         elif [ -f "${image}" ]; then
460             backdev=$(get_backing_device "$image")
461             fstype=$(get_fstype "${backdev}")
462             if [ "${fstype}" = "unknown" ]; then
463                 panic "Unknown file system type on ${backdev} (${image})"
464              fi
465             mkdir -p "${croot}/${imagename}"
466             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}"
467         fi
468     done
469     rofsstring=${rofsstring%:}
470
471     mkdir -p /cow
472     cowdevice="tmpfs"
473     cow_fstype="tmpfs"
474
475     # Looking for "${root_persistence}" device or file
476     if [ -n "${PERSISTENT}" ]; then
477         cowprobe=$(find_cow_device "${root_persistence}")
478         if [ -b "${cowprobe}" ]; then
479             cowdevice=${cowprobe}
480             cow_fstype=$(get_fstype "${cowprobe}")
481         else
482             [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent medium"
483         fi
484     fi
485
486     mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount $cowdevice on /cow"
487
488     mount -t unionfs -o dirs=/cow=rw:$rofsstring unionfs "$rootmnt" || panic "Unionfs mount failed"
489
490     # Adding other custom mounts
491     if [ -n "${PERSISTENT}" ]; then
492         # directly mount /home
493         # FIXME: add a custom mounts configurable system
494         homecow=$(find_cow_device "${home_persistence}" )
495         if [ -b "${homecow}" ]; then
496             mount -t $(get_fstype "${homecow}") -o rw "${homecow}" "${rootmnt}/home"
497             export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
498         else
499             [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
500         fi
501         # Look for other snapshots to copy in
502         try_snap "${root_snapshot_label}" "${rootmnt}" "ROOT"
503         try_snap "${home_snapshot_label}" "${rootmnt}/home" "HOME"
504     fi
505
506     if [ -n "${SHOWMOUNTS}" ]; then
507         for d in ${rofslist}; do
508             mkdir -p "${rootmnt}/live/${d##*/}"
509             case d in
510                 *.dir) # do nothing # mount -o bind "${d}" "${rootmnt}/live/${d##*/}"
511                     ;;
512                 *) mount --move "${d}" "${rootmnt}/live/${d##*/}"
513                     ;;
514             esac
515         done
516     fi
517
518     # shows cow fs on /cow for use by live-snapshot
519     mkdir -p "${rootmnt}/cow"
520     mount -o bind /cow "${rootmnt}/cow"
521 }
522
523 check_dev ()
524 {
525     sysdev="${1}"
526     devname="${2}"
527     if [ -z "${devname}" ]; then
528         devname=$(sys2dev "${sysdev}")
529     fi
530
531     if [ -n "${LIVE_MEDIA_OFFSET}" ]; then
532         loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVE_MEDIA_OFFSET}" '')
533         devname="${loopdevname}"
534     fi
535
536     fstype=$(get_fstype "${devname}")
537     if is_supported_fs ${fstype}; then
538         mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
539         if is_live_path $mountpoint; then
540             echo $mountpoint
541             return 0
542         else
543             umount $mountpoint
544         fi
545     fi
546
547     if [ -n "${LIVE_MEDIA_OFFSET}" ]; then
548         losetup -d "${loopdevname}"
549     fi
550     return 1
551 }
552
553 find_livefs() {
554     timeout="${1}"
555     # first look at the one specified in the command line
556     if [ ! -z "${LIVE_MEDIA}" ]; then
557         if check_dev "null" "${LIVE_MEDIA}"; then
558             return 0
559         fi
560     fi
561     # don't start autodetection before timeout has expired
562     if [ -n "${LIVE_MEDIA_TIMEOUT}" ]; then
563         if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]; then
564             return 1
565         fi
566     fi
567     # or do the scan of block devices
568     for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram); do
569         devname=$(sys2dev "${sysblock}")
570         fstype=$(get_fstype "${devname}")
571         if /lib/udev/cdrom_id ${devname} > /dev/null; then
572             if check_dev "null" "${devname}" ; then
573                 return 0
574             fi
575         elif is_nice_device "${sysblock}" ; then
576             for dev in $(subdevices "${sysblock}"); do
577                 if check_dev "${dev}" ; then
578                     return 0
579                 fi
580             done
581         elif [ "${fstype}" = "squashfs" -o \
582                 "${fstype}" = "ext2" -o \
583                 "${fstype}" = "ext3" ]; then
584             # This is an ugly hack situation, the block device has
585             # an image directly on it.  It's hopefully
586             # live-initramfs, so take it and run with it.
587             ln -s "${devname}" "${devname}.${fstype}"
588             echo "${devname}.${fstype}"
589             return 0
590         fi
591     done
592     return 1
593 }
594
595 pulsate() {
596     if [ -x /sbin/usplash_write ]; then
597         /sbin/usplash_write "PULSATE"
598     fi
599 }
600
601 set_usplash_timeout() {
602     if [ -x /sbin/usplash_write ]; then
603         /sbin/usplash_write "TIMEOUT 120"
604     fi
605 }
606
607 mountroot() {
608     exec 6>&1
609     exec 7>&2
610     exec > live.log
611     exec 2>&1
612
613     parse_cmdline
614
615     set_usplash_timeout
616     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
617     pulsate
618     run_scripts /scripts/live-premount
619     [ "$quiet" != "y" ] && log_end_msg
620
621     # Needed here too because some things (*cough* udev *cough*)
622     # changes the timeout
623
624     set_usplash_timeout
625
626     if [ ! -z "${NETBOOT}" ]; then
627         if do_netmount ; then
628             livefs_root="${mountpoint}"
629         else
630             panic "Unable to find a live file system on the network"
631         fi
632     else
633         # Scan local devices for the image
634         for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
635             livefs_root=$(find_livefs $i)
636             if [ -n "${livefs_root}" ]; then
637                 break
638             fi
639             sleep 1
640         done
641     fi
642
643     if [ -z "${livefs_root}" ]; then
644         panic "Unable to find a medium containing a live file system"
645     fi
646
647     if [ "${TORAM}" ]; then
648         live_dest="ram"
649     elif [ "${TODISK}" ]; then
650         live_dest="${TODISK}"
651     fi
652     if [ "${live_dest}" ]; then
653         log_begin_msg "Copying live_media to ${live_dest}"
654         copy_live_to "${livefs_root}" "${live_dest}"
655         log_end_msg
656     fi
657
658     mount_images_in_directory "${livefs_root}" "${rootmnt}"
659
660     log_end_msg
661
662     maybe_break live-bottom
663     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
664
665     pulsate
666     run_scripts /scripts/live-bottom
667     [ "$quiet" != "y" ] && log_end_msg
668
669     exec 1>&6 6>&-
670     exec 2>&7 7>&-
671     cp live.log "${rootmnt}/var/log/"
672 }