CVS: moonbase/kernel/linux/2.4.22 BUILD, NONE, 1.1 CONFIGURE, NONE, 1.1 DEPENDS, NONE, 1.1 DETAILS, NONE, 1.1 POST_INSTALL, NONE, 1.1 PRE_BUILD, NONE, 1.1

Niki Gulbrand niki at lunar-linux.org
Tue Nov 18 17:38:43 GMT 2003


Update of /var/cvs/lunar/moonbase/kernel/linux/2.4.22
In directory dbguin.lunar-linux.org:/tmp/cvs-serv1629/2.4.22

Added Files:
	BUILD CONFIGURE DEPENDS DETAILS POST_INSTALL PRE_BUILD 
Log Message:
Moved the 2.4.22 kernel to new dir in moonbase, and merged in the kernel
backup changes.


--- NEW FILE: BUILD ---
cd  /usr/src/linux

#set the arch once
XARCH="x`arch`"

#Select the prefered linux config method and lets things fall back
while
  case  $CONFIG_KERNEL in
      y|Y)  case $CONFIG_METHOD in
              xconfig ) 
	      		   if [ $DISPLAY ]
			   then
			       make xconfig || make menuconfig || make config
			   else
			       make menuconfig || make config
			   fi ;;
	      menuconfig ) make menuconfig || make config ;;
	      config )     make config ;;
	    esac
            if  query  "Repeat $CONFIG_METHOD?"  n
            then  CONFIG_KERNEL=y
            else  CONFIG_KERNEL=n
            fi     ;;
        *)  false  ;;
    esac
do
  true
done			

backup_modules()  {
  if    [  -d  /lib/modules/$VERSION      ];  then
    rm   -rf   /lib/modules/$VERSION.old
    mv         /lib/modules/$VERSION      \
               /lib/modules/$VERSION.old
  fi
}

(

  yes  n  |  make  oldconfig
  cp .config $CONFIG_CACHE
  make dep                                   &&

  case $XARCH in
     xi386 | xi486 | xi586 | xi686 ) make bzImage;;
    xalpha ) make boot;;
      xppc ) make vmlinux;;
    xsparc ) echo "Sorry no Lunar port yet want to try its easy :-P the penguin team will help.";;
      xarm ) echo "Sorry no Lunar port yet want to try its easy :-P the penguin team will help.";;
     xm68k ) echo "Sorry no Lunar port yet want to try its easy :-P the penguin team will help.";;
     xmips ) echo "Sorry no Lunar port yet want to try its easy :-P the penguin team will help.";;
          *) echo "Opps. You, yea you, yap at hardkrash for forgetting to put in your arch in this module. :-P";;
  esac					     &&
  
  if grep -q "CONFIG_MODULES=y" .config
  then
    make modules
  fi                                         &&
  
  prepare_install                            &&
  
  if grep -q "CONFIG_MODULES=y" .config
  then
    backup_modules                           &&
    make modules_install
  fi                                         &&
  
  case $XARCH in
     xi386 | xi486 | xi586 | xi686 )
             cp arch/i386/boot/bzImage   /boot/vmlinubz-$VERSION;;
	
    xalpha )
             cp arch/alpha/boot/vmlinux.gz /boot/vmlinux-$VERSION.gz;;

      xppc ) 
             cp vmlinux /boot/vmlinux-$VERSION;;
      xarm ) echo "Oh crud they forgot to tell me what should I do for arm.";;
     xm68k ) echo "Oh crud they forgot to tell me what should I do for m68k.";;
     xmips ) echo "Oh crud they forgot to tell me what should I do for mips.";;
         * ) echo "Oh crud they forgot to tell me what to do for you. ;~-(";;
  esac
) > $C_FIFO 2>&1

--- NEW FILE: CONFIGURE ---
XARCH="x`arch`"

if  !  grep  -q  "BOOT_LOADER"  $MODULE_CONFIG;  then

	case $XARCH in
	     xi386|xi486|xi586|xi686) 
	      message  "The Linux Kernel requires a boot loader"
	      message  "Choose either GRUB or LILO"
	      if  query  "To use lilo choose yes, to use grub choose no"  y
		then  BOOT_LOADER=lilo
	      else  BOOT_LOADER=grub
	      fi;;
	  
	    xalpha) BOOT_LOADER=aboot;;
	      xppc)  BOOT_LOADER=yaboot;;
	    xsparc) echo ";~( I am not setup for Sparcs. Can you electrify me?.";; 
	      xarm) echo ";~( I am not setup for arms. Can you give me limbs?";;
	     xm68k) echo ";~( I am not setup for 68k. Can you configure me?";;
	     xmips) echo ";~( I am not setup for mips. Can you configure me?";;
	  esac
	    
	  echo  "BOOT_LOADER=$BOOT_LOADER"  >>  $MODULE_CONFIG

