|
Lines 37-44
Link Here
|
| 37 |
|
37 |
|
| 38 |
create_image() { |
38 |
create_image() { |
| 39 |
Verbose "Creating image for \`$IDENT'." |
39 |
Verbose "Creating image for \`$IDENT'." |
|
|
40 |
[ -n "$IMAGE_TYPE" ] || IMAGE_TYPE="$image_type" |
| 41 |
Verbose "image type: \`$IMAGE_TYPE'." |
| 40 |
|
42 |
|
| 41 |
case "$image_type" in |
43 |
case "$IMAGE_TYPE" in |
| 42 |
squashfs) |
44 |
squashfs) |
| 43 |
init_chroot_progs "squashfsprogs" |
45 |
init_chroot_progs "squashfsprogs" |
| 44 |
cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" |
46 |
cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" |
|
Lines 57-62
Link Here
|
| 57 |
mkiso= |
59 |
mkiso= |
| 58 |
cat "$tmpdir/.archive.tar" | gzip -f9 > "$workdir/$OUT.tar.gz" |
60 |
cat "$tmpdir/.archive.tar" | gzip -f9 > "$workdir/$OUT.tar.gz" |
| 59 |
;; |
61 |
;; |
|
|
62 |
cpio) |
| 63 |
init_chroot_progs "cpio findutils" |
| 64 |
cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" |
| 65 |
cat >"$tmpdir/script" <<'__EOF__' |
| 66 |
mkdir -p /tmp/.archive |
| 67 |
tar -C /tmp/.archive -xf /tmp/.archive.tar |
| 68 |
cd /tmp/.archive |
| 69 |
find . | cpio -o -H newc > /.image |
| 70 |
__EOF__ |
| 71 |
chroot_exec "$tmpdir/script" |
| 72 |
mv -f -- "$chroot/.image" "$outdir/$OUT" |
| 73 |
gzip "$outdir/$OUT" |
| 74 |
mv "$outdir/$OUT.gz" "$outdir/$OUT" |
| 75 |
;; |
| 60 |
*) |
76 |
*) |
| 61 |
Fatal 'Unsupported image type.' |
77 |
Fatal 'Unsupported image type.' |
| 62 |
;; |
78 |
;; |
|
Lines 115-121
Link Here
|
| 115 |
|
132 |
|
| 116 |
if [ -n "$HOOKPKGS" ]; then |
133 |
if [ -n "$HOOKPKGS" ]; then |
| 117 |
Verbose "Installation packages for hook" |
134 |
Verbose "Installation packages for hook" |
| 118 |
hsh-install "$workdir" $verbose $quiet $excludedocs ${number:+--number="$number"} $HOOKPKGS |
135 |
hsh-install "$workdir" $verbose $quiet $excludedocs ${number:+--number="$number"} --save-fakeroot $HOOKPKGS |
| 119 |
fi |
136 |
fi |
| 120 |
|
137 |
|
| 121 |
packages="$profile_dir/$IDENT/packages" |
138 |
packages="$profile_dir/$IDENT/packages" |
|
Lines 151-162
Link Here
|
| 151 |
|
168 |
|
| 152 |
runto_components() { |
169 |
runto_components() { |
| 153 |
local cmd comp |
170 |
local cmd comp |
| 154 |
local IDENT VENDOR COPYONLY INSTALLDIR NOIMAGE EXTRAOPTS FILES OUT |
171 |
local IDENT VENDOR COPYONLY INSTALLDIR NOIMAGE EXTRAOPTS FILES OUT IMAGE_TYPE |
| 155 |
|
172 |
|
| 156 |
cmd="$1" && shift |
173 |
cmd="$1" && shift |
| 157 |
|
174 |
|
| 158 |
for comp in $COMPONENTS; do |
175 |
for comp in $COMPONENTS; do |
| 159 |
IDENT="packages" VENDOR="ALTLinux" COPYONLY= INSTALLDIR= NOIMAGE= EXTRAOPTS= FILES= OUT= |
176 |
IDENT="packages" VENDOR="ALTLinux" COPYONLY= INSTALLDIR= NOIMAGE= EXTRAOPTS= FILES= OUT= IMAGE_TYPE= |
| 160 |
|
177 |
|
| 161 |
. "$profile_dir/$comp/config" || |
178 |
. "$profile_dir/$comp/config" || |
| 162 |
Fatal "File \`$profile_dir/$comp/config' not found." |
179 |
Fatal "File \`$profile_dir/$comp/config' not found." |