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