From 02364405810566a2ab6a2a57d05cb69c7171aecf Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 21 Oct 2011 16:12:12 -0400 Subject: [PATCH] clean up config_files dir (and fix templates to match) move arch-specific stuff to arch-specific subdirs and move all the common stuff to a subdir named 'common'. Also, rename '.profile' and '.bash_history' so you actually see them when you 'ls' the 'common' dir. also added some helpful(?) comments to the templates. --- .../{.bash_history => common/bash_history} | 0 share/config_files/{ => common}/libuser.conf | 0 share/config_files/{ => common}/pam.sshd | 0 .../config_files/{.profile => common/profile} | 0 share/config_files/{ => common}/resolv.conf | 0 share/config_files/{ => common}/rsyslog.conf | 0 .../config_files/{ => common}/selinux.config | 0 .../{ => common}/sshd_config.anaconda | 0 share/config_files/{ => ppc}/bootinfo.txt | 0 share/config_files/{ => ppc}/mapping | 0 share/config_files/{ => ppc}/ofboot.b | 0 share/config_files/{ => ppc}/yaboot.conf.3264 | 0 share/config_files/{ => ppc}/yaboot.conf.in | 0 share/config_files/{ => s390}/generic.ins | 0 share/config_files/{ => s390}/generic.prm | 0 share/config_files/{ => s390}/redhat.exec | 0 .../{boot.msg.sparc => sparc/boot.msg} | 0 share/config_files/{ => sparc}/silo.conf | 0 .../{boot.msg.x86 => x86/boot.msg} | 0 share/config_files/{ => x86}/grub.conf | 0 share/config_files/{ => x86}/isolinux.cfg | 0 share/ppc.tmpl | 34 ++++++++++++------- share/runtime-postinstall.tmpl | 5 +-- share/s390.tmpl | 10 +++++- share/sparc.tmpl | 12 ++++--- share/x86.tmpl | 15 +++++--- 26 files changed, 51 insertions(+), 25 deletions(-) rename share/config_files/{.bash_history => common/bash_history} (100%) rename share/config_files/{ => common}/libuser.conf (100%) rename share/config_files/{ => common}/pam.sshd (100%) rename share/config_files/{.profile => common/profile} (100%) rename share/config_files/{ => common}/resolv.conf (100%) rename share/config_files/{ => common}/rsyslog.conf (100%) rename share/config_files/{ => common}/selinux.config (100%) rename share/config_files/{ => common}/sshd_config.anaconda (100%) rename share/config_files/{ => ppc}/bootinfo.txt (100%) rename share/config_files/{ => ppc}/mapping (100%) rename share/config_files/{ => ppc}/ofboot.b (100%) rename share/config_files/{ => ppc}/yaboot.conf.3264 (100%) rename share/config_files/{ => ppc}/yaboot.conf.in (100%) rename share/config_files/{ => s390}/generic.ins (100%) rename share/config_files/{ => s390}/generic.prm (100%) rename share/config_files/{ => s390}/redhat.exec (100%) rename share/config_files/{boot.msg.sparc => sparc/boot.msg} (100%) rename share/config_files/{ => sparc}/silo.conf (100%) rename share/config_files/{boot.msg.x86 => x86/boot.msg} (100%) rename share/config_files/{ => x86}/grub.conf (100%) rename share/config_files/{ => x86}/isolinux.cfg (100%) diff --git a/share/config_files/.bash_history b/share/config_files/common/bash_history similarity index 100% rename from share/config_files/.bash_history rename to share/config_files/common/bash_history diff --git a/share/config_files/libuser.conf b/share/config_files/common/libuser.conf similarity index 100% rename from share/config_files/libuser.conf rename to share/config_files/common/libuser.conf diff --git a/share/config_files/pam.sshd b/share/config_files/common/pam.sshd similarity index 100% rename from share/config_files/pam.sshd rename to share/config_files/common/pam.sshd diff --git a/share/config_files/.profile b/share/config_files/common/profile similarity index 100% rename from share/config_files/.profile rename to share/config_files/common/profile diff --git a/share/config_files/resolv.conf b/share/config_files/common/resolv.conf similarity index 100% rename from share/config_files/resolv.conf rename to share/config_files/common/resolv.conf diff --git a/share/config_files/rsyslog.conf b/share/config_files/common/rsyslog.conf similarity index 100% rename from share/config_files/rsyslog.conf rename to share/config_files/common/rsyslog.conf diff --git a/share/config_files/selinux.config b/share/config_files/common/selinux.config similarity index 100% rename from share/config_files/selinux.config rename to share/config_files/common/selinux.config diff --git a/share/config_files/sshd_config.anaconda b/share/config_files/common/sshd_config.anaconda similarity index 100% rename from share/config_files/sshd_config.anaconda rename to share/config_files/common/sshd_config.anaconda diff --git a/share/config_files/bootinfo.txt b/share/config_files/ppc/bootinfo.txt similarity index 100% rename from share/config_files/bootinfo.txt rename to share/config_files/ppc/bootinfo.txt diff --git a/share/config_files/mapping b/share/config_files/ppc/mapping similarity index 100% rename from share/config_files/mapping rename to share/config_files/ppc/mapping diff --git a/share/config_files/ofboot.b b/share/config_files/ppc/ofboot.b similarity index 100% rename from share/config_files/ofboot.b rename to share/config_files/ppc/ofboot.b diff --git a/share/config_files/yaboot.conf.3264 b/share/config_files/ppc/yaboot.conf.3264 similarity index 100% rename from share/config_files/yaboot.conf.3264 rename to share/config_files/ppc/yaboot.conf.3264 diff --git a/share/config_files/yaboot.conf.in b/share/config_files/ppc/yaboot.conf.in similarity index 100% rename from share/config_files/yaboot.conf.in rename to share/config_files/ppc/yaboot.conf.in diff --git a/share/config_files/generic.ins b/share/config_files/s390/generic.ins similarity index 100% rename from share/config_files/generic.ins rename to share/config_files/s390/generic.ins diff --git a/share/config_files/generic.prm b/share/config_files/s390/generic.prm similarity index 100% rename from share/config_files/generic.prm rename to share/config_files/s390/generic.prm diff --git a/share/config_files/redhat.exec b/share/config_files/s390/redhat.exec similarity index 100% rename from share/config_files/redhat.exec rename to share/config_files/s390/redhat.exec diff --git a/share/config_files/boot.msg.sparc b/share/config_files/sparc/boot.msg similarity index 100% rename from share/config_files/boot.msg.sparc rename to share/config_files/sparc/boot.msg diff --git a/share/config_files/silo.conf b/share/config_files/sparc/silo.conf similarity index 100% rename from share/config_files/silo.conf rename to share/config_files/sparc/silo.conf diff --git a/share/config_files/boot.msg.x86 b/share/config_files/x86/boot.msg similarity index 100% rename from share/config_files/boot.msg.x86 rename to share/config_files/x86/boot.msg diff --git a/share/config_files/grub.conf b/share/config_files/x86/grub.conf similarity index 100% rename from share/config_files/grub.conf rename to share/config_files/x86/grub.conf diff --git a/share/config_files/isolinux.cfg b/share/config_files/x86/isolinux.cfg similarity index 100% rename from share/config_files/isolinux.cfg rename to share/config_files/x86/isolinux.cfg diff --git a/share/ppc.tmpl b/share/ppc.tmpl index 0bb07a71..6575744c 100644 --- a/share/ppc.tmpl +++ b/share/ppc.tmpl @@ -1,6 +1,6 @@ <%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/> <% -configdir="tmp/config_files" +configdir="tmp/config_files/ppc" BOOTDIR="ppc" LIVEDIR="LiveOS" MACDIR=BOOTDIR+"/mac" @@ -16,34 +16,40 @@ prepboot = "" mkdir ${LIVEDIR} install ${runtime_img} ${LIVEDIR}/squashfs.img -## basic ppc stuff +## install bootloaders mkdir ${BOOTDIR} +## basic ppc stuff install ${configdir}/bootinfo.txt ${BOOTDIR} install boot/efika.forth ${BOOTDIR} ## boot dir for CHRP systems mkdir ${BOOTDIR}/chrp install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp +runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot ## boot dir for PowerMacs mkdir ${MACDIR} install usr/lib/yaboot/yaboot ${MACDIR} install ${configdir}/ofboot.b ${MACDIR} +## NOTE: PPC is kind of funky. There's three possible "arch" setups here: +## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels). + +## Install kernel and bootloader config (in separate places for each arch) %for kernel in kernels: <% bits = 64 if kernel.arch == "ppc64" else 32 + ## separate dirs/images for each arch KERNELDIR=BOOTDIR+"/ppc%s" % bits NETIMG=NETBOOTDIR+"/ppc%s.img" % bits bitsizes.add(bits) %> + ## install kernel mkdir ${KERNELDIR} ${NETBOOTDIR} - install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img - replace @PRODUCT@ ${product.name} ${KERNELDIR}/yaboot.conf - replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf + ## install bootloader config + install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf - replace @ROOT@ root=live:CDLABEL=PBOOT ${KERNELDIR}/yaboot.conf ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img runcmd ${inroot}/${WRAPPER} -p of \ @@ -59,20 +65,22 @@ install ${configdir}/ofboot.b ${MACDIR} %endif %endfor -runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot - -## copy yaboot.conf into /etc +## copy correct yaboot.conf into /etc mkdir etc %if len(bitsizes) == 2: - ## magic ppc biarch tree! we need magic ppc biarch config. + ## hybrid - use the magic hybrid config install ${configdir}/yaboot.conf.3264 etc/yaboot.conf - replace @PRODUCT@ ${product.name} etc/yaboot.conf - replace @VERSION@ ${product.version} etc/yaboot.conf - replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' etc/yaboot.conf %else: + ## single arch - use the yaboot.conf we created above copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf %endif +## configure bootloader +replace @PRODUCT@ ${product.name} etc/yaboot.conf +replace @VERSION@ ${product.version} etc/yaboot.conf +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' etc/yaboot.conf + +## make boot.iso runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ ${prepboot} -part -hfs -T -r -l -J \ -A "${product.name} ${product.version}" -sysid PPC -V '${isolabel}' \ diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl index 381562d1..81fbe35c 100644 --- a/share/runtime-postinstall.tmpl +++ b/share/runtime-postinstall.tmpl @@ -9,6 +9,7 @@ KEYMAP_OVERRIDE = "usr/share/anaconda/keymaps-override-%s" % filearch SCREENFONT = "usr/share/anaconda/screenfont-%s.gz" % filearch PYTHONDIR = glob("usr/"+libdir+"/python?.?")[0] stubs = ("list-harddrives", "loadkeys", "raidstart", "raidstop") +configdir = configdir + "/common" %> ## create_keymaps() @@ -57,8 +58,8 @@ symlink /sbin/init init append etc/resolv.conf "" copy usr/share/anaconda/lang-table etc install ${configdir}/rsyslog.conf etc -install ${configdir}/.bash_history root -install ${configdir}/.profile root +install ${configdir}/bash_history root/.bash_history +install ${configdir}/profile root/.profile install ${configdir}/libuser.conf etc %if exists(root+"/etc/selinux/targeted"): install ${configdir}/selinux.config etc/selinux/config diff --git a/share/s390.tmpl b/share/s390.tmpl index 2a8b34e4..9523f9c7 100644 --- a/share/s390.tmpl +++ b/share/s390.tmpl @@ -1,6 +1,6 @@ <%page args="kernels, runtime_img, basearch, outroot"/> <% -configdir="tmp/config_files" +configdir="tmp/config_files/s390" BOOTDIR="images" KERNELDIR=BOOTDIR INITRD_ADDRESS="0x02000000" @@ -12,19 +12,27 @@ kernel = kernels[0] mkdir images install ${runtime_img} images +## install bootloader (such as it is) and bootloader config install ${configdir}/redhat.exec ${BOOTDIR} install ${configdir}/generic.prm ${BOOTDIR} install ${configdir}/generic.ins . +## configure bootloader replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins +## install kernel installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + +## s390 needs some extra boot config runcmd usr/libexec/anaconda/addrsize ${INITRD_ADDRESS} ${KERNELDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd_addrsize + +## s390 also has some special treeinfo data treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd_addrsize treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm treeinfo images-${basearch} generic.ins generic.ins +## make cdboot.img runcmd ${MKCDBOOT} \ -i ${outroot}/${kernel.path} \ -r ${outroot}/${kernel.initrd.path} \ diff --git a/share/sparc.tmpl b/share/sparc.tmpl index 307625b0..4fe50505 100644 --- a/share/sparc.tmpl +++ b/share/sparc.tmpl @@ -1,6 +1,6 @@ <%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/> <% -configdir="tmp/config_files" +configdir="tmp/config_files/sparc" BOOTDIR="boot" LIVEDIR="LiveOS" %> @@ -8,20 +8,24 @@ LIVEDIR="LiveOS" mkdir ${LIVEDIR} install ${runtime_img} ${LIVEDIR}/squashfs.img +## install bootloader and config files install boot/*.b ${BOOTDIR} install ${configdir}/silo.conf ${BOOTDIR} -install ${configdir}/boot.msg.sparc ${BOOTDIR}/boot.msg +install ${configdir}/boot.msg ${BOOTDIR} +## configure bootloader replace @VERSION@ ${product.version} ${BOOTDIR}/boot.msg replace @PRODUCT@ ${product.name} ${BOOTDIR}/boot.msg +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/silo.conf +## install kernels +## FIXME: this will overwrite if there are multiple sparc kernels %for kernel in kernels: installkernel images-${basearch} ${kernel.path} ${BOOTDIR}/vmlinuz installinitrd images-${basearch} ${kernel.initrd.path} ${BOOTDIR}/initrd.img %endfor -replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/silo.conf - +## make boot.iso runcmd mkisofs -R -J -T -G /${BOOTDIR}/isofs.b -B ... \ -s /${BOOTDIR}/silo.conf -r -V '${isolabel}' \ -A "${product.name} ${product.version}" \ diff --git a/share/x86.tmpl b/share/x86.tmpl index 2bc57cac..f5dcc7a3 100644 --- a/share/x86.tmpl +++ b/share/x86.tmpl @@ -1,6 +1,6 @@ <%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/> <% -configdir="tmp/config_files" +configdir="tmp/config_files/x86" SYSLINUXDIR="usr/share/syslinux" PXEBOOTDIR="images/pxeboot" BOOTDIR="isolinux" @@ -11,18 +11,22 @@ LIVEDIR="LiveOS" mkdir ${LIVEDIR} install ${runtime_img} ${LIVEDIR}/squashfs.img -mkdir ${BOOTDIR} ${KERNELDIR} +## install bootloader and config files +mkdir ${BOOTDIR} install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR} -install ${configdir}/isolinux.cfg ${BOOTDIR}/isolinux.cfg -install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png -install ${configdir}/boot.msg.x86 ${BOOTDIR}/boot.msg install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR} +install ${configdir}/isolinux.cfg ${BOOTDIR} +install ${configdir}/boot.msg ${BOOTDIR} install ${configdir}/grub.conf ${BOOTDIR} +install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png +## configure bootloader replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @PRODUCT@ ${product.name} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg +## install kernels +mkdir ${KERNELDIR} %for kernel in kernels: %if kernel.flavor: installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} @@ -53,6 +57,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch"/> %endif +## make boot.iso runcmd mkisofs -o ${outroot}/images/boot.iso \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -boot-load-size 4 -boot-info-table -no-emul-boot \