Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on building the Linux kernel and doing some related things.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/kernel.e>
#           or at <http://angg.twu.net/e/kernel.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




I'm trying to reorganize this file.

# «.loaded-kernel»		(to "loaded-kernel")
# «.boot-parameters»		(to "boot-parameters")
# «.kernel-parameters»		(to "kernel-parameters")

Notes on compiling the Linux kernel the Debian way:
# «.kernel-flavours-2.2»	(to "kernel-flavours-2.2")
# «.flavours-2.2_index»		(to "flavours-2.2_index")
# «.kernel-flavours_naive»	(to "kernel-flavours_naive")
# «.kernel-source.deb»		(to "kernel-source.deb")
# «.make-kpkg_patch»		(to "make-kpkg_patch")
# «.make-kpkg_hacking»		(to "make-kpkg_hacking")
# «.make-kpkg»			(to "make-kpkg")
# «.make-kpkg_docs»		(to "make-kpkg_docs")

On downloading:
# «.kernel.org-mirrors»		(to "kernel.org-mirrors")
# «.downloading»		(to "downloading")
# «.apply_version_patch»	(to "apply_version_patch")

On how to compile the Linux kernel "by hand":
# «.compile20»			(to "compile20")
# «.gdb20»			(to "gdb20")
# «.compile22»			(to "compile22")
# «.compile22_index»		(to "compile22_index")
# «.fast-unpack-22xx»		(to "fast-unpack-22xx")

On kernel patches:
# «.ppscsi-patch-2.2»		(to "ppscsi-patch-2.2")
# «.ppscsi-patch-2.4»		(to "ppscsi-patch-2.4")
# «.scanner»			(to "scanner")
# «.kdb»			(to "kdb")
# «.make-kpkg-ide»		(to "make-kpkg-ide")
# «.make-kpkg-ide-install»	(to "make-kpkg-ide-install")
# «.pcsnddrv»			(to "pcsnddrv")

Etc/unclassified:
# «.gdb_ing_the_kernel»		(to "gdb_ing_the_kernel")
# «.statm»			(to "statm")
# «.kernel-patch-udma0»		(to "kernel-patch-udma0")
# «.kernel-patch-udma»		(to "kernel-patch-udma")
# «.kerneld_docs»		(to "kerneld_docs")
# «.2.4.9»			(to "2.4.9")
# «.2.4.17»			(to "2.4.17")
# «.2.4.9-uml»			(to "2.4.9-uml")
# «.2.4.18»			(to "2.4.18")
# «.2.4.18-uml»			(to "2.4.18-uml")
# «.user-mode-linux»		(to "user-mode-linux")
# «.kernel-source-2.6.8»	(to "kernel-source-2.6.8")
# «.kernel-source-2.4.26»	(to "kernel-source-2.4.26")
# «.make-kpkg-timestamps-k26»	(to "make-kpkg-timestamps-k26")
# «.k26.Configure.help»		(to "k26.Configure.help")
# «.vcsa»			(to "vcsa")
# «.kernel-backports»		(to "kernel-backports")
# «.linux-on-etch»		(to "linux-on-etch")
# «.linux-on-lenny»		(to "linux-on-lenny")
# «.linux-on-lenny-grub-gwen»	(to "linux-on-lenny-grub-gwen")
# «.squeeze»			(to "squeeze")
# «.update-grub»		(to "update-grub")
# «.lugao»			(to "lugao")



#####
#
# loaded kernel
# 2013may20
#
#####

# «loaded-kernel» (to ".loaded-kernel")
# (find-es "kernel" "kernel-backports")
# (find-sh "uname -a")
# (find-fline "/proc/version")
# (find-sh "dmesg")
# (find-zsh "installeddebs | sort | egrep 'linux|kernel'")
# (find-zsh "availabledebs | sort | egrep 'linux|kernel'")
# (find-status   "linux-image-3.2.0-0.bpo.2-686-pae")
# (find-vldifile "linux-image-3.2.0-0.bpo.2-686-pae.list")
# (find-udfile   "linux-image-3.2.0-0.bpo.2-686-pae/")
# (find-udfile   "linux-image-3.2.0-0.bpo.4-686-pae/")

# (find-zsh "availabledebs | sort | grep linux")
# (find-zsh "installeddebs | sort | grep kernel")
# (find-zsh "availabledebs | sort | grep kernel")

# (find-status   "linux-image-3.2.0-0.bpo.4-686-pae")
# (find-vldifile "linux-image-3.2.0-0.bpo.4-686-pae.list")
# (find-udfile   "linux-image-3.2.0-0.bpo.4-686-pae/")
# (find-status   "linux-doc-3.2")
# (find-vldifile "linux-doc-3.2.list")
# (find-udfile   "linux-doc-3.2/")
# (find-status   "firmware-linux-free")
# (find-vldifile "firmware-linux-free.list")
# (find-udfile   "firmware-linux-free/")

# debian-kernel-handbook






linux-source



#####
#
# Linux kernel command line parameters
# 2012nov01 / 2016feb15
#
#####

# «boot-parameters» (to ".boot-parameters")
# «kernel-parameters» (to ".kernel-parameters")
# http://oreilly.com/linux/excerpts/9780596100797/kernel-boot-command-line-parameter-reference.html
# http://www.kernel.org/doc/Documentation/kernel-parameters.txt
# http://www.cyberciti.biz/tips/10-boot-time-parameters-you-should-know-about-the-linux-kernel.html

kernel-parameters
# (find-zsh "locate kernel-parameters")
# (find-zsh "dmissing kernel-parameters")

# (find-fline "/usr/share/doc/" "linux-")
# (find-fline "/usr/share/doc/linux-doc/")
# (find-udfile "linux-doc/kernel-parameters.txt.gz")
# (find-udfile "linux-doc/kernel-parameters.txt.gz" "init=")





#####
#
# kernel flavours for 2.2.x (with the Makefile patch)
# 2000dec26
#
#####

# «kernel-flavours-2.2»  (to ".kernel-flavours-2.2")
# This block is what I use to recompile 2.2.18 on my Debian box; as I
# want flavours and the ppscsi patch things are not very simple.

#*
# Unpack an "upstream" 2.2.18. My ~/tmp/linux-2.2.18.tar.gz should be
# equivalent to the one in kernel.org, but it was obtained by patching
# the 2.2.1 sources all the way up to a 2.2.18 and tgzing the result;
# so I prefer to keep it in a non-standard place.
# (to "apply_version_patch")
#
cd /usr/src/
rm -Rv linux linux-2.2
tar -xvzf ~/tmp/linux-2.2.18.tar.gz
cd /usr/src/
ln -s linux linux-2.2

gzip -cd $S/http/www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.19.gz \
  | patch -p0 \
  | tee /tmp/op

# The flavours trick doesn't work out of the box, as it can be seen in:
# (to "kernel-flavours_naive")
# But:
# (find-fline "/usr/doc/kernel-package/Flavours.gz")
# (find-fline "/usr/doc/kernel-package/Flavours.gz" "+++ Makefile")
# (find-k22file "debian/rules" "FLAVOURS")
# (find-k22file "Makefile" "modules_install:")
# (find-k22file "Makefile" "\ninclude/linux/version.h:")
# (find-k22file "Makefile" "KERNELRELEASE=")
# ...we only need a very small patch, that we now do "by hand".

cd /usr/src/linux/
patch Makefile <<'%%%'
63c63,74
< KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
---
> # FLAVOUR is like EXTRAVERSION, but it's meant for local use, and the
> # dash between it and the rest of the version is supplied here.  It's used
> # by make-kpkg's --flavour switch, see /usr/share/doc/kernel-package/Flavours.
> #FLAVOUR =
> 
> ifneq ($(strip $(FLAVOUR)),)
> INT_FLAV := -$(FLAVOUR)
> else
> INT_FLAV :=
> endif
> 
> KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(INT_FLAV)
%%%

# Note: debian/rules will check if the main Makefile accepts flavours,
# but it will do that by grepping for a line starting with "FLAVOUR",
# i.e., it seems that we are supposed to set FLAVOUR inside the
# Makefile, not at the invocation of "make"... my way of doing things
# is working well, though -- but it may be the wrong way. Help, please?
# (find-k22file "debian/rules" "FLAVOURS")
#*

# Follow this (and get back later) to apply the PPSCSI patch
# (to "ppscsi-patch-2.2")
#*

# Now make the .deb:
# (to "make-kpkg_hacking")
#
cd /usr/src/linux/
make-kpkg clean		|& tee omkc
cp ~/k22conf .config

# kernel-headers-2.2.18 won't be very useful because all standard
# dependency on kernel-headers specify an explicit version:
# (find-fline "$SDEBIAN/dists/potato/main/binary-i386/Packages.gz")
# (find-fline "$SDEBIAN/dists/potato/main/source/Sources.gz")
#make-kpkg --revision=custom.1 --flavour=edrx kernel_headers	|& tee omkks
#make-kpkg --revision=custom.1 --flavour=edrx kernel_source	|& tee omkks
make-kpkg --revision=custom.1 --flavour=edrx kernel_image 	|& tee omkki


# «flavours-2.2_index»  (to ".flavours-2.2_index")
# (to "compile22_index")
# Now index the ".c/.h/.S"s that were compiled into the kernel.
# You need to have applied the patch described in:
#  (to "make-kpkg_patch")
# to make this work.

etags `cat .files.chS.used`
glimpseindex -H . -F < .files.chS.used
# (find-k22tag "con_stop")

# Inspect the package:
#
ls -l /usr/src/kernel-image-2.2.18-edrx_custom.1_i386.deb
ar p  /usr/src/kernel-image-2.2.18-edrx_custom.1_i386.deb data.tar.gz \
  | tar -tzf -

# The modules are going into /lib/modules/2.2.18-edrx/, and running
# "uname -r" on this kernel answers "2.2.18-edrx", which makes the
# module utils search for modules in the right places.
# (find-fline "/lib/modules/2.2.17-edrx/")
#*



dpkg -i /usr/src/kernel-image-2.2.18-edrx_custom.1_i386.deb

# (find-status "kernel-image-2.2.18-edrx")
# (find-vldifile "kernel-image-2.2.18-edrx.list")
# (find-fline "/usr/doc/kernel-image-2.2.18-edrx/")
# (find-fline "/boot/")
# (find-fline "/lib/modules/")
# (find-es "grub" "grub-adjust")

# (find-k22file "")
# (find-k22file "omkki")
# (find-k22file "omkki" "stamp-build:")
# (find-fline "/usr/share/kernel-package/rules")
# (find-fline "/usr/share/kernel-package/rules" "stamp-build:")
# (find-fline "/usr/share/kernel-package/rules" "target = $(kimage)")
# (find-fline "/usr/bin/make-kpkg")
# (find-fline "/usr/src/")






#####
#
# kernel flavours (using naively and getting frustrated in the end)
# 2000jul20
#
#####

# «kernel-flavours_naive»  (to ".kernel-flavours_naive")
# (find-deblistsw3 "debian-user-9910/msg00243.html")
# Follow this link for something that really works:
# (to "kernel-flavours-2.2")

make-kpkg clean
make-kpkg --revision=custom.1 --flavour=-allmod .......