fi

CONFIG_GRUB="n"
CONFIG_LILO="n"
CONFIG_ABOOT="n"
CONFIG_YABOOT="n"

if    grep  -q  "BOOT_LOADER=grub"  $MODULE_CONFIG  &&
      query  "Configure grub?"  n
then  CONFIG_GRUB=y
fi

if    grep  -q  "BOOT_LOADER=lilo"  $MODULE_CONFIG; then
      if ! grep -q "CONFIG_LILO=[yn]" $MODULE_CONFIG; then
	      if query  "Automaticaly configure and run lilo?"  n; 
	      then
		CONFIG_LILO=y
	      fi
      fi	    
      
      if query  "Hand edit /etc/lilo.conf?" n; 
      then
        EDIT_LILO=y
      else
        EDIT_LILO=n
      fi
fi

if    grep  -q  "BOOT_LOADER=aboot" $MODULE_CONFIG  &&
      query  "Configure aboot?" n
then  CONFIG_ABOOT=y
fi

if    grep  -q  "BOOT_LOADER=yaboot" $MODULE_CONFIG; then
	if ! grep -q "CONFIG_YABOOT=[yn]" $MODULE_CONFIG; then
		if query "Automatically configure and run yaboot?" n;
		then
			CONFIG_YABOOT=y
		fi
	fi
	
	if query "Hand edit /etc/yaboot.conf?" n;
	then
		EDIT_YABOOT=y
	else
		EDIT_YABOOT=n
	fi
fi

CONFIG_AGGRESSIVE="n"

if !  grep  -q  "CONFIG_AGGRESSIVE=" $MODULE_CONFIG &&
      query  "Use Aggressive patchset?" n
then  CONFIG_AGGRESSIVE="y"
else  if grep -q "CONFIG_AGGRESSIVE=y"  $MODULE_CONFIG
      then  CONFIG_AGGRESSIVE="y"
      fi
fi      

if  !  grep  -q  "CONFIG_METHOD="  $MODULE_CONFIG
then
      CONFIG_HELP="Answer \Z1one\Zn question at a time. (Are you SURE?)"
  MENUCONFIG_HELP="Menu driven ncurses interface, falls back to config."
     XCONFIG_HELP="Graphical interface with X windows, falls back to menuconfig."
     
  OPTIONS=( "config"     "text based"             "off" "$CONFIG_HELP"
            "menuconfig" "ncurses menu interface" "off" "$MENUCONFIG_HELP"
	    "xconfig"    "X graphical interface"  "off" "$XCONFIG_HELP" )

  while [ -z "$CONFIG_METHOD" ] ; do
  CONFIG_METHOD=`dialog --title "Select how to configure your kernel" 	\
  			--backtitle "Lunar Linux Kernel Configuration"  \
			--ok-label  "Ok"				\
			--no-cancel                                   	\
			--stdout                                      	\
			--item-help				      	\
			--colors				      	\
			--radiolist                                   	\
			"Select your kernel configuration method"    	      	\
			 0 0 0                                        	\
			"${OPTIONS[@]}"`

  done
  
  echo  "CONFIG_METHOD=$CONFIG_METHOD"  >>  $MODULE_CONFIG
fi


if  [  !  -f  $CONFIG_CACHE/.config  ];  then
  message  "Preparing to make $CONFIG_METHOD"
  CONFIG_KERNEL="y"
else
  message  "Reconfiguration is optional."
  if    query  "Configure linux kernel?"  n
  then  CONFIG_KERNEL=y
  else  CONFIG_KERNEL=n
  fi
fi

TEMP=`grep  -v  "CONFIG_KERNEL="          $MODULE_CONFIG  |
      grep  -v  "CONFIG_LILO="                            |
      grep  -v  "CONFIG_GRUB="                            |
      grep  -v  "CONFIG_ABOOT="				  |
      grep  -v  "CONFIG_YABOOT="			  |
      grep  -v  "CONFIG_AGGRESSIVE="                      |
      grep  -v  "EDIT_LILO"`

echo  "$TEMP"                                >   $MODULE_CONFIG
echo  "CONFIG_KERNEL=$CONFIG_KERNEL"         >>  $MODULE_CONFIG
echo  "CONFIG_LILO=$CONFIG_LILO"             >>  $MODULE_CONFIG
echo  "CONFIG_GRUB=$CONFIG_GRUB"             >>  $MODULE_CONFIG
echo  "CONFIG_ABOOT=$CONFIG_ABOOT"           >>  $MODULE_CONFIG
echo  "CONFIG_YABOOT=$CONFIG_YABOOT"         >>  $MODULE_CONFIG
echo  "CONFIG_AGGRESSIVE=$CONFIG_AGGRESSIVE" >>  $MODULE_CONFIG
echo  "EDIT_LILO=$EDIT_LILO"	             >>  $MODULE_CONFIG

