grub single boot and kernel panic reboot

ZZ from :http://www.linux-noob.com/forums/index.php?/topic/2928-grub-single-boot-and-kernel-panic-reboot/

 

1.) Booting once-only - (same as lilo -R)

In reference to http://www.gnu.org/s…g-once_002donly

in grub.conf, add the following line to the beginning.

default saved

If for example your grub.conf looks like the one i have below. This boots into the 2.6.20-1.2944 by default.

default=0 
timeout=5 
splashimage=(hd0,0)/grub/splash.xpm.gz 
hiddenmenu 
title Fedora Core (2.6.20-1.2944.fc6) 
        root (hd0,0) 
        kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ acpi=off  
        initrd /initrd-2.6.20-1.2944.fc6.img 
title Fedora Core (2.6.20-FluKex.com) 
        root (hd0,0) 
        kernel /vmlinuz-2.6.20-FluKex.com ro root=LABEL=/ acpi=off  
        initrd /initrd-2.6.20-FluKex.com.img

If you want to have it so that 2.6.20-FluKex.com boots on next boot, run the following command from the console before rebooting.
echo “savedefault –default=1 –once” | grub –batch
then
reboot

Now, if you have a kernel that panics and need it to reboot if it panics. change your config and add the panic=# (# being seconds before auto reboot) to the kernel line. Example file below

default=0 
timeout=5 
splashimage=(hd0,0)/grub/splash.xpm.gz 
hiddenmenu 
title Fedora Core (2.6.20-1.2944.fc6) 
        root (hd0,0) 
        kernel /vmlinuz-2.6.20-1.2944.fc6 ro root=LABEL=/ acpi=off panic=5 
        initrd /initrd-2.6.20-1.2944.fc6.img 
title Fedora Core (2.6.20-FluKex.com) 
        root (hd0,0) 
        kernel /vmlinuz-2.6.20-FluKex.com ro root=LABEL=/ acpi=off panic=5 
        initrd /initrd-2.6.20-FluKex.com.img

so the order of operations on this are as follows.

1.) Add new kernel to grub.conf
2.) set default=# in grub.conf to the failsafe kernel (the one you want it to try if the other fails)
3.) run the following:
echo “savedefault –default=1 –once” | grub –batch
4.) reboot


nginx configure for ubuntu

./configure –prefix=/usr –conf-path=/etc/nginx/nginx.conf \
–error-log-path=/var/log/nginx/error.log –pid-path=/var/run/nginx.pid \
–lock-path=/var/lock/nginx.lock   –http-log-path=/var/log/nginx/access.log \
–http-client-body-temp-path=/var/lib/nginx/body –http-proxy-temp-path=/var/lib/nginx/proxy \
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi –with-http_stub_status_module –with-pcre \
–with-http_flv_module –with-http_ssl_module –with-http_gzip_static_module \
–with-http_secure_link_module –with-http_dav_module \
–with-http_realip_module


centos/redhat ppp inital file

[root@localhost network-scripts]# cat ifcfg-ppp0
USERCTL=yes
PEERDNS=yes
TYPE=xDSL
DEVICE=ppp0
BOOTPROTO=dialup
ONBOOT=yes
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
PERSIST=no
SYNCHRONOUS=no
DEFROUTE=yes
USER=200000749076
PROVIDER=pppconfig
NAME=pppconfig
ETH=eth0


Get china IP

wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
grep CN delegated-apnic-latest|grep ipv4 > ipv4
cat ipv4 |awk -F”|” ‘{print $4″ “$5}’ >ipv

t.php
<?php

$c=file_get_contents(”ipv”);
$lines=explode(”\n”,$c);
foreach($lines as $line){
        $line=trim($line);
        $lp=explode(” “,$line);
        echo $lp[0].”/”.countmask($lp[1]).”\n”;
}
function countmask($i){
        $p=0;
        while($i>1){
                $i=$i/2;
                $p++;
        }
        return 32-$p;
}
?>

php t.php >china_ip_addr.txt


Installing GRUB on a Hard Disk Image File

zz: http://www.omninerd.com/articles/Installing_GRUB_on_a_Hard_Disk_Image_File


Kdevelop project was broken when going to 8.10

zz:https://bugs.launchpad.net/ubuntu/+source/kdevelop/+bug/253286


Redhat 7.3 binary package site

http://packages.sw.be


Qemu 0.10 version compile from source

how to avoid with this error ” KVM support       no - (#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS) ”

1. Configure Kernel

 

cd /usr/src/linux-2.6.x

make menuconfig

CONFIG_PARAVIRT_GUEST=y
# CONFIG_XEN is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y

 

CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y

 

then compile kernel,and use the new kernel

2.download kvm source from kvm homepage.

./configure –prefix=/usr  –disable-sdl –disable-gfx-check

make

make install

3.download qemu 0.10 from homepage

./configure –prefix=/usr –enable-system –disable-gfx-check –enable-linux-user  –disable-sdl –kerneldir=/usr/local/src/kvm-84/kernel/

make

make install

then work


ubuntu china apt server

http://wiki.ubuntu.org.cn/index.php?title=Template:8.10source&variant=zh-cn

that’s great


centos Yum update repositories

http://centos.ustc.edu.cn/centos/

 

 
# URL: http://www.centos.org

### CentOS-4 APT older rpms repositories
#rpm http://centos.ustc.edu.cn centos/4/apt/i386 os addons updates extras
#rpm  http://centos.ustc.edu.cn centos/4/apt/i386  contrib centosplus cfgfs

### CentOS-4 APT repomd repositories
repomd http://centos.ustc.edu.cn centos/4/os/i386
repomd http://centos.ustc.edu.cn centos/4/addons/i386
repomd http://centos.ustc.edu.cn centos/4/extras/i386
repomd http://centos.ustc.edu.cn centos/4/updates/i386
repomd http://centos.ustc.edu.cn centos/4/fasttrack/i386
#repomd http://centos.ustc.edu.cn centos/4/centosplus/i386
#repomd http://centos.ustc.edu.cn centos/4/contrib/i386
#repomd http://centos.ustc.edu.cn centos/4/csgfs/i386



Next Page »