From 39542a6836ce2abd85a8df04af4229c888a71956 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 10 Jan 2007 15:08:43 +0000 Subject: Busybox is now properly named for the two supported architectures: i386 and x86_64. mkdxsinitrd includes usb keyboard stuff per default and init loads the modules rather early (otherwise on non-legacy machines debugging might be difficult) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@609 95ad53e4-c205-0410-b2fa-d234c58c8868 --- Makefile | 11 +++++------ initramfs/initrd-stuff/init | 10 +++++++++- initramfs/mkdxsinitrd | 45 ++++++++++++++++++++++---------------------- initramfs/slxmkramfs | 2 +- tools/busybox | Bin 360864 -> 12 bytes tools/busybox.i386 | Bin 0 -> 360864 bytes 6 files changed, 37 insertions(+), 31 deletions(-) mode change 100755 => 120000 tools/busybox create mode 100755 tools/busybox.i386 diff --git a/Makefile b/Makefile index f3be5ba0..37928d4b 100644 --- a/Makefile +++ b/Makefile @@ -122,10 +122,10 @@ supported."; \ -p $(SLX_TFTPBOOT_PATH) \ -p $(SLX_SHARE_PATH)/themes @# copy license - @cp COPYING $(SLX_BASE_PATH) + @cp COPYING $(SLX_BASE_PATH)/ @# copy initramfs generator scripts (and inject SLX_CONFIG_PATH on the way): - @cp ./initramfs/mkdxsinitrd $(SLX_BIN_PATH) - @cp ./initramfs/slxmkramfs $(SLX_BIN_PATH) + @cp ./initramfs/mkdxsinitrd $(SLX_BIN_PATH)/ + @cp ./initramfs/slxmkramfs $(SLX_BIN_PATH)/ @sed -e "s,@@@SLX_CONFIG_PATH@@@,$(SLX_CONFIG_PATH)," \ -i $(SLX_BIN_PATH)/mkdxsinitrd @sed -e "s,@@@SLX_CONFIG_PATH@@@,$(SLX_CONFIG_PATH)," \ @@ -146,13 +146,12 @@ supported."; \ @tar --exclude=.svn -cp -C initramfs distro-specs | \ tar -xp -C $(SLX_SHARE_PATH) @cp -a installer/default_files/machine-setup.default \ - $(SLX_SHARE_PATH)/templates + $(SLX_SHARE_PATH)/templates/ @tar --exclude=.svn -cp -C installer/default_files tftpboot | \ tar -xp -C $(SLX_SHARE_PATH) @cd theming; tar --exclude=.svn -cp * | \ tar -xp -C $(SLX_SHARE_PATH)/themes; cd .. - @# ia32 busybox should be renamed accordingly ... - @cp -p tools/busybox{,.links,.x86_64} installer/slxbootstrap \ + @cp -p tools/busybox{,.links,.x86_64,.i386} installer/slxbootstrap \ $(SLX_SHARE_PATH)/busybox/ @# create pre-/postinit scripts for us in initramfs: diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index ca8bd984..446439b8 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -4,7 +4,7 @@ # # this file is distributed under the GPLv2, see ~/openslx/COPYING # -# Dirk von Suchodoletz , 22-12-2006 +# Dirk von Suchodoletz , 10-01-2007 # (xenbr), 27-09-2006 # # (c) 2006 - RZ Universitaet Freiburg @@ -62,6 +62,13 @@ COWSIZE="50%" RWDIR=/dev/shm NFSRO="nfs" +# load usb modules for keyboard (reenable usb keyboards, otherwise the +# admin has to wait until second run of hwsetup late in stage3) +( for mod in usbcore uhci-hcd ohci-hcd usbhid; do + modprobe -q $mod 2>/dev/null +done ) & + + # run pre init script and user defined preinit.local, copied by mkdxsinitrd # from /var/lib/openslx/config/... in stage2 preinit @@ -259,6 +266,7 @@ fi for mod in ${NWMODULES}; do modprobe ${MODPRV} $mod || error "$init_errnwad" done + # set up loopback networking (ipsetup - function defined in /etc/functions) ipsetup 127.0.0.1 255.0.0.0 0.0.0.0 127.255.255.255 lo diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index 424ace18..25970a78 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -4,15 +4,13 @@ # ramdisks for linux diskless clients (stage2 system # setup) # -# Author(s): Dirk von Suchodoletz , 08-01-2007 +# Author(s): Dirk von Suchodoletz , 10-01-2007 # Nico Dietrich # Felix Endres -# (xenbr), 12-12-2006 +# (xenbr), 09-01-2007 # # Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg # (c) 2006, 2007 - OpenSLX GmbH -# -# Version: 0.4.5d # debug level of script itself DEBUG=1 @@ -60,6 +58,9 @@ SLX_CONFIG_PATH=@@@SLX_CONFIG_PATH@@@ . $SLX_CONFIG_PATH/settings.default [ -f $SLX_CONFIG_PATH/settings.local ] && \ . $SLX_CONFIG_PATH/settings.local +# read the common functions file +[ -e ${SLX_SHARE_PATH}/initramfs/etc/functions ] && \ + . ${SLX_SHARE_PATH}/initramfs/etc/functions ######################################################################### # End of global variable declaration, nothing needed to be changed at @@ -174,7 +175,7 @@ DATE=`date +%m-%d-%Y` # do not forget to define all variables which should be replaced within # the start and configuration scripts. All comment lines will be deleted. if [ -d ${SLX_SHARE_PATH}/initramfs/${FILENAME} ] ; then - [ -d ${INSTDIR}/${FILENAME} ] || mkdir -p ${INSTDIR}/${FILENAME} + testmkd ${INSTDIR}/${FILENAME} else if file ${SLX_SHARE_PATH}/initramfs/${FILENAME}| grep "ELF" &>/dev/null ; then cp ${SLX_SHARE_PATH}/initramfs/${FILENAME} ${INSTDIR}/${FILENAME} @@ -494,23 +495,29 @@ done chmod 755 ${INSTDIR}/init \ ${INSTDIR}/bin/{servconfig,hwautocfg,screenres,dhcpmkconfig} +# quickhack architecture detection of target system +if [ -d ${ROOTDIR}/lib64 ] ; then + ARCH=x86_64 +else + ARCH=i386 +fi + # test for the existance of busybox if [ "$use_busybox" = 1 ]; then - [ -x ${SLX_SHARE_PATH}/busybox/busybox ] || { + [ -x ${SLX_SHARE_PATH}/busybox/busybox.${ARCH} ] || { unset use_busybox - echo "You wanted to include busybox, but did not provide it in \ -${SLX_SHARE_PATH}/busybox directory."; } + echo "You wanted to include busybox for ${ARCH}, but did not provide \ +it in ${SLX_SHARE_PATH}/busybox directory."; } fi if [ -n "$use_busybox" ] ; then # somehow the target platform should be defined and proper busybox copied cp ${SLX_SHARE_PATH}/busybox/busybox ${INSTDIR}/bin for bbins in [ ar arping ash bunzip2 cat chmod chown chroot cp cpio cut \ - date dd df dmesg du echo env expr fdisk free grep gunzip hwclock \ - insmod \ - id ip kill killall ln ls lsmod mdev mkdir mke2fs mkfs.ext2 mkfs.ext3 \ - mknod mkswap modprobe mount mv nice ping printf ps rdate rm rmmod sed \ - sleep sort swapoff swapon switch_root tar test tftp time touch tr \ - udhcpc umount uptime usleep vconfig vi zcat zcip; do + date dd df dmesg du echo env expr fdisk free grep gunzip hwclock \ + insmod id ip kill killall ln ls lsmod mdev mkdir mke2fs mkfs.ext2 \ + mkfs.ext3 mknod mkswap modprobe mount mv nice ping printf ps rdate \ + rm rmmod sed sleep sort swapoff swapon switch_root tar test tftp \ + time touch tr udhcpc umount uptime usleep vconfig vi zcat zcip; do ln -fs /bin/busybox ${INSTDIR}/bin/$bbins done # fake the sh link in busybox environment @@ -662,18 +669,10 @@ if [ -z "$INITRD_PATH" ] ; then INITRD_PATH="${ROOTDIR}/tmp/slxinitramfs.gz" fi -# define modules to put into initial ramdisk for debugging -#DEBUGMODULES="uhci_hcd usbhid" -if [ $IRFSDEBUG -gt 1 ] ; then - DEBUGMODULES="uhci-hcd ohci-hcd usbhid" -else - DEBUGMODULES="" -fi - # put all needed modules into initial ramdisk mkdir -p ${INSTDIR}/lib/modules/${KERNVER} for module in af_packet unix ${NWMODULES} ${FSMODULES} ${MISCMODULES} \ - ${DEBUGMODULES}; do + ${DEBUGMODULES} usbcore usbhid uhci-hcd ohci-hcd; do mod=`cd /${ROOTDIR}; find "lib/modules/${KERNVER}" -name ${module}.ko \ 2>/dev/null` diff --git a/initramfs/slxmkramfs b/initramfs/slxmkramfs index 6a0bba9d..8162f840 100755 --- a/initramfs/slxmkramfs +++ b/initramfs/slxmkramfs @@ -156,7 +156,7 @@ else -e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \ -e "s,@@@DATE@@@,${DATE},g;/^#[^!].*/d" \ ${SLX_SHARE_PATH}/initramfs/${FILENAME} >> ${INSTDIR}/${FILENAME} - [ -x busybox -a "$use_busybox" = 1 ] && sed -e "s,^#!/bin/sh,#!/bin/ash," \ + [ "$use_busybox" = 1 ] && sed -e "s,^#!/bin/sh,#!/bin/ash," \ -i ${INSTDIR}/${FILENAME} fi fi diff --git a/tools/busybox b/tools/busybox deleted file mode 100755 index 3bbcdbb4..00000000 Binary files a/tools/busybox and /dev/null differ diff --git a/tools/busybox b/tools/busybox new file mode 120000 index 00000000..99db4a8b --- /dev/null +++ b/tools/busybox @@ -0,0 +1 @@ +busybox.i386 \ No newline at end of file diff --git a/tools/busybox.i386 b/tools/busybox.i386 new file mode 100755 index 00000000..3bbcdbb4 Binary files /dev/null and b/tools/busybox.i386 differ -- cgit v1.2.3-55-g7522