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