CVS: moonbase/kernel/linux/2.4.22-test_only 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 at lunar-linux.org niki at lunar-linux.org
Tue Sep 16 16:11:50 GMT 2003


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

Added Files:
	BUILD CONFIGURE DEPENDS DETAILS POST_INSTALL PRE_BUILD 
Log Message:
copied linux kernel module to 2.4.22 test versioned module as a base...


--- 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
        VERSION=2.4.20
   PATCHVERSION=r1.3
         SOURCE=linux-$VERSION.tar.bz2
        SOURCE2=$MODULE-$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:c439d5c93d7fc9a1480a90842465bb97
    SOURCE2_VFY=md5:588c9dfa03283f6d3cb2ff6ccd44d117
        WEBSITE=http://www.kernel.org
        ENTERED=20020818
        UPDATED=20030818
    KEEP_SOURCE="on"
          SHORT="The Linux kernel, the core of the GNU/Linux OS, with the lunar patch set"
cat << EOF
The lunar patch set enables the sysadmin to add some desirable features like:

XFS support (enabled by default)
fixes APM SMP crashes
ipconntack.h
P3m-cache
pcmcia-smc91c92_cs
adds cpuid entries amd msr entries
devfs-zip
rivafb
rpc-accounting-nfs
smp-race-nfs
radeon FB fixes
scsi-in2000
scsi-t128
ide-driver-null
getcwd-err
mmap
ext3 fixes
paraport-serial-pci
titan-serial
VIA chipset vt8235 fixes
xfs-sysctl
firewire patch
pdc202xx
3c574_cs
ptrace patch
ipv4 routing hash patch

The aggressive patch set adds:

adds gcc 3.1 machine types to the kernel
swab64
preemptible kernel support
low-latency

Features are enabled or disabled by the standard kernel configuration tools,
i.e. "make menuconfig" or "make config" or "make xconfig".
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

if [ "`arch`" == "alpha" ]; then
    patch -p1 < patches/alpha/00_alpha-cia.patch
fi

for pat in patches/main/*
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