Dash:
[t2.git] / target / embedded / build_image.sh
blobb1271d8d7ae348aa1b2c17e565773508faab998d
1 #!/bin/bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 #
5 # T2 SDE: target/embedded/build_image.sh
6 # Copyright (C) 2004 - 2010 The T2 SDE Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
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
18 set -e
20 echo "Preparing root filesystem image from build result ..."
22 rm -rf $imagelocation{,.squashfs}
23 mkdir -p $imagelocation ; cd $imagelocation
25 find $build_root -printf "%P\n" | sed '
27 # stuff we never need
29 /^TOOLCHAIN/ d;
30 /^var\/adm/ d;
32 /\/include/ d;
33 /\/src/ d;
34 /\.a$/ d;
35 /\.o$/ d;
36 /\.old$/ d;
38 /\/games/ d;
39 /\/local/ d;
40 /^boot/ d;
42 # # stuff that would be nice - but is huge and only documentation
43 /\/man/ d;
44 /\/doc/ d;
46 # /etc noise
47 /^etc\/stone.d/ d;
48 /^etc\/cron.d/ d;
49 /^etc\/init.d/ d;
51 /^etc\/skel/ d;
52 /^etc\/opt/ d;
53 /^etc\/conf/ d;
54 /^etc\/rc.d/ d;
56 /^opt/ d;
58 /^\/man\// d;
60 /terminfo\/a\/ansi$/ { p; d; }
61 /terminfo\/l\/linux$/ { p; d; }
62 /terminfo\/x\/xterm$/ { p; d; }
63 /terminfo\/n\/nxterm$/ { p; d; }
64 /terminfo\/x\/xterm-color$/ { p; d; }
65 /terminfo\/x\/xterm-8bit$/ { p; d; }
66 /terminfo\/x\/screen$/ { p; d; }
67 /terminfo\/v\/vt100$/ { p; d; }
68 /terminfo\/v\/vt200$/ { p; d; }
69 /terminfo\/v\/vt220$/ { p; d; }
70 /terminfo/ d;
72 ' > tar.input
74 copy_with_list_from_file $build_root . $PWD/tar.input
75 rm tar.input
77 echo "Preparing root filesystem image from target defined files ..."
78 rm -f sbin/init ; ln -s minit sbin/init
79 copy_from_source $base/target/$target/rootfs .
81 echo "Creating links for identical files ..."
82 link_identical_files
84 echo "Creating root filesystem image (squashfs) ..."
86 mksquashfs $imagelocation{,.squashfs} > /dev/null
88 du -sh $imagelocation{,.squashfs}
90 echo "The image is located at $imagelocation.squasfs."