--- NEW FILE: DEPENDS ---
depends  autoconf

--- NEW FILE: DETAILS ---
         MODULE=linux/2.4.22
        VERSION=2.4.22
   PATCHVERSION=rc2.1.4
         SOURCE=linux-$VERSION.tar.bz2
        SOURCE2=linux-$VERSION-lunar-patch-set-$PATCHVERSION.tar.bz2
  SOURCE_URL[0]=$KERNEL_URL/pub/linux/kernel/v2.4/$SOURCE
  SOURCE_URL[1]=http://www.kernel.org/pub/linux/kernel/v2.4/$SOURCE
 SOURCE2_URL[0]=$PATCH_URL/$SOURCE2
     SOURCE_VFY=md5:75dc85149b06ac9432106b8941eb9f7b
    SOURCE2_VFY=md5:956dd828a183d4b1821dd56c9b763330
        WEBSITE=http://www.kernel.org
        ENTERED=20020916
        UPDATED=20031115
    KEEP_SOURCE="on"
          SHORT="The Lunar Kernel patchset test module."
cat << EOF
WARNING: This is a kernel module for test purpose only...

This is the Linux kernel with the Lunar Linux kernel patch set.

For patch information please see the patch-list.txt file in the patchset.
EOF

--- NEW FILE: POST_INSTALL ---
lilo_image_entry()  {

  cat  <<  EOF

image			=	/boot/vmlinubz-$VERSION
	label		=	linux-$VERSION
	read-only
	restricted

EOF

}

grub_image_entry()  {

. $DEPENDS_CONFIG/grub

  cat  <<  EOF

title   linux-$VERSION
kernel  $GRUB_BOOT/vmlinubz-$VERSION
root    $GRUB_ROOT

EOF

}

yaboot_image_entry()  {

  cat  <<  EOF

image			=	/boot/vmlinubx-$VERSION
	label		=	linux-$VERSION
	restricted

EOF

}

update_lilo()  {
  if  !  grep  -q  "$VERSION"  /etc/lilo.conf;  then

    IFS_OLD=$IFS
    export  IFS="
"

    rm  -rf  /etc/lilo.conf.new
    cp  /etc/lilo.conf  /etc/lilo.conf.old

    (( IMAGE_COUNT=0  ))

    for  LINE  in  `cat /etc/lilo.conf`;  do

      if   echo  $LINE  |  grep  -q  "image"  ||
           echo  $LINE  |  grep  -q  "other"  ;  then
        if  (( IMAGE_COUNT  == 0  ));  then
          echo  -e  "`lilo_image_entry`"  >>  /etc/lilo.conf.new
        fi
        ((  IMAGE_COUNT++  ))
      fi

      if  ((  IMAGE_COUNT == 14  ));  then
        break
      fi
    
      echo  $LINE  >>  /etc/lilo.conf.new

    done

    if  ((  IMAGE_COUNT ==  0  ));  then
      echo  -e  "`lilo_image_entry`"  >>  /etc/lilo.conf.new
    fi

    cp  /etc/lilo.conf.new  /etc/lilo.conf

    export  IFS=$IFS_OLD

  fi

  case  $EDIT_LILO in
    y|Y|j|J)  ${EDITOR:-nano}  /etc/lilo.conf  ;;
  esac

  /sbin/lilo

}


update_grub()  {
  if  !  grep  -q  "$VERSION"  /boot/grub/menu.lst;  then

    IFS_OLD=$IFS
    export  IFS="
"

    rm  -rf  /boot/grub/menu.lst.new
    cp  /boot/grub/menu.lst  /boot/grub/menu.lst.old

    (( IMAGE_COUNT=0  ))

    for  LINE  in  `cat /boot/grub/menu.lst`;  do

      if   echo  $LINE  |  grep  -q  "title";  then
        if  (( IMAGE_COUNT  == 0  ));  then
          echo  -e  "`grub_image_entry`"  >>  /boot/grub/menu.lst.new
        fi
        ((  IMAGE_COUNT++  ))
      fi

      if  ((  IMAGE_COUNT == 14  ));  then
        break
      fi
    
      echo  $LINE  >>  /boot/grub/menu.lst.new

    done

    if  ((  IMAGE_COUNT ==  0  ));  then
      echo  -e  "`grub_image_entry`"  >>  /boot/grub/menu.lst.new
    fi

    cp  /boot/grub/menu.lst.new  /boot/grub/menu.lst

    export  IFS=$IFS_OLD

  fi

  case  $CONFIG_GRUB in

    y|Y)  ${EDITOR:-nano}  /boot/grub/menu.lst;;
  esac

  message "Install GRUB into MBR of first drive? [y|Y]"
  read GRUB_FIRST_DRIVE
  case $GRUB_FIRST_DRIVE in
    y|Y) GRUB_BOOT_DEVICE="(hd0)" ;; 
    *  ) 
         message "Otherwise please specify in GRUB notation the desired drive/partition"
         message "Using parenthesis and NO spaces!"
         message "Samples: (hd1)    2nd drive MBR"
         message "         (hd1,0)  2nd drive with 1st partition"
         message "         (hd0,2)  1st drive with 3rd partition"
         echo -n "GRUB_BOOT_DEVICE=(hd#,#):  "
         read GRUB_BOOT_DEVICE
  esac
  
  /usr/sbin/grub-install "$GRUB_BOOT_DEVICE"
  sleep 4

}

