Mercurial > hg > aboriginal
annotate root-image.sh @ 1432:ee0e4f2f4bdb
Fiddle with the downloads/binaries layout yet again, and update README for it.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 23 Aug 2011 08:21:48 -0500 |
parents | f1d2afdf2034 |
children | 5c29a091278a |
rev | line source |
---|---|
1350
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Package a root filesystem directory into a filesystem image file |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 source sources/include.sh || exit 1 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1366
diff
changeset
|
7 # Parse sources/targets/$1 |
1350
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1366
diff
changeset
|
9 load_target "$1" |
1350
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1398
diff
changeset
|
11 check_for_base_arch || exit 0 |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1398
diff
changeset
|
12 |
1350
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 # Which directory do we package up? |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 if [ -z "$NATIVE_ROOT" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 then |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 [ -z "$NO_NATIVE_COMPILER" ] && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 NATIVE_ROOT="$BUILD/root-filesystem-$ARCH" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 [ -e "$NATIVE_ROOT" ] || |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 NATIVE_ROOT="$BUILD/simple-root-filesystem-$ARCH" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 fi |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 if [ ! -d "$NATIVE_ROOT" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 then |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 [ -z "$FAIL_QUIET" ] && echo No "$NATIVE_ROOT" >&2 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 exit 1 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 fi |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 [ -z "$SYSIMAGE_TYPE" ] && SYSIMAGE_TYPE=squashfs |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 echo "Generating $SYSIMAGE_TYPE root filesystem from $NATIVE_ROOT." |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 # Embed an initramfs image in the kernel? |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 if [ "$SYSIMAGE_TYPE" == "initramfs" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 then |
1366
2059add65b8c
Fix initramfs packaging (never fixed gen_init_cpio.c into sources/toys, best to use the copy out of the Linux source anyway).
Rob Landley <rob@landley.net>
parents:
1350
diff
changeset
|
38 # Borrow gen_init_cpio.c out of package cache copy of Linux source |
2059add65b8c
Fix initramfs packaging (never fixed gen_init_cpio.c into sources/toys, best to use the copy out of the Linux source anyway).
Rob Landley <rob@landley.net>
parents:
1350
diff
changeset
|
39 extract_package linux && |
2059add65b8c
Fix initramfs packaging (never fixed gen_init_cpio.c into sources/toys, best to use the copy out of the Linux source anyway).
Rob Landley <rob@landley.net>
parents:
1350
diff
changeset
|
40 $CC "$SRCTREE/$PACKAGE/usr/gen_init_cpio.c" -o my_gen_init_cpio || dienow |
1350
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 ./my_gen_init_cpio <( |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 "$SOURCES"/toys/gen_initramfs_list.sh "$NATIVE_ROOT" || dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 [ ! -e "$NATIVE_ROOT"/init ] && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 echo "slink /init /sbin/init.sh 755 0 0" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 [ ! -d "$NATIVE_ROOT"/dev ] && echo "dir /dev 755 0 0" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 echo "nod /dev/console 660 0 0 c 5 1" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 ) > "$STAGE_DIR/initramfs_data.cpio" || dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 echo Initramfs generated. |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 elif [ "$SYSIMAGE_TYPE" == "ext2" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 then |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 # Generate a 64 megabyte ext2 filesystem image from the $NATIVE_ROOT |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 # directory, with a temporary file defining the /dev nodes for the new |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 # filesystem. |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 [ -z "$SYSIMAGE_HDA_MEGS" ] && SYSIMAGE_HDA_MEGS=64 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 echo "/dev d 755 0 0 - - - - -" > "$WORK/devs" && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 echo "/dev/console c 640 0 0 5 1 0 0 -" >> "$WORK/devs" && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
61 # Produce a filesystem with the currently used space plus 20% for filesystem |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
62 # overhead, which should always be big enough. |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
63 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
64 BLOCKS=$[1024*(($(du -m -s "$NATIVE_ROOT" | awk '{print $1}')*12)/10)] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
65 [ $BLOCKS -lt 4096 ] && BLOCKS=4096 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
66 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
67 genext2fs -z -D "$WORK/devs" -d "$NATIVE_ROOT" -b $BLOCKS -i 1024 \ |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
68 "$STAGE_DIR/hda.ext2" && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
69 rm "$WORK/devs" || dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
70 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
71 # Extend image size to HDA_MEGS if necessary, keeping it sparse. (Feeding |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
72 # a larger -b size to genext2fs is insanely slow, and not particularly |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
73 # sparse.) |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
74 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
75 echo "$(stat -c %s "$STAGE_DIR/$IMAGE") -lt $SYSIMAGE_HDA_MEGS" |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
76 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
77 if [ ! -z "$SYSIMAGE_HDA_MEGS" ] && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
78 [ $((`stat -c %s "$STAGE_DIR/$IMAGE"` / (1024*1024) )) -lt "$SYSIMAGE_HDA_MEGS" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
79 then |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
80 echo resizing image to $SYSIMAGE_HDA_MEGS |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
81 dd if=/dev/zero of="$STAGE_DIR/$IMAGE" bs=1k count=1 seek=$[1024*1024-1] && |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
82 resize2fs "$STAGE_DIR/$IMAGE" ${SYSIMAGE_HDA_MEGS}M || dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
83 echo resize complete |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
84 fi |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
85 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
86 elif [ "$SYSIMAGE_TYPE" == "squashfs" ] |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
87 then |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
88 mksquashfs "${NATIVE_ROOT}" "$STAGE_DIR/hda.sqf" -noappend -all-root \ |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
89 ${FORK:+-no-progress} -p "/dev d 755 0 0" \ |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
90 -p "/dev/console c 666 0 0 5 1" || dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
91 else |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
92 echo "Unknown image type $SYSIMAGE_TYPE" >&2 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
93 dienow |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
94 fi |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
95 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
96 create_stage_tarball |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
97 |
7eabfa815c90
Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
98 echo Image generation complete. |