Skip to contentSkip to conversation

create kernel symlinks in /boot

PATCH In review Paul Larson 3 participants 5 messages Jan 20, 2005 – Jan 21, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 create kernel symlinks in /boot

Minor patch, but useful to me at least. I really find it convenient to have a symbolic link to the latest xen kernel I've built/installed for testing purposes. When the kernel went from 2.6.9 -> 2.6.10 recently, I hit all kind of strange problems until I realized that I was booting the new xen stuff with an old kernel.

This might also come in handy if someone were inclined to make install.sh smarter so that it modifies grub. The patch was made against xen-2.0-testing but should apply ok to all the trees.

Signature · 29 lines
Thanks,
Paul Larson
[email protected]
http://www.linuxtestproject.org

diff -Nru a/buildconfigs/mk.linux-2.6-xen0 b/buildconfigs/mk.linux-2.6-xen0
--- a/buildconfigs/mk.linux-2.6-xen0	2005-01-20 15:48:20 -06:00
+++ b/buildconfigs/mk.linux-2.6-xen0	2005-01-20 15:48:20 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln -s /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)
diff -Nru a/buildconfigs/mk.linux-2.6-xenU b/buildconfigs/mk.linux-2.6-xenU
--- a/buildconfigs/mk.linux-2.6-xenU	2005-01-20 15:48:20 -06:00
+++ b/buildconfigs/mk.linux-2.6-xenU	2005-01-20 15:48:20 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln -s /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)
#1 lore raw
Quoted 41 lines · Paul Larson

Minor patch, but useful to me at least. I really find it convenient to have a symbolic link to the latest xen kernel I've built/installed for testing purposes. When the kernel went from 2.6.9 -> 2.6.10 recently, I hit all kind of strange problems until I realized that I was booting the new xen stuff with an old kernel.

This might also come in handy if someone were inclined to make install.sh smarter so that it modifies grub. The patch was made against xen-2.0-testing but should apply ok to all the trees.

Signature · 6 lines
Thanks,
Paul Larson
[email protected]
http://www.linuxtestproject.org

diff -Nru a/buildconfigs/mk.linux-2.6-xen0 b/buildconfigs/mk.linux-2.6-xen0
buildconfigs/mk.linux-2.6-xen0 +2 -0
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) 
 modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln -s /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)

rm -rf $(LINUX_DIR)
diff -Nru a/buildconfigs/mk.linux-2.6-xenU b/buildconfigs/mk.linux-2.6-xenU

buildconfigs/mk.linux-2.6-xenU +2 -0
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) 
 modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln -s /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
Quoted 2 lines

rm -rf $(LINUX_DIR)

I think this won't work if /boot is mounted in a separate partition. AFAIK, GRUB isn't able to follow symlinks across different filesystems.

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#2 lore raw

PATCH 1/1 (revised slightly) create kernel symlinks in /boot

Quoted 2 lines · Felipe Alfaro Solana

I think this won't work if /boot is mounted in a separate partition. AFAIK, GRUB isn't able to follow symlinks across different filesystems.

That probably true, but a hard link should work ok right? The cp -dR in make install-kernels should ensure that the link is preserved, and cp -fdr likewise in install.sh.

Signature · 33 lines
Thanks,
Paul Larson
[email protected]
http://www.linuxtestproject.org

diff -Nru a/buildconfigs/mk.linux-2.6-xen0
b/buildconfigs/mk.linux-2.6-xen0
--- a/buildconfigs/mk.linux-2.6-xen0	2005-01-21 10:19:56 -06:00
+++ b/buildconfigs/mk.linux-2.6-xen0	2005-01-21 10:19:56 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)
diff -Nru a/buildconfigs/mk.linux-2.6-xenU
b/buildconfigs/mk.linux-2.6-xenU
--- a/buildconfigs/mk.linux-2.6-xenU	2005-01-21 10:19:56 -06:00
+++ b/buildconfigs/mk.linux-2.6-xenU	2005-01-21 10:19:56 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)
#3 lore raw

Re: [PATCH] (revised slightly) create kernel symlinks in /boot

Quoted 19 lines · Paul Larson
Quoted 2 lines · Felipe Alfaro Solana

I think this won't work if /boot is mounted in a separate partition. AFAIK, GRUB isn't able to follow symlinks across different filesystems.

That probably true, but a hard link should work ok right? The cp -dR in make install-kernels should ensure that the link is preserved, and cp -fdr likewise in install.sh.

--
Thanks,
Paul Larson
[email protected]
http://www.linuxtestproject.org

diff -Nru a/buildconfigs/mk.linux-2.6-xen0
b/buildconfigs/mk.linux-2.6-xen0

buildconfigs/mk.linux-2.6-xen0 line 23

Quoted 6 lines
buildconfigs/mk.linux-2.6-xen0 +2 -0
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
 modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)

bzzt. What if /boot and $(INSTALL_DIR)/boot are different partitions?

Quoted 16 lines
buildconfigs/mk.linux-2.6-xen0 +0 -0
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)

diff -Nru a/buildconfigs/mk.linux-2.6-xenU
b/buildconfigs/mk.linux-2.6-xenU

buildconfigs/mk.linux-2.6-xenU +2 -0
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
 modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln /boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
Quoted 3 lines

rm -rf $(LINUX_DIR)

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#4 lore raw

Re: [PATCH] (revised slightly) create kernel symlinks in /boot

Quoted 3 lines · Adam Heath

On Fri, 21 Jan 2005, Paul Larson wrote:

bzzt. What if /boot and $(INSTALL_DIR)/boot are different partitions?

Oops, forgot to change that, fixed. Needless to say, most of my boxes have a pretty flat filesystem :)

Signature · 33 lines
Thanks,
Paul Larson
[email protected]
http://www.linuxtestproject.org

diff -Nru a/buildconfigs/mk.linux-2.6-xen0
b/buildconfigs/mk.linux-2.6-xen0
--- a/buildconfigs/mk.linux-2.6-xen0	2005-01-21 10:54:17 -06:00
+++ b/buildconfigs/mk.linux-2.6-xen0	2005-01-21 10:54:17 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln $(INSTALL_DIR)/boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)
diff -Nru a/buildconfigs/mk.linux-2.6-xenU
b/buildconfigs/mk.linux-2.6-xenU
--- a/buildconfigs/mk.linux-2.6-xenU	2005-01-21 10:54:17 -06:00
+++ b/buildconfigs/mk.linux-2.6-xenU	2005-01-21 10:54:17 -06:00
@@ -18,6 +18,8 @@
 	    $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR)
modules_install ; \
 	fi
 	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+	ln $(INSTALL_DIR)/boot/vmlinuz-$(FULLVERSION) \
+	    $(INSTALL_DIR)/boot/vmlinuz-$(EXTRAVERSION)
 
 $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER)
 	rm -rf $(LINUX_DIR)