#*
# Unpack an "upstream" 2.2.16. My ~/tmp/linux-2.2.15.tar.gz should be
# equivalent to the one in kernel.org, but it was obtained by patching
# the 2.2.1 sources all the way up to a 2.2.15 and tgzing the result;
# so I prefer to keep it in a non-standard place.
#
cd /usr/src/
rm -Rv linux linux-2.2
tar -xvzf ~/tmp/linux-2.2.15.tar.gz
cd /usr/src/
ln -s linux linux-2.2
gzip -cd $S/http/www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.16.gz \
  | patch -p0					|& tee linux/op

# Make the .deb:
#
cd /usr/src/linux/
make-kpkg clean					|& tee omkc
cp ~/k22conf .config
make-kpkg --revision=custom.1 --flavour=edrx kernel_image 	|& tee omkki

# Argh, it is still putting its modules in "/lib/modules/2.2.16/"!
#
ls -l /usr/src/kernel-image-2.2.16-edrx_custom.1_i386.deb
ar p  /usr/src/kernel-image-2.2.16-edrx_custom.1_i386.deb data.tar.gz \
  | tar -tzf -

# (find-k22file "")
# (find-fline "/usr/src/")

#*





#####
#
# official kernel tarballs -> kernel-source-xxx_yyy.deb (old notes)
# 2000jul16
#
#####

# «kernel-source.deb»  (to ".kernel-source.deb")
# (find-es "kernel" "fast-unpack-22xx")
# (find-es "kernel" "make-kpkg")
# (find-fline "$S/http/www.kernel.org/pub/linux/kernel/")
# (find-fline "$S/http/www.kernel.org/pub/linux/kernel/v2.2/")

movelocaldeb /usr/src/kernel-source-2.2.16*.deb
dpkg -i /usr/src/.debs/binary-i386/web/kernel-source-2.2.16_Custom.1.00.deb

# (find-k22file "")
# (find-k22file "omkp-ki")
# (find-k22file "debian/")
# (find-k22file "debian/rules")
# (find-k22file "debian/rules" "FLAVOURS")
# (find-fline "/usr/bin/make-kpkg" "EOUSAGE")
# (find-fline "/usr/doc/kernel-package/")
# (find-fline "/usr/doc/kernel-package/Flavours.gz")
# (find-k22file "kernel/ksyms.c")
# (find-k22file "arch/i386/kernel/i386_ksyms.c")

# (eeman "depmod")
# (eeman "insmod")
# (find-fline "/etc/modules.conf")

# (find-es "kernel" "make-kpkg")

# (find-k22file "Documentation/Configure.help")
# (find-k22file "Documentation/Configure.help" "kmod")
# (find-k22file "Documentation/kmod.txt")
# (find-k22file "kernel/kmod.c")





#####
#
# make-kpkg - a patch for the "rules" file
# 2000dec23
#
#####

# «make-kpkg_patch»  (to ".make-kpkg_patch")
# Here's an important/nice patch for make-kpg's "rules" file.
# At present it must be applied by hand.
# See its comments for its description and
#  (to "make-kpkg_hacking")
# for how I got it.

# This is how things should look in the "rules" after hand-patching.
# The extra lines are the ones that start with "sleep", "find", or "#".
# Note: I have ideological reasons for not surrounding the new lines
#  with "ifdef"s; I think it is just plain wrong to let the kernel
#  sources be as difficult to browse as they are by default.
# (find-shkpkgfile "rules"      "# Builds the binary package.")
# (find-shkpkgfile "rules.orig" "# Builds the binary package.")

	-test -f stamp-configure || $(deb_rule) configure
	#
	# Save a timestamp before running "make-bzImage":
	sleep 2; touch stamp-kimage; sleep 2
	$(MAKE) $(do_parallel) $(FLAV_ARG) ARCH=$(KERNEL_ARCH)	\
	                    CROSS_COMPILE=$(KERNEL_CROSS) $(target)
	sleep 2; touch stamp-modules; sleep 2
ifdef MODULES_ENABLED
	$(MAKE) $(do_parallel) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \
	                    CROSS_COMPILE=$(KERNEL_CROSS) modules
endif
	#
	# Now find all .c/.h/.S files that were read between
	# stamp-kimage and the present moment; these are exactly the
	# ones that are being compiled into the kernel. Save the
	# listing in .files.chS.used; it will be used by some indexing
	# programs (etags and glimpse) later, see:
	# (to "flavours-2.2_index")
	# (eeman "1 find" "anewer")
	find * -name '*.[chS]' -and      -anewer stamp-kimage > .files.chS.used
	find * -name '*.[chS]' -and -not -anewer stamp-kimage > .files.chS.unused
	touch stamp-build




#####
#
# make-kpkg - hacking the "rules" file
# 2000dec23
#
#####

# «make-kpkg_hacking»  (to ".make-kpkg_hacking")
# (to "make-kpkg_patch")
# (to "flavours-2.2_index")
# (find-es "make" "make_toposort")
# (find-es "make" "make_addtrace")
# (find-fline "/usr/share/kernel-package/rules")
# (find-fline "~/ICON/toposort.icn")
# (find-fline "~/LUA/toposort.lua")

# I wanted make-kpkg to place an extra timestamp before the "make
# bzImage", to let me index the relevant .c/.h/.S files, but
# make-kpkg's "rules" makefile was too complex for barehand hacking;
# with the tricks below I was able to find relatively quickly where to
# modify the "rules" file.
# Here's a message I sent asking about that (it went unanswered AFAIK):
# (find-deblistsw3 "debian-user-0008/msg03984.html")

#*
cd /usr/share/kernel-package/
laf rules*
if [ ! -e rules.orig ]; then
  mv -v rules rules.orig
fi
cat rules.orig \
  | makefile_addtrace \
  > rules
chmod 755 rules
laf rules*
#*
cat /usr/share/kernel-package/rules \
  | makefile_getdeps \
  | lua ~/LUA/toposort.lua
#*




#####
#
# make-kpkg (simple uses)
# 2000jun13
#
#####

# «make-kpkg»  (to ".make-kpkg")
# (find-es "kernel" "compile22")
# (code-c-d "shkpkg" "/usr/share/kernel-package/")

(cd /usr/src/; rm -Rv linux linux-2.2; tar -xvzf ~/tmp/linux-2.2.15.tar.gz)
cd /usr/src/
mv linux linux-2.2
ln -s linux-2.2 linux
cd /usr/src/linux-2.2/

cp ~/k22conf .config
make-kpkg --revision=4:angg.00jun13 kernel_image	|& tee omkp-ki

# (find-angg ".zshrc" "debbasename")
movelocaldeb /usr/src/kernel-image-2.2.15_angg*.deb
cd /usr/src/.debs/binary-i386/web/
dpkg -i kernel-image-2.2.15_angg*.deb



# «make-kpkg-ide»  (to ".make-kpkg-ide")
# (find-es "kernel" "kernel-patch-udma")

(cd /usr/src/; rm -Rv linux linux-2.2; tar -xvzf ~/tmp/linux-2.2.15.tar.gz)
cd /usr/src/
mv linux linux-2.2
ln -s linux-2.2 linux
cd /usr/src/linux-2.2/
bzcat /usr/src/kernel-patch-2.2.15-ide-20000405/ide.bz2 \
  | patch -s    -p1	\
  |& tee oide.apply
date '+patch applied at %Y%b%d %X' \
  |& tee .idepatch.status

#cp ~/k22conf .config
cp ~/k22conf-ide .config

#make oldconfig
#make menuconfig
# (find-k22file ".config")
#cp -v .config ~/k22conf-ide

make-kpkg --revision=ivox.ide.00jun15 kernel_image	|& tee omkp-ki



# «make-kpkg-ide-install»  (to ".make-kpkg-ide-install")
#
movelocaldeb /usr/src/kernel-image-2.2.15_ivox*.deb
cd /usr/src/.debs/binary-i386/web/
dpkg -i kernel-image-2.2.15_ivox*.deb

# (find-status "kernel-image-2.2.15")
# (find-vldifile "kernel-image-2.2.15.list")
# (find-fline "/usr/doc/kernel-image-2.2.15/")
mcopy /boot/vmlinuz-2.2.15 a:k22xxbup




#####
#
# make-kpkg docs
# 2000jun13
#
#####

# «make-kpkg_docs»  (to ".make-kpkg_docs")

# (find-status "kernel-package")
# (find-vldifile "kernel-package.list")
# (find-fline "/usr/doc/kernel-package/")

# (code-c-d "shkpkg" "/usr/share/kernel-package/")

# (find-shkpkgfile "")
# (find-shkpkgfile "rules")
# (find-shkpkgfile "kpkg-vercheck")
# (find-fline "/usr/bin/make-kpkg")
# (find-fline "/usr/sbin/kernel-packageconfig")

# (find-debfaqfile "debian-faq.en.txt.gz" '* 3 "build custom kernels")
# (find-debfaqfile "debian-faq.en.txt.gz" "make-kpkg -rev Custom.N kernel_image")

# (eeman "1 make-kpkg")
# (eeman "5 kernel-package")
# (eeman "5 kernel-pkg.conf")
# (eeman "8 kernel-packageconfig")

# (find-shkpkgfile "Rationale")
# (find-fline "/usr/doc/kernel-package/README.gz")
# (find-fline "/usr/doc/kernel-package/README.gz" "|----")
# (find-fline "/usr/doc/kernel-package/README.gz" "kernel_source")
# (find-fline "/usr/doc/kernel-package/Problems.gz")
# (find-fline "/usr/doc/kernel-package/Multi-Arch.gz")
# (find-fline "/usr/doc/kernel-package/Rationale.gz")
# (find-fline "/usr/doc/kernel-package/copyright")
# (find-fline "/usr/doc/kernel-package/changelog.gz")
# (find-fline "/usr/doc/kernel-package/Flavours.gz")

# (find-fline "/etc/kernel-pkg.conf")
# (find-shkpkgfile "Config/")

# (find-shkpkgfile "Flavours")
# (find-shkpkgfile "LiloDefault")
# (find-shkpkgfile "LinkPolicy")
# (find-shkpkgfile "QuikDefault")
# (find-shkpkgfile "README")
# (find-shkpkgfile "README" "Brave and the impatient:")
# (find-shkpkgfile "README" "stamp-configure")
# (find-shkpkgfile "SiloDefault")
# (find-shkpkgfile "changelog")
# (find-shkpkgfile "config")

# (find-shkpkgfile "README.modules")
# (find-shkpkgfile "README.tecra")

#Boring docs that get included in the newly-made packages.
# (find-shkpkgfile "README.headers")
# (find-shkpkgfile "README.image")
# (find-shkpkgfile "README.source")
# (find-shkpkgfile "README.doc")
# (find-shkpkgfile "copyright.doc")
# (find-shkpkgfile "copyright.headers")
# (find-shkpkgfile "copyright.image")
# (find-shkpkgfile "copyright.source")

#Debian inst/rm scripts.
# (find-shkpkgfile "image.postinst")
# (find-shkpkgfile "image.postrm")
# (find-shkpkgfile "image.preinst")
# (find-shkpkgfile "image.prerm")
# (find-shkpkgfile "include.postinst")
# (find-shkpkgfile "include.prerm")

#"control" files.
# (find-shkpkgfile "sample.module.control")
# (find-shkpkgfile "Control")
# (find-shkpkgfile "Control.libc")

