View previous topic :: View next topic |
Author |
Message |
Leachim n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/1112722312480a85326f2fc.jpg)
Joined: 25 Feb 2007 Posts: 66
|
Posted: Thu May 29, 2008 11:27 pm Post subject: Kernel compilation on remote server |
|
|
Hi all,
I have one problem. I need to compile my new kernel on remote server. I can't go to the housing center, so I need to compile 100% working kernel. If it will not boot at startup, it can be a big problem.
Is any way, how to compile kernel, reboot the machine and when kernel will not works, it will auto reboot the pc and use the old kernel?
I hope that you understand what I need.
Ty for reply |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
BradN Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/StarCraft/starcraft_protoss_observer.gif)
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Thu May 29, 2008 11:45 pm Post subject: |
|
|
Look into the following things:
program "grub-set-default" used within linux (after /boot is mounted) to set the default entry.
default command in grub.conf
fallback command in grub.conf
savedefault command in grub.conf
Use it like:
grub-set-default 0
to set the first entry to be booted
Then: make sure the "default" line in your grub.conf reads as "default saved" instead of using a number. Add a "fallback 1" line so that the backup kernel is loaded if the first kernel can't be loaded.
Next, in your first boot entry (the test kernel), put "savedefault 1" at the end of that entry such that it boots using the old kernel next time (make sure your 2nd entry is the old kernel)
Now, here's the problem. All this work ensures that the 2nd boot will start the old kernel, however we have no way of making the system reboot if it locks up or fails to start the network. You may wish to set a cron job or similar to automatically reboot the machine assuming the kernel comes up. But, if the machine locks up or something, it will need to be manually rebooted (although no intervention will be needed at the menu, which is good for a headless server).
If the kernel panics, there is a way to make it reboot automatically - add the kernel parameter "panic=1" to make it reboot after 1 second if a kernel panic occurs.
If your server has a management module that can automatically reboot the system after some delay, you should use it.
Hopefully the upgrade goes without problems - check the output of "uname -a" to find what kernel you're running. If it works fine, you'll want to alter your grub.conf to set the default to 0 and remove the savedefault line (leaving the fallback at 1 is smart in case the file becomes corrupted).
Good luck
Last edited by BradN on Fri May 30, 2008 4:50 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
electronvolt Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 16 May 2007 Posts: 83
|
Posted: Fri May 30, 2008 4:03 am Post subject: |
|
|
Hi,
BradN, one slight mistake in your 'mini-HOWTO'......the command to save the default boot option in grub.conf is savedefault not setdefault
regards |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
BradN Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/gallery/StarCraft/starcraft_protoss_observer.gif)
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Fri May 30, 2008 4:48 am Post subject: |
|
|
Oops, right you are... I'll edit my previous post ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|