update_aboot() {
    ${EDITOR:-nano}  /etc/aboot.conf;
}

update_yaboot() {
  if  !  grep  -q  "$VERSION"  /etc/yaboot.conf;  then

    IFS_OLD=$IFS
    export  IFS="
"

    rm  -rf  /etc/yaboot.conf.new
    cp  /etc/yaboot.conf  /etc/yaboot.conf.old

    (( IMAGE_COUNT=0  ))

    for  LINE  in  `cat /etc/yaboot.conf`;  do

      if   echo  $LINE  |  grep  -q  "image"  ||
           echo  $LINE  |  grep  -q  "other"  ;  then
        if  (( IMAGE_COUNT  == 0  ));  then
          echo  -e  "`yaboot_image_entry`"  >>  /etc/yaboot.conf.new
        fi
        ((  IMAGE_COUNT++  ))
      fi

      if  ((  IMAGE_COUNT == 14  ));  then
        break
      fi
    
      echo  $LINE  >>  /etc/yaboot.conf.new

    done

    if  ((  IMAGE_COUNT ==  0  ));  then
      echo  -e  "`yaboot_image_entry`"  >>  /etc/yaboot.conf.new
    fi

    cp  /etc/yaboot.conf.new  /etc/yaboot.conf

    export  IFS=$IFS_OLD

  fi

  case  $EDIT_YABOOT in
    y|Y|j|J)  ${EDITOR:-nano}  /etc/yaboot.conf  ;;
  esac

  /sbin/ybin

}

case  $BOOT_LOADER  in
  lilo)  [ $CONFIG_LILO = y ] && update_lilo  ;;
  grub)  [ $CONFIG_GRUB = y ] && update_grub  ;;
  aboot) [ $CONFIG_ABOOT = y ] && update_aboot ;;
  yaboot) [ $CONFIG_YABOOT = y ] && update_yaboot ;;
esac


#  Reinstall packages that add their own kernel modules

rm  -f  $BOOST_LOCK
if  module_installed  ftpfs;          then  lin  ftpfs;          fi
if  module_installed  cvsfs;          then  lin  cvsfs;          fi
if  module_installed  NVIDIA_kernel;  then  lin  NVIDIA_kernel;  fi
if  module_installed  NVIDIA;         then  lin  NVIDIA;         fi
if  module_installed  alsa-driver;    then  lin  alsa-driver;    fi
if  module_installed  cryptoapi;      then  lin  cryptoapi;      fi
if  module_installed  pcmcia-cs;      then  lin  pcmcia-cs;      fi
if  module_installed  mwavem;         then  lin  mwavem;         fi
if  module_installed  cipe;           then  lin  cipe;           fi
if  module_installed  snare-core;     then  lin  snare-core;     fi
if  module_installed  ltmodem;        then  lin  ltmodem;        fi

--- NEW FILE: PRE_BUILD ---
cd       /usr/src
rm  -rf  linux-$VERSION
rm  -f   linux

unpack  $SOURCE

ln  -s     linux-$VERSION  linux

if  [  -f   $CONFIG_CACHE/.config  ];  then
  cp        $CONFIG_CACHE/.config  /usr/src/linux
fi

cd /usr/src/linux
mkdir patches
bzcat $SOURCE_CACHE/$SOURCE2 | tar -xf - -C patches

#
# Patch in main feature enhancements
#
for pat in patches/main/*
do
    patch -p1 < $pat
done

#
# Patch in kernel fixes
#
for pat in patches/fix/*
do
    patch -p1 < $pat
done
    
if [ "$CONFIG_AGGRESSIVE" == "y" ]; then
   for pat in patches/aggressive/*
   do
       patch -p1 < $pat
   done
fi

rm -rf patches
chown -R root:root /usr/src/linux-$VERSION

true





More information about the Lunar-commits mailing list