#"rules" files.
# (find-shkpkgfile "rules")
# (find-shkpkgfile "sample.module.rules")

# (find-fline "/usr/bin/make-kpkg" "$rules_file =")
# (find-shkpkgfile "rules")
# (find-shkpkgfile "rules" "STAMPS_TO_CLEAN")
# (find-shkpkgfile "rules" "$(deb_rule)")
# (find-shkpkgfile "rules" '* 2 "$(deb_rule)")
# (find-shkpkgfile "rules" '* 3 "$(deb_rule)")
# (find-shkpkgfile "rules" '* 4 "$(deb_rule)")
# (find-shkpkgfile "rules" '* 5 "$(deb_rule)")

# (find-shttpw3 "www.geocities.com/ResearchTriangle/3328/paper/Debian-is-Da-BOMB-53.html")

# On modules and sound:
# (find-deblistsw3 "debian-user-9905/msg00138.html")

# (find-debfaqfile "debian-faq.txt.gz" '* 3 "build custom kernels")
# (find-debfaqfile "debian-faq.txt.gz" "make-kpkg -rev Custom.N kernel_image")
# (find-fline "/usr/doc/kernel-package/README.gz" "will not try to upgrade")
# (find-fline "/usr/doc/kernel-package/README.gz" "patch_the_kernel")








#####
#
# kernel.org mirrors
# 2000mar20
#
#####

# «kernel.org-mirrors»  (to ".kernel.org-mirrors")
# psne http://www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.14.gz
# (find-es "net" "debian_mirrors")
# (find-fline "$S/http/www.kernel.org/mirrors/")

getlinks < $S/http/www.kernel.org/mirrors/index.html \
  | perl -nle 'm%^(ftp|http)://(.*?)/% && print $2' \
  | sort | uniq \
  | tee ~/o
mynetselect $(<~/o)

# (find-fline "~/o2")

http://www.mirror.ac.uk/sites/ftp.kernel.org/pub/linux/kernel/v2.2/linux-2.2.14.tar.gz



#######
#
# www.br.kernel.com
#
#######

# (find-shttpw3 "www.kernel.org/mirrors/")

# http://www.br.kernel.org/pub/linux/
# ftp://ftp.br.kernel.org/pub/linux/

lynx    ftp://ftp.br.kernel.org/pub/linux/kernel/v2.2/
anonftp ftp://ftp.br.kernel.org/pub/linux/kernel/v2.2/



#####
#
# downloading new kernel versions
#
#####

# «downloading»  (to ".downloading")
psne http://www.kernel.org/mirrors/
lynx /snarf/http/www.kernel.org/mirrors/

cd $S/http/www.br.kernel.org/pub/linux/kernel/
find v2.0 v2.2

psne http://www.br.kernel.org/pub/linux/kernel/v2.0/
psne http://www.ca.kernel.org/pub/linux/kernel/v2.1/
psne http://www.br.kernel.org/pub/linux/kernel/v2.2/

psne http://www.br.kernel.org/pub/linux/kernel/v2.0/patch-2.0.38.gz

psne http://www.br.kernel.org/pub/linux/kernel/v2.2/patch-2.2.16.gz

mkdir -p /snarf/http/www.br.kernel.org/pub/linux/kernel/v2.1/
cd	/snarf/http/www.br.kernel.org/pub/linux/kernel/v2.1/
for i in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20; do
  psne $FBOTO_H/linux-2.2.0-pre8.tar.bz2$i.gz
done



#####
#
# applying version patches
# 2000dec26
#
#####

# «apply_version_patch»  (to ".apply_version_patch")
#*
# Make an "upstream" 2.2.18. My ~/tmp/linux-2.2.15.tar.gz should be
# equivalent to the one in kernel.org, but it was obtained by patching
# the 2.2.1 sources all the way up to a 2.2.15 and tgzing the result;
# so I prefer to keep it in a non-standard place.
#
cd /usr/src/
rm -Rv linux linux-2.2
tar -xvzf ~/tmp/linux-2.2.15.tar.gz
cd /usr/src/
ln -s linux linux-2.2

#gzip -cd $S/http/www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.16.gz \
#  | patch -p0					|& tee linux/op
for i in v2.2/patch-2.2.16.gz \
	 v2.2/patch-2.2.17.gz \
	 v2.2/patch-2.2.18.gz; do
  echo "\n $i:"
  gzip -cd $S/http/www.kernel.org/pub/linux/kernel/$i | patch -p0
done
# |& tee linux/op

#*
cd /usr/src/
tar -cvzf ~/tmp/linux-2.2.18.tar.gz linux
#*








#####
#
# kernel 2.0.37
# 99jun16
#
#####

# «compile20»  (to ".compile20")
# These are notes on how to compile 2.0.37 "by hand", with several
# nice tricks -- like indexing the ".c"s/".h"s/".S"s that were used in
# the compilation, and compiling with -g to let "gdb /proc/kcore"
# work.
# Status: they were working ok on 99jun16.

k=angg
# k=lea
kconf=~/k20xxconf-$k
kconfsnd=~/k20xxconf-$k.snd

rm -Rv /usr/src/linux-2.0/
rm /usr/src/linux
cd /usr/src/
# tar -xvzf $S/http/www.kernel.org/pub/linux/kernel/v2.0/linux-2.0.35.tar.gz
tar -xvzf /big/slinks1/dists/slink/main/source/devel/kernel-source-2.0.35_2.0.35.orig.tar.gz
for i in v2.0/patch-2.0.36.gz \
	 v2.0/patch-2.0.37.gz \
	 v2.0/patch-2.0.38.gz; do
  echo "\n $i:"
  gzip -cd $S/http/www.kernel.org/pub/linux/kernel/$i | patch -p0
done |& tee linux/op
mv linux linux-2.0
ln -s linux-2.0 linux

# (find-fline "~/k20xxconf-angg")
# (find-fline "~/k20xxconf-angg.snd")
cd /usr/src/linux-2.0/
  sleep 2
  echo -n > .config-start
  sleep 2
# cp -iv ~/.config20xx .config
cp -v $kconf .config
cp -v $kconfsnd /etc/soundconf
  # rm -fv /etc/soundconf
  # (find-fline "/etc/soundconf")
  # cp -iv /etc/soundconf $kconfsnd

cd /usr/src/linux-2.0/
make symlinks
( # The script may ask this:
  # "Old configuration exists in `/etc/soundconf'. Use it [Y/n/?]"
  MAKE=make \
    bash scripts/Configure -d arch/i386/config.in	|& tee omc
)
  find .* * -anewer .config-start > .files.config
  # agrep '\-C' $(cat .files.config)
#cp -v .config $kconf
#cp -iv /etc/soundconf $kconfsnd

make depend						|& tee omd

sleep 2
echo -n > .mkzImage-start
sleep 2

# Use the version with -g if you want debug symbols.
# (find-k2file "Makefile" 90)
#
#make CFLAGS='-g -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce' zImage |& tee omz
make zImage	|& tee omz

sleep 2
echo -n > .mkmodules-start
sleep 2
#
make modules	|& tee omm

# Now we use the timestamps to
# index only the interesting files.
#
find * -name '*.[chS]' -and      -anewer .mkzImage-start > .files.chS.used
find * -name '*.[chS]' -and -not -anewer .mkzImage-start > .files.chS.unused
etags `cat .files.chS.used`
glimpseindex -H . -F < .files.chS.used

ln -sf /usr/src/linux-2.0/System.map /boot/System.map-2.0.38

# (find-k2file "drivers/sound/configure.c" ".soundconf")
# (find-k2file "drivers/sound/configure.c" "oldconf")
# (find-k2file "drivers/sound/Makefile" "oldconfig")

