Difference between revisions of "User talk:Falconindy"

From ArchWiki
Jump to: navigation, search
(Created page with 'Category:Kernel (English) Category:HOWTOs (English) {{i18n|Custom Kernel Compilation with ABS}} === Introduction === There are many ways to build the kernel in Arch; th…')
 
(Mkinitcpio)
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Kernel (English)]]
+
==Mkinitcpio==
[[Category:HOWTOs (English)]]
+
And again, why did you just [https://wiki.archlinux.org/index.php?title=Mkinitcpio&diff=233065&oldid=232126 revert] my 1KB edit on the [[Mkinitcpio#HOOKS|hooks section]] and only leave me as explanation: ''"Most of this is no longer relevant with new lvm2, and this edit suggests wrong syntax in HOOKS."''
 +
* Because it was too much effort to pick out the few decent contributions from the misleading and wrong information. If you don't want to see such large reverts of your work in the future, then don't make such large edits with unrelated content. It's really that simple. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 18:25, 4 November 2012 (UTC)
  
{{i18n|Custom Kernel Compilation with ABS}}
+
This '''does not explain''' to me why unneeded html and other ugly formatting has to stay, why an example line only with the {{ic|autodetect}} hook is better than an explanation what it does, why there should be no sentence mentioning that the wrong order can leave the system unbootable, why the unconventional LUKS on LVM is preferable over LVM on LUKS, why removing {{ic|pata}} and {{ic|scsi}} has a problem if root is on a sata device, [...]! Please be a bit more carefull when reverting edits, a few sentences on a linked talk page won't hurt anyone!
 +
* Sure, feel free to change that. Do '''not''' suggest blatantly wrong syntax like "(keymap)" in the {{ic|HOOKS}} array. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 18:25, 4 November 2012 (UTC)
  
=== Introduction ===
+
Trying to understand your explanation above (''Most of this is no longer relevant with new lvm2'') it came in my mind maybe you meant there is auto-rearrangement done by hooks that fixes in example "wrong" order of {{ic|encrypt}} and {{ic|lvm2}}. I don't know of that and am not going to look in the code or testing it and maybe having to chroot into an unbootable system. If you know better do '''appropriate changes''' but please don't bring back html-formatting! :-)
There are many ways to build the kernel in Arch; this is just one example. For other possibilities, see [[Kernel_Compilation|Kernel Compilation]].  Some Arch users prefer [[Kernel Compilation From Source|the traditional way]], however using ABS is helpful for automating certain tasks.  As with anything in Arch, the choice is yours!  Neither way is inherently better than the other.
+
* Maybe you should keep up with the news before guessing at what might be right and wrong. The new LVM2 package in core and was talked about [https://mailman.archlinux.org/pipermail/arch-dev-public/2012-November/023956.html on the mailing lists] and makes ordering for LVM2 irrelevant. Again, if you want to contribute or improve things fine, but do '''not''' spread misinformation. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 18:25, 4 November 2012 (UTC)
  
This how-to has been updated to provide a definitive PKGBUILD for the creation of custom kernel packages. It allows you to maintain multiple custom kernels with a unique naming scheme under pacman version control.  It is ideal for almost '''any''' custom kernel build and can be easily adapted to fit many requirements.  The PKGBUILD automatically accounts for the modified <code>pkgname</code> and appends your custom suffix to the the kernel's .config.
+
I also noticed that hooks only affecting image generation but not runtime (in example {{ic|filesystems}}, ...) obviously can get listed earlier or later than advised in different articles over the arch wiki. However I think it's best to explain that hooks are executed in the order listed and in general it is good practice to list any hooks in a reasonable order.
  
This how-to also assumes that you are compiling a recent kernel (a 2.6 series kernel released in the past 2-3 years).
+
As said if you know they do not affect runtime this could get neglected but for some of them (like {{ic|filesystems}}) you can't know they won't need runtime capabilities in the future and/or are not expanded by users so maybe this is not even worth mentioning?
 +
* The abhorrent table that describes the runtime and buildtime functionality of each hook sort of points out that hooks like {{ic|filesystems}} don't have a runtime component. Explaining in a circuitous fashion that some hooks can be ordered differently than others does zero good. Rather, explain the basic concepts and not the applications: what a hook is and what it consists of, and how ordering might affect each component. '''This''' would be useful information. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 18:25, 4 November 2012 (UTC)
  
Note that this is '''not''' an ABS howto - to successfully follow this how-to, a working knowledge of building packages with ABS is essential.  Please read [[Arch Build System]], [[Creating Packages]] and [[Patching in ABS]].
+
The other part of your explanation (''this edit suggests wrong syntax in HOOKS'') I think you meant the brackets around {{ic|keymap}} and {{ic|shutdown}} in the LVM on LUKS example line.
 +
It is just said there in the sentence above that the keymap hook is optional and I also think it is self explanatory not to really place those brackets there. However I agree in that this is not good formatting and now tried to solve this using italics (not nice as well I personally think) with my last edit.
  
=== Philosophy and Logic (how it works and why it works this way) ===
+
If you just wanted to remove the crypto content from the article because you are personally not interested in that feel free to take the Merge-Template for granted. I can do the merge if you would rather delete one and copy the other though ;-) just leave me a message here on your talk-page. Note the example line without autodetect can get removed too. As long as the templates are there this section looks unnecessary strange so I will remove the autodetect line if there comes no veto. As well I will remove the merge '''template''' if getting no feedback on this after a week or so. --[[User:Nonix|Nonix]] ([[User talk:Nonix|talk]]) 18:08, 4 November 2012 (UTC)
* The Arch Way - Keep It Simple.
+
* I'm not personally interested in duplicating information on the wiki. It belongs to the wiki page about crypto. [[User:Falconindy|Falconindy]] ([[User talk:Falconindy|talk]]) 18:25, 4 November 2012 (UTC)
* This PKGBUILD is based on the official method used by Arch devs.
 
* This build provides kernel packages and components with a simple, logical and uncomplicated naming scheme that ONLY uses variables that are part of the ABS system and part of the kernel compilation process itself. If you want to prefix your kernel with your name, or reference to a patch involved, simply name the package as such, (e.g. kernel26-ckzero) and your kernel will be named similarly.
 
* If you are familiar with ABS you will see that the PKGBUILD is transparently constructed, self-explanatory and can be customized easily.
 
* User input is almost identical to all ABS builds: simply set <code>pkgver</code>, <code>pkgrel</code> and <code>pkgdesc</code> and add additional sources, including patches, to the <code>source</code> array.  Patch users should insert the appropriate patch commands where indicated.  Aside from uncommenting the config method and choosing whether to <code>make clean</code> or not the rest of the build is automated.
 
 
 
{{Note|For the duration of this article, -ckzero is the custom suffix. Anywhere you see this, you can (read: must) safely replace this with your own suffix.}}
 
 
 
=== Usage Notes ===
 
 
 
* <code>pkgname</code> must be declared within 10 lines of the top of the PKGBUILD - so '''DO NOT''' move it - just leave it.<br>
 
If you miss this simple instruction don't worry, it won't screw up your build but your PKGBUILD file will not have the pkgname automatically updated at the end of the build.  This is to allow you to use gensync correctly BUT you can edit the PKGBUILD file manually afterwards of course.
 
 
 
* Until you have your own config that you are happy with it is easiest just to start with the default Arch config; you should also get the Arch <code>kernel26.install</code> file, make your own <code>kernel26.install</code> script or comment out the line <code>install=kernel26.install</code> from the PKGBUILD. The official Arch files are both in your ABS tree, normally under <code>/var/abs/core/kernel26</code>.  To download the ABS tree to your system simply run <code>abs</code> as root. It doesn't take long, even on dialup.  You should keep this updated by running <code>abs</code> as root on a regular basis.
 
:NOTE: If you use LILO or any other static bootloader (that is, one that requires update after every kernel change) you are advised to use an install file too. This is an example, <code>kernel26.install</code>, for use with Lilo:
 
 
 
 
 
* If used correctly this PKGBUILD '''should''' always provide a unique kernel build based on EXTRAVERSION and LOCALVERSION, and on the pkgver and pkgrel (as normal) - however it is up to the user to '''double check''' resulting pkgnames and contents '''before''' installation to prevent overwrites (see below for more details and examples).
 
 
 
=== Anatomy of the PKGBUILD ===
 
This PKGBUILD is based on the split package that was introduced with the 2.6.32 kernel series. This gives you the flexibility of only installing what you want out of your custom kernel (e.g. you may not need the headers). This does, however, mean a little extra responsibility on the user's part to ensure that we build and package cleanly.
 
 
 
Check out the core/kernel26 port from ABS, and use the modified PKGBUILD below. Before building remember the following:
 
# <code>pkgbase</code> should be changed to be unique. This is what the kernel will be named.
 
# Elements in the <code>pkgname</code> array need to be updated as well, and should match the <code>pkgbase</code> provided above. This is what the built packages will be named.
 
# Insert the <code>pkgver</code> for your kernel (for example: <code>2.6.9</code>).
 
# Change the <code>pkgrel</code> for your current revision. You should increment this each time you make changes to the kernel config and want to build a REPLACEMENT pkg.  If you don't want to replace the previous build but rather install in parallel you should use <code>LOCALVERSION</code> to create a unique pkg.
 
# Change/expand the <code>pkgdesc</code> to describe any patches or special config options applied.
 
# Change the source to use a closer mirror and if you are using a patchset, add the patches to the source array.
 
# {OPTIONAL} Place the patch commands where indicated.
 
# Choose a make method by leaving your preferred method uncommented - gconfig (gtk based) xconfig (qt based) menuconfig (ncurses based).
 
 
 
{{Warning|This PKGBUILD makes some modifications from the one available directly from ABS. It will '''not''' build the firmware package as it assumes you will keep the vanilla ARCH kernel installed.}}
 
 
 
{{File|name=PKGBUILD|content=
 
pkgbase="kernel26-ckzero"
 
pkgname=('kernel26-ckzero' 'kernel26-ckzero-headers')
 
_kernelname=${pkgname#kernel26}
 
_basekernel=2.6.32
 
pkgver=${_basekernel}.8
 
pkgrel=1
 
_patchname="patch-${pkgver}-${pkgrel}-ARCH"
 
arch=(i686 x86_64)
 
license=('GPL2')
 
url="http://www.kernel.org"
 
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
 
        ftp://ftp.archlinux.org/other/kernel26/${_patchname}.bz2
 
        # the main kernel config files
 
        config config.x86_64
 
        # standard config files for mkinitcpio ramdisk
 
        kernel26.preset)
 
md5sums=('260551284ac224c3a43c4adac7df4879'
 
        '908f38fc5ba77b9bf691ae83e501b8e4'
 
        'c114c5d89622a93165bb948d62d966b5'
 
        '5c91374d56f115ba4324978d5b002711'
 
        '25584700a0a679542929c4bed31433b6')
 
build() {
 
  cd ${srcdir}/linux-$_basekernel
 
 
 
  # The ARCH patchset provides:
 
  #  - Official patches from kernel.org to bring a base kernel up to the current patch
 
  #      (i.e. kernel 2.6.32 + 2.6.32.8-ARCH.patch = 2.6.32.8)
 
  #  - Arch logo on bootup
 
  #  - Patches to allow Aufs to be used as an external module
 
 
 
  # Add -ARCH patches
 
  # See http://projects.archlinux.org/linux-2.6-ARCH.git/
 
  patch -Np1 -i ${srcdir}/${_patchname} {{{||}}} return 1
 
 
 
  # The stock Arch kernel enables the config option to save your kernel in /proc. You can reuse it:
 
  #  zcat /proc/config.gz  >./.config
 
  # Comment or delete the lines below if you choose to do this.
 
  if [ "$CARCH" = "x86_64" ]; then
 
    cat ../config.x86_64 >./.config
 
  else
 
    cat ../config >./.config
 
  fi
 
 
 
  if [ "${_kernelname}" != "" ]; then
 
    sed -i "s{{{|}}}CONFIG_LOCALVERSION=.*{{{|}}}CONFIG_LOCALVERSION=\"${_kernelname}\"{{{|}}}g" ./.config
 
  fi
 
  # get kernel version 
 
  make prepare
 
  # load configuration
 
  # Configure the kernel. Uncomment one of the lines below to change the kernel config
 
  #  before compiling
 
  # make menuconfig # CLI menu for configuration
 
  # make xconfig # X-based configuration
 
  # make oldconfig # using old config from previous kernel version
 
  ####################
 
  yes "" {{{|}}} make config
 
  # build!
 
  make bzImage modules {{{||}}} return 1
 
}
 
 
 
package_kernel26-ckzero() {
 
  pkgdesc="The Linux Kernel and modules"
 
  groups=('base')
 
  backup=(etc/mkinitcpio.d/${pkgname}.preset)
 
  depends=('coreutils' 'kernel26-firmware>=2.6.32' 'module-init-tools' 'mkinitcpio>=0.5.20')
 
  # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
 
  # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
 
  # kernel24 support is dropped since glibc24
 
  replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
 
            'alsa-driver' 'ieee80211' 'hostap-driver26'
 
            'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
 
            'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
 
            'gspcav1' 'atl2' 'wlan-ng26' 'rt2500')
 
  install=kernel26.install
 
  optdepends=('crda: to set the correct wireless channels of your country')
 
 
 
  KARCH=x86
 
  cd ${srcdir}/linux-$_basekernel
 
  # get kernel version
 
  _kernver="$(make kernelrelease)"
 
  mkdir -p ${pkgdir}/{lib/modules,boot}
 
  make INSTALL_MOD_PATH=${pkgdir} modules_install {{{||}}} return 1
 
  cp System.map ${pkgdir}/boot/System.map26${_kernelname}
 
  cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
 
  #  # add vmlinux
 
  install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
 
 
 
  # install fallback mkinitcpio.conf file and preset file for kernel
 
  install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset {{{||}}} return 1
 
  # set correct depmod command for install
 
  sed \
 
    -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
 
    -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
 
    -i $startdir/kernel26.install
 
  sed \
 
    -e "s{{{|}}}source .*{{{|}}}source /etc/mkinitcpio.d/kernel26${_kernelname}.kver{{{|}}}g" \
 
    -e "s{{{|}}}default_image=.*{{{|}}}default_image=\"/boot/${pkgname}.img\"{{{|}}}g" \
 
    -e "s{{{|}}}fallback_image=.*{{{|}}}fallback_image=\"/boot/${pkgname}-fallback.img\"{{{|}}}g" \
 
    -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
 
 
 
  echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
 
  # remove build and source links
 
  rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
 
  # remove the firmware
 
  rm -rf ${pkgdir}/lib/firmware
 
}
 
 
 
package_kernel26-headers() {
 
  pkgdesc="Header files and scripts for building modules for kernel26"
 
  mkdir -p ${pkgdir}/lib/modules/${_kernver}
 
  cd ${pkgdir}/lib/modules/${_kernver}
 
  ln -sf ../../../usr/src/linux-${_kernver} build
 
  cd ${srcdir}/linux-$_basekernel
 
  install -D -m644 Makefile \
 
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
 
  install -D -m644 kernel/Makefile \
 
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
 
  install -D -m644 .config \
 
    ${pkgdir}/usr/src/linux-${_kernver}/.config
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
 
 
 
  for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
 
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
 
  done
 
 
 
  # copy arch includes for external modules
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
 
  cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
 
 
 
  # copy files necessary for later builds, like nvidia and vmware
 
  cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
 
  cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
 
  # fix permissions on scripts dir
 
  chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
 
 
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
 
 
 
  cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
 
  if [ "$CARCH" = "i686" ]; then
 
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
 
  fi
 
  cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
 
 
 
  # add headers for lirc package
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
 
  cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
 
  for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
 
  cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
 
  done
 
  # add docbook makefile
 
  install -D -m644 Documentation/DocBook/Makefile \
 
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
 
  # add dm headers
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
 
  cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
 
  # add inotify.h
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
 
  cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
 
  # add wireless headers
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
 
  cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
 
  # add dvb headers for external modules
 
  # in reference to:
 
  # http://bugs.archlinux.org/task/9912
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
 
  cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
 
  # add dvb headers for external modules
 
  # in reference to:
 
  # http://bugs.archlinux.org/task/11194
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
 
  cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
 
  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
 
  # in reference to:
 
  # http://bugs.archlinux.org/task/13146
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
 
  cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
 
  cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
 
  # add xfs and shmem for aufs building
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
 
  mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
 
  cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
 
  # add headers vor virtualbox
 
  # in reference to:
 
  # http://bugs.archlinux.org/task/14568
 
  cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
 
  # add headers for broadcom wl
 
  # in reference to:
 
  # http://bugs.archlinux.org/task/14568
 
  cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
 
  # copy in Kconfig files
 
  for i in `find . -name "Kconfig*"`; do
 
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i {{{|}}} sed 's{{{|}}}/Kconfig.*{{{||}}}'`
 
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
 
  done
 
 
 
  cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
 
  # add header for aufs2-util
 
  cp -a ${srcdir}/linux-$_basekernel/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
 
 
 
  chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
 
  find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
 
  # remove unneeded architectures
 
  rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
 
}
 
}}
 
 
 
* Install your new pkg as normal.
 
 
 
=== Your <code>.config</code> file ===
 
PLEASE NOTE:  during the build the '''final''' kernel config is stored in your <code>$startdir</code> as, for example, <code>config-Apr13-12h</code>.  Your '''original''' config remains in the <code>$startdir</code> named <code>config</code>.  If you wish to use the new config in another build make sure you copy the correct file!
 
 
 
== Common .config Changes ==
 
* The default Arch kernel is built for a generic i686 or x86_64 processor. You can compile for your specific architecture. On a 64-bit build, you'll see the following:
 
{{Kernel|content=
 
Processor type and features  --->
 
  Processor family --->
 
      ( ) Opteron/Athlon64/Hammer/K8
 
      ( ) Intel P4 / older Netburst based Xeon
 
      ( ) Core 2/newer Xeon
 
      ( ) Intel Atom
 
      ( ) Generic-x86-64
 
}}
 
 
 
 
 
* Preemptable RCU. This produces some mild improvement in desktop response for multi-core and/or multi-threading systems.
 
{{Kernel|content=
 
General Setup --->
 
  RCU Subsystem --->
 
      RCU Implementation --->
 
        ( ) Tree-based hierarchical RCU
 
        (X) Preemptable tree-based hierarchical RCU
 
}}
 
 
 
 
 
=== I Want the Arch logo! ===
 
{{Note|If you use the -ARCH patchset mentioned in the provided PKGBUILD, this is already included. If you opt not to use the patchset, you can still get the logo by doing the following}}
 
Download the <code>logo_linux_clut224.ppm</code> to your <code>$startdir</code> from: [http://projects.archlinux.org/linux-2.6-ARCH.git/tree/patches projects.archlinux.org/linux-2.6-ARCH.git/tree/patches]
 
 
 
Add the the file <code>logo_linux_clut224.ppm</code> to the source array, and add the copy command marked with (<code>>></code>) below into the PKGBUILD as indicated:
 
 
 
<pre>
 
  ##### Uncomment and apply any patches here
 
  #patch -Np1 -i ../patchname || return 1
 
 
 
>>  ##### Arch logo - not compatible with gensplash!
 
>>  cp ../logo_linux_clut224.ppm drivers/video/logo/
 
 
 
  # get rid of the 'i' in i686
 
  carch=`echo $CARCH | sed 's|i||'`
 
  cat ../config | sed &quot;s|#CARCH#|$carch|g&quot; >./.config
 
</pre>
 
 
 
The stock Arch config uses the following logo settings, ensure you set them at the config stage or use the stock config:
 
 
 
<pre>
 
#
 
# Logo configuration
 
#
 
CONFIG_LOGO=y
 
CONFIG_LOGO_LINUX_MONO=y
 
CONFIG_LOGO_LINUX_VGA16=y
 
CONFIG_LOGO_LINUX_CLUT224=y
 
</pre>
 
 
 
=== Install Scriptlet ===
 
Chances are high that you'll want to use a .install scriptlet to automate the creation and installation of boot images. Don't forget to replace the two declarations at the top of the file to match your suffix. Below is an example of a slimmed down script for handling a kernel that uses a boot image.
 
 
 
{{File|name=kernel26.install|content=
 
# arg 1:  the new package version
 
# arg 2:  the old package version
 
 
 
KERNEL_NAME=-ckzero
 
KERNEL_VERSION=2.6.32-ckzero
 
 
 
post_install () {
 
  # updating module dependencies
 
  echo ">>> Updating module dependencies. Please wait ..."
 
  depmod $KERNEL_VERSION
 
  # generate init ramdisks
 
  echo ">>> MKINITCPIO SETUP"
 
  echo ">>> ----------------"
 
  echo ">>> If you use LVM2, Encrypted root or software RAID,"
 
  echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
 
  echo ">>> More information about mkinitcpio setup can be found here:"
 
  echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
 
  echo ""
 
  echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
 
  /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
 
}
 
 
 
post_upgrade() {
 
  pacman -Q grub &>/dev/null
 
  hasgrub=$?
 
  pacman -Q grub2 &>/dev/null
 
  hasgrub2=$?
 
  pacman -Q lilo &>/dev/null
 
  haslilo=$?
 
  # reminder notices
 
  if [ $haslilo -eq 0 ]; then
 
    echo ">>>"
 
    if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
 
      echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
 
    else
 
      echo ">>> You appear to be using the LILO bootloader. You should run"
 
      echo ">>> 'lilo' before rebooting."
 
    fi
 
    echo ">>>"
 
  fi
 
 
 
  if grep "^[^#]*/boot" /etc/fstab 2>&1 >/dev/null; then
 
    if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
 
      echo "WARNING: /boot appears to be a seperate partition but is not mounted"
 
      echo "        This is most likely not what you want.  Please mount your /boot"
 
      echo "        partition and reinstall the kernel unless you are sure this is OK"
 
    fi
 
  fi
 
 
 
  echo ">>> If you use LVM2, Encrypted root or software RAID,"
 
  echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
 
  echo ">>> More information about mkinitcpio setup can be found here:"
 
  echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
 
  echo ""
 
  echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
 
  /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
 
}
 
 
 
post_remove() {
 
  rm -f /boot/kernel26${KERNEL_NAME}.img
 
  rm -f /boot/kernel26${KERNEL_NAME}-fallback.img
 
}
 
}}
 
 
 
{{Tip|If your config doesn't use a boot image, the only thing this script needs to do is run <code>depmod $KERNELNAME</code>.}}
 
 
 
=== Post Installation ===
 
Once you have your kernel installed, don't forget to add a new entry to your bootloader to load the new kernel. See Wiki pages about [[GRUB]], [[GRUB2]], or [[Lilo]] for more info on how to create these entries.
 
 
 
=== Problems ===
 
 
 
===== My kernel's version has a hash sum and/or 'dirty' appended to it! =====
 
* Make sure that you're not building within the confines of a Git, SVN, or Mercurial repository. During the compilation process, the kernel will check for the presence of a repository, whether for the kernel or not, and append to the <code>LOCALVERSION</code>.
 
 
 
=== Using the nVIDIA video driver with your custom kernel ===
 
 
 
To use the nvidia driver with your new custom kernel, see: [[NVIDIA#Alternate_install:_custom_kernel|How to install NVIDIA driver with custom kernel]]
 
 
 
Original article written by ''DibbleTheWrecker''. Updated by ''Falconindy''.
 

Revision as of 18:25, 4 November 2012

Mkinitcpio

And again, why did you just revert my 1KB edit on the hooks section and only leave me as explanation: "Most of this is no longer relevant with new lvm2, and this edit suggests wrong syntax in HOOKS."

  • Because it was too much effort to pick out the few decent contributions from the misleading and wrong information. If you don't want to see such large reverts of your work in the future, then don't make such large edits with unrelated content. It's really that simple. Falconindy (talk) 18:25, 4 November 2012 (UTC)

This does not explain to me why unneeded html and other ugly formatting has to stay, why an example line only with the autodetect hook is better than an explanation what it does, why there should be no sentence mentioning that the wrong order can leave the system unbootable, why the unconventional LUKS on LVM is preferable over LVM on LUKS, why removing pata and scsi has a problem if root is on a sata device, [...]! Please be a bit more carefull when reverting edits, a few sentences on a linked talk page won't hurt anyone!

  • Sure, feel free to change that. Do not suggest blatantly wrong syntax like "(keymap)" in the HOOKS array. Falconindy (talk) 18:25, 4 November 2012 (UTC)

Trying to understand your explanation above (Most of this is no longer relevant with new lvm2) it came in my mind maybe you meant there is auto-rearrangement done by hooks that fixes in example "wrong" order of encrypt and lvm2. I don't know of that and am not going to look in the code or testing it and maybe having to chroot into an unbootable system. If you know better do appropriate changes but please don't bring back html-formatting! :-)

  • Maybe you should keep up with the news before guessing at what might be right and wrong. The new LVM2 package in core and was talked about on the mailing lists and makes ordering for LVM2 irrelevant. Again, if you want to contribute or improve things fine, but do not spread misinformation. Falconindy (talk) 18:25, 4 November 2012 (UTC)

I also noticed that hooks only affecting image generation but not runtime (in example filesystems, ...) obviously can get listed earlier or later than advised in different articles over the arch wiki. However I think it's best to explain that hooks are executed in the order listed and in general it is good practice to list any hooks in a reasonable order.

As said if you know they do not affect runtime this could get neglected but for some of them (like filesystems) you can't know they won't need runtime capabilities in the future and/or are not expanded by users so maybe this is not even worth mentioning?

  • The abhorrent table that describes the runtime and buildtime functionality of each hook sort of points out that hooks like filesystems don't have a runtime component. Explaining in a circuitous fashion that some hooks can be ordered differently than others does zero good. Rather, explain the basic concepts and not the applications: what a hook is and what it consists of, and how ordering might affect each component. This would be useful information. Falconindy (talk) 18:25, 4 November 2012 (UTC)

The other part of your explanation (this edit suggests wrong syntax in HOOKS) I think you meant the brackets around keymap and shutdown in the LVM on LUKS example line. It is just said there in the sentence above that the keymap hook is optional and I also think it is self explanatory not to really place those brackets there. However I agree in that this is not good formatting and now tried to solve this using italics (not nice as well I personally think) with my last edit.

If you just wanted to remove the crypto content from the article because you are personally not interested in that feel free to take the Merge-Template for granted. I can do the merge if you would rather delete one and copy the other though ;-) just leave me a message here on your talk-page. Note the example line without autodetect can get removed too. As long as the templates are there this section looks unnecessary strange so I will remove the autodetect line if there comes no veto. As well I will remove the merge template if getting no feedback on this after a week or so. --Nonix (talk) 18:08, 4 November 2012 (UTC)

  • I'm not personally interested in duplicating information on the wiki. It belongs to the wiki page about crypto. Falconindy (talk) 18:25, 4 November 2012 (UTC)