]>
Commit | Line | Data |
---|---|---|
3e6a3a30 PZ |
1 | #!/bin/bash |
2 | ||
3 | ORIGDIR=`pwd` | |
4 | COMPONENT="" | |
5 | DEBUG="" | |
6 | ||
7 | if [ "$1" == "--debug" ]; then | |
8 | DEBUG="--debug" | |
9 | shift | |
10 | fi | |
11 | ||
12 | if [ "$1" == "--comp" ]; then | |
13 | COMPONENT=$2 | |
14 | shift; shift | |
15 | fi | |
16 | ||
17 | if [ -z "$1" ]; then | |
18 | echo "upd-instroot: updates instimage from a Red Hat RPMS directory" | |
19 | echo "usage: $0 --comp <comp> <packagedir> [templatedir] [instroot]" | |
20 | exit 1 | |
21 | fi | |
22 | ||
23 | if [ ! -d $1 ]; then | |
24 | if [ -z "$ARCH" ]; then | |
25 | echo "ARCH must be set" >&2 | |
26 | exit 1 | |
27 | fi | |
28 | LATEST="latest --arch $ARCH" | |
29 | fi | |
30 | ||
31 | PACKAGEDIR=$1 | |
32 | ||
33 | if [ -z "$ARCH" ]; then | |
34 | ARCH=`rpm --nodigest --nosignature -qp --qf "%{ARCH}" $PACKAGEDIR/anaconda-runtime*.rpm` | |
35 | fi | |
36 | ||
37 | if [ $ARCH = x86_64 -o $ARCH = s390x ]; then | |
38 | LIBDIR=lib64 | |
39 | else | |
40 | LIBDIR=lib | |
41 | fi | |
42 | ||
43 | NEEDGR=yes | |
44 | ||
45 | prunePackageList() { | |
46 | PACKAGEPATH=$1 | |
47 | PACKAGES="$2" | |
48 | ||
49 | if [ -n "$LATEST" ]; then | |
50 | $LATEST $PACKAGEPATH $PACKAGES | |
51 | if [ $? != 0 ]; then | |
52 | $LATEST $PACKAGEPATH $PACKAGES >&2 | |
53 | kill -9 $$ | |
54 | fi | |
55 | ||
56 | return | |
57 | fi | |
58 | ||
59 | PATTERN="" | |
60 | PACKAGEFILES="" | |
61 | for PKG in $PACKAGES; do | |
62 | PATTERN="${PATTERN:+${PATTERN}|}(^$PKG )" | |
63 | PACKAGEFILES="$PACKAGEFILES $(ls $PACKAGEPATH/$PKG*{$ARCH,noarch}.rpm 2>/dev/null)" | |
64 | done | |
65 | ||
66 | # gtk+, enough said | |
67 | PATTERN=$(echo $PATTERN | sed 's,[\+\*],\\&,g') | |
68 | ||
69 | PACKAGEFILES=$(ls $PACKAGEFILES | sort -u) | |
70 | ||
71 | rpm --nodigest --nosignature --qf "%{NAME} $PACKAGEPATH/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n" \ | |
72 | -qp $PACKAGEFILES | egrep "$PATTERN" | sed 's/.* //' | |
73 | } | |
74 | ||
75 | expandPackageSet() { | |
76 | RPMS=$1 | |
77 | PKGDEST=$2 | |
78 | KEEPFILES=$3 | |
79 | ||
80 | [ -d $PKGDEST ] || die "ERROR: directory missing: $PKGDEST" | |
81 | for n in $RPMS; do | |
82 | [ -n "$DEBUG" ] && echo -ne "\rExpanding packages..." $(basename $n) | |
83 | if [ "$(rpm --nosignature --nodigest -qp --qf '%{NAME}' $n)" = "glibc-misc" ] ; then | |
84 | TZDATA=$n | |
85 | fi | |
86 | rpm2cpio $n | (cd $PKGDEST; cpio -E $KEEPFILES --quiet -iumd) | |
87 | [ -n "$DEBUG" ] && echo -ne "\rExpanding packages..." "$(basename $n | sed 's/./ /g')" | |
88 | done | |
89 | pushd $PKGDEST/$LIBDIR >/dev/null 2>&1 | |
90 | if [ -d obsolete/linuxthreads/ ]; then | |
91 | for x in obsolete/linuxthreads/*-* ; do | |
92 | lib_base=$(basename $x | cut -d- -f1) | |
93 | rm -f ./$lib_base[.-]* | |
94 | mv -f obsolete/linuxthreads/$lib_base[.-]* . | |
95 | done | |
96 | rmdir obsolete/linuxthreads obsolete | |
97 | fi | |
98 | popd >/dev/null 2>&1 | |
99 | } | |
100 | ||
101 | die () { | |
102 | echo "$@" | |
103 | echo "Aborting instroot creation..." | |
104 | exit 1 | |
105 | } | |
106 | ||
107 | if [ -z "$2" ]; then | |
108 | DEST=/tmp/upd-instroot | |
109 | else | |
110 | DEST=$2 | |
111 | fi | |
112 | ||
113 | if [ -z "$3" ]; then | |
114 | DESTGR=/tmp/upd-instroot | |
115 | else | |
116 | DESTGR=$3 | |
117 | fi | |
118 | ||
119 | rm -rf $DEST $DESTGR | |
120 | mkdir -p $DEST | |
121 | mkdir -p $DESTGR | |
122 | ||
123 | # glibc-misc for timezone data (was tzdata) | |
124 | # libtermcap | |
125 | ||
126 | PACKAGES="acl anaconda anaconda-runtime ash attr | |
127 | bash beecrypt bogl bogl-bterm busybox-anaconda bzip2 bzip2-libs | |
128 | device-mapper dmapi dosfstools | |
129 | e2fsprogs elfutils-libelf expat | |
130 | fedora-logos | |
131 | glib2 glibc glibc-misc | |
132 | hdparm hwdata | |
133 | jfsutils | |
134 | kudzu | |
135 | libgcc libselinux libsepol libstdc++ libxml2 lvm2 | |
136 | mdadm | |
137 | ncurses neon newt | |
138 | openssl | |
139 | parted pciutils policy policycoreutils popt procps python python-booty python-libs python-libxml2 python-parted python-rhpl python-rpm python-urlgrabber python-xf86config | |
140 | readline reiserfsprogs rpm rpm-lib | |
141 | sed setup slang sqlite | |
142 | util-linux | |
143 | xfsdump xfsprogs | |
144 | zlib | |
145 | X11 X11-tools" | |
146 | ||
147 | if [ $ARCH = i686 -o $ARCH = x86_64 ]; then | |
148 | PACKAGES="$PACKAGES pcmcia-cs kernel-utils" | |
149 | fi | |
150 | ||
151 | if [ $ARCH = ia64 ]; then | |
152 | PACKAGES="$PACKAGES elilo" | |
153 | fi | |
154 | ||
155 | if [ $ARCH = s390 -o $ARCH = s390x ]; then | |
156 | PACKAGES="$PACKAGES s390utils binutils libgcc tcp_wrappers | |
157 | sed net-tools xinetd openssl openssh openssh-server coreutils | |
158 | login initscripts XFree86-xauth bash portmap pam | |
159 | telnet-server login mount grep modutils gawk | |
160 | XFree86-libs strace xorg-x11-xauth xorg-x11-libs" | |
161 | fi | |
162 | ||
163 | if [ $ARCH = ppc -o $ARCH = ppc64 ]; then | |
164 | PACKAGES="$PACKAGES kernel-pcmcia-cs pdisk yaboot hfsutils" | |
165 | fi | |
166 | ||
167 | # xpm is missing | |
168 | ||
169 | # Some packages are listed twice, but that's okay | |
170 | # | |
171 | # The packages in this list are needed for the graphical installer to run | |
172 | # | |
173 | # Extra stuff we want for rescue mode should go in PACKAGESRESCUE | |
174 | # | |
175 | PACKAGESGR="anaconda X11-libs libpng X11-fonts-75dpi | |
176 | X11-fonts-75dpi-ISO8859-2 gtk+2 libglade2 | |
177 | X11-fonts-75dpi-ISO8859-9 | |
178 | X11-fonts-100dpi fonts-ISO8859-2 fonts-ISO8859-9 | |
179 | X11-xfs e2fsprogs coreutils glibc glibc-misc | |
180 | popt specspo util-linux rpm rpm-libs | |
181 | procps bash cpio gpm python-pygtk-libglade | |
182 | X11 Xconfigurator python-pygtk gdk-pixbuf | |
183 | X11-fonts-KOI8-R X11-fonts-75dpi-KOI8-R pam | |
184 | reiserfs-utils atk pango freetype python-gnome-canvas | |
185 | libgnomecanvas libart_lgpl libgcc libacl libattr libstdc++ expat | |
186 | anaconda-images anaconda-help X11-fonts-base | |
187 | ttfonts-ko taipeifonts X11-fonts-75dpi-ISO8859-15 python-rhpl | |
188 | system-config-keyboard Xft fontconfig gtk2-engines gnome-themes | |
189 | ttfonts-ja ttfonts-zh_TW bitmap-fonts-cjk urw-fonts fonts-arabic | |
190 | comps-extras X11-libs convertdb1 fonts-bengali | |
191 | vnc-server libjpeg tcp_wrappers system-config-date | |
192 | xfsprogs xfsdump dmapi attr acl policy policycoreutils | |
193 | selinux-policy-targeted ttfonts-zh_CN redhat-artwork audit-libs | |
194 | bogl-bterm | |
195 | prelink redhat-logos fedora-logos | |
196 | ttfonts-ta ttfonts-bn ttfonts-gu ttfonts-hi ttfonts-pa bogl-devel | |
197 | fonts-japanese fonts-chinese fonts-korean fonts-indic | |
198 | fonts-gujarati fonts-hindi fonts-punjabi fonts-tamil" | |
199 | ||
200 | # | |
201 | # stuff ONLY included for rescue mode | |
202 | # | |
203 | # these packages are combined with the PACKAGES and PACKAGESGR for big stage 2 | |
204 | # | |
205 | PACKAGESRESCUE="bzip2 bzip2-libs dump | |
206 | findutils ftp gzip iputils joe krb5-libs less man | |
207 | modutils mtools mt-st mtr net-tools open | |
208 | openssh openssh-clients pciutils rsh traceroute tar" | |
209 | ||
210 | if [ $ARCH = i386 ]; then | |
211 | PACKAGESRESCUE="$PACKAGESRESCUE" | |
212 | fi | |
213 | ||
214 | # turn off options we dont want, ie. set package list to something harmless | |
215 | if [ -z "$NEEDGR" ]; then | |
216 | PACKAGESGR="bash" | |
217 | PACKAGESRESCUE="bash" | |
218 | fi | |
219 | ||
220 | # | |
221 | # add bootloader for particular arch | |
222 | # | |
223 | if [ $ARCH = sparc ]; then | |
224 | PACKAGESGR="$PACKAGESGR tilo silo" | |
225 | fi | |
226 | ||
227 | if [ $ARCH = i686 -o $ARCH = x86_64 ]; then | |
228 | PACKAGESGR="$PACKAGESGR syslinux memtest86+" | |
229 | fi | |
230 | ||
231 | if [ $ARCH = alpha ]; then | |
232 | PACKAGESGR="$PACKAGESGR aboot" | |
233 | fi | |
234 | ||
235 | if [ $ARCH = ia64 ]; then | |
236 | PACKAGESGR="$PACKAGESGR elilo" | |
237 | fi | |
238 | ||
239 | if [ $ARCH = ppc ]; then | |
240 | PACKAGESGR="$PACKAGESGR fbset yaboot ppc64-utils" | |
241 | fi | |
242 | ||
243 | # | |
244 | # KEEPFILE is all files to keep from the packages in PACKAGES | |
245 | # | |
246 | # This is what is present in http, ftp, and hard drive installs, and is | |
247 | # supposed to be a small image because these methods keep it in RAM. | |
248 | # | |
249 | # It also is the base on which the other install images build on top of, | |
250 | # so if something is needed by all images it should go here | |
251 | # | |
252 | KEEPFILE=/tmp/keepfile.$$ | |
253 | ||
254 | cat > $KEEPFILE <<EOF | |
255 | boot/efi/EFI/redhat/elilo.efi | |
256 | bin/ash | |
257 | bin/fdisk* | |
258 | bin/mkfs* | |
259 | bin/sed | |
260 | etc/group | |
261 | etc/passwd | |
262 | etc/protocols | |
263 | etc/services | |
264 | etc/selinux/targeted/booleans | |
265 | etc/selinux/targeted/policy/policy.* | |
266 | etc/selinux/targeted/contexts/files/file_contexts | |
267 | etc/security/selinux/policy.* | |
268 | etc/security/selinux/file_contexts | |
269 | $LIBDIR/libc[-.]* | |
270 | $LIBDIR/libm[-.]* | |
271 | $LIBDIR/libpthread* | |
272 | $LIBDIR/librt[-.]* | |
273 | $LIBDIR/ld*.so* | |
274 | $LIBDIR/libblkid* | |
275 | $LIBDIR/libcom_err* | |
276 | $LIBDIR/libcrypt* | |
277 | $LIBDIR/libdevmapper* | |
278 | $LIBDIR/libdl* | |
279 | $LIBDIR/libe2p* | |
280 | $LIBDIR/libext2fs* | |
281 | $LIBDIR/liblvm-10.so* | |
282 | $LIBDIR/libgcc_s* | |
283 | $LIBDIR/libnsl* | |
284 | $LIBDIR/libnss_dns* | |
285 | $LIBDIR/libnss_files* | |
286 | $LIBDIR/libresolv* | |
287 | $LIBDIR/libselinux* | |
288 | $LIBDIR/libsepol* | |
289 | $LIBDIR/libss* | |
290 | $LIBDIR/libtermcap* | |
291 | $LIBDIR/libhandle* | |
292 | $LIBDIR/libattr* | |
293 | $LIBDIR/libdm* | |
294 | $LIBDIR/libutil* | |
295 | $LIBDIR/libuuid* | |
296 | sbin/badblocks | |
297 | sbin/busybox.anaconda | |
298 | sbin/clock | |
299 | sbin/debugfs | |
300 | sbin/e2fsck | |
301 | sbin/e2fsadm | |
302 | sbin/e2label | |
303 | sbin/fsck.ext2 | |
304 | sbin/fsck.ext3 | |
305 | sbin/fsck.jfs | |
306 | sbin/fsck.xfs | |
307 | sbin/fdisk | |
308 | sbin/hdparm | |
309 | sbin/hwclock | |
310 | sbin/jfs_tune | |
311 | sbin/ldconfig | |
312 | sbin/lvm* | |
313 | sbin/mdadm | |
314 | sbin/mkdosfs | |
315 | sbin/mke2fs | |
316 | sbin/mkfs.ext2 | |
317 | sbin/mkfs.ext3 | |
318 | sbin/mkfs.jfs | |
319 | sbin/mkfs.xfs | |
320 | sbin/mkfs.msdos | |
321 | sbin/mkfs.vfat | |
322 | sbin/mkreiserfs | |
323 | sbin/mkraid | |
324 | sbin/mkswap | |
325 | sbin/parted | |
326 | sbin/pdisk | |
327 | sbin/probe | |
328 | sbin/resize2fs | |
329 | sbin/sfdisk | |
330 | sbin/tune2fs | |
331 | sbin/xfsdump | |
332 | sbin/xfsrestore | |
333 | sbin/xfs_repair | |
334 | usr/sbin/xfs_db | |
335 | usr/sbin/xfs_check | |
336 | usr/sbin/xfs_copy | |
337 | usr/X11R6/share/Xconfigurator/MonitorsDB | |
338 | usr/bin/python | |
339 | usr/bin/python?.? | |
340 | usr/bin/hmount | |
341 | usr/bin/humount | |
342 | usr/bin/hcopy | |
343 | usr/bin/hattrib | |
344 | usr/bin/hformat | |
345 | usr/lib/anaconda-runtime/* | |
346 | usr/lib/anaconda/* | |
347 | usr/lib/anaconda/installclasses/* | |
348 | usr/lib/anaconda/textw/* | |
349 | usr/$LIBDIR/bogl/font.bgf.gz | |
350 | usr/lib/booty/* | |
351 | usr/kerberos/$LIBDIR/libkrb5.so* | |
352 | usr/kerberos/$LIBDIR/libkrb5support.so* | |
353 | usr/kerberos/$LIBDIR/libk5crypto.so* | |
354 | usr/kerberos/$LIBDIR/libcom_err.so* | |
355 | usr/kerberos/$LIBDIR/libgssapi_krb5.so* | |
356 | usr/$LIBDIR/libkrb5.so* | |
357 | usr/$LIBDIR/libkrb5support.so* | |
358 | usr/$LIBDIR/libk5crypto.so* | |
359 | usr/$LIBDIR/libcom_err.so* | |
360 | usr/$LIBDIR/libgssapi_krb5.so* | |
361 | usr/$LIBDIR/gconv/ISO8859-1.so | |
362 | usr/$LIBDIR/gconv/gconv-modules | |
363 | usr/$LIBDIR/libbeecrypt* | |
364 | usr/$LIBDIR/libexpat* | |
365 | usr/$LIBDIR/libglib* | |
366 | usr/$LIBDIR/libgmodule* | |
367 | usr/$LIBDIR/libgobject* | |
368 | usr/$LIBDIR/libgthread* | |
369 | usr/$LIBDIR/libssl* | |
370 | usr/$LIBDIR/libcrypto* | |
371 | usr/$LIBDIR/libbz2* | |
372 | usr/$LIBDIR/libelf* | |
373 | usr/$LIBDIR/libncurses* | |
374 | usr/$LIBDIR/libnewt* | |
375 | usr/$LIBDIR/libparted* | |
376 | usr/$LIBDIR/libpopt* | |
377 | usr/$LIBDIR/libpython* | |
378 | usr/$LIBDIR/libneon* | |
379 | usr/$LIBDIR/libsqlite3* | |
380 | usr/$LIBDIR/librpm-*4.?.so* | |
381 | usr/$LIBDIR/librpmbuild-*4.?.so* | |
382 | usr/$LIBDIR/librpmdb*4.?.so* | |
383 | usr/$LIBDIR/librpmio*4.?.so* | |
384 | usr/$LIBDIR/libslang* | |
385 | usr/$LIBDIR/libstdc++.so.6* | |
386 | usr/$LIBDIR/libxml2.so* | |
387 | usr/$LIBDIR/libz.* | |
388 | usr/$LIBDIR/libbogl.so* | |
389 | usr/$LIBDIR/libreadline* | |
390 | usr/$LIBDIR/python?.?/* | |
391 | usr/$LIBDIR/python?.?/site-packages/libxml2* | |
392 | usr/$LIBDIR/python?.?/site-packages/*kudzu* | |
393 | usr/$LIBDIR/python?.?/site-packages/rpmmodule.so | |
394 | usr/$LIBDIR/python?.?/site-packages/partedmodule.so | |
395 | usr/$LIBDIR/python?.?/site-packages/ixf86configmodule.so | |
396 | usr/$LIBDIR/python?.?/site-packages/xf86config.py | |
397 | usr/$LIBDIR/python?.?/site-packages/rhpl | |
398 | usr/share/locale/* | |
399 | usr/lib/python?.?/site-packages/urlgrabber/* | |
400 | usr/lib/rpm/macros | |
401 | usr/lib/rpm/rpmpopt | |
402 | usr/lib/rpm/rpmrc | |
403 | usr/lib/yaboot/addnote | |
404 | usr/lib/yaboot/ofboot | |
405 | usr/lib/yaboot/yaboot | |
406 | usr/libexec/convertdb1 | |
407 | usr/share/locale/*/LC_MESSAGES/anaconda.mo | |
408 | usr/share/locale/locale.alias | |
409 | usr/sbin/anaconda | |
410 | usr/sbin/ddcprobe | |
411 | usr/sbin/dmidecode | |
412 | usr/sbin/mkofboot | |
413 | usr/sbin/ofpath | |
414 | usr/sbin/ybin | |
415 | usr/sbin/load_policy | |
416 | usr/sbin/lvm | |
417 | usr/sbin/build-locale-archive | |
418 | usr/share/anaconda/locale-list | |
419 | usr/share/anaconda/anaconda.conf | |
420 | usr/share/terminfo/b/bterm | |
421 | usr/share/terminfo/l/linux | |
422 | usr/share/terminfo/v/vt100 | |
423 | usr/share/terminfo/v/vt100-nav | |
424 | usr/share/hwdata/pcitable | |
425 | usr/share/hwdata/pci.ids | |
426 | usr/share/hwdata/Cards | |
427 | usr/share/hwdata/MonitorsDB | |
428 | usr/share/rhpl/extramodes | |
429 | usr/share/rhpl/vesamodes | |
430 | EOF | |
431 | ||
432 | if [ $ARCH = s390 -o $ARCH = s390x ]; then | |
433 | cat >> $KEEPFILE <<EOF | |
434 | usr/share/terminfo/a/ansi | |
435 | usr/share/terminfo/d/dumb | |
436 | usr/share/terminfo/k/kterm | |
437 | usr/share/terminfo/s/screen | |
438 | usr/share/terminfo/v/vt100 | |
439 | usr/share/terminfo/v/vt100-nav | |
440 | usr/share/terminfo/v/vt102 | |
441 | usr/share/terminfo/x/xterm | |
442 | usr/share/terminfo/x/xterm-color | |
443 | usr/bin/strace | |
444 | usr/bin/ldd | |
445 | usr/sbin/chroot | |
446 | usr/sbin/sshd | |
447 | usr/sbin/glibc_post_upgrade | |
448 | usr/sbin/in.telnetd | |
449 | usr/sbin/xinetd | |
450 | sbin/cmsfslst | |
451 | sbin/cmsfscat | |
452 | sbin/busybox.anaconda | |
453 | sbin/ifconfig | |
454 | sbin/route | |
455 | sbin/portmap | |
456 | sbin/fdasd | |
457 | sbin/dasdfmt | |
458 | sbin/swapon | |
459 | sbin/swapoff | |
460 | sbin/mkswap | |
461 | bin/bash | |
462 | bin/dd | |
463 | bin/gawk | |
464 | bin/mount | |
465 | bin/umount | |
466 | bin/mknod | |
467 | bin/sleep | |
468 | bin/login | |
469 | bin/cat | |
470 | bin/chmod | |
471 | bin/sort | |
472 | $LIBDIR/libpam.so* | |
473 | $LIBDIR/libdl.so* | |
474 | $LIBDIR/libdl-*.so* | |
475 | usr/$LIBDIR/libz.so* | |
476 | $LIBDIR/libnsl.so* | |
477 | $LIBDIR/libnsl-*.so* | |
478 | $LIBDIR/libnss* | |
479 | $LIBDIR/libutil.so* | |
480 | $LIBDIR/libutil-*.so* | |
481 | $LIBDIR/libcrypt* | |
482 | $LIBDIR/libc.so* | |
483 | $LIBDIR/libc-*so* | |
484 | lib/ld*.so* | |
485 | $LIBDIR/ld*.so* | |
486 | $LIBDIR/libresolv.so* | |
487 | $LIBDIR/libresolv-*.so* | |
488 | $LIBDIR/libvtoc*.so* | |
489 | lib/modules/ibm/* | |
490 | etc/xinetd.conf | |
491 | etc/pam.d/sshd | |
492 | etc/pam.d/other | |
493 | etc/security/limits.conf | |
494 | etc/security/pam_env.conf | |
495 | lib/security | |
496 | $LIBDIR/security/pam_* | |
497 | usr/$LIBDIR/libwrap.so* | |
498 | usr/X11R6/$LIBDIR/libXmuu.so* | |
499 | usr/X11R6/$LIBDIR/libX11.so* | |
500 | usr/X11R6/$LIBDIR/libXext.so* | |
501 | usr/X11R6/$LIBDIR/libXxf86misc.so* | |
502 | usr/X11R6/bin/xauth | |
503 | EOF | |
504 | fi | |
505 | ||
506 | # | |
507 | # KEEPFILEGR is all files to keep from the packages in PACKAGESGR | |
508 | # | |
509 | # This defines the files in addition to KEEPFILE that make up the install | |
510 | # images for NFS and CD/DVD based installs. This image is not loaded into | |
511 | # memory so it can be considerably larger. | |
512 | # | |
513 | # The rescue mode of anaconda uses these files as well as those defined | |
514 | # by KEEPFILERESCUE below. The total size of this image should be | |
515 | # under the size of the miniature CD used for the rescue CD (around 68MB). | |
516 | # | |
517 | KEEPFILEGR=/tmp/keepfilegr.$$ | |
518 | cp $KEEPFILE $KEEPFILEGR | |
519 | cat >> $KEEPFILEGR <<EOF | |
520 | boot/efi/EFI/redhat/elilo.efi | |
521 | boot/memtest86* | |
522 | bin/bash | |
523 | bin/cat | |
524 | bin/chmod | |
525 | bin/cp | |
526 | bin/cpio | |
527 | bin/dd | |
528 | bin/df | |
529 | bin/du | |
530 | bin/ln | |
531 | bin/ls | |
532 | bin/mkdir | |
533 | bin/mv | |
534 | bin/ps | |
535 | bin/rm | |
536 | bin/rpm | |
537 | bin/touch | |
538 | boot/*.b | |
539 | boot/bootlx | |
540 | etc/fb.modes | |
541 | etc/gtk-2.0/gtkrc* | |
542 | etc/im_palette.pal | |
543 | etc/imrc | |
544 | etc/man.config | |
545 | etc/pango/* | |
546 | etc/fonts/* | |
547 | etc/prelink.conf | |
548 | etc/rpm/macros.prelink | |
549 | $LIBDIR/libacl* | |
550 | $LIBDIR/libattr* | |
551 | $LIBDIR/libaudit*.so* | |
552 | $LIBDIR/libgcc* | |
553 | $LIBDIR/libnss_dns* | |
554 | $LIBDIR/libpam* | |
555 | $LIBDIR/libproc* | |
556 | sbin/addRamDisk | |
557 | sbin/addSystemMap | |
558 | sbin/debugfs | |
559 | sbin/e2fsck | |
560 | sbin/e2label | |
561 | sbin/reiserfsck | |
562 | sbin/fsck | |
563 | sbin/fsck.ext2 | |
564 | sbin/fsck.ext3 | |
565 | sbin/fsck.jfs | |
566 | sbin/fsck.reiserfs | |
567 | sbin/parted | |
568 | sbin/silo | |
569 | sbin/tune2fs | |
570 | usr/X11R6/bin/XFree86 | |
571 | usr/X11R6/bin/Xorg | |
572 | usr/X11R6/bin/setxkbmap | |
573 | usr/X11R6/bin/xsetroot | |
574 | usr/X11R6/lib/X11/XKeysymDB | |
575 | usr/X11R6/lib/X11/fonts/misc/6x13* | |
576 | usr/X11R6/lib/X11/fonts/misc/fonts* | |
577 | usr/X11R6/lib/X11/fonts/misc/cursor* | |
578 | usr/X11R6/lib/X11/fonts/misc/olcursor* | |
579 | usr/X11R6/lib/X11/fonts/Type1/l047013t* | |
580 | usr/X11R6/lib/X11/fonts/Type1/* | |
581 | usr/X11R6/lib/X11/locale/* | |
582 | usr/X11R6/lib/X11/rgb* | |
583 | usr/X11R6/lib/X11/xkb/* | |
584 | usr/X11R6/lib/X11/xserver/SecurityPolicy | |
585 | usr/X11R6/$LIBDIR/libICE* | |
586 | usr/X11R6/$LIBDIR/libSM* | |
587 | usr/X11R6/$LIBDIR/libXaw.so* | |
588 | usr/X11R6/$LIBDIR/libX11* | |
589 | usr/X11R6/$LIBDIR/libXcursor* | |
590 | usr/X11R6/$LIBDIR/libXext* | |
591 | usr/X11R6/$LIBDIR/libXfixes* | |
592 | usr/X11R6/$LIBDIR/libXft* | |
593 | usr/X11R6/$LIBDIR/libXi* | |
594 | usr/X11R6/$LIBDIR/libxkbfile* | |
595 | usr/X11R6/$LIBDIR/libXmu* | |
596 | usr/X11R6/$LIBDIR/libXpm* | |
597 | usr/X11R6/$LIBDIR/libXrandr* | |
598 | usr/X11R6/$LIBDIR/libXrender* | |
599 | usr/X11R6/$LIBDIR/libXt* | |
600 | usr/X11R6/$LIBDIR/libXxf86misc* | |
601 | usr/X11R6/$LIBDIR/modules/* | |
602 | usr/X11R6/share/Xconfigurator/pixmaps/* | |
603 | usr/bin/chattr* | |
604 | usr/bin/fc-cache | |
605 | usr/bin/gtk-query* | |
606 | usr/bin/gdk-pixbuf-query-loaders* | |
607 | usr/bin/head | |
608 | usr/bin/lsattr* | |
609 | usr/bin/maketilo | |
610 | usr/bin/mini-wm | |
611 | usr/bin/pango* | |
612 | usr/bin/syslinux | |
613 | usr/bin/mkzimage | |
614 | usr/bin/tac | |
615 | usr/bin/tail | |
616 | usr/bin/tilo | |
617 | usr/bin/uniq | |
618 | usr/bin/Xvnc | |
619 | usr/bin/vncconfig | |
620 | usr/bin/vncpasswd | |
621 | usr/bin/reduce-font | |
622 | usr/bin/bdftobogl | |
623 | usr/lib/anaconda/iw | |
624 | usr/lib/bogl/font.bdf.gz | |
625 | usr/$LIBDIR/gconv/* | |
626 | usr/$LIBDIR/gdk-pixbuf/loaders/*png* | |
627 | usr/$LIBDIR/gdk-pixbuf/loaders/*la* | |
628 | usr/$LIBDIR/gtk-2.0/*/engines/libclearlooks.so | |
629 | usr/$LIBDIR/gtk-2.0/*/loaders/*png* | |
630 | usr/$LIBDIR/gtk-2.0/*/loaders/*la* | |
631 | usr/$LIBDIR/gtk-2.0/immodules/ | |
632 | usr/$LIBDIR/libImlib* | |
633 | usr/$LIBDIR/libXft* | |
634 | usr/$LIBDIR/libart* | |
635 | usr/$LIBDIR/libatk* | |
636 | usr/$LIBDIR/libaudio* | |
637 | usr/$LIBDIR/libesd* | |
638 | usr/$LIBDIR/libfontconfig* | |
639 | usr/$LIBDIR/libfreetype* | |
640 | usr/$LIBDIR/libgdk* | |
641 | usr/$LIBDIR/libglade* | |
642 | usr/$LIBDIR/libgnomecanvas* | |
643 | usr/$LIBDIR/libgnomeui* | |
644 | usr/$LIBDIR/libgpm* | |
645 | usr/$LIBDIR/libgtk* | |
646 | usr/$LIBDIR/libjpeg* | |
647 | usr/$LIBDIR/libpango* | |
648 | usr/$LIBDIR/libpng.so.3* | |
649 | usr/$LIBDIR/libpng12.so* | |
650 | usr/$LIBDIR/libstdc++.so.* | |
651 | usr/$LIBDIR/libwrap* | |
652 | usr/$LIBDIR/pango/* | |
653 | usr/$LIBDIR/python?.?/site-packages/gtk*/gtk/* | |
654 | usr/$LIBDIR/rpm/rpmpopt | |
655 | usr/lib/syslinux/* | |
656 | usr/lib/yaboot/* | |
657 | usr/sbin/chroot | |
658 | usr/sbin/ddcprobe | |
659 | usr/sbin/fbset | |
660 | usr/sbin/prelink | |
661 | usr/sbin/smartctl | |
662 | usr/share/anaconda/* | |
663 | usr/share/icons/default/* | |
664 | usr/share/icons/gnome/cursors/* | |
665 | usr/share/icons/gnome/*/stock/* | |
666 | usr/share/icons/gnome/index.theme | |
667 | usr/share/fonts/default/Type1/n019003l* | |
668 | usr/share/fonts/default/Type1/n019004l* | |
669 | usr/share/fonts/default/Type1/n019023l* | |
670 | usr/share/fonts/default/Type1/n019024l* | |
671 | usr/share/fonts/default/Type1/n021003l* | |
672 | usr/share/fonts/default/Type1/n021004l* | |
673 | usr/share/fonts/default/Type1/n021023l* | |
674 | usr/share/fonts/default/Type1/n021024l* | |
675 | usr/share/fonts/korean/TrueType/dotum.ttf | |
676 | usr/share/fonts/japanese/TrueType/kochi-gothic-subst.ttf | |
677 | usr/share/fonts/chinese/TrueType/gbsn00lp.ttf | |
678 | usr/share/fonts/chinese/TrueType/bsmi00lp.ttf | |
679 | usr/share/fonts/bengali/MuktiNarrow.ttf | |
680 | usr/share/fonts/arabic/KacstFarsi.ttf | |
681 | usr/share/fonts/arabic/KacstQura.ttf | |
682 | usr/share/fonts/tamil/lohit_ta.ttf | |
683 | usr/share/fonts/gujarati/lohit_gu.ttf | |
684 | usr/share/fonts/bengali/lohit_bn.ttf | |
685 | usr/share/fonts/hindi/lohit_hi.ttf | |
686 | usr/share/fonts/panjabi/lohit_pa.ttf | |
687 | usr/share/fonts/punjabi/lohit_pa.ttf | |
688 | usr/share/locale/*/LC_MESSAGES/anaconda.mo | |
689 | usr/share/locale/*/LC_MESSAGES/system-config-date.mo | |
690 | usr/share/locale/*/LC_MESSAGES/redhat-dist.mo | |
691 | usr/share/locale/*/LC_MESSAGES/system-config-keyboard.mo | |
692 | usr/share/locale/*/LC_MESSAGES/gtk20.mo | |
693 | usr/share/locale/*/LC_MESSAGES/libc.mo | |
694 | usr/share/locale/*/LC_MESSAGES/rhpl.mo | |
695 | usr/share/locale/*/LC_MESSAGES/parted.mo | |
696 | usr/share/pixmaps/comps/*.png | |
697 | usr/share/pixmaps/gnome-default-dlg.png | |
698 | usr/share/pixmaps/gnome-error.png | |
699 | usr/share/pixmaps/gnome-info.png | |
700 | usr/share/pixmaps/gnome-question.png | |
701 | usr/share/pixmaps/gnome-warning.png | |
702 | usr/share/pixmaps/no.xpm | |
703 | usr/share/pixmaps/yes.xpm | |
704 | usr/share/ppc64-utils/zImage.lds | |
705 | usr/share/system-config-keyboard/* | |
706 | usr/share/terminfo/l/linux | |
707 | usr/share/terminfo/x/xterm | |
708 | usr/share/terminfo/v/vt100 | |
709 | usr/share/terminfo/v/vt100-nav | |
710 | usr/share/themes/Clearlooks/gtk-2.0/* | |
711 | usr/share/themes/Clearlooks/index.theme | |
712 | usr/share/vte/termcap/xterm | |
713 | usr/share/zoneinfo/zone.tab | |
714 | EOF | |
715 | ||
716 | TIMEZONES=" | |
717 | usr/share/zoneinfo/Africa | |
718 | usr/share/zoneinfo/America | |
719 | usr/share/zoneinfo/Antarctica | |
720 | usr/share/zoneinfo/Arctic | |
721 | usr/share/zoneinfo/Asia | |
722 | usr/share/zoneinfo/Atlantic | |
723 | usr/share/zoneinfo/Australia | |
724 | usr/share/zoneinfo/Canada | |
725 | usr/share/zoneinfo/Europe | |
726 | usr/share/zoneinfo/Indian | |
727 | usr/share/zoneinfo/Japan | |
728 | usr/share/zoneinfo/Mideast | |
729 | usr/share/zoneinfo/Pacific | |
730 | usr/share/zoneinfo/US | |
731 | " | |
732 | ||
733 | # sparc needs 100dpi fonts as well, otherwise | |
734 | # things look ugly | |
735 | ||
736 | if [ $ARCH = sparc ]; then | |
737 | cat >> $KEEPFILEGR <<-EOF | |
738 | usr/X11R6/lib/X11/fonts/100dpi/cour* | |
739 | usr/X11R6/lib/X11/fonts/100dpi/helv* | |
740 | usr/X11R6/lib/X11/fonts/100dpi/tim* | |
741 | usr/X11R6/lib/X11/fonts/100dpi/fonts* | |
742 | usr/share/fonts/ISO8859-2/100dpi/cour* | |
743 | usr/share/fonts/ISO8859-2/100dpi/helv* | |
744 | usr/share/fonts/ISO8859-2/100dpi/tim* | |
745 | usr/share/fonts/ISO8859-2/100dpi/fonts* | |
746 | EOF | |
747 | fi | |
748 | ||
749 | # | |
750 | # KEEPFILERESCUE is all files to keep from the packages in PACKAGESRESCUE | |
751 | # | |
752 | # This defines the files in addition to KEEPFILE and KEEPFILEGR that make up | |
753 | # the install images for NFS and CD/DVD based rescue mode installs. This | |
754 | # image is not loaded into memory so it can be considerably larger. | |
755 | # | |
756 | # NOTE: hd, ftp, and http rescue mode use and image based on KEEPFILE since | |
757 | # it has to be much smaller due to memory usage. | |
758 | # | |
759 | KEEPFILERESCUE=/tmp/keepfilerescue.$$ | |
760 | cat > $KEEPFILERESCUE <<EOF | |
761 | bin/gunzip | |
762 | bin/gzip | |
763 | bin/mt | |
764 | bin/ping | |
765 | bin/sync | |
766 | bin/tar | |
767 | bin/zcat | |
768 | etc/joe/* | |
769 | sbin/arp | |
770 | sbin/depmod | |
771 | sbin/dump | |
772 | sbin/ifconfig | |
773 | sbin/insmod | |
774 | sbin/lsmod | |
775 | sbin/lspci | |
776 | sbin/modinfo | |
777 | sbin/modprobe | |
778 | sbin/netstat | |
779 | sbin/restore | |
780 | sbin/rrestore | |
781 | sbin/rmmod | |
782 | sbin/route | |
783 | usr/bin/bunzip2 | |
784 | usr/bin/bzcat | |
785 | usr/bin/bzip2 | |
786 | usr/bin/emacs | |
787 | usr/bin/find | |
788 | usr/bin/ftp | |
789 | usr/bin/jmacs | |
790 | usr/bin/joe | |
791 | usr/bin/jpico | |
792 | usr/bin/less | |
793 | usr/bin/mattrib | |
794 | usr/bin/mbadblocks | |
795 | usr/bin/mcd | |
796 | usr/bin/mcopy | |
797 | usr/bin/mdel | |
798 | usr/bin/mdeltree | |
799 | usr/bin/mdir | |
800 | usr/bin/mdu | |
801 | usr/bin/mformat | |
802 | usr/bin/minfo | |
803 | usr/bin/mlabel | |
804 | usr/bin/mmd | |
805 | usr/bin/mmount | |
806 | usr/bin/mmove | |
807 | usr/bin/mpartition | |
808 | usr/bin/mrd | |
809 | usr/bin/mread | |
810 | usr/bin/mren | |
811 | usr/bin/mshowfat | |
812 | usr/bin/mtools | |
813 | usr/bin/mtype | |
814 | usr/bin/mzip | |
815 | usr/bin/open | |
816 | usr/bin/rcp | |
817 | usr/bin/rlogin | |
818 | usr/bin/rsh | |
819 | usr/bin/scp | |
820 | usr/bin/sftp | |
821 | usr/bin/shred | |
822 | usr/bin/ssh | |
823 | usr/bin/termidx | |
824 | usr/bin/xargs | |
825 | usr/kerberos/$LIBDIR/libgssapi* | |
826 | usr/kerberos/$LIBDIR/libkrb5* | |
827 | usr/kerberos/$LIBDIR/libk5crypto* | |
828 | usr/kerberos/$LIBDIR/libcom_err* | |
829 | usr/sbin/mtr | |
830 | usr/sbin/traceroute | |
831 | EOF | |
832 | ||
833 | echo "Assembling package list..." | |
834 | RPMS=$(prunePackageList $PACKAGEDIR "$PACKAGES") | |
835 | [ -n "$DEBUG" ] && echo "RPMS are $RPMS" | |
836 | RPMSGR=$(prunePackageList $PACKAGEDIR "$PACKAGESGR $PACKAGESRESCUE") | |
837 | [ -n "$DEBUG" ] && echo "RPMSGR are $RPMSGR" | |
838 | ||
839 | rm -rf $DEST; mkdir -p $DEST/usr/sbin | |
840 | rm -rf $DESTGR; mkdir -p $DESTGR/usr/sbin $DESTGR/var/lib $DESTGR/boot | |
841 | ln -s /tmp $DESTGR/var/lib/xkb | |
842 | ||
843 | # | |
844 | # concat KEEPFILEGR and KEEPFILERESCUE lists | |
845 | # | |
846 | cat $KEEPFILERESCUE >> $KEEPFILEGR | |
847 | ||
848 | # | |
849 | # filter paths in keepfile lists for use by cpio | |
850 | # | |
851 | for file in $KEEPFILE $KEEPFILEGR; do | |
852 | cat $file | awk '{print $1 "\n./" $1}' > $file- | |
853 | mv -f $file- $file | |
854 | done | |
855 | ||
856 | echo "Expanding text packages..." | |
857 | expandPackageSet "$RPMS" $DEST $KEEPFILE | |
858 | ||
859 | (cd $DEST; tar cSpf - .) | (cd $DESTGR; tar xSpf -) | |
860 | ||
861 | echo "Expanding graphical packages..." | |
862 | expandPackageSet "$RPMSGR" $DESTGR $KEEPFILEGR | |
863 | ||
864 | echo "retrieving timezones" | |
865 | TZDIR=/tmp/glibc-timezone-$$ | |
866 | mkdir -p $TZDIR/usr/share/zoneinfo | |
867 | rpm2cpio $TZDATA | (cd $TZDIR; cpio --quiet -iumd usr/share/zoneinfo ./usr/share/zoneinfo ./usr/share/zoneinfo/* usr/share/zoneinfo/*) | |
868 | [ $? = 0 ] || die "ERROR: Unable to expand timezone data ($TZDATA)" | |
869 | (cd $TZDIR; tar cSpf - $TIMEZONES) | (cd $DEST; tar xSpf -) | |
870 | (cd $TZDIR; tar cSpf - $TIMEZONES) | (cd $DESTGR; tar xSpf -) | |
871 | ||
872 | chown -R root:root $DEST $DESTGR | |
873 | chmod -R a+rX-w $DEST $DESTGR | |
874 | if [ $ARCH = s390 -o $ARCH = s390x ]; then | |
875 | for i in $DEST $DESTGR; do | |
876 | mv $i/bin/sed $i/bin/sed_save | |
877 | mv $i/bin/sort $i/bin/sort_save | |
878 | done | |
879 | fi | |
880 | ||
881 | # change mtimes to 0 (to match what happens on the cramfs) | |
882 | for p in $DEST $DESTGR; do | |
883 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
884 | runroot $COMPONENT --onlyone --arch $ARCH "cd $p\; usr/lib/anaconda-runtime/fixmtime.py $DEBUG $p" | |
885 | else | |
886 | $p/usr/lib/anaconda-runtime/fixmtime.py $DEBUG $p | |
887 | fi | |
888 | done | |
889 | ||
890 | # Remove locales unused during the install | |
891 | cat $DESTGR/usr/lib/anaconda/lang-table* | awk ' | |
892 | { gsub("-", "", $4); | |
893 | print $4; | |
894 | print gensub(/\..*$/,"","",$4); | |
895 | print gensub(/_.*$/,"","",$4); | |
896 | if (split ($4, a, ".") > 1) { | |
897 | print gensub(/\..*$/,tolower("." a[2]),"",$4); | |
898 | }; | |
899 | gsub("-", "", $7); | |
900 | print $7; | |
901 | print gensub(/\..*$/,"","",$7); | |
902 | print gensub(/_.*$/,"","",$7); | |
903 | if (split ($7, a, ".") > 1) { | |
904 | print gensub(/\..*$/,tolower("." a[2]),"",$7); | |
905 | }; | |
906 | } | |
907 | ' | LC_ALL=C sort -u > $DESTGR/locales | |
908 | # lib not used below | |
909 | for p in share; do ( | |
910 | cd $DESTGR/usr/$p/locale && { | |
911 | ls | grep -v locale.alias | LC_ALL=C sort > $DESTGR/locales.list | |
912 | LC_ALL=C comm -13 $DESTGR/locales $DESTGR/locales.list | xargs rm -rf | |
913 | } | |
914 | ); done | |
915 | rm -f $DESTGR/locales $DESTGR/locales.list | |
916 | ||
917 | # now, create a locale archive and nuke the locale dirs since | |
918 | # that ends up taking less space | |
919 | #for p in $DEST $DESTGR; do | |
920 | # echo "Building locale archive" | |
921 | # if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
922 | # runroot $COMPONENT --onlyone --arch $ARCH "/usr/sbin/chroot $p /usr/sbin/build-locale-archive" | |
923 | # else | |
924 | # /usr/sbin/chroot $p /usr/sbin/build-locale-archive | |
925 | # fi | |
926 | # mv $p/usr/lib/locale/locale-archive $p/usr/lib/locale-archive | |
927 | # rm -rf $p/usr/lib/locale/* | |
928 | # rm -f $p/usr/sbin/build-locale-archive | |
929 | # mv $p/usr/lib/locale-archive $p/usr/lib/locale/locale-archive | |
930 | #done | |
931 | ||
932 | # Remove unneeded XFree86 modules | |
933 | rm -rf $DESTGR/usr/X11R6/$LIBDIR/modules/dri | |
934 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/libscanpci.a | |
935 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/libxf1bpp.a | |
936 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/fonts/libspeedo.a | |
937 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/drivers/linux/v4l_drv.o | |
938 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/extensions/libdri.a | |
939 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/extensions/libxtrap.a | |
940 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/extensions/librecord.a | |
941 | ||
942 | rm -f $DESTGR/usr/X11R6/$LIBDIR/modules/extensions/lib{GLcore,glx,pex5}* | |
943 | ||
944 | # fixup joe links | |
945 | ln -fs jpicorc $DESTGR/etc/joe/picorc | |
946 | ln -fs jmacsrc $DESTGR/etc/joe/emacsrc | |
947 | ln -fs jmacs $DESTGR/usr/bin/emacs | |
948 | ln -fs jpico $DESTGR/usr/bin/pico | |
949 | ||
950 | echo "Creating nsswitch.conf" | |
951 | cat > $DEST/etc/nsswitch.conf <<EOF | |
952 | # munged nsswitch.conf with just what anaconda needs | |
953 | # created by upd-instroot | |
954 | # | |
955 | passwd: files | |
956 | shadow: files | |
957 | group: files | |
958 | hosts: files dns | |
959 | ethers: files | |
960 | netmasks: files | |
961 | networks: files | |
962 | protocols: files | |
963 | rpc: files | |
964 | services: files | |
965 | netgroup: files | |
966 | automount: files | |
967 | aliases: files | |
968 | EOF | |
969 | ||
970 | cp $DEST/etc/nsswitch.conf $DESTGR/etc/nsswitch.conf | |
971 | ||
972 | # fixup man.config to point into /mnt/sysimage for rescue | |
973 | echo "Fixing up /etc/man.config to point into /mnt/sysimage" | |
974 | if [ -n "$NEEDGR" ]; then | |
975 | mv $DESTGR/etc/man.config $DESTGR/etc/man.config-old | |
976 | cat $DESTGR/etc/man.config-old | sed 's^/usr/bin^/mnt/sysimage/usr/bin^' | sed 's^/bin/cat^/mnt/sysimage/usr/bin/cat^' > $DESTGR/etc/man.config | |
977 | rm -f $DESTGR/etc/man.config-old | |
978 | fi | |
979 | ||
980 | echo "Creating bogl font..." | |
981 | OLDLANG=$LANG | |
982 | export LANG=en_US.UTF-8 | |
983 | zcat $DESTGR/usr/lib/bogl/font.bdf.gz > $DESTGR/usr/lib/bogl/font.bdf | |
984 | (cat $DESTGR/usr/lib/anaconda-runtime/loader/unicode-linedraw-chars.txt ; for i in $(find $DESTGR/usr/share/locale -name '*.mo'); do msgunfmt $i 2>/dev/null | msgconv -t utf-8 -o - - ; done) | $DESTGR/usr/bin/reduce-font $DESTGR/usr/lib/bogl/font.bdf > $DESTGR/usr/lib/anaconda-runtime/loader/font-reduced.bdf | |
985 | $DESTGR/usr/bin/bdftobogl -b $DESTGR/usr/lib/anaconda-runtime/loader/font-reduced.bdf > $DESTGR/usr/lib/anaconda-runtime/loader/font.bgf | |
986 | rm -f $DESTGR/usr/lib/anaconda-runtime/loader/font-reduced.bdf $DESTGR/usr/lib/bogl/font.bdf $DESTGR/usr/bin/reduce-font $DESTGR/usr/bin/bdftobogl $DESTGR/usr/lib/bogl/font.bdf.gz | |
987 | gzip -9 -f $DESTGR/usr/lib/anaconda-runtime/loader/font.bgf | |
988 | export LANG=$OLDLANG | |
989 | ||
990 | echo "Running mkfontdir..." | |
991 | if [ -n "$NEEDGR" ]; then | |
992 | /usr/X11R6/bin/mkfontdir $DESTGR/usr/X11R6/lib/X11/fonts/* | |
993 | rm -f $DESTGR/usr/X11R6/bin/mkfontdir | |
994 | fi | |
995 | ||
996 | echo "Getting pango modules" | |
997 | if [ -n "$NEEDGR" ]; then | |
998 | # sick sick sick hack for pango-querymodules being -32 or -64 | |
999 | mv $DESTGR/usr/bin/pango-querymodules* $DESTGR/usr/bin/pango-querymodules | |
1000 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1001 | runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/pango-querymodules 2> $DESTGR/etc/pango/pango.modules" | |
1002 | else | |
1003 | LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/pango-querymodules > $DESTGR/etc/pango/pango.modules | |
1004 | fi | |
1005 | rm -f $DESTGR/usr/bin/pango-querymodules | |
1006 | # more sick hackery since it doesn't fall back to this like owen thought | |
1007 | cat > $DESTGR/etc/pango/pangorc <<EOF | |
1008 | [Pango] | |
1009 | ModuleFiles=/etc/pango/pango.modules | |
1010 | EOF | |
1011 | fi | |
1012 | ||
1013 | host=`rpm --nodigest --nosignature -qp --qf "%{POSTIN}\n" $PACKAGEDIR/gtk2*.$ARCH.rpm |grep update-gdk-pixbuf |awk {'print $2;'}` | |
1014 | ||
1015 | case "$host" in | |
1016 | *linux) canonhost="$host-gnu" | |
1017 | ;; | |
1018 | *) canonhost=$host | |
1019 | ;; | |
1020 | esac | |
1021 | ||
1022 | # autoconf uses powerpc not ppc | |
1023 | HOSTTRIPLET=`echo $canonhost | sed "s/^ppc/powerpc/"` | |
1024 | ||
1025 | ||
1026 | mkdir -p $DESTGR/etc/gtk-2.0/$HOSTTRIPLET | |
1027 | ||
1028 | echo "Getting gtk2 input method modules" | |
1029 | if [ -n "$NEEDGR" ]; then | |
1030 | mv $DESTGR/usr/bin/gtk-query-immodules-2.0* $DESTGR/usr/bin/gtk-query-immodules-2.0 | |
1031 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1032 | runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gtk-query-immodules-2.0 2> $DESTGR/etc/gtk-2.0/$HOSTTRIPLET/gtk.immodules" | |
1033 | else | |
1034 | LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gtk-query-immodules-2.0 > $DESTGR/etc/gtk-2.0/$HOSTTRIPLET/gtk.immodules | |
1035 | fi | |
1036 | rm -f $DESTGR/usr/bin/gtk-query-immodules-2.0 | |
1037 | fi | |
1038 | ||
1039 | echo "Getting gtk2 gdk-pixbuf loaders" | |
1040 | if [ -n "$NEEDGR" ]; then | |
1041 | mv $DESTGR/usr/bin/gdk-pixbuf-query-loaders* $DESTGR/usr/bin/gdk-pixbuf-query-loaders | |
1042 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1043 | runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gdk-pixbuf-query-loaders 2> $DESTGR/etc/gtk-2.0/$HOSTTRIPLET/gdk-pixbuf.loaders" | |
1044 | else | |
1045 | LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gdk-pixbuf-query-loaders > $DESTGR/etc/gtk-2.0/$HOSTTRIPLET/gdk-pixbuf.loaders | |
1046 | fi | |
1047 | rm -f $DESTGR/usr/bin/gdk-pixbuf-query-loaders | |
1048 | fi | |
1049 | ||
1050 | rm -f $KEEPFILE $KEEPFILEGR $KEEPFILERESCUE | |
1051 | ||
1052 | for p in $DEST $DESTGR; do | |
1053 | echo "Scrubbing trees..." "$p" | |
1054 | cp $p/usr/lib/anaconda/raidstart-stub $p/usr/bin/raidstart | |
1055 | cp $p/usr/lib/anaconda/raidstop-stub $p/usr/bin/raidstop | |
1056 | cp $p/usr/lib/anaconda/losetup-stub $p/usr/bin/losetup | |
1057 | cp $p/usr/lib/anaconda/pump-stub $p/usr/bin/pump | |
1058 | cp $p/usr/lib/anaconda/list-harddrives-stub $p/usr/bin/list-harddrives | |
1059 | cp $p/usr/lib/anaconda/kudzu-probe-stub $p/usr/bin/kudzu-probe | |
1060 | cp $p/usr/lib/anaconda/loadkeys-stub $p/usr/bin/loadkeys | |
1061 | cp $p/usr/lib/anaconda/mknod-stub $p/usr/bin/mknod | |
1062 | cp $p/usr/lib/anaconda/rescue-startx-stub $p/usr/bin/rescue-startx | |
1063 | mv $p/usr/sbin/anaconda $p/usr/bin/anaconda | |
1064 | mv $p/usr/lib/anaconda-runtime/lib* $p/usr/$LIBDIR | |
1065 | ||
1066 | # we only want the libunicode-lite stuff on the minimal image | |
1067 | if [ $p = $DESTGR ]; then | |
1068 | rm -f $p/usr/$LIBDIR/libunicode-lite* | |
1069 | fi | |
1070 | ||
1071 | find $p -type d | xargs chmod 755 | |
1072 | ||
1073 | if [ -f $p/bin/bash ]; then | |
1074 | rm -f $p/bin/ash | |
1075 | ln -s bash $p/bin/sh | |
1076 | else | |
1077 | ln -sf busybox $p/bin/sh | |
1078 | fi | |
1079 | ||
1080 | [ -d $p/bin ] || die "ERROR: directory missing: $p/bin" | |
1081 | [ -d $p/sbin ] || die "ERROR: directory missing: $p/sbin" | |
1082 | (cd $p/bin; find) | (cd $p/bin; /bin/cpio --quiet -pdmu $p/usr/bin) | |
1083 | (cd $p/sbin; find) | (cd $p/sbin; /bin/cpio --quiet -pdmu $p/usr/sbin) | |
1084 | rm -rf $p/bin | |
1085 | rm -rf $p/sbin | |
1086 | ||
1087 | # copy bootloader files for sparc | |
1088 | if [ $ARCH = sparc -a $p = $DESTGR ]; then | |
1089 | mkdir -p $p/usr/lib/anaconda-runtime/boot | |
1090 | [ -d $p/boot ] || die "ERROR: directory missing: $p/boot" | |
1091 | (cd $p/boot; find -name "*.b") | (cd $p/boot; /bin/cpio --quiet -pdmu $p/usr/lib/anaconda-runtime/boot) | |
1092 | fi | |
1093 | ||
1094 | # copy bootloader file for alpha | |
1095 | if [ $ARCH = alpha -a $p = $DESTGR ]; then | |
1096 | mkdir -p $p/usr/lib/anaconda-runtime/boot | |
1097 | cp -af $p/boot/bootlx $p/usr/lib/anaconda-runtime/boot | |
1098 | fi | |
1099 | ||
1100 | # copy bootloader files for ia64 | |
1101 | if [ $ARCH = ia64 -a $p = $DESTGR ]; then | |
1102 | mkdir -p $p/usr/lib/anaconda-runtime/boot | |
1103 | cp -af $p/boot/efi/EFI/redhat//* $p/usr/lib/anaconda-runtime/boot | |
1104 | fi | |
1105 | ||
1106 | # copy bootloader files for i386/x86_64 | |
1107 | if [ $ARCH = i386 -o $ARCH = x86_64 ]; then | |
1108 | if [ $p = $DESTGR ]; then | |
1109 | mkdir -p $p/usr/lib/anaconda-runtime/boot | |
1110 | cp -af $p/boot/memtest* $p/usr/lib/anaconda-runtime/boot | |
1111 | fi | |
1112 | fi | |
1113 | ||
1114 | rm -rf $p/boot $p/home $p/root $p/tmp | |
1115 | ||
1116 | find $p -name "*.a" | grep -v "usr/X11R6/$LIBDIR/modules" | xargs rm -rf | |
1117 | find $p -name "lib*.la" |grep -v "usr/$LIBDIR/gtk-2.0" | xargs rm -rf | |
1118 | for f in newt popt rpm rpmio; do | |
1119 | rm -f $p/usr/$LIBDIR/lib$f.so | |
1120 | done | |
1121 | ||
1122 | # nuke some python stuff we don't need | |
1123 | for d in idle distutils email bsddb lib-old hotshot doctest.py pydoc.py site-packages/japanese site-packages/japanese.pth ; do | |
1124 | rm -rf $p/$d | |
1125 | done | |
1126 | ||
1127 | if [ "$ARCH" != "s390" -a "$ARCH" != "s390x" ]; then | |
1128 | (cd $p/lib && rm -f libnss_files.so.1 libnss_dns.so.1) | |
1129 | fi | |
1130 | ||
1131 | if [ -d $DEST/usr/share/zoneinfo ]; then | |
1132 | (cd $DEST/usr/share/zoneinfo; find . -type f -or -type l | | |
1133 | grep '^./[A-Z]' | sort | sed 's/^..//' | | |
1134 | gzip -9) > $p/usr/lib/timezones.gz | |
1135 | else | |
1136 | echo "ERROR: unable to explode tzdata for small images" | |
1137 | fi | |
1138 | ||
1139 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1140 | runroot $COMPONENT --onlyone --arch $ARCH "cd $p\; usr/lib/anaconda-runtime/scrubtree $DEBUG $p" | |
1141 | else | |
1142 | $p/usr/lib/anaconda-runtime/scrubtree $p | |
1143 | fi | |
1144 | done | |
1145 | ||
1146 | echo "Compressing .mo files in stage2 images..." | |
1147 | if [ -d $DEST/usr/share/locale ]; then | |
1148 | for i in `find $DEST/usr/share/locale -name anaconda.mo`; do | |
1149 | gzip -9 $i | |
1150 | mv -f $i.gz $i | |
1151 | done | |
1152 | fi | |
1153 | ||
1154 | echo "Creating fontconfig cache" | |
1155 | if [ -n "$NEEDGR" ]; then | |
1156 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1157 | runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/fc-cache" | |
1158 | else | |
1159 | LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/fc-cache | |
1160 | fi | |
1161 | rm -f $DESTGR/usr/bin/fc-cache | |
1162 | fi | |
1163 | ||
1164 | echo "Creating debug dir" | |
1165 | for p in $DEST $DESTGR ; do | |
1166 | mkdir -p $p/usr/lib/debug | |
1167 | done | |
1168 | ||
1169 | if [ $ARCH = "alpha" ]; then | |
1170 | rm -rf $DEST/usr/share/locale | |
1171 | rm -rf $DEST/usr/$LIBDIR/locale | |
1172 | fi | |
1173 | ||
1174 | echo "Patching python library..." | |
1175 | ||
1176 | # always use passive mode for ftp installs | |
1177 | cd $DEST/usr/$LIBDIR/python2.4 | |
1178 | patch -p0 > /dev/null <<EOF | |
1179 | --- urllib.py.orig Thu Oct 25 17:05:06 2001 | |
1180 | +++ urllib.py Thu Oct 25 17:05:34 2001 | |
1181 | @@ -453,6 +453,7 @@ | |
1182 | path, attrs = splitattr(path) | |
1183 | path = unquote(path) | |
1184 | dirs = path.split('/') | |
1185 | + dirs[0] = '/' + dirs[0] | |
1186 | dirs, file = dirs[:-1], dirs[-1] | |
1187 | if dirs and not dirs[0]: dirs = dirs[1:] | |
1188 | if dirs and not dirs[0]: dirs[0] = '/' | |
1189 | @@ -707,6 +708,7 @@ | |
1190 | self.ftp = ftplib.FTP() | |
1191 | self.ftp.connect(self.host, self.port) | |
1192 | self.ftp.login(self.user, self.passwd) | |
1193 | + self.ftp.set_pasv(1) | |
1194 | for dir in self.dirs: | |
1195 | self.ftp.cwd(dir) | |
1196 | EOF | |
1197 | cd - | |
1198 | ||
1199 | echo -n -e "Removing unused python files in hdimage... " | |
1200 | ||
1201 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1202 | runroot $COMPONENT --onlyone --arch $ARCH "cd $DEST\; usr/lib/anaconda-runtime/pythondeps $DEST" | |
1203 | else | |
1204 | $DEST/usr/lib/anaconda-runtime/pythondeps $DEST | |
1205 | fi | |
1206 | echo "done." | |
1207 | ||
1208 | for p in $DEST $DESTGR; do | |
1209 | find $p -name "*.py" | while read fn; do | |
1210 | rm -f ${fn}o | |
1211 | rm -f ${fn}c | |
1212 | ln -sf /dev/null ${fn}c | |
1213 | done | |
1214 | done | |
1215 | ||
1216 | # do some stripping of debugging symbols | |
1217 | if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then | |
1218 | runroot $COMPONENT --onlyone --arch $ARCH "\"find $DEST -type f -name '*.so' -exec strip -g '{}' ';'\"" | |
1219 | runroot $COMPONENT --onlyone --arch $ARCH "\"find $DESTGR -type f -name '*.so' -exec strip -g '{}' ';'\"" | |
1220 | else | |
1221 | find $DEST -type f -name '*.so' |xargs strip -g | |
1222 | find $DESTGR -type f -name '*.so' |xargs strip -g | |
1223 | fi | |
1224 | ||
1225 | # some python stuff we don't need for stage2 | |
1226 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/distutils/ | |
1227 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/lib-dynload/japanese | |
1228 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/encodings/ | |
1229 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/compiler/ | |
1230 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/email/ | |
1231 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/curses/ | |
1232 | rm -f $DESTGR/usr/$LIBDIR/python?.?/site-packages/pydoc.py | |
1233 | ||
1234 | # clean up tzdata | |
1235 | rm -rf $TZDIR | |
1236 | ||
1237 | # this is only for the minimal second stage | |
1238 | echo "Cleaning ramdisk install images..." | |
1239 | rm -rf $DEST/usr/lib/anaconda-runtime | |
1240 | ||
1241 | if [ "$ARCH" != "s390" -a "$ARCH" != "s390x" ]; then | |
1242 | if [ $NEEDGR ]; then | |
1243 | # Xserver needs a place to put the compiled xkb maps. | |
1244 | rm -rf $DESTGR/usr/X11R6/lib/X11/xkb/compiled | |
1245 | ln -s /tmp $DESTGR/usr/X11R6/lib/X11/xkb/compiled | |
1246 | fi | |
1247 | ||
1248 | if [ -n "$NEEDGR" ]; then | |
1249 | cd $ORIGDIR | |
1250 | $DESTGR/usr/lib/anaconda-runtime/checkcards.py $DESTGR/usr/share/hwdata/pcitable $DESTGR/usr/share/hwdata/Cards | |
1251 | fi | |
1252 | fi |