k=angg
rm -Rv /boot/$k
mkdir /boot/$k
cd /usr/src/linux-2.0/
cp -iv .config /boot/$k/k20conf
cp -iv modules/* /boot/$k
cp -iv arch/i386/boot/zImage /boot/$k/k2038

gzip -cd /usr/lib/loadlin/loadlin.exe.gz > /boot/$k/loadlin.exe
cd /boot/$k
zip -9 /root/k$k.zip *


# «gdb20»  (to ".gdb20")
#
# (gdb "gdb /usr/src/linux-2.0/vmlinux /proc/kcore")

# (find-fline "~/latte/.gdbinit")
# (gdb "gdb -cd=/home/root/latte -d /usr/src/latte-1.1/ -x /home/root/latte/.gdbinit")





#####
#
# Kernel 2.2.14
# 2000mar20
#
#####

# «compile22»  (to ".compile22")
# These are notes on how to compile 2.2.14 "by hand", with several
# nice tricks -- like indexing the ".c"s/".h"s/".S"s that were used in
# the compilation, and compiling with -g to let "gdb /proc/kcore"
# work.
# Status: they were working ok on ??????.

k=angg22
# k=lea

# (find-shttpfile "www.kernel.org/pub/linux/kernel/v2.2/")

rm -Rv /usr/src/linux-2.2/
rm -Rv /usr/src/linux/
rm /usr/src/linux
cd /usr/src/
# tar -xvzf /big/slinks1/dists/slink/main/source/devel/kernel-source-2.2.1_2.2.1.orig.tar.gz
tar -xvzf /big/slinks2/kernel2.2/linux-2.2.3.tar.gz
for i in v2.2/patch-2.2.4.gz		\
	v2.2/patch-2.2.5.gz		\
	v2.2/patch-2.2.6.gz		\
	v2.2/patch-2.2.7.gz		\
	v2.2/patch-2.2.8.gz		\
	v2.2/patch-2.2.9.gz		\
	v2.2/patch-2.2.10.gz		\
	v2.2/patch-2.2.11.gz		\
	v2.2/patch-2.2.12.gz		\
	v2.2/patch-2.2.13.gz		\
	v2.2/patch-2.2.14.gz		\
	v2.2/patch-2.2.15.gz; do
  echo " $i:"
  gzip -cd $S/http/www.kernel.org/pub/linux/kernel/$i | patch -p0
done |& tee linux/op

# «fast-unpack-22xx»  (to ".fast-unpack-22xx")
# Faster alternative: keep a tgz of the last version in ~/tmp.
# (find-fline "$S/http/www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.15.gz")
# (find-fline "~/tmp/")
#
#(cd /usr/src/; tar -cvzf ~/tmp/linux-2.2.15.tar.gz linux)
#(cd /usr/src/; rm -Rv linux linux-2.2; tar -xvzf ~/tmp/linux-2.2.15.tar.gz)

k=angg22
# k=lea

cd /usr/src/
mv linux linux-2.2
ln -s linux-2.2 linux
cd /usr/src/linux-2.2/

# make config

cp ~/k22conf .config
make oldconfig	|& tee omo
# (find-fline "~/k22conf")
# (find-k22file "omo")

#make xconfig
# (find-k22file "Makefile" "xconfig:")
# (find-k22file "scripts/")
# (find-k22file "scripts/Makefile" "kconfig.tk:")

#make menuconfig
# (find-k22file "Makefile" "menuconfig:")
# (find-k22file "scripts/lxdialog/")
# (find-k22file "scripts/Menuconfig")

# (find-k22file "scripts/kconfig.tk")
# (find-k22file "Documentation/Configure.help")
# (find-k22file "Documentation/Configure.help" "CONFIG_VORTEX")
# make xconfig	|& tee omx
# tkdiff .config ~/k22conf
cp .config ~/k22conf

make depend	|& tee omd

sleep 2
echo -n > .mkzImage-start
sleep 2

# Use the line with -g if you want debug symbols.
# (find-k2file "Makefile" 90)
#
nice make CFLAGS='-g -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce' bzImage	|& tee omz
#nice make bzImage	|& tee omz

sleep 2
echo -n > .mkmodules-start
sleep 2
#
# I don't know if it is useful to
# compile the modules with -g...
make modules	|& tee omm

# «compile22_index»  (to ".compile22_index")
# (to "flavours-2.2_index")
# Now we use the timestamps to
# index only the interesting files.
#
find * -name '*.[chS]' -and      -anewer .mkzImage-start > .files.chS.used
find * -name '*.[chS]' -and -not -anewer .mkzImage-start > .files.chS.unused
etags `cat .files.chS.used`
glimpseindex -H . -F < .files.chS.used

find * -type f > .files
grep -i make < .files > .files.m

#echo 'quit' | gdb -m vmlinux /proc/kcore
# ...seems to be broken on slink's gdb...
# (find-node "(gdb)File Options" "`-m'")
# (gdb "gdb /usr/src/linux-2.2/vmlinux /proc/kcore")


k=angg22
rm -Rv /boot/$k
mkdir /boot/$k
cd /usr/src/linux-2.2/
cp -iv .config /boot/$k/kconfig
cp -iv modules/* /boot/$k
cp -iv arch/i386/boot/bzImage /boot/$k/k22xx

laf /boot/$k

# (find-es "floppy" "syslinux")
# (find-es "general" "lilo")

# (find-fline "/etc/lilo.conf")
rm -v /hda1/boot/angg22/*
cp -v /boot/angg22/* /hda1/boot/angg22/
lilo







#####
#
# applying a patch to support a parallel port SCSI scanner
# 2000sep23
#
#####

# «ppscsi-patch-2.2»  (to ".ppscsi-patch-2.2")
# (to "scanner")
#*
cd /usr/src/linux/
zcat $S/ftp/people.redhat.com/twaugh/parport/patch-2.2.17-pre10-ppdev1.gz \
  | patch -p1 \
  |& tee op-ppdev
zcat $S/ftp/people.redhat.com/twaugh/parport/patch-2.2.15pre14-ppscsi1.gz \
  | patch -p1 \
  |& tee op-ppscsi

# (find-k22file "op-ppdev")
# (find-k22file "op-ppscsi")

# On 2.2.18 a certain chunk fails, so I reapply it by hand.
# (find-k22file "include/linux/proc_fs.h.rej")
# (find-k22file "include/linux/proc_fs.h")
patch -p0 <<'%%%'
--- include/linux/proc_fs.h~	Thu Dec 28 02:50:39 2000
+++ include/linux/proc_fs.h	Thu Dec 28 02:56:09 2000
@@ -213,6 +213,15 @@
 	PROC_SCSI_I2O,
 	PROC_SCSI_3W_XXXX,
 	PROC_SCSI_USB_SCSI,
+	PROC_SCSI_ONSCSI,
+	PROC_SCSI_EPST,
+	PROC_SCSI_EPSA2,
+	PROC_SCSI_BELKIN,       /* Not done yet. */
+	PROC_SCSI_T348,
+	PROC_SCSI_T358,
+	PROC_SCSI_VPI0,
+	PROC_SCSI_VPI2,         /* Not done yet. */
+	PROC_SCSI_SPARCSI,
 	PROC_SCSI_CPQFCTS,
 	PROC_SCSI_SCSI_DEBUG,
 	PROC_SCSI_NOT_PRESENT,
%%%

#*

# «ppscsi-patch-2.4»  (to ".ppscsi-patch-2.4")
# (find-fline "$S/ftp/people.redhat.com/twaugh/patches/")
# (find-fline "$S/ftp/people.redhat.com/twaugh/parport/")
#*
cd /usr/src/linux-2.4/
zcat $S/ftp/people.redhat.com/twaugh/patches/patch-cvs-tmw.gz \
  | patch -p1 \
  |& tee op-ppscsi

#*

# (find-shttpw3 "www.buzzard.org.uk/jonathan/scanners.html")
# (find-shttpw3 "www.torque.net/parport/")
# (find-shttpw3 "www.torque.net/parport/parscsi.html")
# (find-shttpw3 "www.torque.net/parport/ppscsi.html")
# (find-shttpw3 "www.torque.net/parscsi.html")
# (find-shttpw3 "people.redhat.com/twaugh/parport/")

# (code-c-d "ppscsi" "$S/ftp/people.redhat.com/twaugh/parport/")
# (find-ppscsifile "patch-2.2.17-pre10-ppdev1.gz")
# (find-ppscsifile "patch-2.2.15pre14-ppscsi1.gz")

# (find-shttpw3 "www.buzzard.org.uk/jonathan/scanners.html" "ScanJet 5100C")
# (find-ppscsifile "patch-2.2.15pre14-ppscsi1.gz" "Shuttle EPST adapter")
# (find-shttpw3 "www.torque.net/parport/ppscsi.html" "insmod ppscsi")






#####
#
# scanner (hp scanjet 5100c)
# 2000sep23
#
#####

# «scanner»  (to ".scanner")
# (to "ppscsi-patch-2.2")

# (find-status "libsane")
# (find-vldifile "libsane.list")
# (find-fline "/usr/doc/libsane/")

# (find-status "sane")
# (find-vldifile "sane.list")
# (find-fline "/usr/doc/sane/")

rmmod lp
rmmod parport_pc
rmmod parport

insmod scsi_mod
insmod sg
insmod parport
# insmod parport_pc
insmod ppscsi
insmod epst

cd /tmp
scanimage -d hp:/dev/sg0 --mode Color > hpscan

xscanimage hp


# Oops: now I'm getting: epst -> "device busy". How do I fix it?

# Aha. The scanner needs to be turned on to be detected as a
# scsi-over-parallel-port device by epst, and also to give access to
# the printer (that is now connected to the computer through the
# scanner).

rmmod epst
rmmod ppscsi
rmmod lp
rmmod parport_pc
rmmod parport
rmmod sg
rmmod scsi_mod

insmod parport
insmod scsi_mod
insmod ppscsi
insmod epst





#####
#
# kdb
# 2000sep02
#
#####

# «kdb»  (to ".kdb")
# I have tried a bit, but I DON'T KNOW how to run kdb (in any sense).
pdsc $SDEBIAN/dists/woody/main/source/devel/kernel-patch-kdb_1.2-2.dsc
cd /usr/src/kernel-patch-kdb-1.2/
# egrep '^(---|\+\+\+)' kdb-v0.6-2.2.13
egrep '^\+\+\+' kdb-v0.6-2.2.13

debian/rules binary	|& tee odrb
apti binutils-dev
dpkg -i ../kernel-patch-kdb

# (find-status "kernel-patch-kdb")
# (find-vldifile "kernel-patch-kdb.list")
# (find-fline "/usr/doc/kernel-patch-kdb/")
zless /usr/doc/kernel-patch-kdb/kdb.txt.gz

# (code-c-d "patchkdb" "/usr/src/kernel-patch-kdb-1.2/")
# (find-patchkdbfile "")
# (find-patchkdbfile "doc/")
# (find-patchkdbfile "debian/")
# (find-patchkdbfile "kdb-v0.6-2.2.13" "linux2.2-kdb/kern/Makefile")

# TODO: try to apply this patch to the 2.2.16 kernel, possibly making
# it compatible with the Debian kernel flavours patch





#####
#
# pcsndrv 1.2
#
#####

# «pcsnddrv»  (to ".pcsnddrv")
# (find-k2file "drivers/pcsnd/README")
# (find-k2file "drivers/pcsnd/pcspinstall")
# (find-fline "/dev/MAKEDEV" "audio)")

insmod /usr/src/linux/modules/pcsnd.o

cd /dev/
mknod -m 666 pcmixer c 13 0
mknod -m 666 pcsp    c 13 3
mknod -m 666 pcaudio c 13 4
mknod -m 666 pcsp16  c 13 5
rm -v mixer dsp audio dsp16
ln -s pcmixer mixer
ln -s pcsp    dsp
ln -s pcaudio audio
ln -s pcsp16  dsp16


rm -Rv /usr/src/pcsnd-kit/
cd /usr/src/
tar -xvzf /snarf/ftp/ftp.informatik.hu-berlin.de/pub/os/linux/hu-sound/pcsndrv-1.2.tgz pcsnd-kit/'*'

cd /usr/src/pcsnd-kit/
make |& tee om

# (find-fline "/usr/src/pcsnd-kit/Readme")
# (find-fline "/usr/src/pcsnd-kit/")



#
# Armada keyboard patch:
# (I'm not using it anymore)
cd /usr/src/linux/drivers/char/
patch keyboard.c \
  /snarf/http/www.kabel.de/~hmueller/armada11xx/armada11xx_apm.patch
# (find-shttpfile "www.kabel.de/~hmueller/armada11xx/armada11xx_apm.patch")






######
#
# gdb'ing the kernel
#
######

# «gdb_ing_the_kernel»  (to ".gdb_ing_the_kernel")
# (gdb "gdb /usr/src/linux-2.0/vmlinux /proc/kcore")
# (find-k2file ".files.chS.used")
# (find-k2file "kernel/module.c")
# (find-k2file "kernel/info.c")

# (eeman "2 intro")
# (eeman "2 syscalls")
# (find-k2tag "__NR__newselect")
# (find-k2tag "sys_open")
# (eeman "5 proc")

# (find-k2file "fs/proc/")
# (find-k2file "fs/proc/root.c" "\"modules\"")
# (find-k2file "fs/proc/array.c" "PROC_MODULES:")
# (find-k2tag "get_module_list")

# (find-k2tag "printk")
# (find-k2file "kernel/printk.c" "int printk")

ptype kernel_module

set var $x=kernel_module
define xn
  set var $x=$x->next
  p *$x
end





#####
#
# /proc/xxx/statm
# 99nov??
#
#####

# «statm»  (to ".statm")
# (eeman "5 proc" "maps *A file containing")
# (find-k22file "")
# (find-k22file ".files.chS.used")

# Prepare the ".strings" file
# This is *SLOW*, as getstrings is a perl script
# «.strings»
#
cd /usr/src/linux-2.2/
for i in $(<.files.chS.used); do
  echo "\n$i:"; getstrings < $i
done | tee .strings

# (find-k22file ".strings" "statm")
# (find-k22file "fs/proc/base.c" "statm")
# (find-k22tag "proc_dir_entry")
# (find-k22tag "proc_pid_fill_inode")
# (find-k22file "fs/proc/array.c" "proc_array_inode_operations")
# (find-k22file "fs/proc/array.c" "proc_array_operations")
# (find-k22file "fs/proc/array.c" "array_read")
# (find-k22file "fs/proc/array.c" "case PROC_PID_STAT")
# (find-k22file "fs/proc/array.c" "get_process_array")
# (find-k22file "fs/proc/array.c" "get_stat(")
# (find-k22file "fs/proc/array.c" "get_statm(")

