2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: target/share/livecd/build_image.sh
6 # Copyright (C) 2004 - 2010 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 .
$base/misc
/target
/functions.
in
20 mkdir
-p $imagelocation ; cd $imagelocation
21 # just in case it is still there from the last run
22 (umount proc
; umount dev
) 2>/dev
/null || true
24 echo "Creating root file-system file lists ..."
26 for pkg
in `grep '^X ' $base/config/$config/packages | cut -d ' ' -f 5`; do
27 # include the package?
28 if [ "${f/ $pkg /}" == "$f" ] ; then
29 cut
-d ' ' -f 2 $build_root/var
/adm
/flists
/$pkg || true
31 done > ..
/files-wanted
33 [ "$filter_hook" ] && "$filter_hook" ..
/files-wanted
34 sort -u ..
/files-wanted
> x
; mv -f x ..
/files-wanted
36 # for rsync with --delete we can not use file lists, since rsync does not
37 # delete in that mode - instead we need to generate a negative list
39 time find $build_root -mount -wholename $build_root/TOOLCHAIN
-prune -o -printf '%P\n' |
40 sort -u > ..
/files-all
42 diff -u ..
/files-all ..
/files-wanted |
43 sed -n -e '/var\/adm\/olist/d' -e '/var\/adm\/logs/d' \
44 -e '/var\/adm\/dep-debug/d' -e '/var\/adm\/cache/d' -e 's/^-//p' > ..
/files-exclude
52 var/adm/cache" >> ..
/files-exclude
54 echo "Syncing root file-system (this may take some time) ..."
55 [ -e $imagelocation/bin
] && v
="-v" || v
=""
56 time rsync
-artH $v --devices --specials --delete --delete-excluded \
57 --exclude-from ..
/files-exclude
$build_root/ $imagelocation/
58 rm ..
/files-
{wanted
,all
,exclude
}
60 # avoid duplicate files on the medium and initrd anyway
61 find $isofsdir/boot
-type f |
while read f
; do
62 rm -f .
/${f#$isofsdir} > /dev
/null
64 for initrd
in $isofsdir/boot
/initrd
*; do
65 zcat
$initrd |
cpio -i --list |
grep '.ko$' |
67 rm -f .
/$f > /dev
/null
71 echo "Overlaying root file-system with target defined files ..."
72 copy_and_parse_from_source
$base/target
/share
/livecd
/rootfs
$imagelocation
73 copy_and_parse_from_source
$base/target
/$target/rootfs
$imagelocation
75 [ "$inject_hook" ] && "$inject_hook"
77 echo "Running ldconfig and other postinstall scripts ..."
79 mount none proc
-t proc
80 for x
in sbin
/ldconfig etc
/postinstall.d
/*; do
82 */scrollkeeper
) echo "$x left out" ;;
83 *) chroot .
/bin
/sh
-c ". /etc/profile; /$x" && true
;;
89 echo "Squashing root file-system (this may take some time) ..."
90 time mksquashfs
* $isofsdir/live.squash
-noappend -no-progress -no-exports
91 du
-sh $isofsdir/live.squash