diff options
author | Nico Dietrich | 2006-01-19 23:41:03 +0100 |
---|---|---|
committer | Nico Dietrich | 2006-01-19 23:41:03 +0100 |
commit | 9384f07f7b73a3e23121881363c259581c98d46d (patch) | |
tree | cd127ed8cf15cd7a7d843675b6ef1ea0acb702e1 /initrd/mkdxsinitrd | |
parent | distro-erkennung, debian -> debian+ubuntu (diff) | |
download | core-9384f07f7b73a3e23121881363c259581c98d46d.tar.gz core-9384f07f7b73a3e23121881363c259581c98d46d.tar.xz core-9384f07f7b73a3e23121881363c259581c98d46d.zip |
rest von commit 23
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@24 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/mkdxsinitrd')
-rwxr-xr-x | initrd/mkdxsinitrd | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index e9193ab6..a498213c 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -59,7 +59,7 @@ local FPTB=`which $1` if [ -z ${FPTB} ] ; then return 1; else - cp ${boot_dir}/${FPTB} ${INSTDIR}/${DEST} + cp ${ROOTDIR}/${FPTB} ${INSTDIR}/${DEST} fi } @@ -187,10 +187,10 @@ resolve_modules() { ######################################################################### # End of function declaration -while getopts :hgMRk:i:m:r:d:o:s:Sut:D:I:V:a: a ; do +while getopts :hgMRk:i:m:r:o:s:Sut:d:D:I:V:a: a ; do case $a in \:|\?) case $OPTARG in - k) echo "-k requires kernel list parameter" + k) echo "-k requires kernel version parameter" ;; i) echo "-i requires initrd list parameter" ;; @@ -198,12 +198,12 @@ while getopts :hgMRk:i:m:r:d:o:s:Sut:D:I:V:a: a ; do ;; r) echo "-r requires root dir parameter" ;; - d) echo "-d requires root device parameter" - ;; s) echo "-s requires image size(s)" ;; t) echo "-t requires tmp dir parameter" ;; + d) echo "-d requires linux distribution name (debian, ubuntu, suse-9.3, suse-10.1)" + ;; D) echo "-D requires dhcp interface parameter" ;; I) echo "-I requires network interface parameter" @@ -220,21 +220,20 @@ while getopts :hgMRk:i:m:r:d:o:s:Sut:D:I:V:a: a ; do ;; g) use_glibc=1 ;; - k) kernel_images=$OPTARG + k) KERNELVER=$OPTARG ;; i) initrd_images=$OPTARG ;; m) modules=$OPTARG modules_set=1 ;; - r) root_dir=$OPTARG - ;; - d) rootdev=$OPTARG + r) ROOTDIR=$OPTARG ;; s) splash=$OPTARG ;; t) tmp_dir=$OPTARG ;; + d) DISTRO=$OPTARG D) interface=$OPTARG interface=${interface#/dev/} use_dhcp=1 @@ -271,10 +270,44 @@ mkdir -p ${INSTDIR}/usr/share mkdir -p ${INSTDIR}/etc/sysconfig # source configuration file for the distribution used -DISTRO=debian -case "${DISTRO}.${DISVER}" in +#DISTRO=debian + +if [ -z $DISTRO ] ; then + for i in ${ROOTDIR}/bin/lsb_release ${ROOTDIR}/usr/bin/lsb_release; do + if [ -e $i ] ; then + DISTRO = `. $i -a | grep "Distributor" | sed "s/.*\t//"` + DISTRO_VER = `. $i -a | grep "Release:" | sed "s/.*\t//"` + break + fi + done +fi + +if [ -z $DISTRO ] ; then + if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then + DISTRO = suse + DISTRO_VER = grep "VERSION" /etc/SuSE-release | sed "s/.*= //" + fi +fi + +if [ -z $DISTRO ] ; then + if [ -e ${ROOTDIR}/etc/debian-version ] ; then + DISTRO = debian + DISTRO_VER = `cat ${ROOTDIR}/etc/debian-version` + fi +fi + + +case "${DISTRO}" in SuSE*|suse*|Suse*|SuSe*) - DISTRO=suse-10.0 + case "${DISTRO_VER}" in + 9*) + DISTRO=suse-9.3 + ;; + *) + DISTRO=suse-10.0 + ;; + esac + # hotplug/udev style and stuff cp -a /etc/udev /etc/hotplug ${INSTDIR}/etc #cp -a /etc/sysconfig/{hardware,network} ${INSTDIR}/etc/sysconfig @@ -282,10 +315,14 @@ case "${DISTRO}.${DISVER}" in Debian*|debian*|Sarge*|sarge*) DISTRO=debian ;; + Ubuntu*|ubuntu*) + DISTRO=ubuntu + ;; Gentoo*|gentoo*) DISTRO=gentoo ;; esac + cp distro-specs/${DISTRO}/config ${INSTDIR}/etc/sysconfig cp distro-specs/${DISTRO}/functions-${DISTRO} ${INSTDIR}/etc/distro-functions cp -a distro-specs/${DISTRO}/files ${INSTDIR}/etc/sysconfig |