P=$(cd /proc; print -l [0-9]* | sort -n) \
expect -c '
  foreach pid $env(P) {
    catch {
      foreach {size res sha txt lib sta drt} [exec cat /proc/$pid/statm] {}
      puts [format "%s::  size: %s  resident: %s  share: %s
        text: %s  library: %s  stack: %s  dirty: %s" \
        $pid $size $res $sha $txt $lib $sta $drt]
    }
  }
'

# Much better:

P=$(cd /proc; print -l [0-9]* | sort -n) \
expect -c '
  foreach pid $env(P) {
    catch {
      foreach v {siz res sha txt lib sta drt} \
	  n "[exec cat /proc/$pid/statm]" {
	set $v [format "%3s" $n]
      }
      set pid [format "%4s" $pid]
      puts "pid:$pid siz:$siz res:$res sha:$sha txt:$txt lib:$lib sta:$sta drt:$drt"
    }
  }
'




#####
#
# Looking for the UDMA patch
# 2000jun01
#
#####

# «kernel-patch-udma0»  (to ".kernel-patch-udma0")
# (find-fline "~/tmp/" "ivox1")
# (find-htetfile "mini/Ultra-DMA.txt.gz")
# (find-htetfile "mini/Ultra-DMA.txt.gz" "Andre M. Hedrick")

# (find-k22file "drivers/block/ide-dma.c" "UDMA")
# (find

cd $SDEBIAN/
agrep 2.2.1 *.i

cd $SDEBIAN/
egrep 'kernel-(source|image)' *.i

Pgrepp 'm/kernel-(source|image)/'

cd /usr/src/boot-floppies-2.2.13/
agrep -i udma $(find *)

# (find-bffile "documentation/release-notes.sgml" "Andre Hedrick's")
# (find-bffile "Makefile" "kerneli386_udma66 :=")
# (find-bffile "Makefile" "modcontudma66:")
# (find-bffile "Makefile" "rootudma66.bin:")
# (find-bffile "Makefile" "resc1440udma66.bin:")





#####
#
# kernel-patch-...-ide
# 2000jun01
#
#####

# «kernel-patch-udma»  (to ".kernel-patch-udma")

pdsc $SPOTATO/main/source/devel/kernel-patch-2.2.15-ide_20000405-1.dsc
cd /usr/src/kernel-patch-2.2.15-ide-20000405/

# (code-c-d "kpide" "/usr/src/kernel-patch-2.2.15-ide-20000405/")
# (find-kpidefile "debian/control" "Hedrick")
# (find-kpidefile "debian/rules")
# (find-kpidefile "ide.bz2")

# (find-kpidefile "")

# (find-kpidefile "ide.apply")
# (find-kpidefile "ide.unapply")

# Apply:
cd /usr/src/linux-2.2/
bzcat /usr/src/kernel-patch-2.2.15-ide-20000405/ide.bz2 \
  | patch -s    -p1	\
  |& tee oide.apply
date '+patch applied at %Y%b%d %X' \
  |& tee .idepatch.status

# Unapply:
cd /usr/src/linux-2.2/
bzcat /usr/src/kernel-patch-2.2.15-ide-20000405/ide.bz2 \
  | patch -s -R -p1	\
  |& tee oide.unapply
date '+patch UNapplied at %Y%b%d %X' \
  |& tee .idepatch.status

# (find-k22file ".idepatch.status")



#Evidence in favor of using this patch:
# (find-fline "~/tmp/" "ivox1")
# (find-fline "~/tmp/ivox1.dmesg" "DID=2411")
# (find-fline "~/tmp/ivox1.lspci" "82801")
# (find-kpidefile "ide.bz2" "Unknown device 2411")
# (find-kpidefile "ide.bz2" "0x2411")

#About some not-so-default configurations...
# (find-kpidefile "ide.bz2" "Intel PIIXn chipsets support")
# (find-k22file "drivers/block/piix.c")






#####
#
# kerneld
# 2000jun14
#
#####

# «kerneld_docs»  (to ".kerneld_docs")

# (find-status "modutils")
# (find-vldifile "modutils.list")
# (find-fline "/usr/doc/modutils/")
# (find-vldifile "modutils.preinst")
# (find-vldifile "modutils.postinst")
# (find-vldifile "modutils.prerm")
# (find-vldifile "modutils.postrm")

# (eeman "8 insmod")
# (eeman "8 rmmod")
# (eeman "8 lsmod")
# (eeman "8 modinfo")

# (find-fline "/etc/modules")
# (eeman "5 modules")

# (find-fline "/usr/doc/modutils/NEWS.gz")
# (find-fline "/usr/doc/modutils/TODO.gz")
# (find-fline "/usr/doc/modutils/CREDITS.gz")
# (find-fline "/usr/doc/modutils/changelog.gz")
# (find-fline "/usr/doc/modutils/copyright")
# (find-fline "/usr/doc/modutils/changelog.Debian.gz")
# (find-fline "/usr/doc/modutils/README.gz")
# (find-fline "/usr/doc/modutils/README.Debian.gz")
# (find-fline "/usr/doc/modutils/module-policy.Debian.gz")

# (eeman "2 get_kernel_syms")
# (eeman "2 init_module")
# (eeman "2 query_module")
# (eeman "2 create_module")
# (eeman "2 delete_module")

# (eeman "5 modules.conf")
# (eeman "8 depmod")
# (eeman "8 modprobe")
# (eeman "8 update-modules")
# (find-fline "/etc/modules.conf")
# (find-fline "/etc/modutils/0keep")
# (find-fline "/sbin/update-modules")

# (find-fline "/lib/modules/")
# (find-fline "/lib/modules/2.2.15/")

# (find-fline "/etc/cron.daily/")
# (find-fline "/etc/cron.daily/modutils")
# (find-fline "/etc/modutils/")
# (find-fline "/etc/modutils/aliases")
# (find-fline "/etc/modutils/arch/")
# (find-fline "/etc/modutils/paths")
# (find-fline "/etc/init.d/modutils")
# (find-fline "/usr/doc/modutils/examples/versioned")

# (eeman "8 ksyms")
# (eeman "8 genksyms")

# (find-fline "/etc/init.d/kerneld")
# (find-fline "/usr/doc/modutils/README.kerneld.gz")
# (eeman "8 kerneld")
# (eeman "8 kdstat")

# (find-fline "/sbin/insmod_ksymoops_clean")
# (find-fline "/var/log/ksymoops/")

# (find-fline "/sbin/kernelversion")
# (eeman "1 kernelversion")





#####
#
# linux-2.4.9
# 2001sep22
#
#####

# «2.4.9»  (to ".2.4.9")
# «2.4.17»  (to ".2.4.17")
lynx http://www.br.kernel.org/pub/linux/kernel/v2.4/
cd $S/http/www.br.kernel.org/pub/linux/kernel/v2.4/

#*
cd /usr/src/
rm -Rv linux linux-2.4
tar -xvzf $S/http/www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.9.tar.gz
for i in v2.4/patch-2.4.10.gz \
         v2.4/patch-2.4.11-dontuse.gz \
         v2.4/patch-2.4.12.gz \
         v2.4/patch-2.4.13.gz \
         v2.4/patch-2.4.14.gz \
         v2.4/patch-2.4.15.gz \
         v2.4/patch-2.4.16.gz \
         v2.4/patch-2.4.17.gz; do
  echo "\n $i:"
  gzip -cd $S/http/www.kernel.org/pub/linux/kernel/$i | patch -p0
done	;# |& tee linux/op
mv linux linux-2.4
cd /usr/src/linux-2.4/

#*
# Or:
#
cd /usr/src/
rm -Rv linux linux-2.4
tar -xvzf $S/http/www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.gz
mv linux linux-2.4
cd /usr/src/linux-2.4/

#*
# (find-k24file "Makefile" "KERNELRELEASE")
cd /usr/src/linux-2.4/
patch Makefile <<'%%%'
6c6,17
< KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
---
> # FLAVOUR is like EXTRAVERSION, but it's meant for local use, and the
> # dash between it and the rest of the version is supplied here.  It's used
> # by make-kpkg's --flavour switch, see /usr/share/doc/kernel-package/Flavours.
> #FLAVOUR =
> 
> ifneq ($(strip $(FLAVOUR)),)
> INT_FLAV := -$(FLAVOUR)
> else
> INT_FLAV :=
> endif
> 
> KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(INT_FLAV)
%%%

#*
# (to "ppscsi-patch-2.4")
  cd /usr/src/linux-2.4/
  zcat $S/ftp/people.redhat.com/twaugh/patches/patch-cvs-tmw.gz \
    | patch -p1 \
    |& tee op-ppscsi

#*
cd /usr/src/linux-2.4/
find * | sort > .files

# make config
make-kpkg clean					|& tee omkc
cp ~/k24conf .config
make-kpkg --revision=custom.1 --flavour=edrx kernel_image 	|& tee omkki

dpkg -i /usr/src/kernel-image-2.4.0-test10-edrx_custom.1_i386.deb

# (find-status "kernel-image-2.4.0-test7-edrx")
# (find-vldifile "kernel-image-2.4.0-test7-edrx.list")
# (find-fline "/usr/doc/kernel-image-2.4.0-test7-edrx/")

mount -o remount,rw /hda1
cp -v /boot/vmlinuz-2.4.0-test10-edrx /hda1/boot/grub/vmlinuz-2.4xx

# (find-k24file "")
# (find-k24file "Documentation/")
# (find-k24file "Documentation/Configure.help" "/dev/shm")
# (find-k24file "Documentation/Configure.help" "CONFIG_VT_CONSOLE")
# (find-k24file "Documentation/Configure.help")
# (find-k24file "Documentation/Configure.help" "CONFIG_PPSCSI")
# (find-k24file "Documentation/sound/OPL3-SA2")

# (find-fline "~/k22conf")
# (find-fline "~/k24conf")
# (find-k24file "")
# (find-k24file "arch/i386/config.in")
# (find-k24file "scripts/")

#*
cp ~/k24conf .config
#*
cd /usr/src/linux-2.4/
# Beware: ppscsi is not asked for in xconfig!
# make xconfig
make oldconfig
#*
cp .config ~/k24conf
#*

APM - configurei errado
SG - também
SYM53C8XX SCSI support - melhor dizer N
compressões para PPP: M

outb_console
# (find-k22file "drivers/char/vt.c")




#####
#
# 2.4.9-uml
# 2002jan01
#
#####

# «2.4.9-uml»  (to ".2.4.9-uml")

#*
cd /usr/src/
rm -Rv linux linux-2.4
tar -xvzf $S/http/www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.9.tar.gz
mv linux linux-2.4
cd /usr/src/linux-2.4/

#*
# (find-shttpw3 "user-mode-linux.sourceforge.net/compile.html" "tar.bz2")
cd /usr/src/linux-2.4/
bunzip2 < \
  $S/http/prdownloads.sourceforge.net/user-mode-linux/uml-patch-2.4.9-9.bz2 \
  | patch -p1	|& tee op

#*
cd /usr/src/linux-2.4/
# make menuconfig ARCH=um
make oldconfig ARCH=um

#*



#####
#
# linux-2.4.18 on debian
# 2004jan07
#
#####

# «2.4.18»  (to ".2.4.18")
#*
mkdir /tmp/binary-1
mount -o loop,ro /hdb2/woodycds/debian-30r2-i386-binary-1_NONUS.iso \
  /tmp/binary-1

#*
cd /tmp/binary-1/pool/main/k/kernel-source-2.4.18/
debtartvzf kernel-source-2.4.18_2.4.18-13_all.deb
debtarxvzf kernel-source-2.4.18_2.4.18-13_all.deb -C ~/bigsrc/
# maybe only ./usr/src/kernel-source-2.4.18.tar.bz2

#*
# (find-status "kernel-package")
# (find-vldifile "kernel-package.list")
# (find-fline "/usr/doc/kernel-package/")
# (find-fline "/usr/doc/kernel-package/README.gz" "For the Brave and the impatient:")

cd ~/bigsrc/
rm -Rv kernel-source-2.4.18/
tar -xvjf ./usr/src/kernel-source-2.4.18.tar.bz2

#*
cd ~/bigsrc/kernel-source-2.4.18/
cp -v ~/kconf2418-test .config
# (find-fline "~/kconf2418-test")

#*
cd ~/bigsrc/kernel-source-2.4.18/
make menuconfig
# (find-fline "~/kconf2418-cdrw")

#*
cp .config ~/kconf2418-test

#*
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--append-to-version")
cd ~/bigsrc/kernel-source-2.4.18/
make-kpkg clean						|& tee omkc
make-kpkg --append-to-version persephone kernel_image	|& tee omkki

#*
cd ~/bigsrc/
dpkg -i kernel-image-2.4.18persephone_10.00.Custom_i386.deb

#*
# (find-status "kernel-image-2.4.18persephone")
# (find-vldifile "kernel-image-2.4.18persephone.list")
# (find-fline "/usr/doc/kernel-image-2.4.18persephone/")

#*
cd ~/bigsrc/kernel-source-2.4.18/
make-kpkg --append-to-version persephone kernel_headers	|& tee omkkh
#*
cd ~/bigsrc/
dpkg -i kernel-headers-2.4.18persephone_10.00.Custom_i386.deb
#*
# (find-status "kernel-headers-2.4.18persephone")
# (find-vldifile "kernel-headers-2.4.18persephone.list")
# (find-vldifile "" "kernel-headers-2.4.18persephone.list")
# (find-fline "/usr/doc/kernel-headers-2.4.18persephone/")

aptrm kernel-headers-2.4.18persephone
#*





#####
#
# linux-2.4.18 with the user-mode-linux patch
# 2004jan07
#
#####

# «2.4.18-uml»  (to ".2.4.18-uml")




#####
#
# user-mode-linux
# 2004oct04
#
#####

# «user-mode-linux»  (to ".user-mode-linux")
# (find-status   "user-mode-linux")
# (find-vldifile "user-mode-linux.list")
# (find-udfile   "user-mode-linux/")
# (find-status   "user-mode-linux-doc")
# (find-vldifile "user-mode-linux-doc.list")
# (find-udfile   "user-mode-linux-doc/")
# (find-udfile   "user-mode-linux-doc/html/UserModeLinux-HOWTO.txt.gz")
# (find-status   "uml-utilities")
# (find-vldifile "uml-utilities.list")
# (find-udfile   "uml-utilities/")
# (find-status   "rootstrap")
# (find-vldifile "rootstrap.list")
# (find-udfile   "rootstrap/")

# (find-man "1 rootstrap")
# (find-fline "/usr/bin/rootstrap")
# (find-fline "/usr/lib/rootstrap/builder")
# (find-fline "/usr/lib/rootstrap/modules/uml")
# (find-fline "/usr/lib/rootstrap/modules/mkisofs")
# (find-fline "/usr/lib/rootstrap/modules/docpurge")
# (find-fline "/usr/lib/rootstrap/modules/tasksel")
# (find-fline "/usr/lib/rootstrap/modules/mkfs")
# (find-fline "/usr/lib/rootstrap/modules/base-config")
# (find-fline "/usr/lib/rootstrap/modules/mount")
# (find-fline "/usr/lib/rootstrap/modules/network")
# (find-fline "/usr/lib/rootstrap/modules/localepurge")
# (find-fline "/usr/lib/rootstrap/modules/umount")
# (find-fline "/usr/lib/rootstrap/modules/debian")
# (find-fline "/etc/rootstrap/dhclient-script")
# (find-fline "/etc/rootstrap/rootstrap.conf")

#*
# Create a sparse 1G image to use as a partition
umount /tmp/sarge/proc
umount /tmp/sarge/dev/pts
umount /tmp/sarge
rmdir  /tmp/sarge
rm -v  /tmp/sarge.img

python =(<<'%%%'
image = open("/tmp/sarge.img", 'w')
image.truncate(1024 * 1048576L)
image.close()
%%%)

mke2fs -F /tmp/sarge.img
mkdir     /tmp/sarge
mount -o loop /tmp/sarge.img /tmp/sarge

#*
debootstrap sarge /tmp/sarge http://127.0.0.1/vcarchives/

#*
cd /tmp/
cp -l sarge.img root_fs

#*
# A simple test:
mount -t proc   sargeproc   /tmp/sarge/proc
mount -t devpts sargedevpts /tmp/sarge/dev/pts
  chroot /tmp/sarge /bin/sh
umount /tmp/sarge/proc
umount /tmp/sarge/dev/pts

#*
# (find-man "1 linux")
# (find-man "1 linux" "root=/dev/root rootflags=/")
# (find-man "1 linux" "ubd0=/tmp/chroot")
# (find-sh "linux --help")

#*
linux root=/dev/root rootfstype=hostfs rootflags=/tmp/ con=xterm
#*

umlrun /bin/ls

#*
function umlkill () {
  sudo kill $(cat ~/.uml/*/pid)
  rm -Rfv ~/.uml/*
}

#*



proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)






umount /tmp/sarge

#*
# (find-man "1 linux")
# Not working.
linux con1=xterm ubd0=/tmp/sarge.img root=/dev/ubd0

#*
mkdir     /tmp/sarge/
mount -o loop /tmp/sarge.img /tmp/sarge

#*
cd /
mkdir /sarge-root
debootstrap sarge /tmp/sarge http://127.0.0.1/vcarchives/

#*
umount /tmp/sarge

#*


#*
cd /usr/share/doc/user-mode-linux-doc/html/
zless UserModeLinux-HOWTO.txt.gz
#*

# Nah, we don't need all this, there's a precompiled version...
# (find-vldifile "user-mode-linux.list" "/usr/bin/linux")

# http://www.megahosted.com/~en/papers/uml-debian-mini.html




#####
#
# kernel-source-2.6.8
# 2004sep13
#
#####

# «kernel-source-2.6.8»  (to ".kernel-source-2.6.8")
# (find-sh "dpkg -l")
# (find-status   "kernel-source-2.6.8")
# (find-vldifile "kernel-source-2.6.8.list")
# (find-udfile   "kernel-source-2.6.8/")
# (find-udfile "kernel-source-2.6.8/debian.README.gz" "6. \"make menuconfig\"")
# (find-udfile "kernel-source-2.6.8/debian.README.gz" "patch_the_kernel")
# (find-udfile "kernel-source-2.6.8/debian.README.gz" "\npatch_the_kernel")
# (find-k26file "Documentation/filesystems/cramfs.txt")
# (find-k26file "fs/cramfs/")
#*
tar -tvjf /usr/src/kernel-source-2.6.8.tar.bz2 | l -S
#*
rm -Rv ~/bigsrc/kernel-source-2.6.8/
tar -C ~/bigsrc/ \
  -xvjf /usr/src/kernel-source-2.6.8.tar.bz2
cd     ~/bigsrc/kernel-source-2.6.8/

#*
cd ~/bigsrc/kernel-source-2.6.8/
make-kpkg clean		|& tee omkc
make menuconfig

#*
cd ~/bigsrc/kernel-source-2.6.8/
make-kpkg kernel_image					|& tee omkki
make-kpkg --rootcmd fakeroot kernel_image		|& tee omkfrki
INITRD_OK=yes \
  make-kpkg --rootcmd fakeroot --initrd kernel_image	|& tee omkfriki

#*
# (find-k26file "omkki")
# (find-k26file "omkfrki")
# (find-k26file "omkfriki")
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--mkimage")
# (find-man "8 mkinitrd")
make-kpkg --revision=custom.1.0 kernel_image	|& tee omkki
#*
debtartvzf ~/bigsrc/kernel-image-2.6.8_10.00.Custom_i386.deb |& tee ~/o | l -S
# (find-fline "~/o")
#*
# (find-fline "/usr/bin/make-kpkg")
# (find-fline "/usr/bin/make-kpkg" "if ($mkimage)")

make-kpkg clean   
make-kpkg -rootcmd fakeroot --append-to-version -custom.${VER} \
          --revision custom.${VER} kernel_image modules-image





#####
#
# kernel-source-2.4.26 with initrd
# 2004sep13
#
#####

# «kernel-source-2.4.26»  (to ".kernel-source-2.4.26")
# (find-sh "dpkg -l")
# (find-status   "kernel-source-2.4.26")
# (find-vldifile "kernel-source-2.4.26.list")
# (find-udfile   "kernel-source-2.4.26/")
# (find-udfile "kernel-source-2.4.26/debian.README.gz" "6. \"make menuconfig")
# (find-udfile "kernel-source-2.4.26/debian.README.gz" "patch_the_kernel")
# (find-udfile "kernel-source-2.4.26/debian.README.gz" "\npatch_the_kernel")
# (code-c-d-linux "k24" "~/bigsrc/kernel-source-2.4.18/")
# (code-c-d-linux "k24" "~/bigsrc/kernel-source-2.4.26/")
# (find-fline "~/LINUX/")
# (find-k24file "Documentation/")
# (find-k24confvar "CONFIG_BLK_DEV_INITRD")
# (find-k24confvar "CONFIG_CRAMFS")
# (find-k24file "fs/cramfs/")
#*
rm -Rv ~/bigsrc/kernel-source-2.4.26/
tar -C ~/bigsrc/ \
  -xvjf /usr/src/kernel-source-2.4.26.tar.bz2
cd     ~/bigsrc/kernel-source-2.4.26/

#*
# Reconfigure (this works best on a VT)
cd ~/bigsrc/kernel-source-2.4.26/
make-kpkg --rootcmd fakeroot clean		|& tee omkc
cp -v ~/LINUX/2.4.26-initrd.conf .config
make menuconfig

#*
# Compare the config files
cd ~/bigsrc/kernel-source-2.4.26/
tkdiff ~/LINUX/2.4.26-initrd.conf .config &

#*
# Save
cd ~/bigsrc/kernel-source-2.4.26/
cp -v .config ~/LINUX/2.4.26-initrd.conf

#*
cd ~/bigsrc/kernel-source-2.4.26/
cp -v ~/LINUX/2.4.26-initrd.conf .config
# make-kpkg --rootcmd fakeroot kernel_image		|& tee omkki
INITRD_OK=yes \
  make-kpkg --rootcmd fakeroot --initrd kernel_image	|& tee omkfriki

#*
# (find-k24file "omkki")
# (find-k24file "omkfrki")
# (find-k24file "omkfriki")
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--mkimage")
# (find-man "8 mkinitrd")
make-kpkg --revision=custom.1.0 kernel_image	|& tee omkki
#*
debtartvzf ~/bigsrc/kernel-image-2.4.26_10.00.Custom_i386.deb |& tee ~/o | l -S
# (find-fline "~/o")
#*
# (find-fline "/usr/bin/make-kpkg")
# (find-fline "/usr/bin/make-kpkg" "if ($mkimage)")

make-kpkg clean   
make-kpkg -rootcmd fakeroot --append-to-version -custom.${VER} \
          --revision custom.${VER} kernel_image modules-image





#####
#
# make-kpkg and timestamps for grepping
# 2004dec20
#
#####

# «make-kpkg-timestamps-k26»  (to ".make-kpkg-timestamps-k26")
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--config target")
# (find-man "1 make-kpkg" "--targets")
# (find-man "1 make-kpkg" "\nTARGETS\n")
# (find-man "1 make-kpkg" "\nTARGETS\n" "\n       configure\n")
# (find-man "1 make-kpkg" "\nTARGETS\n" "\n       build ")

# (find-sh "make-kpkg --targets")
# (find-fline "/usr/share/kernel-package/rules")
# (find-fline "/usr/bin/make-kpkg")
#*
# Check in which subdirectory the tarfile will uncompress
tar -tvjf /usr/src/kernel-source-2.6.8.tar.bz2 | head -n 5

#*
# Uncompress
rm -Rv ~/bigsrc/kernel-source-2.6.8/
tar -C ~/bigsrc/ \
  -xvjf /usr/src/kernel-source-2.6.8.tar.bz2
cd     ~/bigsrc/kernel-source-2.6.8/

#*
# Produce something corresponding to the
# "Documentation/Configure.help" file of linux-2.4
# «k26.Configure.help»  (to ".k26.Configure.help")

# (find-k26file ".Configure.help")
# (find-k26confvar "CONFIG_BLK_DEV_LOOP")

cd ~/bigsrc/kernel-source-2.6.8/
find * -name '*Kconfig' > .files.Kconfig
mycat $(< .files.Kconfig) \
  | awk 'NF==2 && $1=="config" { print "CONFIG_" $2 }
         1 { print }
        ' \
  > .Configure.help

#*
# To change the .config file execute the adequate parts of this block
# (find-fline "~/LINUX/2.6.28-persephone1.conf")
#
cd ~/bigsrc/kernel-source-2.6.8/; cp ~/LINUX/2.6.28-persephone1.conf .config
cd ~/bigsrc/kernel-source-2.6.8/; make menuconfig
cd ~/bigsrc/kernel-source-2.6.8/; cp .config ~/LINUX/2.6.28-persephone1.conf

#*
# (find-fline "~/LINUX/2.6.28-persephone1.conf")
# (find-k26file "")
#
cd ~/bigsrc/kernel-source-2.6.8/
make-kpkg clean		|& tee omkc
cp ~/LINUX/2.6.28-persephone1.conf .config

INITRD_OK=1 \
make-kpkg \
  --revision=persephone1 --append-to-version -persephone1 \
  --rootcmd fakeroot \
  kernel_image	|& tee omkki

# --initrd  	     \

find * -name '*.[chS]' -and      -anewer stamp-configure > .files.chS.used
find * -name '*.[chS]' -and -not -anewer stamp-configure > .files.chS.unused

# Now the file ".files.chS.used" holds a listing of all the .c/.h/.S
# files that were read between the end of the configuration step and
# the end of the building of the deb.
#
# In other words: .files.chS.used holds a listing of all the .c/.h/.S
# that were compiled into the kernel we just built. It can be used to
# help grepping the source.

#*
cd ~/bigsrc/kernel-source-2.6.8/
etags $(sort .files.chS.used)

#*





#####
#
# make-kpkg and timestamps for grepping
# 2004dec20
#
#####

# «make-kpkg-timestamps-k26»  (to ".make-kpkg-timestamps-k26")
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--config target")
# (find-man "1 make-kpkg" "--targets")
# (find-man "1 make-kpkg" "\nTARGETS\n")
# (find-man "1 make-kpkg" "\nTARGETS\n" "\n       configure\n")
# (find-man "1 make-kpkg" "\nTARGETS\n" "\n       build ")

# (find-sh "make-kpkg --targets")
# (find-fline "/usr/share/kernel-package/rules")
# (find-fline "/usr/bin/make-kpkg")
#*
# Check in which subdirectory the tarfile will uncompress
tar -tvjf /usr/src/kernel-source-2.6.8.tar.bz2 | head -n 5

#*
# Uncompress
rm -Rv ~/bigsrc/kernel-source-2.6.8/
tar -C ~/bigsrc/ \
  -xvjf /usr/src/kernel-source-2.6.8.tar.bz2
cd     ~/bigsrc/kernel-source-2.6.8/

#*
# Produce something corresponding to the
# "Documentation/Configure.help" file of linux-2.4
# «k26.Configure.help»  (to ".k26.Configure.help")

# (find-k26file ".Configure.help")
# (find-k26confvar "CONFIG_BLK_DEV_LOOP")

cd ~/bigsrc/kernel-source-2.6.8/
find * -name '*Kconfig' > .files.Kconfig
mycat $(< .files.Kconfig) \
  | awk 'NF==2 && $1=="config" { print "CONFIG_" $2 }
         1 { print }
        ' \
  > .Configure.help

#*
# (find-fline "~/LINUX/2.6.28-persephone1.conf")
#
cd ~/bigsrc/kernel-source-2.6.8/
make-kpkg clean		|& tee omkc
cp ~/LINUX/2.6.28-persephone1.conf .config

INITRD_OK=1 \
make-kpkg \
  --revision=persephone1 --append-to-version -persephone1 \
  --rootcmd fakeroot \
  --initrd \
  configure		|& tee omkc

sleep 1
touch .stamp-configure
sleep 1

INITRD_OK=1 \
make-kpkg \
  --revision=persephone1 --append-to-version -persephone1 \
  --rootcmd fakeroot \
  --initrd  	     \
  kernel_image	|& tee omkki

find * -name '*.[chS]' -and      -anewer .stamp-configure > .files.chS.used
find * -name '*.[chS]' -and -not -anewer .stamp-configure > .files.chS.unused

# Now the file ".files.chS.used" holds a listing of all the .c/.h/.S
# files that were read between the end of the configuration step and
# the end of the building of the deb.
#
# In other words: .files.chS.used holds a listing of all the .c/.h/.S
# that were compiled into the kernel we just built. It can be used to
# help grepping the source.

#*


# (find-k26file "")
# (find-fline "/usr/share/kernel-package/rules" "stamp-configure:")
# (find-fline "/usr/share/kernel-package/rules" "stamp-build:")
#



#*
cd ~/bigsrc/kernel-source-2.6.8/
cp -iv .config ~/LINUX/2.6.28-persephone1.conf

#*

# kernel_image


#*
cd ~/bigsrc/kernel-source-2.6.8/
make-kpkg kernel_image					|& tee omkki
make-kpkg --rootcmd fakeroot kernel_image		|& tee omkfrki
INITRD_OK=yes \
  make-kpkg --rootcmd fakeroot --initrd kernel_image	|& tee omkfriki

#*
# (find-k26file "omkki")
# (find-k26file "omkfrki")
# (find-k26file "omkfriki")
# (find-man "1 make-kpkg")
# (find-man "1 make-kpkg" "--mkimage")
# (find-man "8 mkinitrd")
make-kpkg --revision=custom.1.0 kernel_image	|& tee omkki

       


apti kernel-source-2.6.8

apparently:
  configure
  build
  and then the modules






#####
#
# Finding the code for a device (vcsa)
# 2001aug16
#
#####

# «vcsa»  (to ".vcsa")
# (find-k22file "Documentation/devices.txt")
# (find-k22file "include/linux/major.h")
# (find-k22file "drivers/char/vc_screen.c" "VCS_MAJOR")
# (find-k22file "drivers/char/vc_screen.c" "= (char) video_num_lines")
# (find-k22file "include/asm-i386/uaccess.h" "#define put_user(x,ptr)")
# (find-k22file "drivers/char/vc_screen.c" "4 bytes lines,columns,x,y")

laf /dev/vcs1 /dev/vcsa1

 (upper left is 0,0)

# (find-k22tag "vt_ioctl")
# (find-k22tag "tty_driver")

# (find-k22file "arch/i386/kernel/entry.S" "ENTRY(sys_call_table)")
# (find-k22file "arch/i386/kernel/entry.S" ".long SYMBOL_NAME(sys_ioctl)")
# (find-k22file "fs/ioctl.c" "asmlinkage int sys_ioctl")

# (find-k22configoption "CONFIG_DEBUG_INFO")






#####
#
# linux on post-sarge debians (with backports)
# 2006oct15
#
#####

# «kernel-backports»  (to ".kernel-backports")

# 2013:
# http://backports.debian.org/
# http://backports.debian.org/debian-backports/pool/main/l/linux/

# (find-debpkg-links "linux-2.6")
# http://packages.debian.org/testing/admin/linux-image-2.6-686
# http://packages.debian.org/testing/admin/linux-image-2.6.17-2-686
# http://packages.debian.org/testing/source/linux-latest-2.6

# http://ftp.debian.org/debian/pool/main/l/linux-2.6/
# http://backports.org/debian/pool/main/l/linux-2.6/
# http://backports.org/debian/pool/main/l/linux-2.6/linux-headers-2.6.17-2-686_2.6.17-9~bpo.1_i386.deb
# http://backports.org/debian/pool/main/l/linux-2.6/linux-image-2.6.17-2-686_2.6.17-9~bpo.1_i386.deb
# http://backports.org/debian/pool/main/l/linux-2.6/linux-manual-2.6.17_2.6.17-9~bpo.1_all.deb
# http://backports.org/debian/pool/main/l/linux-2.6/linux-tree-2.6.17_2.6.17-9~bpo.1_all.deb

sudo dpkg -i \
  $S/http/backports.org/debian/pool/main/l/linux-2.6/linux-image-2.6.17-2-686_2.6.17-9~bpo.1_i386.deb

# http://www.backports.org/dokuwiki/doku.php?id=instructions
# (find-fline "/etc/apt/sources.list")
# (find-fline "$ASROOT/etc/apt/sources.list")
#   deb http://backports.org/debian sarge-backports main

apti linux-image-2.6.17
apti linux-manual-2.6.17

# (find-vldish "sort linux-manual-2.6.17.list")




#####
#
# linux on etch
# 2008jan29
#
#####

# «linux-on-etch»  (to ".linux-on-etch")
# (find-status   "linux-source-2.6.18")
# (find-vldifile "linux-source-2.6.18.list")
# (find-udfile   "linux-source-2.6.18/")
# (find-sh "tar -tvjf /usr/src/linux-source-2.6.18.tar.bz2 | head -n 4")
#*
rm -Rf ~/bigsrc/linux-source-2.6.18/
tar -C ~/bigsrc/ -xjf /usr/src/linux-source-2.6.18.tar.bz2
cd     ~/bigsrc/linux-source-2.6.18/

#*
# (code-c-d "linux" "~/bigsrc/linux-source-2.6.18/")
# (find-linuxfile "")


# (find-status   "kernel-package")
# (find-vldifile "kernel-package.list")
# (find-udfile   "kernel-package/")

# (find-man "1 make-kpkg")
# (find-man "5 kernel-img.conf")
# (find-man "5 kernel-package")
# (find-man "5 kernel-pkg.conf")
# (find-man "8 kernel-packageconfig")

# (find-fline "/usr/share/kernel-package/docs/")
# (find-fline "/usr/share/kernel-package/changelog")
# (find-fline "/usr/share/kernel-package/examples/")
# (find-fline "/usr/share/kernel-package/Control.bin86")
# (find-udfile "kernel-package/NEWS.Debian.gz")
# (find-udfile "kernel-package/Rationale.gz")
# (find-udfile "kernel-package/changelog.gz")
# (find-udfile "kernel-package/copyright")
# (find-udfile "kernel-package/README.gz")
# (find-udfile "kernel-package/HOWTO-Linux-2.6-Woody.gz")





#####
#
# linux on lenny (with ubuntu patches)
# 2010aug15
#
#####

# «linux-on-lenny»  (to ".linux-on-lenny")

# (find-status   "linux")
# (find-vldifile "linux.list")
# (find-udfile   "linux/")
# (find-status   "linux-image")
# (find-vldifile "linux-image.list")
# (find-udfile   "linux-image/")
# (find-zsh "availabledebs | sort | grep linux")
# (find-zsh "availabledebs | sort | grep source")
# (find-zsh "availabledebs | sort | grep kernel")
# (find-zsh "availabledebs | sort | grep kpkg")
# (find-esgrep "grep -nH -e kpkg *.e")

# (find-status   "linux-image-2.6-686")
# (find-vldifile "linux-image-2.6-686.list")
# (find-udfile   "linux-image-2.6-686/")
# (find-vldifile "" "linux-image-2.6-686.list")

# (find-status   "linux-headers-2.6-686")
# (find-vldifile "linux-headers-2.6-686.list")
# (find-udfile   "linux-headers-2.6-686/")

apti debian-faq
apti kernel-package linux-source

# (find-status   "debian-faq")
# (find-vldifile "debian-faq.list")
# (find-udfile   "debian-faq/")
# (find-debfaqfile "debian-faq.txt.gz")
# (find-debfaqfile "debian-faq.txt.gz" "10. Debian and the kernel")
# (find-status   "kernel-package")
# (find-vldifile "kernel-package.list")
# (find-udfile   "kernel-package/")
# (find-udfile   "kernel-package/README.gz")
# (find-status   "linux-source")
# (find-vldifile "linux-source.list")
# (find-udfile   "linux-source/")
# (find-status   "linux-source-2.6.32")
# (find-vldifile "linux-source-2.6.32.list")
# (find-udfile   "linux-source-2.6.32/")
# (find-sh "make-kpkg --help")
# (find-sh "make-kpkg --targets")
# (find-man "1 make-kpkg")

rm -R ~/bigsrc/linux/
mkdir ~/bigsrc/linux/
cd    ~/bigsrc/linux/
# tar -C ~/bigsrc/linux/ -xvjf /usr/src/linux-source-2.6.32.tar.bz2
# tar -C ~/bigsrc/linux/  -xjf /usr/src/linux-source-2.6.32.tar.bz2
  tar -C ~/bigsrc/linux/  -xjf /sda5/usr/src/linux-source-2.6.32.tar.bz2
cd    ~/bigsrc/linux/linux-source-2.6.32/
# sudo make-kpkg clean
cp -v /sda5/boot/config-2.6.32-24-generic .config
  make-kpkg --rootcmd fakeroot --initrd --append-to-version=-custom kernel_image kernel_headers |& tee om

cd    ~/bigsrc/linux/
sudo dpkg -i ~/bigsrc/linux/linux-image-2.6.32.15+drm33.5-custom_2.6.32.15+drm33.5-custom-10.00.Custom_i386.deb
# (find-zsh "installeddebs | sort | grep linux-image")

# «linux-on-lenny-grub-gwen»  (to ".linux-on-lenny-grub-gwen")
# (find-fline      "/boot/grub/")
# (find-fline      "/boot/grub/menu.lst")
# (find-fline      "/boot/grub/menu.lst" "2.6.32.15")
# (find-fline      "/boot/grub/default")
# (find-fline "/sda5/boot/grub/")
# (find-fline "/sda5/boot/grub/grub.cfg")
# (find-sh0 " sudo chmod 666 /sda5/boot/grub/grub.cfg")

### Edrx, 2010aug17
# (find-es "kernel" "linux-on-lenny-grub-gwen")
# (find-fline "/etc/fstab" "/dev/sda1")
#
menuentry "Debian GNU/Linux, kernel 2.6.32.15+drm33.5-custom (on /dev/sda3)" {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 8e3a5ebc-1bd7-4ca7-b780-445e245b0d9b
	linux /vmlinuz-2.6.32.15+drm33.5-custom root=/dev/sda3 ro quiet
	initrd /initrd.img-2.6.32.15+drm33.5-custom
}
menuentry "Debian GNU/Linux, kernel 2.6.32.15+drm33.5-custom (single-user mode) (on /dev/sda3)" {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 8e3a5ebc-1bd7-4ca7-b780-445e245b0d9b
	linux /vmlinuz-2.6.32.15+drm33.5-custom root=/dev/sda3 ro single
	initrd /initrd.img-2.6.32.15+drm33.5-custom
}
###





#####
#
# Squeeze (Debian 6.0)
# 2011nov24
#
#####

# «squeeze»  (to ".squeeze")
# (find-zsh "installeddebs | sort")
# (find-zsh "installeddebs | sort | grep linux")
# (find-zsh "availabledebs | sort | grep linux")
# (find-status   "linux-image-2.6.38-bpo.2-686")
# (find-vldifile "linux-image-2.6.38-bpo.2-686.list")
# (find-udfile   "linux-image-2.6.38-bpo.2-686/")
# (find-vldifile "" "linux-image-2.6.38-bpo.2-686.list")
# (find-fline "/etc/apt/sources.list")
# http://backports.debian.org/debian-backports/
# http://backports.debian.org/debian-backports/pool/main/l/linux-2.6/
# (find-status   "firmware-linux-free")
# (find-vldifile "firmware-linux-free.list")
# (find-udfile   "firmware-linux-free/")
# (find-status   "firmware-realtek")
# (find-vldifile "firmware-realtek.list")
# (find-udfile   "firmware-realtek/")

# (find-available "linux-patch-debian-2.6.32")




#####
#
# Update-grub
# 2011dec15
#
#####

# «update-grub»  (to ".update-grub")
# (find-es "grub" "update-grub")
# (find-man "update-grub")





#####
#
# Realtek RTL8188CE on Squeeze (for Felipe Lugão)
# 2011nov25
#
#####

# «lugao»  (to ".lugao")
# Basic preparations on Lugao's machine:
#   (find-es "sudo" "sudo")
#   apt-get install openssh-server
#   ifconfig
#   adduser edrx
# On my machine:
#   (find-newhost-links "lugao" "192.168.0.187" "LU")
#   (find-lugaofile "")
#   (find-es "emacs" "multi-hop")

;; (setenv "LU" "/scp:edrx@lugao:")
;; (setenv "LR" "/ssh:edrx@lugao:")
;; (setenv "LR" "/ssh:root@lugao:")
;; (setenv "VR" "/ssh:root@lugao:")
(code-c-d "lugao" "/scp:edrx@lugao:/")
(code-c-d "lugao" "/ssh:edrx@lugao:/")
(code-c-d "lugaor" "/ssh:root@lugao:/")
;; (find-lugaofile "")
;; (find-lugaorfile "")
(defun eepitch-lugao () (interactive) (eepitch-comint "lugao" "ssh edrx@lugao"))

# (find-fline     "/etc/apt/sources.list.d/")
# (find-lugaorfile "etc/apt/sources.list")
# (find-lugaorfile "etc/apt/sources.list.d/")


* (eepitch-lugao)
* (eepitch-kill)
* (eepitch-lugao)
sudo bash
apt-get update
apt-get install eev-puro

ssh root@localhost
ssh root@lugao
yes
exit

# lspci
# 01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter (rev 01)
# http://wiki.debian.org/rtl818x
# http://backports-master.debian.org/Instructions/
# http://backports.debian.org/debian-backports/pool/main/l/linux-2.6/
# http://backports.debian.org/debian-backports/pool/main/l/linux-2.6/linux-image-2.6.38-bpo.2-686_2.6.38-5~bpo60+1_i386.deb
# http://packages.debian.org/firmware-realtek
# http://ftp.de.debian.org/debian/pool/non-free/f/firmware-nonfree/
# http://ftp.de.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-realtek_0.28+squeeze1_all.deb
# http://ftp.de.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-realtek_0.34_all.deb
# (find-fline "$LU/tmp/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

* (eepitch-lugao)
* (eepitch-kill)
* (eepitch-lugao)
sudo bash
cd /etc/apt/
chmod 666 sources.list
# (find-fline    "/etc/apt/sources.list")
# (find-fline "$VR/etc/apt/sources.list")
# (find-fline    "/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-fline "$VR/etc/apt/apt.conf.d/90apt-proxy.conf")
# (find-fline "$VR/etc/apt/apt.conf.d/90apt-proxy.conf")

apt-get update
apt-get install eev-puro
y
y

# (find-aptcacherfile "packages/")


* (eepitch-lugao)
* (eepitch-kill)
* (eepitch-lugao)
sudo bash
apt-get update

cd /tmp/
ls   -l linux-image-2.6.38*
dpkg -i linux-image-2.6.38*
ls   -l firmware-realtek*
dpkg -i firmware-realtek*
apt-get -t squeeze-backports install linux-base
apt-get -t squeeze-backports install linux-image-2.6.38-bpo.2-686
apt-get -t squeeze-backports install firmware-realtek
apt-get install
shutdown -r now





mkdir /tmp/debiandvd/
sudo mount -o loop,ro /sda7/torrents/debian-6.0.3-i386-DVD-1.iso /tmp/debiandvd/
# (find-fline "/tmp/debiandvd/")
# (find-fline "/tmp/debiandvd/md5sum.txt")
# (find-fline "/tmp/debiandvd/pool/main/l/linux-2.6/")

# (find-status   "firmware-realtek")
# (find-vldifile "firmware-realtek.list")
# (find-udfile   "firmware-realtek/")











# (code-c-d "linuxsrc" "~/bigsrc/linux/linux-source-2.6.32/")
# (find-linuxsrcfile "")
# (find-linuxsrcfile "ubuntu/ndiswrapper/")
# (find-linuxsrcsh "find ubuntu/")

http://newbiedoc.sourceforge.net/system/kernel-pkg.html



# (find-lugaofile "")
# (find-lugaofile "home/edrx/")

# (find-udfile "linux-source-2.6.18/README.Debian")
# (find-udfile "linux-source-2.6.18/copyright")
# (find-udfile "linux-source-2.6.18/changelog.Debian.gz")

# (find-available "linux-patch-debian-2.6.18")
# (find-status   "linux-patch-debian-2.6.18")
# (find-vldifile "linux-patch-debian-2.6.18.list")
# (find-udfile   "linux-patch-debian-2.6.18/")






#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: