diff --git a/etc/modules/modules b/etc/modules/modules index 0582d60a..b173cbf7 100644 --- a/etc/modules/modules +++ b/etc/modules/modules @@ -1,94 +1,84 @@ -# -# Kernel modules for the initrd.img boot image -# One module per line. Lorax will use module-init-utils to resolve -# dependencies and make sure the modules specified here have all of -# the required modules in order to load. -# - -=net -=scsi -aes_generic -appletouch -arc4 -cbc -cifs -cramfs -crc32c -crypto_blkcipher -dm-crypt -dm-emc -dm-mirror -dm-mod -dm-multipath -dm-round-robin -dm-snapshot -dm-zero -drm -ecb -edd -ehci-hcd -ext2 -ext3 -ext4dev fat -firewire-ohci -firewire-sbp2 +vfat +nfs +sunrpc +lockd floppy +cramfs +loop +edd +pcspkr +squashfs +ipv6 +virtio_pci +ohci-hcd +uhci-hcd +ehci-hcd +usbhid +mousedev +usb-storage +sd_mod +sr_mod +ub +appletouch +ohci1394 +sbp2 fw-ohci fw-sbp2 -gfs2 -hid -i810 -i82365 -i830 -i915 +firewire-sbp2 +firewire-ohci +mmc-block +sdhci +sdhci-pci ide-cd ide-cd_mod -ipv6 +sr_mod +sg +st +sd_mod +scsi_mod iscsi_tcp -jfs -linear -lock_nolock -lockd -loop -lrw -mga -mousedev +iscsi_ibft +fat msdos -nfs -nouveau -ohci-hcd -ohci1394 -pcmcia -pcspkr -r128 -radeon +vfat +ext2 +ext3 +ext4 +reiserfs +jfs +xfs +gfs2 +cifs +fuse +btrfs +dm-mod +dm-zero +dm-snapshot +dm-mirror +dm-multipath +dm-round-robin +dm-crypt raid0 raid1 -raid10 -raid456 raid5 raid6 -reiserfs -savage -sbp2 -scsi_mod -sd_mod -sg +raid456 +raid10 +linear sha256_generic -sis -squashfs -sr_mod -st -sunrpc -tcic -tdfx -ub -uhci-hcd -usb-storage -vfat -via -virtio_pci -xfs +cbc xts +lrw +aes_generic +crypto_blkcipher +crc32c +ecb +arc4 yenta_socket +i82365 +tcic +pcmcia +=scsi +=net +=drm diff --git a/etc/packages/packages b/etc/packages/packages.all similarity index 64% rename from etc/packages/packages rename to etc/packages/packages.all index d5d52e03..62065d25 100644 --- a/etc/packages/packages +++ b/etc/packages/packages.all @@ -1,22 +1,9 @@ -# -# List of packages or files required to build boot and install images. -# One package or filename per line. Dependencies resovled by yum. -# -# Packages may be excluded by prefixing them with a minus (-) sign. -# -# Per-architecture packages can be specified in packages.ARCH files. -# These are added to this list to form the final package set for that -# platform. -# - -/etc/gtk-2.0/gtkrc GConf2 NetworkManager ORBit2 PolicyKit -VLGothic-fonts acl -anaconda +#anaconda anaconda-yum-plugins at-spi atk @@ -24,73 +11,57 @@ attr audit-libs bash bitmap-fonts-cjk -booty -busybox-anaconda +btrfs-progs bzip2 bzip2-libs cairo -cjkunifonts-ukai +cjkuni-uming-fonts comps-extras coreutils cpio +cracklib cracklib-dicts cracklib-python cryptsetup-luks db4 dbus dbus-python -dejavu-fonts +dejavu-sans-fonts +dejavu-sans-mono-fonts device-mapper device-mapper-libs dhclient dhcpv6-client -dmapi dmraid dmraid-libs dogtail dosfstools -dump e2fsprogs e2fsprogs-libs echo-icon-theme +ethtool elfutils-libelf expat -findutils -firstaidkit-plugin-all firstboot fontconfig fonts-ISO8859-2 -fonts-arabic -fonts-bengali -fonts-chinese -fonts-gujarati -fonts-hindi -fonts-indic -fonts-kannada -fonts-korean -fonts-malayalam -fonts-oriya -fonts-punjabi -fonts-sinhala -fonts-tamil -fonts-telugu freetype -ftp gail +gawk +gdb-gdbserver gdk-pixbuf gfs2-utils glib2 -glibc glibc-common gnome-python2-canvas gnome-python2-gconf gnome-python2-gtkhtml2 gnome-themes gpm +grep gtk2 gtk2-engines gtkhtml2 -gzip hal hdparm hwdata @@ -99,10 +70,8 @@ iproute iputils iscsi-initiator-utils jfsutils -joe keyutils-libs krb5-libs -less libICE libSM libX11 @@ -130,20 +99,14 @@ libattr libbdevid libbdevid-python libbonobo -libdhcp -libdhcp4client -libdhcp6client libfontenc libgcc -libgcrypt libglade2 libgnomecanvas +libgcrypt libgpg-error -libidn libjpeg -liblbxutil libnl -libpixman libpng libselinux libselinux-python @@ -151,7 +114,6 @@ libsemanage libsemanage-python libsepol libstdc++ -libtermcap libthai libuser libuser-python @@ -159,16 +121,26 @@ libvolume_id libxcb libxkbfile libxml2 +lklug-fonts +lohit-assamese-fonts +lohit-bengali-fonts +lohit-gujarati-fonts +lohit-hindi-fonts +lohit-kashmiri-fonts +lohit-kannada-fonts +lohit-maithili-fonts +lohit-marathi-fonts +lohit-oriya-fonts +lohit-punjabi-fonts +lohit-sindhi-fonts +lohit-tamil-fonts +lohit-telugu-fonts lvm2 -man +madan-fonts mdadm mesa-dri-drivers mkinitrd module-init-tools -modutils -mt-st -mtools -mtr nash ncurses neon @@ -178,17 +150,12 @@ newt-python nfs-utils nspr nss -ntfsprogs -open -openssh -openssh-clients -openssl +ntfs-3g pam pango parted pciutils pcre -policy policycoreutils popt prelink @@ -199,16 +166,14 @@ pygtk2 pygtk2-libglade pykickstart pyparted -pyspi python python-bugzilla -python-elementtree +python-decorator python-libs python-pyblock python-sqlite python-urlgrabber pyxf86config -raidtools readline redhat-artwork reiserfs-utils @@ -216,67 +181,80 @@ rhpl rpm rpm-libs rpm-python -rsh -rsync -samba-client sed selinux-policy-targeted setup slang -smartmontools +smc-meera-fonts specspo sqlite synaptics system-config-date system-config-keyboard -system-logos -system-release +#${brandpkgname}-logos +#${brandpkgname}-release taipeifonts -tar tcp_wrappers -traceroute -ttfonts-bn -ttfonts-gu -ttfonts-hi -ttfonts-ja -ttfonts-ko -ttfonts-pa -ttfonts-ta -ttfonts-zh_CN -ttfonts-zh_TW tzdata udev +un-core-fonts-dotum urw-fonts util-linux-ng -vnc-libs -vnc-server +tigervnc-server +tigervnc-server-module +vlgothic-fonts +vim-minimal wpa_supplicant +xkeyboard-config xfsdump xfsprogs -xkeyboard-config -xorg-x11 xorg-x11-auth -xorg-x11-base xorg-x11-drivers xorg-x11-font-utils -xorg-x11-fonts-100dpi -xorg-x11-fonts-75dpi -xorg-x11-fonts-ISO8859-1-75dpi -xorg-x11-fonts-ISO8859-15-75dpi -xorg-x11-fonts-ISO8859-2-75dpi -xorg-x11-fonts-ISO8859-9-75dpi -xorg-x11-fonts-cyrillic xorg-x11-fonts-ethiopic xorg-x11-fonts-misc -xorg-x11-libs -xorg-x11-libs-data -xorg-x11-server-Xorg xorg-x11-server-utils -xorg-x11-xfs +xorg-x11-server-Xorg xorg-x11-xkb-utils -xorg-x11-xkbdata -yum -yum-fedorakmod +xorg-x11-xfs yum yum-metadata-parser zenity zlib +#/etc/gtk-2.0/gtkrc +glibc +openssl + +# rescue +bzip2 +bzip2-libs +dump +libidn +findutils +ftp +gzip +iputils +joe +krb5-libs +less +man +modutils +mtools +mt-st +mtr +net-tools +smartmontools +openssh +openssh-clients +pciutils +rsh +traceroute +tar +rsync +device-mapper +device-mapper-libs +dmraid +ntfsprogs +samba-client +firstaidkit +firstaidkit-plugin-all +dialog diff --git a/etc/packages/alpha/packages b/etc/packages/packages.alpha similarity index 100% rename from etc/packages/alpha/packages rename to etc/packages/packages.alpha diff --git a/etc/packages/i386/packages b/etc/packages/packages.i386 similarity index 100% rename from etc/packages/i386/packages rename to etc/packages/packages.i386 index 59bda823..f6d90190 100644 --- a/etc/packages/i386/packages +++ b/etc/packages/packages.i386 @@ -1,11 +1,11 @@ -glibc -openssl -dmidecode -efibootmgr glibc.i386 -gpart -grub -memtest86+ openssl.i386 pcmciautils +grub +dmidecode +efibootmgr +gpart syslinux +memtest86+ diff --git a/etc/packages/packages.i586 b/etc/packages/packages.i586 new file mode 100644 index 00000000..c5fb1549 --- /dev/null +++ b/etc/packages/packages.i586 @@ -0,0 +1,11 @@ +-glibc +-openssl +glibc.i586 +openssl.i586 +pcmciautils +grub +dmidecode +efibootmgr +gpart +syslinux +memtest86+ diff --git a/etc/packages/ia64/packages b/etc/packages/packages.ia64 similarity index 77% rename from etc/packages/ia64/packages rename to etc/packages/packages.ia64 index e0756348..1e565c1e 100644 --- a/etc/packages/ia64/packages +++ b/etc/packages/packages.ia64 @@ -1,2 +1,3 @@ dmidecode efibootmgr +elilo diff --git a/etc/packages/ppc/packages b/etc/packages/packages.ppc similarity index 100% rename from etc/packages/ppc/packages rename to etc/packages/packages.ppc index 868a575f..1bdc4e13 100644 --- a/etc/packages/ppc/packages +++ b/etc/packages/packages.ppc @@ -1,6 +1,6 @@ -fbset -hfsutils pcmciautils pdisk -ppc64-utils yaboot +hfsutils +fbset +ppc64-utils diff --git a/etc/packages/packages.ppc64 b/etc/packages/packages.ppc64 new file mode 120000 index 00000000..602b9e1e --- /dev/null +++ b/etc/packages/packages.ppc64 @@ -0,0 +1 @@ +packages.ppc \ No newline at end of file diff --git a/etc/packages/s390/packages b/etc/packages/packages.s390 similarity index 91% rename from etc/packages/s390/packages rename to etc/packages/packages.s390 index 07d79051..96c92436 100644 --- a/etc/packages/s390/packages +++ b/etc/packages/packages.s390 @@ -1,21 +1,19 @@ -bash +s390utils binutils -coreutils -gawk -grep -initscripts libgcc -login -modutils -mount +tcp_wrappers +sed net-tools openssh openssh-server -pam +coreutils +login +initscripts portmap -s390utils -sed +pam +mount +modutils +s390utils-cmsfs strace -tcp_wrappers -xorg-x11-libs xorg-x11-xauth +xorg-x11-libs diff --git a/etc/packages/packages.s390x b/etc/packages/packages.s390x new file mode 120000 index 00000000..2ec6ed77 --- /dev/null +++ b/etc/packages/packages.s390x @@ -0,0 +1 @@ +packages.s390 \ No newline at end of file diff --git a/etc/packages/sparc/packages b/etc/packages/packages.sparc similarity index 100% rename from etc/packages/sparc/packages rename to etc/packages/packages.sparc index 6a5faa7c..a78741ac 100644 --- a/etc/packages/sparc/packages +++ b/etc/packages/packages.sparc @@ -1,2 +1,2 @@ -silo tilo +silo diff --git a/etc/packages/x86_64/packages b/etc/packages/packages.x86_64 similarity index 100% rename from etc/packages/x86_64/packages rename to etc/packages/packages.x86_64 index c70f3df7..6921bc17 100644 --- a/etc/packages/x86_64/packages +++ b/etc/packages/packages.x86_64 @@ -1,7 +1,7 @@ +pcmciautils +grub dmidecode efibootmgr gpart -grub -memtest86+ -pcmciautils syslinux +memtest86+ diff --git a/etc/packages/ppc64/packages b/etc/packages/ppc64/packages deleted file mode 100644 index 2b60b3a9..00000000 --- a/etc/packages/ppc64/packages +++ /dev/null @@ -1,4 +0,0 @@ -hfsutils -pcmciautils -pdisk -yaboot diff --git a/etc/packages/s390x/packages b/etc/packages/s390x/packages deleted file mode 100644 index 07d79051..00000000 --- a/etc/packages/s390x/packages +++ /dev/null @@ -1,21 +0,0 @@ -bash -binutils -coreutils -gawk -grep -initscripts -libgcc -login -modutils -mount -net-tools -openssh -openssh-server -pam -portmap -s390utils -sed -strace -tcp_wrappers -xorg-x11-libs -xorg-x11-xauth diff --git a/etc/templates/includes/initrd/initrd.common b/etc/templates/includes/initrd/initrd.common index fbdba73f..cea58186 100644 --- a/etc/templates/includes/initrd/initrd.common +++ b/etc/templates/includes/initrd/initrd.common @@ -3,7 +3,9 @@ # create required directories makedir @initrd@/modules makedir @initrd@/firmware -makedir @initrd@/lib/modules +makedir @initrd@/lib +link @initrd@/modules to @initrd@/lib/modules +link @initrd@/firmware to @initrd@/lib/firmware makedir @initrd@/lib/firmware makedir @initrd@/sbin makedir @initrd@/dev @@ -54,18 +56,19 @@ edit @initrd@/etc/arch text "@buildarch@" copy @instroot@/etc/passwd to @initrd@/etc mode 0644 copy @instroot@/etc/group to @initrd@/etc mode 0644 copy @instroot@/etc/nsswitch.conf to @initrd@/etc mode 0644 +copy @instroot@/etc/hosts to @initrd@/etc/ mode 0644 # copy mount/umount copy @instroot@/bin/mount to @initrd@/sbin copy @instroot@/bin/umount to @initrd@/sbin -copy @instroot@/sbin/mount.nfs to @initrd@/sbin -link @initrd@/sbin/umount.nfs to mount.nfs +copy @instroot@/sbin/mount.* to @initrd@/sbin +copy @instroot@/sbin/umount.* to @initrd@/sbin # copy udev copy @instroot@/sbin/udevd to @initrd@/sbin copy @instroot@/sbin/udevadm to @initrd@/sbin -link @initrd@/sbin/udevinfo to udevadm -link @initrd@/sbin/udevsettle to udevadm +copy @instroot@/sbin/udevinfo to @initrd@/sbin +copy @instroot@/sbin/udevsettle to @initrd@/sbin # udev rules copy @instroot@/etc/udev/udev.conf to @initrd@/etc/udev mode 0644 @@ -87,7 +90,15 @@ link @initrd@/etc/init.d to /etc/rc.d/init.d # dhcp and dhcpv6 client daemons and support programs copy @instroot@/sbin/dhclient to @initrd@/sbin +copy @instroot@/sbin/dhclient-script to @initrd@/sbin copy @instroot@/sbin/dhcp6c to @initrd@/sbin +copy @instroot@/sbin/arping to @initrd@/sbin +copy @instroot@/sbin/ifconfig to @initrd@/sbin +copy @instroot@/sbin/ip to @initrd@/sbin +copy @instroot@/bin/ipcalc to @initrd@/sbin +copy @instroot@/bin/hostname to @initrd@/sbin +copy @instroot@/sbin/ethtool to @initrd@/sbin +copy @instroot@/sbin/route to @initrd@/sbin touch @initrd@/etc/resolv.conf # hwdata @@ -157,6 +168,20 @@ copy @instroot@/usr/share/terminfo/x/xterm-color to @initrd@/etc/terminfo/x mode copy @instroot@/usr/share/terminfo/g/gnome to @initrd@/etc/terminfo/g mode 0644 # misc +copy @instroot@/bin/awk to @initrd@/sbin +copy @instroot@/bin/gawk to @initrd@/sbin +copy @instroot@/bin/egrep to @initrd@/sbin +copy @instroot@/bin/fgrep to @initrd@/sbin +copy @instroot@/bin/grep to @initrd@/sbin +copy @instroot@/bin/kill to @initrd@/sbin +copy @instroot@/bin/ln to @initrd@/sbin +copy @instroot@/bin/readlink to @initrd@/sbin +copy @instroot@/bin/rm to @initrd@/sbin +copy @instroot@/bin/rmdir to @initrd@/sbin +copy @instroot@/bin/sed to @initrd@/sbin +copy @instroot@/bin/sleep to @initrd@/sbin +copy @instroot@/bin/touch to @initrd@/sbin + link @initrd@/init to /sbin/init link @initrd@/etc/mtab to /proc/mounts link @initrd@/bin to sbin diff --git a/etc/templates/initrd.i386 b/etc/templates/initrd.i386 index 5d61436c..d62eabc7 100644 --- a/etc/templates/initrd.i386 +++ b/etc/templates/initrd.i386 @@ -10,3 +10,6 @@ link @initrd@/sbin/poweroff to init # screenfont copy @instroot@/usr/lib/anaconda-runtime/screenfont-@buildarch@.gz to @initrd@/etc/screenfont.gz + +# keymaps +copy @instroot@/keymaps to @initrd@/etc/keymaps.gz \ No newline at end of file diff --git a/etc/templates/initrd.s390 b/etc/templates/initrd.s390 index 42c5293b..8fc5d3f7 100644 --- a/etc/templates/initrd.s390 +++ b/etc/templates/initrd.s390 @@ -13,12 +13,15 @@ copy @instroot@/usr/bin/xauth to @initrd@/sbin copy @instroot@/usr/sbin/cmsfs* to @initrd@/sbin copy @instroot@/@libdir@/libpam_misc.so.0.* to @initrd@/@libdir@/libpam_misc.so.0 +copy @instroot@/@libdir@/libwrap*.so* to @initrd@/@libdir@ link @initrd@/var/state/xkb to /tmp # loader copy @instroot@/usr/lib/anaconda-runtime/loader/shutdown to @initrd@/sbin copy @instroot@/usr/lib/anaconda-runtime/loader/linuxrc.s390 to @initrd@/sbin/init +copy @instroot@/usr/lib/anaconda-runtime/loader/lsznet.raw to @initrd@/sbin/lsznet +copy @instroot@/usr/lib/anaconda-runtime/loader/controlunits.sh @initrd@/sbin/controlunits copy @instroot@/usr/sbin/dasdfmt to @initrd@/sbin # setup shell environment @@ -30,9 +33,9 @@ copy @instroot@/@libdir@/security/pam_unix.so to @initrd@/@libdir@/security copy @instroot@/@libdir@/security/pam_deny.so to @initrd@/@libdir@/security copy @instroot@/etc/pam.d/other to @initrd@/etc/pam.d -copy @datadir@/etc/pam.d/login to @initrd@/etc/pam.d/login -copy @datadir@/etc/pam.d/login to @initrd@/etc/pam.d/sshd -copy @datadir@/etc/pam.d/login to @initrd@/etc/pam.d/remote +copy @datadir@/pam.d/login to @initrd@/etc/pam.d/login +copy @datadir@/pam.d/login to @initrd@/etc/pam.d/sshd +copy @datadir@/pam.d/login to @initrd@/etc/pam.d/remote copy @instroot@/etc/security/limits.conf to @initrd@/etc/security copy @Instroot@/etc/security/pam_env.conf to @initrd@/etc/security @@ -43,9 +46,8 @@ genkey @initrd@/etc/ssh/ssh_host_key type rsa1 genkey @initrd@/etc/ssh/ssh_host_rsa_key type rsa genkey @initrd@/etc/ssh/ssh_host_dsa_key type dsa -copy @datadir@/etc/ssh/sshd_config to @initrd@/etc/ssh/sshd_config mode 0600 +copy @datadir@/sshd/sshd_config to @initrd@/etc/ssh/sshd_config mode 0600 # copy in the binaries copy @instroot@/bin/login to @initrd@/sbin/login -copy @instroot@/usr/sbin/sshd to @initrd@/sbin/sshd -copy @instroot@/usr/bin/busybox to @initrd@/sbin/busybox +copy @instroot@/usr/sbin/sshd to @initrd@/sbin/sshd \ No newline at end of file diff --git a/rewrite/orig/scripts/mk-images.efi b/rewrite/orig/scripts/mk-images.efi deleted file mode 100755 index f39a051a..00000000 --- a/rewrite/orig/scripts/mk-images.efi +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# -# mk-images.efi -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -makeefibootdisk() -{ - partimg=$1 - target=$2 - - if [ ! -f $1 ]; then - return - fi - - local partsize=$(ls -l $1 | awk '{ print $5; }') - local disksize=$((17408 + $partsize + 17408)) - disksize=$(($disksize + $(($disksize % 512)))) - local diskimg=$(mktemp /tmp/efidisk.img.XXXXXX) - dd if=/dev/zero of=$diskimg count=1 bs=$disksize - local loop=$(losetup -v -f $diskimg | awk '{ print $4 }') - dmsetup create efiboot$$ --table "0 $(($disksize / 512)) linear $loop 0" - parted --script /dev/mapper/efiboot$$ mklabel gpt unit b mkpart '"EFI System Partition"' fat32 17408 $((17408 + $partsize)) set 1 boot on - dd if=$partimg of=/dev/mapper/efiboot$$p1 - dmsetup remove /dev/mapper/efiboot$$p1 - dmsetup remove /dev/mapper/efiboot$$ - losetup -d $loop - - mv -v $diskimg $target - chmod a+r $target -} - -#makeefibootimage required for EFI bootloader dosfs image -makeefibootimage() { - MBD_FILENAME="" - KERNELFILE="" - INITRDFILE="" - grubpkg="" - MBD_TMPIMAGE=${TMPDIR:-/tmp}/makebootdisk.image.$$ - MBD_BOOTTREE=${TMPDIR:-/tmp}/makebootdisk.tree.$$ - MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp' - while [ x$(echo $1 | cut -c1-2) = x"--" ]; do - if [ $1 = "--kernel" ]; then - KERNELFILE=$2 - shift; shift - continue - elif [ $1 = "--initrd" ]; then - INITRDFILE=$2 - shift; shift - continue - elif [ $1 = "--imagename" ]; then - MBD_FILENAME=$IMAGEPATH/$2 - shift; shift - continue - elif [ $1 = "--grubpkg" ]; then - grubpkg=$2 - shift; shift - continue - fi - echo "Unknown option passed to makebootdisk" - exit 1 - done - - if [ -z "$MBD_FILENAME" ]; then - echo "No imagename passed" - exit 1 - fi - - if [ -z "$KERNELFILE" ]; then - echo "No kernel file passed" - exit 1 - fi - - if [ -z "$INITRDFILE" ]; then - echo "No initrd file passed" - exit 1 - fi - MBD_FSIMAGE="$INITRDFILE" - - mkdir -p $MBD_BOOTTREE - mkdir -p $MBD_BOOTTREE_TMP - rm -rf $MBD_BOOTTREE_TMP - mkdir -p $MBD_TMPIMAGE - - # provided by the mk-image.$ARCH file - prepareEfiImage - - left=$(df $MBD_BOOTTREE | tail -n1) - left=$(echo $left | awk '{print $4'}) - - umount $MBD_BOOTTREE - - if [ -n "$EXTRAKERNELPATH" ]; then - mkdir -p `dirname $EXTRAKERNELPATH` - cp -f $KERNELROOT/$KERNELDIR/${KERNELNAME}-* $EXTRAKERNELPATH - fi - - mkdir -p `dirname $MBD_FILENAME` - rm -rf $MBD_TMPIMAGE $MBD_MNTPOINT $MBD_BOOTTREE - if [ -z "$INITRDFILE" ]; then - rm -f $MBD_FSIMAGE - fi - - chmod a+r $MBD_FILENAME - echo "Wrote $MBD_FILENAME (${left}k free)" -} - -# prepare and build an efiboot.img. -prepareEfiImage() { - prepareEfiTree || return 1 - - # dynamically calculate the size of the dosfs - BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail -n1 | awk '{print $1}') - BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100) - echo "The size of the efiboot.img dosfs is $BOOTDISKSIZE" - mkdosfs -n ANACONDA -C $MBD_FILENAME $BOOTDISKSIZE >/dev/null - mount -o loop,shortname=winnt,umask=0077 -t vfat $MBD_FILENAME $MBD_BOOTTREE - cp -R $MBD_BOOTTREE_TMP/* $MBD_BOOTTREE -} - -# prepare a directory with the kernel, initrd, and various message files -# used to populate the efi boot image -prepareEfiTree() { - mkdir -p $MBD_BOOTTREE_TMP/EFI/boot - - cp -a $BOOTDISKDIR/* $MBD_BOOTTREE_TMP/EFI/boot/ - cp $INITRDFILE $MBD_BOOTTREE_TMP/EFI/boot/initrd.img - cp $KERNELFILE $MBD_BOOTTREE_TMP/EFI/boot/vmlinuz - - sed -i "s/@PRODUCT@/$PRODUCT/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf - sed -i "s/@VERSION@/$VERSION/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf - - yumdownloader -c $yumconf $grubpkg - rpm2cpio $grubpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd) - cp $KERNELROOT/boot/efi/EFI/redhat/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/grub.efi - - # The first generation Mactel machines get the bootloader name wrong - # as per the spec. Awesome, guys. - if [ "$efiarch" == "ia32" ]; then - cp $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot.efi - cp $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot.conf - fi - - mv $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.efi - mv $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.conf - - artpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" --whatprovides system-logos | grep -v generic-logos | head -1) - - if [ -z "$artpkg" ]; then - argpkg="generic-logos" - fi - - yumdownloader -c $yumconf $artpkg - rpm2cpio $artpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd) - cp $KERNELROOT/boot/grub/splash.xpm.gz $MBD_BOOTTREE_TMP/EFI/boot/splash.xpm.gz -} - -makeEfiImages() { - yumconf="$1" - if [ "$kernelvers" != "$kernelxen" ]; then - local grubarch=${efiarch} - case ${efiarch} in - ia32) grubarch=i386 ;; - x64) grubarch=x86_64 ;; - esac - grubpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf grub.$grubarch) - if [ -z "$grubpkg" ]; then - echo "cannot find package grub.$grubarch" >&2 - return 1 - fi - echo "Building efiboot.img for ${efiarch}/$KERNELARCH at $TOPDESTPATH/images/efiboot.img" - - makeefibootimage \ - --imagename pxeboot/efiboot.img \ - --kernel $TOPDESTPATH/images/pxeboot/vmlinuz \ - --initrd $TOPDESTPATH/images/pxeboot/initrd.img \ - --grubpkg ${grubpkg} - local ret=$? - [ $ret -eq 0 ] || return $ret - - makeefibootdisk $TOPDESTPATH/images/pxeboot/efiboot.img $TOPDESTPATH/images/efidisk.img - return $? - fi - return 1 -} diff --git a/rewrite/orig/scripts/mk-images.ia64 b/rewrite/orig/scripts/mk-images.ia64 deleted file mode 100644 index 871ce6a6..00000000 --- a/rewrite/orig/scripts/mk-images.ia64 +++ /dev/null @@ -1,173 +0,0 @@ -#!/bin/bash -# -# mk-images.ia64 -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -#makebootdisk required for EFI bootloader dosfs image -makebootdisk() { - EXTRAKERNELPATH="" - INITRDFLAGS="" - MBD_FILENAME="" - INITRDFILE="" - MBD_TMPIMAGE=${TMPDIR:-/tmp}/makebootdisk.image.$$ - MBD_BOOTTREE=${TMPDIR:-/tmp}/makebootdisk.tree.$$ - MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp' - while [ x$(echo $1 | cut -c1-2) = x"--" ]; do - if [ $1 = "--kernelto" ]; then - EXTRAKERNELPATH=$2 - shift; shift - continue - elif [ $1 = "--initrdflags" ]; then - INITRDFLAGS=$2 - shift; shift - continue - elif [ $1 = "--initrd" ]; then - INITRDFILE=$2 - shift; shift - continue - elif [ $1 = "--imagename" ]; then - MBD_FILENAME=$IMAGEPATH/$2 - shift; shift - continue - fi - echo "Unknown option passed to makebootdisk" - exit 1 - done - - if [ -z "$MBD_FILENAME" ]; then - echo "No imagename passed" - exit 1 - fi - - if [ -n "$INITRDFILE" ]; then - MBD_FSIMAGE="$INITRDFILE" - elif [ -n "$INITRDFLAGS" ]; then - eval makeinitrd --keep $INITRDFLAGS - fi - - mkdir -p $MBD_BOOTTREE - mkdir -p $MBD_BOOTTREE_TMP - rm -rf $MBD_BOOTTREE_TMP - mkdir -p $MBD_TMPIMAGE - - # provided by the mk-image.$ARCH file - prepareBootImage - - left=$(df $MBD_BOOTTREE | tail -n1) - left=$(echo $left | awk '{print $4'}) - - umount $MBD_BOOTTREE - - if [ -n "$EXTRAKERNELPATH" ]; then - mkdir -p `dirname $EXTRAKERNELPATH` - cp -f $KERNELROOT/$KERNELDIR/${KERNELNAME}-* $EXTRAKERNELPATH - fi - - mkdir -p `dirname $MBD_FILENAME` - rm -rf $MBD_TMPIMAGE $MBD_MNTPOINT $MBD_BOOTTREE - if [ -z "$INITRDFILE" ]; then - rm -f $MBD_FSIMAGE - fi - - echo "Wrote $MBD_FILENAME (${left}k free)" -} - -prepareBootImage() { - - prepareBootTree - - # dynamically calculate the size of the dosfs - BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail -n1 | awk '{print $1}') - BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100) - echo "The size of the boot.img dosfs is $BOOTDISKSIZE" - mkdosfs -n ANACONDA -C $MBD_FILENAME $BOOTDISKSIZE >/dev/null - mount -o loop -t vfat $MBD_FILENAME $MBD_BOOTTREE - cp -R $MBD_BOOTTREE_TMP/* $MBD_BOOTTREE -} - -prepareBootTree() { - mkdir -p $MBD_BOOTTREE_TMP/EFI/boot - cp $MBD_FSIMAGE $MBD_BOOTTREE_TMP/EFI/boot/initrd.img - - cp -a $BOOTDISKDIR/* $MBD_BOOTTREE_TMP/EFI/boot/ - cp $KERNELROOT/boot/efi/EFI/redhat/vmlinuz-* $MBD_BOOTTREE_TMP/EFI/boot/vmlinuz - - cp $MBD_BOOTTREE_TMP/EFI/boot/elilo.efi $MBD_BOOTTREE_TMP/EFI/boot/bootia64.efi - cat > $MBD_BOOTTREE_TMP/EFI/boot/elilo.conf << EOF -prompt -timeout=50 -relocatable - -image=vmlinuz - label=linux - read-only - initrd=initrd.img -EOF - - # make a copy in the root of the image - cp $MBD_BOOTTREE_TMP/EFI/boot/* $MBD_BOOTTREE_TMP -} - -makeBootImages() { - # Because ia64 boxes use EFI there needs to be a boot.img dosfs. - echo "making boot.img for EFI bootloader" - makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \ - --imagename boot.img \ - --initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \ - --initrdsize 12288 \ - --loaderbin loader \ - --modules "$INITRDMODS sgiioc4" ' - - - mkdir -p $TOPDESTPATH/images/pxeboot - makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \ - --initrdsize 12288 \ - --loaderbin loader \ - --modules "$INITRDMODS sgiioc4" - [ $? = 0 ] || exit 1 - mv $TOPDESTPATH/kernels/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz - rmdir $TOPDESTPATH/kernels - - # make a pxe dir with kernel + initrd - cat > $TOPDESTPATH/images/pxeboot/README <> $TOPDESTPATH/.treeinfo -[images-$KERNELARCH] -kernel = images/pxeboot/vmlinuz -initrd = images/pxeboot/initrd.img -boot.img = images/boot.img - -[images-xen] -kernel = images/pxeboot/vmlinuz -initrd = images/pxeboot/initrd.img - -__EOT__ -} - -doPostImages() { - if [ -n "$BOOTISO" ]; then - mkisofs -quiet -o $TOPDESTPATH/images/$BOOTISO -b boot.img -no-emul-boot -R -J -V "$PRODUCT" -T -graft-points boot.img=$TOPDESTPATH/images/boot.img images/install.img=$TOPDESTPATH/images/install.img - implantisomd5 $TOPDESTPATH/images/$BOOTISO - fi -} diff --git a/rewrite/orig/scripts/mk-images.x86 b/rewrite/orig/scripts/mk-images.x86 deleted file mode 100644 index bdee490f..00000000 --- a/rewrite/orig/scripts/mk-images.x86 +++ /dev/null @@ -1,164 +0,0 @@ -# -# mk-images.x86 -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -SYSLINUX=$IMGPATH/usr/lib/syslinux/syslinux-nomtools - -if [ ! -f $SYSLINUX ]; then - echo "Warning: nomtools syslinux doesn't exist" - SYSLINUX=$IMGPATH/usr/bin/syslinux - if [ ! -f $SYSLINUX ]; then - echo "$SYSLINUX doesn't exist" - exit 1 - fi -fi - -# prepare a directory with the kernel, initrd, and various message files -# used to populate a boot image -prepareBootTree() { - (cd $BOOTDISKDIR; find . -maxdepth 1 ! -name "*.msg" ! -type d | cpio --quiet -p $MBD_BOOTTREE) - - cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img - cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz - - if [ -f $IMGPATH/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg ]; then - cp $IMGPATH/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg $MBD_BOOTTREE/splash.jpg - cp $IMGPATH/usr/lib/syslinux/vesamenu.c32 $MBD_BOOTTREE/vesamenu.c32 - sed -i s'/default linux/default vesamenu.c32/g' $MBD_BOOTTREE/syslinux.cfg - sed -i 's/prompt 1/#prompt 1/g' $MBD_BOOTTREE/syslinux.cfg - elif [ -x $IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh ]; then - $IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh $BOOTDISKDIR/syslinux-splash.png $BOOTDISKDIR/splash.lss - if [ $? != 0 ]; then - echo $0: Failed to create splash.lss - exit 1 - fi - cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss - elif [ -f $IMGPATH/usr/lib/anaconda-runtime/splash.lss ]; then - cp $IMGPATH/usr/lib/anaconda-runtime/splash.lss $MBD_BOOTTREE/splash.lss - fi - - rm -f $MBD_BOOTTREE/syslinux-splash.png - sed -i "s/@PRODUCT@/$PRODUCT/g" $MBD_BOOTTREE/syslinux.cfg - sed -i "s/@VERSION@/$VERSION/g" $MBD_BOOTTREE/syslinux.cfg - - rm -f $MBD_BOOTTREE/memtest* - for file in $BOOTDISKDIR/*.msg; do - filename=`basename $file` - sed -e "s/@VERSION@/$VERSION/g" $file > $MBD_BOOTTREE/$filename - done - if [ $? != 0 ]; then - echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE. - umount $MBD_BOOTTREE - rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE - exit 1 - fi -} - -mkdir -p $TOPDESTPATH/images/pxeboot -cat > $TOPDESTPATH/images/README <> $MBD_BOOTTREE/isolinux.cfg - fi - else - echo "No isolinux binaries. Skipping isolinux creation" - fi - - # symlink the kernel for pxe dir - ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz - - cat > $TOPDESTPATH/images/pxeboot/README <> $TOPDESTPATH/.treeinfo -[images-$BASEARCH] -kernel = images/pxeboot/vmlinuz -initrd = images/pxeboot/initrd.img -__EOT__ - if [ -n "$BOOTISO" ]; then echo "boot.iso = images/$BOOTISO" >> $TOPDESTPATH/.treeinfo ; fi - fi - - # set up the boot stuff for the xen guest kernel - if [ -z "$kernelxen" -o "$kernelvers" = "$kernelxen" ] ; then - cp $KERNELROOT/boot/vmlinuz-$version $TOPDESTPATH/images/pxeboot/$kernelimage - cat << __EOT__ >> $TOPDESTPATH/.treeinfo -[images-xen] -kernel = images/pxeboot/$kernelimage -initrd = images/pxeboot/$initrd - -__EOT__ - fi -} - - -doPostImages() { - if [ -n "$BOOTISO" ]; then - mkisofs -quiet -o $TOPDESTPATH/images/$BOOTISO -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V "$PRODUCT" -T -graft-points isolinux=$TOPDESTPATH/isolinux images/install.img=$TOPDESTPATH/images/install.img - implantisomd5 $TOPDESTPATH/images/$BOOTISO - fi - -} diff --git a/rewrite/orig/utils/Makefile b/rewrite/orig/utils/Makefile deleted file mode 100644 index c665d915..00000000 --- a/rewrite/orig/utils/Makefile +++ /dev/null @@ -1,99 +0,0 @@ -# -# Makefile -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -include ../Makefile.inc - -ARCH := $(patsubst i%86,i386,$(shell uname -m)) -ARCH := $(patsubst sparc%,sparc,$(ARCH)) - -ISYSLIB=isys - -LOADERDIR = ../loader -LOADLIBES = -lpopt -CFLAGS += -I.. -I$(LOADERDIR) -fno-strict-aliasing -RPMCFLAGS = $(CFLAGS) -I/usr/include/rpm - -UTILS = modlist snarffont mapshdr readmap -ifeq (s390, $(ARCH)) -UTILS += geninitrdsz mk-s390-cdboot -endif -ifeq (s390x, $(ARCH)) -UTILS += geninitrdsz mk-s390-cdboot -endif - -ifeq (.depend,$(wildcard .depend)) -TARGET=all -else -TARGET=depend all -endif - -everything: $(TARGET) - -all: $(UTILS) - -modlist: modlist.o moduleinfo.o - $(CC) $(LDFLAGS) -o modlist modlist.o moduleinfo.o $(LOADLIBES) - -moduleinfo.o: $(LOADERDIR)/moduleinfo.c - cp $(LOADERDIR)/moduleinfo.c ./ - $(CC) $(CFLAGS) -c moduleinfo.c - -moduledeps.o: $(LOADERDIR)/moduledeps.c - cp $(LOADERDIR)/moduledeps.c ./ - $(CC) $(CFLAGS) -c moduledeps.c - -md5.o: md5.c md5.h - gcc -c -O -g md5.c -D_FORTIFY_SOURCE=2 - -hash.o : hash.c - $(CC) $(RPMCFLAGS) -c -o $@ $< - -geninitrdsz: geninitrdsz.c - $(CC) $(CFLAGS) -o $@ $< - -mk-s390-cdboot: mk-s390-cdboot.c - $(CC) $(CFLAGS) -o $@ $< - -depends: - -install: all - mkdir -p $(DESTDIR)/usr/bin - mkdir -p $(DESTDIR)/$(RUNTIMEDIR) - install -m755 genmodinfo $(DESTDIR)/$(RUNTIMEDIR) - install -m755 trimpciids $(DESTDIR)/$(RUNTIMEDIR) - install -m755 modlist $(DESTDIR)/$(RUNTIMEDIR) - install -m755 readmap $(DESTDIR)/$(RUNTIMEDIR) - install -m755 mapshdr $(DESTDIR)/$(RUNTIMEDIR) - if [ -x geninitrdsz ]; then \ - install -m755 geninitrdsz $(DESTDIR)/$(RUNTIMEDIR) ; \ - fi - if [ -x mk-s390-cdboot ]; then \ - install -m755 mk-s390-cdboot $(DESTDIR)/$(RUNTIMEDIR) ; \ - fi - -clean: - rm -f modlist snarffont mapshdr readmap geninitrdsz \ - moduledeps.c moduleinfo.c .depend *.o - -depend: - $(CPP) -M $(RPMCFLAGS) *.c > .depend - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/rewrite/scratch/mk-images b/rewrite/scratch/mk-images deleted file mode 100755 index 76464378..00000000 --- a/rewrite/scratch/mk-images +++ /dev/null @@ -1,792 +0,0 @@ -#!/bin/bash -# -# mk-images -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - - -# Stuff that we need - TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids - GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps - GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz - MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot - GENMODINFO=$IMGPATH/usr/lib/anaconda-runtime/genmodinfo - KEYMAPS=$TMPDIR/keymaps-$BUILDARCH.$$ - SCREENFONT=$IMGPATH/usr/lib/anaconda-runtime/screenfont-${BASEARCH}.gz - MODLIST=$IMGPATH/usr/lib/anaconda-runtime/modlist - MODINFO=$TMPDIR/modinfo-$BUILDARCH.$$ - LOADERBINDIR=$IMGPATH/usr/lib/anaconda-runtime/loader - BOOTDISKDIR=$IMGPATH/usr/lib/anaconda-runtime/boot - LANGTABLE=$IMGPATH/usr/lib/anaconda/lang-table - PCIIDS=$IMGPATH/usr/share/hwdata/pci.ids - XDRIVERS=$IMGPATH/usr/share/hwdata/videoaliases - XDRIVERDESCS=$IMGPATH/usr/share/hwdata/videodrivers - - REQUIREMENTS="$TRIMPCIIDS $PCIIDS $XDRIVERDESCS $GENMODINFO - $LANGTABLE $GETKEYMAPS" - - dieLater= - for n in $REQUIREMENTS; do - if [ ! -f $n ]; then - echo "$n doesn't exist" - dieLater=1 - fi - done - - for n in $BOOTDISKDIR; do - if [ ! -d $n ]; then - echo "$n doesn't exist" - dieLater=1 - fi - done - - if [ -n "$dieLater" ]; then exit 1; fi - - if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then - # go ahead and create the keymaps so we only have to do it once - if [ -f $IMGPATH/usr/lib/anaconda-runtime/keymaps-override-$BUILDARCH ]; then - echo "Found keymap override, using it" - cp $IMGPATH/usr/lib/anaconda-runtime/keymaps-override-$BUILDARCH $KEYMAPS - else - echo "Running: $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH" - $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH - if [ $? != 0 ]; then - echo "Unable to create keymaps and thus can't create initrd." - exit 1 - fi - fi - fi - -findPackage() { - name=$1 - - pkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf --archlist=$KERNELARCH $name.$KERNELARCH) - if [ -n "$pkg" ]; then - echo $pkg - return - fi - echo "cannot find package $name" >&2 -} - -rundepmod () { - where=$1 - - $FAKEARCH /sbin/depmod -a -F $KERNELROOT/boot/System.map-$version \ - -b $where $version -} - -# This loops to make sure it resolves dependencies of dependencies of... -resdeps () { - items="$*" - - deplist="" - for item in $items ; do - deps=$(awk -F ':' "/$item.ko: / { print gensub(\".*/$item.ko: \",\"\",\"g\") }" $KERNELROOT/lib/modules/$version/modules.dep) - for dep in $deps ; do - depfile=${dep##*/} - depname=${dep%%.ko} - deplist="$deplist $depname" - done - done - items=$(for n in $items $deplist; do echo $n; done | sort -u) - echo $items -} - -expandModuleSet() { - SET="" - for name in $1; do - char=$(echo $name | cut -c1) - if [ $char = '=' ]; then - NAME=$(echo $name | cut -c2-) - SET="$SET $($MODLIST --modinfo-file $MODINFO $NAME)" - else - SET="$SET $name" - fi - done - - echo $SET -} - -makemoduletree() { - MMB_DIR=$1 - MMB_MODULESET=$(resdeps $2) - - mkdir -p $MMB_DIR/lib - mkdir -p $MMB_DIR/modules - mkdir -p $MMB_DIR/firmware - ln -snf ../modules $MMB_DIR/lib/modules - ln -snf ../firmware $MMB_DIR/lib/firmware - - echo "Copying kernel modules..." - cp -a $KERNELROOT/lib/modules/* $MMB_DIR/lib/modules/ - echo "Removing extraneous modules..." - find $MMB_DIR/lib/modules/ -name *.ko | while read module ; do - m=${module##*/} - modname=${m%%.ko} - echo $MMB_MODULESET | grep -wq $modname || { - rm -f $module - } - done - - # Copy in driver firmware we want during installation. NOTE: This isn't - # the ideal solution, but we'll do this for now. What we really want is - # for the kernel modules to include a modinfo field that names the firmware - # file we should have. If we can get that it would make it even easier to - # push the kernel people to depend on the firmware packages in the kernel, - # but we have to take small steps first. - for module in $MODSET ; do - case $module in - ipw2100) - cp $KERNELROOT/lib/firmware/ipw2100* $MBD_DIR/firmware - ;; - ipw2200) - cp $KERNELROOT/lib/firmware/ipw2200* $MBD_DIR/firmware - ;; - iwl3945) - cp $KERNELROOT/lib/firmware/iwlwifi-3945* $MBD_DIR/firmware - ;; - iwl4965) - cp $KERNELROOT/lib/firmware/iwlwifi-4965* $MBD_DIR/firmware - ;; - atmel) - cp $KERNELROOT/lib/firmware/atmel_*.bin $MBD_DIR/firmware - ;; - zd1211rw) - cp -r $KERNELROOT/lib/firmware/zd1211 $MBD_DIR/firmware - ;; - qla2xxx) - cp $KERNELROOT/lib/firmware/ql* $MBD_DIR/firmware - ;; - esac - done - - # clean up leftover cruft - find -H $MMB_DIR/lib/modules -type d -exec rmdir -f {} \; 2>/dev/null - $MODLIST --modinfo-file $MODINFO --ignore-missing --modinfo \ - $MMB_MODULESET > $MMB_DIR/lib/modules/module-info - # compress modules - find -H $MMB_DIR/lib/modules -type f -name *.ko -exec gzip -9 {} \; - rundepmod $MMB_DIR - rm -f $MMB_DIR/lib/modules/*/modules.*map - rm -f $MMB_DIR/lib/modules/*/{build,source} - - # create the pci.ids, from modules.alias and the X driver aliases - awk '!/^(\t\t|#)/ { print ;if ($0 == "ffff Illegal Vendor ID") nextfile; }' < $PCIIDS | \ - $TRIMPCIIDS $MMB_DIR/lib/modules/*/modules.alias $XDRIVERS/* > ../pci.ids -} - - -makeproductfile() { - root=$1 - - rm -f $root/.buildstamp - echo $IMAGEUUID > $root/.buildstamp - echo $PRODUCT >> $root/.buildstamp - echo $VERSION >> $root/.buildstamp - if [ -n "$BUGURL" ]; then - echo $BUGURL >> $root/.buildstamp - fi -} - -instbin() { - ROOT=$1 - BIN=$2 - DIR=$3 - DEST=$4 - - install -s -m 755 $ROOT/$BIN $DIR/$DEST - get_dso_deps $ROOT "$BIN" - local DEPS="$DSO_DEPS" - mkdir -p $DIR/$LIBDIR - for x in $DEPS ; do - cp -Lfp $ROOT/$x $DIR/$LIBDIR - done - - pushd $DIR/$LIBDIR - if [ -f ld-linux.so.2 ]; then - rm -f ld-linux.so.2 - linker="$(ls -1 ld-*.*.*.so)" - found=$(echo $linker | wc -l) - if [ $found -ne 1 ]; then - echo "Found too many dynamic linkers:" >&2 - echo $linker >&2 - exit 1 - fi - ln -s $linker ld-linux.so.2 - fi - popd -} - -setupShellEnvironment() { - echo "tcp 6 TCP" > $MBD_DIR/etc/protocols - - # PAM configuration - for i in pam_limits.so pam_env.so pam_unix.so pam_deny.so; do - cp -f $IMGPATH/$LIBDIR/security/$i $MBD_DIR/$LIBDIR/security - done - - cp -f $IMGPATH/etc/pam.d/other $MBD_DIR/etc/pam.d - cat > $MBD_DIR/etc/pam.d/login << EOF -#%PAM-1.0 -auth required pam_env.so -auth sufficient pam_unix.so likeauth nullok -auth required pam_deny.so -account required pam_unix.so -password sufficient pam_unix.so nullok use_authtok md5 shadow -password required pam_deny.so -session required pam_limits.so -session required pam_unix.so -EOF - cp -f $MBD_DIR/etc/pam.d/login $MBD_DIR/etc/pam.d/sshd - cp -f $MBD_DIR/etc/pam.d/login $MBD_DIR/etc/pam.d/remote - - cp -f $IMGPATH/etc/security/{limits.conf,pam_env.conf} $MBD_DIR/etc/security/ - - # key generation takes ages on s390, you really don't want this for every - # installation attempt. These are NOT the keys of the installed system! - mkdir -m 0700 -p $MBD_DIR/etc/ssh - echo -n "Generating SSH1 RSA host key: " - /usr/bin/ssh-keygen -q -t rsa1 -f $MBD_DIR/etc/ssh/ssh_host_key \ - -C '' -N '' >&/dev/null - echo - echo -n "Generating SSH2 RSA host key: " - /usr/bin/ssh-keygen -q -t rsa -f $MBD_DIR/etc/ssh/ssh_host_rsa_key \ - -C '' -N '' >&/dev/null - echo - echo -n "Generating SSH2 DSA host key: " - /usr/bin/ssh-keygen -q -t dsa -f $MBD_DIR/etc/ssh/ssh_host_dsa_key \ - -C '' -N '' >&/dev/null - echo - (cd $MBD_DIR/etc/ssh; \ - chmod 600 ssh_host_key ssh_host_rsa_key ssh_host_dsa_key; \ - chmod 644 ssh_host_key.pub ssh_host_rsa_key.pub ssh_host_dsa_key.pub; ) - - - cat > $MBD_DIR/etc/ssh/sshd_config <&1| awk '/^\t([[:alnum:]_\.\[]+,)+/' | sed 's/,//g' | sed 's/ +//'); - while [ -n "$1" ]; do - if [ $1 != "busybox" -a $1 != "sh" ]; then - # if file doesnt already exist, link to busybox - if [ ! -f "$1" ]; then - ln -sf ./busybox $1 - else - [ -n "$DEBUG" ] && echo "Overriding busybox version of $1" - fi - fi - shift - done ) -} - - -makeinitrd() { - EXTRAINITRDPATH="" - INITRDSIZE="" - KEEP="" - PADSIZE="" - LOADERBIN="" - INITRDMODULES="" - MYLANGTABLE=$LANGTABLE - MYLOADERTR=loader.tr - while [ x$(echo $1 | cut -c1-2) = x"--" ]; do - if [ $1 = "--initrdto" ]; then - EXTRAINITRDPATH=$2 - shift; shift - continue - elif [ $1 = "--keep" ]; then - KEEP=yes - shift - continue - elif [ $1 = "--initrdsize" ]; then - INITRDSIZE=$2 - shift; shift - continue - elif [ $1 = "--loaderbin" ]; then - LOADERBIN=$2 - shift; shift - continue - elif [ $1 = "--modules" ]; then - INITRDMODULES=$2 - shift; shift - continue - fi - echo "Unknown option passed to makeinitrd" - exit 1 - done - if [ -z "$LOADERBIN" ]; then - echo "no loader binary specified!" >&2 - exit 1 - fi - if [ -z "$INITRDMODULES" ]; then - echo "warning: no loader modules specified!" >&2 - fi - if [ -z "$INITRDSIZE" ]; then - echo "I don't know how big to make the initrd image!" >&2 - exit 1 - fi - - MBD_DIR=$TMPDIR/makebootdisk.dir.$$ - MBD_FSIMAGE=$TMPDIR/makebootdisk.initrdimage.$$ - MBD_BOOTTREE=$TMPDIR/makebootdisk.tree.$$ - - rm -rf $MBD_DIR $MBD_FSIMAGE - mkdir -p $MBD_DIR/modules - mkdir -p $MBD_DIR/sbin - mkdir -p $MBD_DIR/dev - mkdir -p $MBD_DIR/etc - mkdir -p $MBD_DIR/etc/udev/rules.d - mkdir -p $MBD_DIR/lib/udev/rules.d - mkdir -p $MBD_DIR/proc - mkdir -p $MBD_DIR/selinux - mkdir -p $MBD_DIR/sys - mkdir -p $MBD_DIR/etc/terminfo/{a,b,d,l,s,v,x} - mkdir -p $MBD_DIR/tmp - mkdir -p $MBD_DIR/usr/libexec - mkdir -p $MBD_DIR/usr/$LIBDIR/NetworkManager - mkdir -p $MBD_DIR/usr/share/dbus-1/system-services - mkdir -p $MBD_DIR/var/cache/hald - mkdir -p $MBD_DIR/var/lib/dbus - mkdir -p $MBD_DIR/var/lib/dhclient - mkdir -p $MBD_DIR/var/lock/rpm - mkdir -p $MBD_DIR/var/run - mkdir -p $MBD_DIR/var/run/dbus - mkdir -p $MBD_DIR/var/run/hald - mkdir -p $MBD_DIR/var/run/NetworkManager - mkdir -p $MBD_DIR/etc/dbus-1/system.d - mkdir -p $MBD_DIR/etc/modprobe.d - mkdir -p $MBD_DIR/etc/NetworkManager/dispatcher.d - mkdir -p $MBD_DIR/$LIBDIR/dbus-1 - mkdir -p $MBD_DIR/etc/sysconfig/network-scripts - mkdir -p $MBD_DIR/usr/share/PolicyKit/policy - mkdir -p $MBD_DIR/etc/PolicyKit - mkdir -p $MBD_DIR/var/lib/misc - mkdir -p $MBD_DIR/etc/hal/fdi - mkdir -p $MBD_DIR/usr/share/hal/fdi - mkdir -p $MBD_DIR/usr/share/hwdata - mkdir -p $MBD_DIR/etc/rc.d/init.d - mkdir -p $MBD_DIR/usr/sbin - mkdir -p $MBD_DIR/var/run/wpa_supplicant - - if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then - mkdir -m 111 -p $MBD_DIR/var/empty/sshd - mkdir -p $MBD_DIR/etc/{pam.d,security} - mkdir -p $MBD_DIR/$LIBDIR/security - cp $IMGPATH/$LIBDIR/libpam_misc.so.0.* $MBD_DIR/$LIBDIR/libpam_misc.so.0 - ln -s /tmp $MBD_DIR/var/state/xkb - cp $IMGPATH/usr/bin/xauth $MBD_DIR/sbin/xauth - cp $IMGPATH/usr/sbin/cmsfs* $MBD_DIR/sbin/ - fi - - if [ -n "$INITRDMODULES" ]; then - MODSET=`expandModuleSet "$INITRDMODULES"` - makemoduletree $MBD_DIR "$MODSET" - fi - - # set up the arch bits - echo $arch > $MBD_DIR/etc/arch - - echo "Setting up arch bits" - instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/$LOADERBIN $MBD_DIR /sbin/loader - if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then - instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/init $MBD_DIR /sbin/init - ln -s ./init $MBD_DIR/sbin/reboot - ln -s ./init $MBD_DIR/sbin/halt - ln -s ./init $MBD_DIR/sbin/poweroff - else - instbin $IMGPATH ${LOADERBINDIR##IMGPATH}/shutdown $MBD_DIR /sbin/shutdown - instbin $IMGPATH /usr/lib/anaconda-runtime/loader/linuxrc.s390 $MBD_DIR /sbin/init - instbin $IMGPATH /usr/sbin/dasdfmt $MBD_DIR /sbin/dasdfmt - fi - - if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then - install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz - install -m 644 $SCREENFONT $MBD_DIR/etc/screenfont.gz - fi - install -m 644 $MYLANGTABLE $MBD_DIR/etc/lang-table - install -m 644 $IMGPATH/etc/passwd $MBD_DIR/etc/passwd - install -m 644 $IMGPATH/etc/group $MBD_DIR/etc/group - install -m 644 $IMGPATH/etc/nsswitch.conf $MBD_DIR/etc/nsswitch.conf - - instbin $IMGPATH /usr/bin/mount $MBD_DIR /sbin/mount - instbin $IMGPATH /usr/sbin/mount.nfs $MBD_DIR /sbin/mount.nfs - instbin $IMGPATH /usr/bin/umount $MBD_DIR /sbin/umount - ln -s mount.nfs $MBD_DIR/sbin/umount.nfs - - instbin $IMGPATH /usr/sbin/udevd $MBD_DIR /sbin/udevd - instbin $IMGPATH /usr/sbin/udevadm $MBD_DIR /sbin/udevadm - instbin $IMGPATH /usr/bin/udevinfo $MBD_DIR /sbin/udevinfo - ln -s udevadm $MBD_DIR/sbin/udevsettle - - instbin $IMGPATH /usr/bin/bash $MBD_DIR /sbin/bash - ( cd $MBD_DIR/sbin ; ln -sf bash sh ) - instbin $IMGPATH /usr/sbin/consoletype $MBD_DIR /sbin/consoletype - instbin $IMGPATH /usr/bin/logger $MBD_DIR /sbin/logger - - ( cd $IMGPATH/etc/rc.d/init.d - cp -a functions $MBD_DIR/etc/rc.d/init.d - ) - - ( cd $IMGPATH/etc/sysconfig/network-scripts - cp -a network-functions $MBD_DIR/etc/sysconfig/network-scripts - cp -a network-functions-ipv6 $MBD_DIR/etc/sysconfig/network-scripts - ) - - ( cd $MBD_DIR/etc ; ln -sf /etc/rc.d/init.d init.d ) - - # DHCP and DHCPv6 client daemons and support programs - instbin $IMGPATH /usr/sbin/dhclient $MBD_DIR /sbin/dhclient - cp -a $IMGPATH/usr/sbin/dhclient-script $MBD_DIR/sbin/dhclient-script - chmod 0755 $MBD_DIR/sbin/dhclient-script - instbin $IMGPATH /usr/sbin/dhcp6c $MBD_DIR /sbin/dhcp6c - instbin $IMGPATH /usr/sbin/arping $MBD_DIR /sbin/arping - instbin $IMGPATH /usr/sbin/ifconfig $MBD_DIR /sbin/ifconfig - instbin $IMGPATH /usr/sbin/ip $MBD_DIR /sbin/ip - touch $MBD_DIR/etc/resolv.conf - - # hwdata - cp -a $IMGPATH/usr/share/hwdata/pci.ids $MBD_DIR/usr/share/hwdata/pci.ids - cp -a $IMGPATH/usr/share/hwdata/usb.ids $MBD_DIR/usr/share/hwdata/usb.ids - - # hal - instbin $IMGPATH /usr/sbin/hald $MBD_DIR /sbin/hald - ( cd $IMGPATH/usr/libexec - for f in hald-runner hald-generate-fdi-cache hal*storage* ; do - instbin $IMGPATH /usr/libexec/$f $MBD_DIR /usr/libexec/$f - done - ) - touch $MBD_DIR/var/run/hald.acl-list - cp -a $IMGPATH/usr/share/hal/fdi/* $MBD_DIR/usr/share/hal/fdi - cp -a $IMGPATH/etc/hal/fdi/* $MBD_DIR/etc/hal/fdi - cp -a $IMGPATH/etc/dbus-1/system.d/hal.conf $MBD_DIR/etc/dbus-1/system.d - - # PolicyKit - ( cd $IMGPATH/etc/PolicyKit - cp -a PolicyKit.conf $MBD_DIR/etc/PolicyKit - ) - ( cd $IMGPATH/usr/share/dbus-1/system-services - cp -a org.freedesktop.PolicyKit.service $MBD_DIR/usr/share/dbus-1/system-services - ) - ( cd $IMGPATH/usr/share/PolicyKit/policy - cp -a org.freedesktop.policykit.policy $MBD_DIR/usr/share/PolicyKit/policy - ) - ( cd $IMGPATH/var/lib/misc - cp -a PolicyKit.reload $MBD_DIR/var/lib/misc - ) - - # dbus - instbin $IMGPATH /usr/bin/dbus-uuidgen $MBD_DIR /sbin/dbus-uuidgen - instbin $IMGPATH /usr/bin/dbus-daemon $MBD_DIR /sbin/dbus-daemon - cp -a $IMGPATH/etc/dbus-1/system.conf $MBD_DIR/etc/dbus-1/system.conf - cp -a $IMGPATH/$LIBDIR/dbus-1/dbus-daemon-launch-helper $MBD_DIR/$LIBDIR/dbus-1 - chown root:dbus $MBD_DIR/$LIBDIR/dbus-1/dbus-daemon-launch-helper - chmod 04750 $MBD_DIR/$LIBDIR/dbus-1/dbus-daemon-launch-helper - - # wpa_supplicant - instbin $IMGPATH /usr/sbin/wpa_passphrase $MBD_DIR /usr/sbin/wpa_passphrase - instbin $IMGPATH /usr/sbin/wpa_supplicant $MBD_DIR /usr/sbin/wpa_supplicant - cp -a $IMGPATH/etc/dbus-1/system.d/wpa_supplicant.conf $MBD_DIR/etc/dbus-1/system.d - cp -a $IMGPATH/etc/wpa_supplicant/wpa_supplicant.conf $MBD_DIR/etc/wpa_supplicant - ( cd $IMGPATH/usr/share/dbus-1/system-services - cp -a fi.epitest.hostap.WPASupplicant.service $MBD_DIR/usr/share/dbus-1/system-services - ) - - # NetworkManager - instbin $IMGPATH /usr/sbin/NetworkManager $MBD_DIR /usr/sbin/NetworkManager - instbin $IMGPATH /usr/sbin/nm-system-settings $MBD_DIR /usr/sbin/nm-system-settings - cp -a $IMGPATH/etc/dbus-1/system.d/nm-*.conf $MBD_DIR/etc/dbus-1/system.d - cp -a $IMGPATH/etc/dbus-1/system.d/NetworkManager.conf $MBD_DIR/etc/dbus-1/system.d - cp -a $IMGPATH/etc/NetworkManager/nm-system-settings.conf $MBD_DIR/etc/NetworkManager - instbin $IMGPATH /usr/$LIBDIR/NetworkManager/libnm-settings-plugin-ifcfg-fedora.so \ - $MBD_DIR /usr/$LIBDIR/NetworkManager/libnm-settings-plugin-ifcfg-fedora.so - ( cd $IMGPATH/usr/libexec - for f in nm-* ; do - instbin $IMGPATH /usr/libexec/$f $MBD_DIR /usr/libexec/$f - done - ) - ( cd $IMGPATH/usr/share/dbus-1/system-services - cp -a org.freedesktop.NetworkManagerSystemSettings.service $MBD_DIR/usr/share/dbus-1/system-services - cp -a org.freedesktop.nm_dispatcher.service $MBD_DIR/usr/share/dbus-1/system-services - ) - - # Indirect dependencies - install -m 755 $IMGPATH/$LIBDIR/libfreebl3.so $MBD_DIR/$LIBDIR/ - install -m 755 $IMGPATH/$LIBDIR/libsoftokn3.so $MBD_DIR/$LIBDIR/ - install -m 755 $IMGPATH/usr/$LIBDIR/libsqlite3.so.0 $MBD_DIR/usr/$LIBDIR/ - install -m 755 $IMGPATH/$LIBDIR/libnss_dns.so.2 $MBD_DIR/$LIBDIR/ - install -m 755 $IMGPATH/$LIBDIR/libnss_files.so.2 $MBD_DIR/$LIBDIR/ - install -m 755 $IMGPATH/$LIBDIR/libgcc_s.so.1 $MBD_DIR/$LIBDIR/ - - install -m 644 $IMGPATH/etc/udev/udev.conf $MBD_DIR/etc/udev/udev.conf - for i in $IMGPATH/lib/udev/rules.d/*.rules ; do - install -m 644 $i $MBD_DIR/lib/udev/rules.d/${i##*/} - done - for i in $IMGPATH/etc/udev/rules.d/*.rules ; do - install -m 644 $i $MBD_DIR/etc/udev/rules.d/${i##*/} - done - for i in $IMGPATH/lib/udev/*; do - if [ -f $i ]; then install -m 755 $i $MBD_DIR/lib/udev/${i##*/}; fi - done - rm -f $MBD_DIR/lib/udev/rules.d/*persistent* - rm -f $MBD_DIR/lib/udev/rules.d/*generator* - - install -m 644 $LOADERBINDIR/$MYLOADERTR $MBD_DIR/etc/loader.tr - for i in a/ansi d/dumb l/linux s/screen v/vt100 v/vt100-nav v/vt102 x/xterm x/xterm-color g/gnome ; do - [ -f $IMGPATH/usr/share/terminfo/$i ] && \ - install -m 644 $IMGPATH/usr/share/terminfo/$i $MBD_DIR/etc/terminfo/$i - done - - makeproductfile $MBD_DIR - - for n in insmod rmmod modprobe; do - instbin $IMGPATH /usr/sbin/$n $MBD_DIR /sbin/$n - done - - ln -s /sbin/init $MBD_DIR/init - ln -s /proc/mounts $MBD_DIR/etc/mtab - ln -s sbin $MBD_DIR/bin - mkdir -p $MBD_DIR/var/lib - ln -s ../../tmp $MBD_DIR/var/lib/xkb - - # s390/s390x need sshd setup - if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then - setupShellEnvironment - fi - -cat > $MBD_DIR/.profile < $MBD_FSIMAGE - - size=$(du $MBD_FSIMAGE | awk '{ print $1 }') - - echo "Wrote $MBD_FSIMAGE (${size}k compressed)" - - if [ -n "$EXTRAINITRDPATH" ]; then - mkdir -p `dirname $EXTRAINITRDPATH` - cp -a $MBD_FSIMAGE $EXTRAINITRDPATH - fi - - if [ -z "$KEEP" ]; then - rm -rf $MBD_FSIMAGE $MBD_BOOTTREE - fi -} - -makemainimage () { - imagename=$1 - type=$2 - mmi_tmpimage=$TMPDIR/instimage.img.$$ - mmi_mntpoint=$TMPDIR/instimage.mnt.$$ - - rm -rf $mmi_tmpimage $mmi_mntpoint - mkdir $mmi_mntpoint - - if [ $type = "ext2" ]; then - SIZE=$(du -sk $IMGPATH | awk '{ print int($1 * 1.1) }') - if [ -d $IMGPATH/usr/lib/anaconda-runtime ]; then - ERROR=$(du -sk $IMGPATH/usr/lib/anaconda-runtime | awk '{ print $1 }') - SIZE=$(expr $SIZE - $ERROR) - fi - if [ -d $IMGPATH/usr/lib/syslinux ]; then - ERROR=$(du -sk $IMGPATH/usr/lib/syslinux | awk '{ print $1 }') - SIZE=$(expr $SIZE - $ERROR) - fi - dd if=/dev/zero bs=1k count=${SIZE} of=$mmi_tmpimage 2>/dev/null - mke2fs -q -F $mmi_tmpimage > /dev/null - tune2fs -c0 -i0 $mmi_tmpimage >/dev/null - mount -o loop $mmi_tmpimage $mmi_mntpoint - - (cd $IMGPATH; find . | - fgrep -v "./usr/lib/anaconda-runtime" | - fgrep -v "./usr/lib/syslinux" - cpio -H crc -o) | (cd $mmi_mntpoint; cpio -iumd) - makeproductfile $mmi_mntpoint - umount $mmi_mntpoint - rmdir $mmi_mntpoint - elif [ $type = "squashfs" ]; then - makeproductfile $IMGPATH - echo "Running mksquashfs $IMGPATH $mmi_tmpimage -all-root -no-fragments -no-progress" - mksquashfs $IMGPATH $mmi_tmpimage -all-root -no-fragments -no-progress - chmod 0644 $mmi_tmpimage - SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024) - elif [ $type = "cramfs" ]; then - makeproductfile $IMGPATH - echo "Running mkcramfs $CRAMBS $IMGPATH $mmi_tmpimage" - mkfs.cramfs $CRAMBS $IMGPATH $mmi_tmpimage - SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024) - fi - - cp $mmi_tmpimage $INSTIMGPATH/${imagename}.img - chmod 644 $INSTIMGPATH/${imagename}.img - - echo "Wrote $INSTIMGPATH/${imagename}.img (${SIZE}k)" - relpath=${INSTIMGPATH#$TOPDESTPATH/} - echo "mainimage = ${relpath}/${imagename}.img" >> $TOPDESTPATH/.treeinfo - - rm $mmi_tmpimage -} - -makeSecondStage() { - echo "[stage2]" >> $TOPDESTPATH/.treeinfo - echo "Building install.img" - makemainimage "install" "squashfs" - [ $? = 0 ] || exit 1 -} - -doPostImages() { - /bin/true -} - -# this gets overloaded if we're on an EFI-capable arch (... with grub) -makeEfiImages() -{ - /bin/true -} - -# source the architecture specific mk-images file so we can call functions -# in it -if [ ${BUILDARCH} = s390x ]; then - # FIXME: this is a bad hack for s390, but better than copying for now - source $TOPDIR/mk-images.s390 -elif [ ${BUILDARCH} = ppc64 ]; then - # ... and similar for ppc64 - source $TOPDIR/mk-images.ppc -elif [ ${BUILDARCH} = "x86_64" -o ${BUILDARCH} = "i386" ]; then - source $TOPDIR/mk-images.x86 - source $TOPDIR/mk-images.efi -else - source $TOPDIR/mk-images.${BUILDARCH} -fi - -# Find the kernel, unpack it, and verify it -kerneltags="kernel" -efiarch="" -arches="$BUILDARCH" -if [ "$BUILDARCH" = "ppc" ]; then - arches="ppc64 ppc" -elif [ "$BUILDARCH" = "i386" ]; then - arches="i586" - efiarch="ia32" - kerneltags="kernel kernel-PAE" - kernelxen="kernel-PAE" -elif [ "$BUILDARCH" = "x86_64" ]; then - kerneltags="kernel" - efiarch="x64" -elif [ "$BUILDARCH" = "ia64" ]; then - kerneltags="kernel" - efiarch="ia64" -fi - -foundakernel="" -for KERNELARCH in $arches; do - for kernelvers in $kerneltags; do - kpackage=$(findPackage $kernelvers) - if [ "$KERNELARCH" = "i586" -a -z "$kpackage" ]; then - echo "No i586 kernel, trying i686..." - KERNELARCH="i686" - kpackage=$(findPackage $kernelvers) - fi - - if [ -z "$kpackage" ]; then - echo "Unable to find kernel package $kernelvers" - continue - fi - - yumdownloader -c $yumconf --archlist=$KERNELARCH $kpackage - kpackage="$kpackage.rpm" - if [ ! -f "$kpackage" ]; then - echo "kernel ($kernelvers) doesn't exist for $KERNELARCH. skipping" - continue - fi - - KERNELROOT=$KERNELBASE/$KERNELARCH - mkdir -p $KERNELROOT - - foundakernel="yes" - - if [ "$BUILDARCH" = "ia64" ]; then - vmlinuz=$(rpm --nodigest --nosignature -qpl $kpackage |grep ^/boot/efi/EFI/redhat/vmlinuz | head -n 1) - version=${vmlinuz##/boot/efi/EFI/redhat/vmlinuz-} - else - vmlinuz=$(rpm --nodigest --nosignature -qpl $kpackage |grep ^/boot/vmlinuz | head -n 1) - version=${vmlinuz##/boot/vmlinuz-} - fi - arch=$(rpm --nodigest --nosignature --qf '%{ARCH}\n' -qp $kpackage) - - rpm2cpio $kpackage | (cd $KERNELROOT; cpio --quiet -iumd) - rm -f $kpackage - # expand out any available firmware too - for p in $(repoquery -c $yumconf '*firmware*') ; do yumdownloader -c $yumconf $p ; rpm2cpio *firmware*.rpm | (cd $KERNELROOT; cpio --quiet -iumd) ; rm -f *firmware*.rpm ; done - - if [ ! -d "$KERNELROOT/lib/modules/$version" ]; then - echo "$KERNELROOT/lib/modules/$version is not a valid modules directory" 2>&1 - exit 1 - fi - - if [ ! -f "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version" ]; then - echo "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version does not exist" - exit 1 - fi - - allmods=$(find $KERNELROOT/lib/modules/$version -name *.ko) - - rundepmod $KERNELROOT - $GENMODINFO $KERNELROOT/lib/modules/$version > $MODINFO - - # make the boot images - makeBootImages - - makeEfiImages $yumconf - done -done - -if [ -n "$foundakernel" ]; then - makeSecondStage - rm -rf $KERNELBASE -fi - -doPostImages - -cd $TOPDIR diff --git a/rewrite/scratch/mk-images.alpha b/rewrite/scratch/mk-images.alpha deleted file mode 100644 index fb2ad60a..00000000 --- a/rewrite/scratch/mk-images.alpha +++ /dev/null @@ -1,131 +0,0 @@ -# -# mk-images.alpha -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -INITRDMODS="tgafb crc32 $INITRDMODS" - -###FSMODS="msdos vfat ext3 reiserfs jfs xfs" -###IDEMODS="cdrom ide-cd" -###SCSIMODS="cdrom scsi_mod sd_mod sg sr_mod st" -###USBMODS="ohci-hcd uhci-hcd hid usb-storage sd_mod sr_mod" -###LATEUSBMODS="mousedev usb-storage" -###SECSTAGE="md raid0 raid1 raid5 dm-mod srm_env $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS" -NETMODULES="e100 tulip 8139too tulip 3c509 3c59x dl2k eepro epic100 ewrk3 hamachi natsemi ne2k-pci ns83820 starfire yellowfin de4x5 depca acenic tg3" - -SCSIMODULES="$SCSIMODS qlogicisp DAC960 cpqfc BusLogic 3w-xxxx dmx3191d dpt_i2o megaraid ncr53c8xx sym53c8xx qlogicfc qla2x00 qla1280 cciss cpqarray aic7xxx aha1740 megaraid" - -###ISOMODULES="ehci-hcd ieee1394 ohci1394 sbp2" - -prepareBootImage() { - echo "ALPHA: prepareBootImage() is called" - dd if=/dev/zero of=$MBD_TMPIMAGE bs=1k count=$BOOTDISKSIZE 2>/dev/null - echo y | /sbin/mke2fs -b 1024 -r 0 -O none $MBD_TMPIMAGE > /dev/null 2>/dev/null - LODEV=`findloopdevice $MBD_TMPIMAGE` - e2writeboot $LODEV $BOOTDISKDIR/bootlx - mount $LODEV -t ext2 $MBD_BOOTTREE - mkdir -p $MBD_BOOTTREE/etc - cat > $MBD_BOOTTREE/etc/aboot.conf < $MBD_BOOTTREE/etc/milo.conf < $MBD_BOOTTREE/vmlinux.gz - umount $LODEV - losetup -d $LODEV - mount -o loop -t ext2 $MBD_TMPIMAGE $MBD_BOOTTREE -} - -makeBootImages() { - echo "Building boot images for kernel $kernelvers" - - mkdir -p $TOPDESTPATH/boot - cp $BOOTDISKDIR/bootlx $TOPDESTPATH/boot - - mkdir -p $TOPDESTPATH/etc - cat > $TOPDESTPATH/etc/aboot.conf <. -# - -makeefibootdisk() -{ - partimg=$1 - target=$2 - - if [ ! -f $1 ]; then - return - fi - - local partsize=$(ls -l $1 | awk '{ print $5; }') - local disksize=$((17408 + $partsize + 17408)) - disksize=$(($disksize + $(($disksize % 512)))) - local diskimg=$(mktemp /tmp/efidisk.img.XXXXXX) - dd if=/dev/zero of=$diskimg count=1 bs=$disksize - local loop=$(losetup -v -f $diskimg | awk '{ print $4 }') - dmsetup create efiboot$$ --table "0 $(($disksize / 512)) linear $loop 0" - parted --script /dev/mapper/efiboot$$ mklabel gpt unit b mkpart '"EFI System Partition"' fat32 17408 $((17408 + $partsize)) set 1 boot on - dd if=$partimg of=/dev/mapper/efiboot$$p1 - dmsetup remove /dev/mapper/efiboot$$p1 - dmsetup remove /dev/mapper/efiboot$$ - losetup -d $loop - - mv -v $diskimg $target - chmod a+r $target -} - -#makeefibootimage required for EFI bootloader dosfs image -makeefibootimage() { - MBD_FILENAME="" - KERNELFILE="" - INITRDFILE="" - grubpkg="" - MBD_TMPIMAGE=${TMPDIR:-/tmp}/makebootdisk.image.$$ - MBD_BOOTTREE=${TMPDIR:-/tmp}/makebootdisk.tree.$$ - MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp' - while [ x$(echo $1 | cut -c1-2) = x"--" ]; do - if [ $1 = "--kernel" ]; then - KERNELFILE=$2 - shift; shift - continue - elif [ $1 = "--initrd" ]; then - INITRDFILE=$2 - shift; shift - continue - elif [ $1 = "--imagename" ]; then - MBD_FILENAME=$IMAGEPATH/$2 - shift; shift - continue - elif [ $1 = "--grubpkg" ]; then - grubpkg=$2 - shift; shift - continue - fi - echo "Unknown option passed to makebootdisk" - exit 1 - done - - if [ -z "$MBD_FILENAME" ]; then - echo "No imagename passed" - exit 1 - fi - - if [ -z "$KERNELFILE" ]; then - echo "No kernel file passed" - exit 1 - fi - - if [ -z "$INITRDFILE" ]; then - echo "No initrd file passed" - exit 1 - fi - MBD_FSIMAGE="$INITRDFILE" - - mkdir -p $MBD_BOOTTREE - mkdir -p $MBD_BOOTTREE_TMP - rm -rf $MBD_BOOTTREE_TMP - mkdir -p $MBD_TMPIMAGE - - # provided by the mk-image.$ARCH file - prepareEfiImage - - left=$(df $MBD_BOOTTREE | tail -n1) - left=$(echo $left | awk '{print $4'}) - - umount $MBD_BOOTTREE - - if [ -n "$EXTRAKERNELPATH" ]; then - mkdir -p `dirname $EXTRAKERNELPATH` - cp -f $KERNELROOT/$KERNELDIR/${KERNELNAME}-* $EXTRAKERNELPATH - fi - - mkdir -p `dirname $MBD_FILENAME` - rm -rf $MBD_TMPIMAGE $MBD_MNTPOINT $MBD_BOOTTREE - if [ -z "$INITRDFILE" ]; then - rm -f $MBD_FSIMAGE - fi - - chmod a+r $MBD_FILENAME - echo "Wrote $MBD_FILENAME (${left}k free)" -} - -# prepare and build an efiboot.img. -prepareEfiImage() { - prepareEfiTree || return 1 - - # dynamically calculate the size of the dosfs - BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail -n1 | awk '{print $1}') - BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100) - echo "The size of the efiboot.img dosfs is $BOOTDISKSIZE" - mkdosfs -n ANACONDA -C $MBD_FILENAME $BOOTDISKSIZE >/dev/null - mount -o loop,shortname=winnt,umask=0077 -t vfat $MBD_FILENAME $MBD_BOOTTREE - cp -R $MBD_BOOTTREE_TMP/* $MBD_BOOTTREE -} - -# prepare a directory with the kernel, initrd, and various message files -# used to populate the efi boot image -prepareEfiTree() { - mkdir -p $MBD_BOOTTREE_TMP/EFI/boot - - cp -a $BOOTDISKDIR/* $MBD_BOOTTREE_TMP/EFI/boot/ - cp $INITRDFILE $MBD_BOOTTREE_TMP/EFI/boot/initrd.img - cp $KERNELFILE $MBD_BOOTTREE_TMP/EFI/boot/vmlinuz - - sed -i "s/@PRODUCT@/$PRODUCT/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf - sed -i "s/@VERSION@/$VERSION/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf - - yumdownloader -c $yumconf $grubpkg - rpm2cpio $grubpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd) - cp $KERNELROOT/boot/efi/EFI/redhat/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/grub.efi - - # The first generation Mactel machines get the bootloader name wrong - # as per the spec. Awesome, guys. - if [ "$efiarch" == "ia32" ]; then - cp $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot.efi - cp $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot.conf - fi - - mv $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.efi - mv $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.conf - - artpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" --whatprovides system-logos | grep -v generic-logos | head -1) - - if [ -z "$artpkg" ]; then - argpkg="generic-logos" - fi - - yumdownloader -c $yumconf $artpkg - rpm2cpio $artpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd) - cp $KERNELROOT/boot/grub/splash.xpm.gz $MBD_BOOTTREE_TMP/EFI/boot/splash.xpm.gz -} - -makeEfiImages() { - yumconf="$1" - if [ "$kernelvers" != "$kernelxen" ]; then - local grubarch=${efiarch} - case ${efiarch} in - ia32) grubarch=i386 ;; - x64) grubarch=x86_64 ;; - esac - grubpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf grub.$grubarch) - if [ -z "$grubpkg" ]; then - echo "cannot find package grub.$grubarch" >&2 - return 1 - fi - echo "Building efiboot.img for ${efiarch}/$KERNELARCH at $TOPDESTPATH/images/efiboot.img" - - makeefibootimage \ - --imagename pxeboot/efiboot.img \ - --kernel $TOPDESTPATH/images/pxeboot/vmlinuz \ - --initrd $TOPDESTPATH/images/pxeboot/initrd.img \ - --grubpkg ${grubpkg} - local ret=$? - [ $ret -eq 0 ] || return $ret - - makeefibootdisk $TOPDESTPATH/images/pxeboot/efiboot.img $TOPDESTPATH/images/efidisk.img - return $? - fi - return 1 -} diff --git a/rewrite/scratch/mk-images.ppc b/rewrite/scratch/mk-images.ppc deleted file mode 100644 index b90865b6..00000000 --- a/rewrite/scratch/mk-images.ppc +++ /dev/null @@ -1,171 +0,0 @@ -# -# mk-images.ppc -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -makeBootImages() { - echo "Building boot images for kernel $kernelvers" - FAKEARCH="" - - if [ "$KERNELARCH" = "ppc64" ]; then - mkdir -p $TOPDESTPATH/ppc/ppc64 - echo "Building $KERNELARCH initrd" - makeinitrd --initrdto $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz \ - --initrdsize 8192 \ - --loaderbin loader \ - --modules "$INITRDMODS spufs viocd gpio_mdio" - - cp $KERNELROOT/boot/vmlinuz-* $TOPDESTPATH/ppc/ppc64/vmlinuz - sed -e "s/%BITS%/64/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \ - $BOOTDISKDIR/yaboot.conf.in > $TOPDESTPATH/ppc/ppc64/yaboot.conf - - cat << __EOT__ >> $TOPDESTPATH/.treeinfo -[images-$KERNELARCH] -kernel = ppc/ppc64/vmlinuz -initrd = ppc/ppc64/ramdisk.image.gz -__EOT__ - - if [ -x $IMGPATH/usr/bin/mkzimage -a -r $IMGPATH/usr/share/ppc64-utils/zImage.stub ]; then - mkdir -p $TOPDESTPATH/images/netboot - pushd $TOPDESTPATH/ppc/ppc64 - cp $IMGPATH/usr/share/ppc64-utils/zImage.lds $TOPDESTPATH/ppc/ppc64/zImage.lds - $IMGPATH/usr/bin/mkzimage $TOPDESTPATH/ppc/ppc64/vmlinuz no no $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz $IMGPATH/usr/share/ppc64-utils/zImage.stub $TOPDESTPATH/images/netboot/ppc64.img - rmdir $TOPDESTPATH/images/netboot || : - rm -f $TOPDESTPATH/ppc/ppc64/zImage.lds - popd - echo "zimage = images/netboot/ppc64.img" >> $TOPDESTPATH/.treeinfo - elif [ -x $IMGPATH/usr/sbin/wrapper -a -r $IMGPATH/usr/lib/kernel-wrapper/wrapper.a ]; then - mkdir -p $TOPDESTPATH/images/netboot - $IMGPATH/usr/sbin/wrapper -o $TOPDESTPATH/images/netboot/ppc64.img \ - -i $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz \ - -D $IMGPATH/usr/lib/kernel-wrapper \ - $TOPDESTPATH/ppc/ppc64/vmlinuz - rmdir $TOPDESTPATH/images/netboot || : - echo "zimage = images/netboot/ppc64.img" >> $TOPDESTPATH/.treeinfo - fi - - echo >> $TOPDESTPATH/.treeinfo - - - elif [ "$KERNELARCH" = "ppc" ]; then - FAKEARCH="ppc" - mkdir -p $TOPDESTPATH/ppc/ppc32 - mkdir -p $TOPDESTPATH/ppc/mac - - echo "Building ppc initrd" - makeinitrd --initrdto $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz \ - --initrdsize 8192 \ - --loaderbin loader \ - --modules "$INITRDMODS" - - cp $KERNELROOT/boot/vmlinuz-* $TOPDESTPATH/ppc/ppc32/vmlinuz - sed -e "s/%BITS%/32/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \ - $BOOTDISKDIR/yaboot.conf.in > $TOPDESTPATH/ppc/ppc32/yaboot.conf - - cat << __EOT__ >> $TOPDESTPATH/.treeinfo -[images-$KERNELARCH] -kernel = ppc/ppc32/vmlinuz -initrd = ppc/ppc32/ramdisk.image.gz -__EOT__ - if [ -x $IMGPATH/usr/bin/mkzimage -a -r $IMGPATH/usr/share/ppc64-utils/zImage.stub ]; then - mkdir -p $TOPDESTPATH/images/netboot - pushd $TOPDESTPATH/ppc/ppc32 - cp $IMGPATH/usr/share/ppc64-utils/zImage.lds $TOPDESTPATH/ppc/ppc32/zImage.lds - $IMGPATH/usr/bin/mkzimage $TOPDESTPATH/ppc/ppc32/vmlinuz no no $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz $IMGPATH/usr/share/ppc64-utils/zImage.stub $TOPDESTPATH/images/netboot/ppc32.img - rmdir $TOPDESTPATH/images/netboot || : - rm -f $TOPDESTPATH/ppc/ppc32/zImage.lds - popd - echo "zimage = images/netboot/ppc32.img" >> $TOPDESTPATH/.treeinfo - elif [ -x $IMGPATH/usr/sbin/wrapper -a -r $IMGPATH/usr/lib/kernel-wrapper/wrapper.a ]; then - $IMGPATH/usr/sbin/wrapper -o $TOPDESTPATH/images/netboot/ppc32.img \ - -i $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz \ - -D $IMGPATH/usr/lib/kernel-wrapper \ - $TOPDESTPATH/ppc/ppc32/vmlinuz - rmdir $TOPDESTPATH/images/netboot || : - popd - echo "zimage = images/netboot/ppc32.img" >> $TOPDESTPATH/.treeinfo - fi - echo >> $TOPDESTPATH/.treeinfo - - else - echo "Unknown kernel arch: $KERNELARCH" - fi -} - -doPostImages() { - mkdir -p $TOPDESTPATH/etc - mkdir -p $TOPDESTPATH/ppc/chrp - - # Create ofboot.b and bootinfo.txt files, and yaboot binaries for Mac and CHRP - cp $BOOTDISKDIR/bootinfo.txt $TOPDESTPATH/ppc/bootinfo.txt - cp $IMGPATH/usr/lib/anaconda-runtime/boot/efika.forth $TOPDESTPATH/ppc/efika.forth - - if [ -d $TOPDESTPATH/ppc/mac ]; then - cp $BOOTDISKDIR/ofboot.b $TOPDESTPATH/ppc/mac/ofboot.b - cp $IMGPATH/usr/lib/yaboot/yaboot $TOPDESTPATH/ppc/mac/yaboot - fi - - if [ -d $TOPDESTPATH/ppc/chrp ]; then - cp $IMGPATH/usr/lib/yaboot/yaboot $TOPDESTPATH/ppc/chrp/yaboot - $IMGPATH/usr/lib/yaboot/addnote $TOPDESTPATH/ppc/chrp/yaboot - fi - - # IBM firmware can't handle boot scripts properly, so for biarch installs - # we use a yaboot.conf which asks the user to select 32-bit or 64-bit kernel. - if [ -r $TOPDESTPATH/ppc/ppc32/yaboot.conf -a -r $TOPDESTPATH/ppc/ppc64/yaboot.conf ]; then - # Both kernels exist. Copy the biarch yaboot.conf into place. - sed -e "s/%BITS%/32/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \ - $BOOTDISKDIR/yaboot.conf.3264 > $TOPDESTPATH/etc/yaboot.conf - else - # Copy the one that exists, assuming one does exist - cp $TOPDESTPATH/ppc/ppc??/yaboot.conf $TOPDESTPATH/etc - fi - - if [ -z "$BOOTISO" ]; then - return - fi - - # Copy it all into the isopath for the boot CD - mkdir -p $TOPDESTPATH/isopath - cp -r $TOPDESTPATH/{ppc,etc} $TOPDESTPATH/isopath - - # We want the ppc32 prep image in the boot.iso too. - if [ -d $TOPDESTPATH/images/netboot ]; then - mkdir -p $TOPDESTPATH/isopath/images - cp -r $TOPDESTPATH/images/netboot $TOPDESTPATH/isopath/images - rm -f $TOPDESTPATH/isopath/images/ppc64.img - fi - - if [ -r $TOPDESTPATH/isopath/images/netboot/ppc32.img ]; then - PREPBOOT="-prep-boot images/netboot/ppc32.img" - fi - - if [ -d $TOPDESTPATH/isopath/ppc/mac ]; then - MACBOOT="-hfs-volid $VERSION -hfs-bless $TOPDESTPATH/isopath/ppc/mac" - fi - - # Create the boot.iso - mkisofs -o $TOPDESTPATH/images/$BOOTISO -chrp-boot -U $PREPBOOT \ - -part -hfs -T -r -l -J -A "$PRODUCT $VERSION" -sysid PPC \ - -V "PBOOT" -volset "$VERSION" -volset-size 1 -volset-seqno 1 \ - $MACBOOT \ - -map $BOOTDISKDIR/mapping -magic $BOOTDISKDIR/magic \ - -no-desktop -allow-multidot -graft-points $TOPDESTPATH/isopath \ - images/install.img=$TOPDESTPATH/images/install.img - implantisomd5 $TOPDESTPATH/images/$BOOTISO - rm -rf $TOPDESTPATH/isopath -} diff --git a/rewrite/scratch/mk-images.s390 b/rewrite/scratch/mk-images.s390 deleted file mode 100644 index 1f87232a..00000000 --- a/rewrite/scratch/mk-images.s390 +++ /dev/null @@ -1,53 +0,0 @@ -# -# mk-images.s390 -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -S390SCSIMODS="zfcp tape390" -S390DASDMODS=" dasd_diag_mod dasd_eckd_mod dasd_fba_mod dasd_mod" -S390NETMODS="ctc netiucv smsgiucv lcs qdio qeth ccwgroup crypto_api xfrm_nalgo" -S390MODS="$S390SCSIMODS $S390DASDMODS $S390NETMODS" - -makeBootImages() { - makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \ - --initrdsize 20000 \ - --loaderbin loader \ - --modules "$INITRDMODS $S390MODS" - sz=$(ls -l $TOPDESTPATH/images/initrd.img | awk '{print $5}') - $GENINITRDSZ $sz $TOPDESTPATH/images/initrd.size - cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img - - cp -v $BOOTDISKDIR/generic.prm $TOPDESTPATH/images/generic.prm - cp -v $BOOTDISKDIR/generic.ins $TOPDESTPATH/generic.ins - - $MKS390CDBOOT \ - -i $TOPDESTPATH/images/kernel.img \ - -r $TOPDESTPATH/images/initrd.img \ - -p $TOPDESTPATH/images/generic.prm \ - -o $TOPDESTPATH/images/cdboot.img - - cat << __EOT__ >> $TOPDESTPATH/.treeinfo -[images-$KERNELARCH] -kernel = images/kernel.img -initrd = images/initrd.img -initrd.size = images/initrd.size -generic.prm = images/generic.prm -generic.ins = generic.ins -cdboot.img = images/cdboot.img - -__EOT__ -} diff --git a/rewrite/scratch/mk-s390-cdboot.c b/rewrite/scratch/mk-s390-cdboot.c deleted file mode 100644 index 45e5cf84..00000000 --- a/rewrite/scratch/mk-s390-cdboot.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * mk-s390-cdboot -- creates one big image using a kernel, a ramdisk and - * a parmfile - * - * - * 2003-07-24 Volker Sameske - * - * compile with: - * gcc -Wall -o mk-s390-cdboot mk-s390-cdboot.c - */ - -#include -#include -#include -#include -#include - -#define BUFFER_LEN 1024 -#define INITRD_START 0x0000000000800000LL -#define START_PSW_ADDRESS 0x80010000 -#define PARAMETER_BUFFER_LEN 80 - -static struct option getopt_long_options[]= -{ - { "image", 1, 0, 'i'}, - { "ramdisk", 1, 0, 'r'}, - { "parmfile", 1, 0, 'p'}, - { "outfile", 1, 0, 'o'}, - { "help", 0, 0, 'h'}, - {0, 0, 0, 0} -}; - - -static void usage(char *cmd) -{ - printf("%s [-h] [-v] -i -r -p -o \n", cmd); -} - - -int main (int argc, char **argv) -{ - char *cmd = basename(argv[0]); - FILE *fd1; - FILE *fd2; - FILE *fd3; - FILE *fd4; - char buffer[BUFFER_LEN]; - int rc, oc, index; - unsigned long long initrd_start = INITRD_START; - unsigned long long initrd_size; - char image[PARAMETER_BUFFER_LEN]; - char ramdisk[PARAMETER_BUFFER_LEN]; - char parmfile[PARAMETER_BUFFER_LEN]; - char outfile[PARAMETER_BUFFER_LEN]; - int image_specified = 0; - int ramdisk_specified = 0; - int parmfile_specified = 0; - int outfile_specified = 0; - int start_psw_address = START_PSW_ADDRESS; - - opterr=0; - while (1) - { - oc = getopt_long(argc, argv, "i:r:p:o:h?", getopt_long_options, &index); - if (oc==-1) break; - - switch (oc) - { - case '?': - case 'h': - usage(cmd); - exit(0); - case 'i': - strcpy(image, optarg); - image_specified = 1; - break; - case 'r': - strcpy(ramdisk, optarg); - ramdisk_specified = 1; - break; - case 'p': - strcpy(parmfile, optarg); - parmfile_specified = 1; - break; - case 'o': - strcpy(outfile, optarg); - outfile_specified = 1; - break; - default: - usage(cmd); - exit(0); - } - } - - if (!image_specified || !ramdisk_specified || - !parmfile_specified || !outfile_specified) { - usage(cmd); - exit(0); - } - - printf("Creating bootable CD-ROM image...\n"); - printf("kernel is : %s\n", image); - printf("ramdisk is : %s\n", ramdisk); - printf("parmfile is: %s\n", parmfile); - printf("outfile is : %s\n", outfile); - - fd1 = fopen(outfile, "w"); - fd2 = fopen(image, "r"); - fd3 = fopen(ramdisk, "r"); - fd4 = fopen(parmfile, "r"); - - printf("writing kernel...\n"); - while (1) { - rc = fread(buffer, BUFFER_LEN, 1, fd2); - fwrite(buffer, BUFFER_LEN, 1, fd1); - if (rc == 0) break; - } - - printf("writing initrd...\n"); - fseek(fd1, initrd_start, SEEK_SET); - while (1) { - rc = fread(buffer, BUFFER_LEN, 1, fd3); - fwrite(buffer, BUFFER_LEN, 1, fd1); - if (rc == 0) break; - } - - fseek(fd3, 0 ,SEEK_END); - initrd_size = ftell(fd3); - - printf("changing start PSW address to 0x%08x...\n", start_psw_address); - fseek(fd1, 0x4, SEEK_SET); - fwrite(&start_psw_address, 4, 1, fd1); - - printf("writing initrd address and size...\n"); - printf("INITRD start: 0x%016llx\n", initrd_start); - printf("INITRD size : 0x%016llx\n", initrd_size); - - fseek(fd1, 0x10408, SEEK_SET); - fwrite(&initrd_start, 8, 1, fd1); - fseek(fd1, 0x10410, SEEK_SET); - fwrite(&initrd_size, 8, 1, fd1); - - printf("writing parmfile...\n"); - fseek(fd1, 0x10480, SEEK_SET); - while (1) { - rc = fread(buffer, 1, 1, fd4); - fwrite(buffer, 1, 1, fd1); - if (rc == 0) break; - } - - fclose(fd1); - fclose(fd2); - fclose(fd3); - fclose(fd4); - return 0; -} diff --git a/rewrite/scratch/modlist.c b/rewrite/scratch/modlist.c deleted file mode 100644 index 5c88e323..00000000 --- a/rewrite/scratch/modlist.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * modlist.c - * - * Copyright (C) 2007 Red Hat, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include - -#include "../isys/isys.h" -#include "moduleinfo.h" - -int main(int argc, char ** argv) { - poptContext optCon; - char * modInfoFile = "/boot/module-info"; - enum driverMajor major; - const char * type; - const char * mod; - struct moduleInfo * list, * m; - int rc, i; - int showModInfo = 0; - int ignoreMissing = 0; - moduleInfoSet mis; - struct moduleInfo * mi; - struct poptOption optionTable[] = { - { "ignore-missing", 'I', POPT_ARG_NONE, &ignoreMissing, 0, - "Ignore modules not in modinfo file for --modinfo" }, - { "modinfo", 'm', POPT_ARG_NONE, &showModInfo, 0, - "Give output in module-info file for listed args" }, - { "modinfo-file", 'f', POPT_ARG_STRING, &modInfoFile, 0, - "Module info file to use"}, - POPT_AUTOHELP - { 0, 0, 0, 0, 0 } - }; - - optCon = poptGetContext(NULL, argc, (const char **) argv, optionTable, 0); - - if ((rc = poptGetNextOpt(optCon)) < -1) { - fprintf(stderr, "bad option %s: %s\n", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - exit(1); - } - - mis = newModuleInfoSet(); - if (readModuleInfo(modInfoFile, mis, NULL, 0)) { - fprintf(stderr, "Failed to read %s\n", modInfoFile); - exit(1); - } - - if (showModInfo) { - printf("Version 0\n"); - while ((mod = poptGetArg(optCon))) { - mi = findModuleInfo(mis, mod); - if (mi) { - printf("%s\n", mi->moduleName); - switch (mi->major) { - case DRIVER_CDROM: printf("\tcdrom\n"); break; - case DRIVER_SCSI: printf("\tscsi\n"); break; - case DRIVER_FS: printf("\tfs\n"); break; - case DRIVER_PCMCIA: printf("\tpcmcia\n"); break; - case DRIVER_IDE: printf("\tide\n"); break; - case DRIVER_OTHER: printf("\tother\n"); break; - case DRIVER_NET: - switch (mi->minor) { - case DRIVER_MINOR_ETHERNET: printf("\teth\n"); break; - case DRIVER_MINOR_TR: printf("\ttr\n"); break; - - default: - fprintf(stderr, "unknown net minor type for %s\n", - mi->moduleName); - exit(1); - } - break; - - default: - fprintf(stderr, "unknown device type for %s (%d)\n", - mi->moduleName, mi->major); - exit(1); - - } - printf("\t\"%s\"\n", mi->description); - for (i = 0; i < mi->numArgs; i++) { - printf("\t%s \"%s\"\n", mi->args[i].arg, - mi->args[i].description); - } - } else if (!ignoreMissing) { - fprintf(stderr, "I know nothing about %s\n", mod); - exit(1); - } - } - } else { - while ((type = poptGetArg(optCon))) { - if (!strcasecmp(type, "scsi")) { - major = DRIVER_SCSI; - } else if (!strcasecmp(type, "net")) { - major = DRIVER_NET; - } else if (!strcasecmp(type, "fs")) { - major = DRIVER_FS; - } else if (!strcasecmp(type, "cdrom")) { - major = DRIVER_CDROM; - } else { - fprintf(stderr, "type must be one of scsi, net, fs, cdrom\n"); - exit(1); - } - - list = getModuleList(mis, major); - for (m = list; m && m->moduleName; m++) - printf("%s\n", m->moduleName); - free(list); - } - } - - return 0; -} diff --git a/rewrite/orig/scripts/buildinstall b/rewrite/scripts/buildinstall similarity index 56% rename from rewrite/orig/scripts/buildinstall rename to rewrite/scripts/buildinstall index 97eaf614..bdc7cef3 100755 --- a/rewrite/orig/scripts/buildinstall +++ b/rewrite/scripts/buildinstall @@ -18,68 +18,76 @@ # along with this program. If not, see . # +die() { + [ -n "$TREEDIR" ] && rm -rf $TREEDIR + [ -n "$BUILDINSTDIR" ] && rm -rf $BUILDINSTDIR + [ -n "$yumconf" ] && rm -rf $yumconf + echo "Aborting buildinstall" + echo "$@" + exit 1 +} + usage() { - echo "Usage: buildinstall --version --product --release [--output outputdir] [--discs ] " >&2 - exit 1 + echo "Usage: buildinstall --version --product --release [--output outputdir] [--discs ] " >&2 + exit 1 } PRODUCTPATH="anaconda" while [ $# -gt 0 ]; do case $1 in - # general options affecting how we build things - --nogr) - NOGRSTR="--nogr" - shift - ;; - --debug) - DEBUGSTR="--debug" - shift - ;; + # general options affecting how we build things + --nogr) + NOGRSTR="--nogr" + shift + ;; + --debug) + DEBUGSTR="--debug" + shift + ;; - # release information - --version) - VERSION=$2 - shift; shift - ;; - --release) - RELEASESTR=$2 - shift; shift - ;; + # release information + --version) + VERSION=$2 + shift; shift + ;; + --release) + RELEASESTR=$2 + shift; shift + ;; --product) - PRODUCTSTR=$2 - shift; shift - ;; - --variant) - VARIANT=$2 - shift; shift - ;; - --bugurl) - BUGURL=$2 - shift; shift - ;; + PRODUCTSTR=$2 + shift; shift + ;; + --variant) + VARIANT=$2 + shift; shift + ;; + --bugurl) + BUGURL=$2 + shift; shift + ;; + --output) + OUTPUT=$2 + shift; shift + ;; + --updates) + UPDATES=$2 + shift; shift + ;; + --mirrorlist) + MIRRORLIST="$MIRRORLIST $2" + shift; shift + ;; - --output) - OUTPUT=$2 - shift; shift - ;; - --updates) - UPDATES=$2 - shift; shift - ;; - --mirrorlist) - MIRRORLIST="$MIRRORLIST $2" - shift; shift - ;; - - *) - if [ -z "$REPO" ]; then - REPO=$1 - else - EXTRA_REPOS="$EXTRA_REPOS $1" - fi - shift - ;; + *) + if [ -z "$REPO" ]; then + REPO=$1 + else + EXTRA_REPOS="$EXTRA_REPOS $1" + fi + shift + ;; esac done @@ -116,6 +124,10 @@ if [ ! -d "$OUTPUT" ]; then mkdir -p $OUTPUT fi +# The first -release and -logos package we are going to look for is the lowercase +# equivalent of the PRODUCTSTR +export brandpkgname="`echo $PRODUCTSTR | tr '[:upper:]' '[:lower:]'`" + BUILDINSTDIR=$(mktemp -d ${TMPDIR:-/tmp}/buildinstall.tree.XXXXXX) TREEDIR=$(mktemp -d ${TMPDIR:-/tmp}/treedir.XXXXXX) CACHEDIR=$(mktemp -d ${TMPDIR:-/tmp}/yumcache.XXXXXX) @@ -167,6 +179,9 @@ echo "Running buildinstall..." pushd $BUILDINSTDIR BUILDARCH=`repoquery -c $yumconf --qf "%{ARCH}\n" anaconda` +# This is a crappy implementation but x86 is the only place we currently see +# BUILDARCH != BASEARCH (e.g. i586 != i386) so it'll suffice. +BASEARCH=`echo $BUILDARCH | sed -e 's/i.86/i386/'` yumdownloader -c $yumconf anaconda || exit 1 rpm2cpio anaconda*rpm | cpio --quiet -iumd './usr*' rm -f anaconda*rpm @@ -180,11 +195,11 @@ BUILDINSTALL=./buildinstall for f in $UPD_INSTROOT $MK_IMAGES $MK_STAMP $MK_TREEINFO $BUILDINSTALL; do if [ -n "$UPDATES" -a -f $UPDATES/usr/lib/anaconda-runtime/$f ]; then - cp -a $UPDATES/usr/lib/anaconda-runtime/$f* $BUILDINSTDIR/ + cp -a $UPDATES/usr/lib/anaconda-runtime/$f* $BUILDINSTDIR/ elif [ ! -f $f ]; then - cp -a $BUILDINSTDIR/usr/lib/anaconda-runtime/$f* $BUILDINSTDIR/ + cp -a $BUILDINSTDIR/usr/lib/anaconda-runtime/$f* $BUILDINSTDIR/ else - cp -a $f* $BUILDINSTDIR/ + cp -a $f* $BUILDINSTDIR/ fi done @@ -197,17 +212,19 @@ BUILDINSTALL=$BUILDINSTDIR/buildinstall if [ -n "$UPDATES" ]; then UPDATES="--updates $UPDATES"; fi echo "Building images..." -$UPD_INSTROOT $DEBUGSTR $NOGRSTR --arch $BUILDARCH $UPDATES --imgdir $TREEDIR/install $yumconf +$UPD_INSTROOT $DEBUGSTR $NOGRSTR --arch $BUILDARCH $UPDATES --imgdir $TREEDIR/install $yumconf || die "upd-instroot failed" echo "Writing .treeinfo file..." -$MK_TREEINFO --family="$PRODUCTSTR" ${VARIANT:+--variant="$VARIANT"} --version=$VERSION --arch=$BUILDARCH --outfile=$OUTPUT/.treeinfo +# NOTE --arch must match MK_IMAGES or the resulting treeinfo will be invalid +$MK_TREEINFO --family="$PRODUCTSTR" ${VARIANT:+--variant="$VARIANT"} --version=$VERSION --arch=$BASEARCH --outfile=$OUTPUT/.treeinfo # FIXME: need to update mk-images to take the yumconf -echo "Making images..." -$MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BUILDARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf +MKIMGCMD="$MK_IMAGES $DEBUGSTR $NOGRSTR --imgdir $TREEDIR/install --arch $BASEARCH --product "$PRODUCTSTR" --version $VERSION --bugurl "$BUGURL" --output $OUTPUT $yumconf" +echo "Making images: $PWD\$ $MKIMGCMD" +$MKIMGCMD || die "image creation failed" echo "Writing .discinfo file" -$MK_STAMP --releasestr="$RELEASESTR" --arch=$BUILDARCH --discNum="ALL" --outfile=$OUTPUT/.discinfo +$MK_STAMP --releasestr="$RELEASESTR" --arch=$BASEARCH --discNum="ALL" --outfile=$OUTPUT/.discinfo rm -rf $TREEDIR $BUILDINSTDIR rm -f $yumconf diff --git a/rewrite/orig/scripts/buildinstall.functions b/rewrite/scripts/buildinstall.functions similarity index 75% rename from rewrite/orig/scripts/buildinstall.functions rename to rewrite/scripts/buildinstall.functions index e0910c71..3b10dffd 100755 --- a/rewrite/orig/scripts/buildinstall.functions +++ b/rewrite/scripts/buildinstall.functions @@ -6,19 +6,28 @@ LDSO="" get_dso_deps() { root="$1" ; shift bin="$1" ; shift + LDSODIR="$1" ; shift DSO_DEPS="" declare -a FILES declare -a NAMES + [ -z "$LDSODIR" ] && LDSODIR=$LIBDIR # this is a hack, but the only better way requires binutils or elfutils # be installed. i.e., we need readelf to find the interpretter. + $LDSO --verify $bin >/dev/null 2>&1 + case $? in + [02]) ;; + *) unset LDSO ;; + esac if [ -z "$LDSO" ]; then - for ldso in $root/$LIBDIR/ld*.so* ; do + for ldso in $root/$LDSODIR/ld*.so* ; do [ -L $ldso ] && continue [ -x $ldso ] || continue - $ldso --verify $bin >/dev/null 2>&1 || continue - LDSO=$(echo $ldso |sed -e "s,$root,,") + $ldso --verify $bin >/dev/null 2>&1 + case $? in + [02]) LDSO=$(echo $ldso |sed -e "s,$root,,") ; break ;; + esac done fi @@ -73,9 +82,14 @@ EOF DSO_DEPS="${FILES[@]}" - for l in $(/usr/sbin/chroot $root find /$LIBDIR -maxdepth 1 -type l -name ld*.so*); do + for l in $(/usr/sbin/chroot $root find /$LDSODIR -maxdepth 1 -type l -name ld*.so*); do [ "$(/usr/sbin/chroot $root readlink -f $l)" == "$LDSO" ] && DSO_DEPS="$DSO_DEPS $l" done + if [ "$(uname -m)" == "s390x" ]; then + for l in $(/usr/sbin/chroot $root find /lib -maxdepth 1 -type 1 -name ld*.so*); do + [ "$(/usr/sbin/chroot $root readlink -f $l)" == "$LDSO" ] && DSO_DEPS="$DSO_DEPS $l" + done + fi [ -n "$DEBUG" ] && echo "DSO_DEPS for $bin are $DSO_DEPS" } @@ -98,13 +112,19 @@ instFile() { cp -aL $FILE $DESTROOT/`dirname $FILE` fi - file $FILE | egrep -q ": (setuid )?ELF" && { - get_dso_deps $(pwd) "$FILE" + f=$(file $FILE) + echo $f | egrep -q ": (setuid )?ELF" && { + if echo $f | grep -q " 64-bit " ; then + get_dso_deps $(pwd) "$FILE" lib64 + else + get_dso_deps $(pwd) "$FILE" lib + fi local DEPS="$DSO_DEPS" for x in $DEPS ; do instFile ./$x $DESTROOT done } + unset f } instDir() { diff --git a/rewrite/scripts/getkeymaps b/rewrite/scripts/getkeymaps new file mode 100755 index 00000000..2e003a77 --- /dev/null +++ b/rewrite/scripts/getkeymaps @@ -0,0 +1,69 @@ +#!/bin/sh +# +# getkeymaps +# +# Copyright (C) 2007 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +ARCH=$1 +if [ -z "$ARCH" ]; then + echo "usage: $0 " + exit 1 +fi + +TOPDIR=`pwd` +OUTPUT=$2 +if [ -z "$OUTPUT" ]; then + echo "No output specified, using ${TMPDIR:-/tmp}/keymaps-$ARCH.$$" + OUTPUT=${TMPDIR:-/tmp}/keymaps-$ARCH.$$ +fi + +UTILDIR=$3 +if [ -z "$UTILDIR" ]; then + READMAP=../utils/readmap + MAPSHDR=$TOPDIR/../utils/mapshdr +else + READMAP=$UTILDIR/usr/lib/anaconda-runtime/readmap + MAPSHDR=$UTILDIR/usr/lib/anaconda-runtime/mapshdr +fi + +TMP=${TMPDIR:-/tmp}/keymaps.$$ + +rm -rf $TMP +mkdir -p $TMP + +if [ $ARCH = "sparc" ]; then + PATTERN={i386,sun} +else + PATTERN=i386 +fi + +MAPS=$(python -c "import rhpl.keyboard_models ; rhpl.keyboard_models.get_supported_models()") + +for map in $MAPS ; do + eval find /lib/kbd/keymaps/$PATTERN -name "$map.map*.gz" | while read n; do + /bin/loadkeys `basename $n .gz` >/dev/null + $READMAP $TMP/`basename $n .map.gz`.map + done +done + +loadkeys us + +rm -f $TMP/defkeymap* $TMP/ANSI* $TMP/lt.map + +(cd $TMP; $MAPSHDR *.map) > $TMP/hdr +cat $TMP/hdr $TMP/*.map | gzip -9 > $OUTPUT +rm -rf $TMP diff --git a/rewrite/scripts/getlangnames.py b/rewrite/scripts/getlangnames.py new file mode 100644 index 00000000..b81d26d2 --- /dev/null +++ b/rewrite/scripts/getlangnames.py @@ -0,0 +1,47 @@ +# +# getlangnames.py +# +# Copyright (C) 2007 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import sys +sys.path.append("..") +import language + +import gettext + +langs = language.Language() +names = {} +for k in langs.localeInfo.keys(): + found = False + for l in language.expandLangs(k): + try: + f = open("po/%s.mo" %(l,)) + except (OSError, IOError): + continue + cat = gettext.GNUTranslations(f) + cat.set_output_charset("utf-8") + names[langs.localeInfo[k][0]] = cat.lgettext(langs.localeInfo[k][0]) + found = True + break + if not found: + names[langs.localeInfo[k][0]] = langs.localeInfo[k][0] + +nameList = names.keys() +nameList.sort() + +for k in nameList: + print("%s\t%s" % (k, names[k])) diff --git a/rewrite/orig/scripts/makestamp.py b/rewrite/scripts/makestamp.py similarity index 100% rename from rewrite/orig/scripts/makestamp.py rename to rewrite/scripts/makestamp.py diff --git a/rewrite/orig/scripts/maketreeinfo.py b/rewrite/scripts/maketreeinfo.py similarity index 100% rename from rewrite/orig/scripts/maketreeinfo.py rename to rewrite/scripts/maketreeinfo.py diff --git a/rewrite/scripts/makeupdates b/rewrite/scripts/makeupdates new file mode 100755 index 00000000..a8947ed0 --- /dev/null +++ b/rewrite/scripts/makeupdates @@ -0,0 +1,212 @@ +#!/usr/bin/env python +# +# makeupdates - Generate an updates.img containing changes since the last +# tag, but only changes that do not need to be compiled. If +# you need an updated _isys.so or a new loader, you should +# still compile things as usual. +# +# Copyright (C) 2009 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . +# +# Author: David Cantrell + +import getopt +import os +import shutil +import subprocess +import sys + +def getArchiveTag(configure, spec): + tag = "" + + f = open(configure) + lines = f.readlines() + f.close() + + for line in lines: + if line.startswith('AC_INIT('): + fields = line.split('[') + tag += fields[1].split(']')[0] + '-' + fields[2].split(']')[0] + break + else: + continue + + f = open(spec) + lines = f.readlines() + f.close() + + for line in lines: + if line.startswith('Release:'): + tag += '-' + line.split()[1].split('%')[0] + else: + continue + + return tag + +def doGitDiff(tag, args=[]): + proc = subprocess.Popen(['git', 'diff', '--stat', tag] + args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE).communicate() + + lines = proc[0].split('\n') + return lines + +def copyUpdatedFiles(tag, updates, cwd): + def pruneFile(src, names): + lst = [] + + for name in names: + if name.startswith('Makefile') or name.endswith('.pyc'): + lst.append(name) + + return lst + + subdirs = [] + + lines = doGitDiff(tag) + for line in lines: + if line.find(' | ') == -1: + continue + + fields = line.split() + file = fields[0] + + if file.endswith('.spec.in') or file.startswith('Makefile') or \ + file.endswith('.c') or file.endswith('.h') or \ + file.endswith('.sh') or file == 'configure.ac': + continue + + if file.find('/') != -1: + fields = file.split('/') + subdir = fields[0] + + if subdir == 'installclasses' or subdir == 'storage' or \ + subdir == 'booty': + subupdates = os.path.realpath(updates + '/' + subdir) + if os.path.isdir(subupdates): + shutil.rmtree(subupdates) + + if not subdir in subdirs: + sys.stdout.write("Including %s/\n" % (subdir,)) + subdirs.append(subdir) + + shutil.copytree(os.path.realpath(cwd + '/' + subdir), + subupdates, ignore=pruneFile) + elif subdir == 'loader' or subdir == 'po' or \ + subdir =='scripts' or subdir == 'command-stubs' or \ + subdir == 'tests' or subdir == 'bootdisk' or \ + subdir == 'docs' or subdir == 'fonts' or \ + subdir == 'utils' or subdir == 'gptsync': + continue + else: + sys.stdout.write("Including %s\n" % (file,)) + shutil.copy2(file, updates) + +def isysChanged(tag): + lines = doGitDiff(tag, ['isys']) + + for line in lines: + if line.find(' | ') == -1: + continue + + fields = line.split() + file = fields[0] + + if file.startswith('Makefile') or file.endswith('.h') or \ + file.endswith('.c'): + return True + + return False + +def copyUpdatedIsys(updates, cwd): + os.chdir(cwd) + + if not os.path.isfile('Makefile'): + if not os.path.isfile('configure'): + os.system('./autogen.sh') + os.system('./configure') + + os.system('make') + + isysmodule = os.path.realpath(cwd + '/isys/.libs/_isys.so') + if os.path.isfile(isysmodule): + shutil.copy2(isysmodule, updates) + +def createUpdatesImage(cwd, updates): + os.chdir(updates) + os.system("find . | cpio -c -o | gzip -9cv > %s/updates.img" % (cwd,)) + sys.stdout.write("updates.img ready\n") + +def usage(cmd): + sys.stdout.write("Usage: %s [OPTION]...\n" % (cmd,)) + sys.stdout.write("Options:\n") + sys.stdout.write(" -k, --keep Do not delete updates subdirectory.\n") + sys.stdout.write(" -c, --compile Compile code if there are isys changes.\n") + sys.stdout.write(" -h, --help Display this help and exit.\n") + +def main(argv): + prog = os.path.basename(sys.argv[0]) + cwd = os.getcwd() + configure = os.path.realpath(cwd + '/configure.ac') + spec = os.path.realpath(cwd + '/anaconda.spec.in') + updates = cwd + '/updates' + keep, compile, help, unknown = False, False, False, False + + try: + opts, args = getopt.getopt(sys.argv[1:], 'kc?', + ['keep', 'compile', 'help']) + except getopt.GetoptError: + help = True + + for o, a in opts: + if o in ('-k', '--keep'): + keep = True + elif o in ('-c', '--compile'): + compile = True + elif o in ('-?', '--help'): + help = True + else: + unknown = True + + if help: + usage(prog) + sys.exit(0) + elif unknown: + sys.stderr.write("%s: extra operand `%s'" % (prog, sys.argv[1],)) + sys.stderr.write("Try `%s --help' for more information." % (prog,)) + sys.exit(1) + + if not os.path.isfile(configure) and not os.path.isfile(spec): + sys.stderr.write("You must be at the top level of the anaconda source tree.\n") + sys.exit(1) + + tag = getArchiveTag(configure, spec) + + if not os.path.isdir(updates): + os.makedirs(updates) + + copyUpdatedFiles(tag, updates, cwd) + + if compile: + if isysChanged(tag): + copyUpdatedIsys(updates, cwd) + + createUpdatesImage(cwd, updates) + + if not keep: + shutil.rmtree(updates) + +if __name__ == "__main__": + main(sys.argv) diff --git a/rewrite/orig/scripts/mk-images b/rewrite/scripts/mk-images similarity index 58% rename from rewrite/orig/scripts/mk-images rename to rewrite/scripts/mk-images index 1eb9529b..56a7a88d 100755 --- a/rewrite/orig/scripts/mk-images +++ b/rewrite/scripts/mk-images @@ -25,7 +25,7 @@ IMAGEUUID=$(date +%Y%m%d%H%M).$(uname -i) TMPDIR=${TMPDIR:-/tmp} usage () { - echo "usage: mk-images