From: Michael Prokop Date: Fri, 16 Mar 2007 11:48:15 +0000 (+0100) Subject: merge linuxrc from outside of terminalserver with changes for busybox-1.4.1 X-Git-Tag: 0.83~3 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;ds=sidebyside;h=81d99d8b0e15f198ade4f008de9e49907ad06e20;p=grml-terminalserver.git merge linuxrc from outside of terminalserver with changes for busybox-1.4.1 --- diff --git a/debian/changelog b/debian/changelog index 4e8b693..b8a7ab8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ grml-terminalserver (0.83) unstable; urgency=low [ Michael Prokop ] * fix mkdir call of $TFTPD_DATA_DIR_/pxelinux.cfg + * merge linuxrc from outside of terminalserver, some + fixes and updates for current version of busybox + (using busybox-1.4.1 now) [ Michael Gebetsroither ] * change from in.tftpd to atftpd [Closes: issue143] @@ -10,7 +13,6 @@ grml-terminalserver (0.83) unstable; urgency=low * remove unnecesarry files * change hw detection from discover to a modalias based one * vim modline fixes in timeout.c - * merge linuxrc from outside of terminalserver * fix error to not only use a running kernel * updated todo * fix module loading in linuxrc diff --git a/linuxrc b/linuxrc index 441ef54..98d5572 100755 --- a/linuxrc +++ b/linuxrc @@ -2,7 +2,7 @@ # Filename: /linuxrc # Purpose: minirt for kernel 2.6 running on grml live-cd # Authors: (c) Klaus Knopper , (c) Michael Prokop -# Latest change: Sun Mar 04 13:47:33 CET 2007 +# Latest change: Fri Mar 16 11:35:19 CET 2007 [mika] ####################################################################################### # hardcoded configurable options @@ -183,7 +183,7 @@ echo "" echo "${WHITE}grml.org - Linux for users of texttools and sysadmins." echo "${NORMAL}" -# We only need the builtin commands and /static at this point +# We need the builtin commands and /static only starting at this point PATH=/static export PATH @@ -291,7 +291,7 @@ loadmodules(){ echo "" for i in "$@"; do echo -n " Probing ${TYPE}... ${WHITE}$i${NORMAL}: " - if test -f /modules/scsi/$i.ko && $INSMOD -f /modules/scsi/$i.ko >/dev/null 2>&1 && echo " $SUCCESS" || echo " failed " ; then + if test -f /modules/scsi/$i.ko && $INSMOD /modules/scsi/$i.ko >/dev/null 2>&1 && echo " $SUCCESS" || echo " failed " ; then case "$TYPE" in scsi|SCSI) FOUND_SCSI="yes"; ;; esac fi done @@ -354,7 +354,7 @@ fi if test -z "$NOSCSI" ; then log_begin_msg "Scanning for SCSI devices." - $INSMOD -f /modules/scsi/firmware_class.ko 1>/dev/null + $INSMOD /modules/scsi/firmware_class.ko 1>/dev/null test -n "$MODULES" && loadmodules SCSI $MODULES && echo -n "" || echo " ${BLUE}[${NORMAL} none found ${BLUE}]${NORMAL} (try bootoption scsi=probe)" else log_warn_msg "Not scanning for SCSI devices as requested on commandline." && echo " $SUCCESS" @@ -365,10 +365,10 @@ if checkbootparam scsi ; then if test "$MODULE" = "probe" ; then log_begin_msg "Bootoption scsi=probe found. Trying to autoprobe SCSI modules:" echo "" - echo -n " Trying to load scsi_debug: " ; $INSMOD -f /modules/scsi/scsi_debug.ko 1>/dev/null && echo " $SUCCESS" || echo " [ failed ]" + echo -n " Trying to load scsi_debug: " ; $INSMOD /modules/scsi/scsi_debug.ko 1>/dev/null && echo " $SUCCESS" || echo " [ failed ]" for module in /modules/scsi/*.ko ; do echo -n " Probing ${WHITE}${module}${NORMAL}..." - $INSMOD -f ${module} >/dev/null 2>&1 && echo " $SUCCESS" || echo " [ failed ]" + $INSMOD ${module} >/dev/null 2>&1 && echo " $SUCCESS" || echo " [ failed ]" done elif test "$MODULE" = "ask" ; then askmodules SCSI $(cd /modules/scsi; echo *.ko) @@ -376,7 +376,7 @@ if checkbootparam scsi ; then else [ -n "$MODULE" ] || echo " ${RED}Neither a specific module nor option probe nor option ask for SCSI module given. Skipping.${NORMAL}" [ -n "$MODULE" ] && echo -n " Trying to load module ${WHITE}${MODULE}${NORMAL}:" ; \ - $INSMOD -f "/modules/scsi/${MODULE}.ko" 1>/dev/null && echo " $SUCCESS" || echo " [ failed ]" + $INSMOD "/modules/scsi/${MODULE}.ko" 1>/dev/null && echo " $SUCCESS" || echo " [ failed ]" fi fi # End of SCSI check @@ -386,7 +386,7 @@ if test -n "$VMWARE" ; then echo "" for module in mptbase mptscsih mptspi BusLogic ; do echo -n " Trying to load ${WHITE}${module}${NORMAL}: " - $INSMOD -f /modules/scsi/${module}.ko >/dev/null 2>&1 && echo " $SUCCESS" || echo " [ failed ]" + $INSMOD /modules/scsi/${module}.ko >/dev/null 2>&1 && echo " $SUCCESS" || echo " [ failed ]" done fi @@ -462,11 +462,11 @@ fi # boot via pcmcia if checkbootparam bootpcmcia ; then log_begin_msg "Bootoption bootpcmcia found. Trying to load ${WHITE}PCMCIA${NORMAL} modules..." - if $INSMOD -f /modules/div/pcmcia_core.ko 1>/dev/null ; then - $INSMOD -f /modules/div/firmware_class.ko 1>/dev/null && \ - $INSMOD -f /modules/div/pcmcia.ko 1>/dev/null && \ - $INSMOD -f /modules/div/rsrc_nonstatic.ko 1>/dev/null && \ - $INSMOD -f /modules/div/yenta_socket.ko 1>/dev/null && echo " $SUCCESS" + if $INSMOD /modules/div/pcmcia_core.ko 1>/dev/null ; then + $INSMOD /modules/div/firmware_class.ko 1>/dev/null && \ + $INSMOD /modules/div/pcmcia.ko 1>/dev/null && \ + $INSMOD /modules/div/rsrc_nonstatic.ko 1>/dev/null && \ + $INSMOD /modules/div/yenta_socket.ko 1>/dev/null && echo " $SUCCESS" else echo " [ failed ]" fi @@ -635,7 +635,7 @@ boot_from() # load filesystems /GRML/sbin/modprobe fuse /GRML/sbin/modprobe ntfs - $INSMOD -f /modules/div/ntfs.ko 1>/dev/null + $INSMOD /modules/div/ntfs.ko 1>/dev/null if [ -n "$ISO_PATH" ]; then LOOP_SOURCE="$TARGET.loop" @@ -797,8 +797,7 @@ if test -n "$DO_REMOUNT" -a -n "$FOUND_GRML" ; then fi # Final test if everything succeeded. -if test -n "$FOUND_GRML" -then +if test -n "$FOUND_GRML" ; then # copy library cache cat /GRML/etc/ld.so.cache > /etc/ld.so.cache @@ -868,19 +867,19 @@ MINSIZE=20000 # At least this much memory minus 30% should remain when home and var are full. MINLEFT=16000 # Maximum ramdisk size -[ -n "$TOTALMEM" ] && MAXSIZE="$(expr $TOTALMEM - $MINLEFT)" +[ -n "$TOTALMEM" ] && MAXSIZE="$(/usr/bin/expr $TOTALMEM - $MINLEFT)" # Default ramdisk size for ramdisk -[ -n "$TOTALMEM" ] && RAMSIZE="$(expr $TOTALMEM / 5)" +[ -n "$TOTALMEM" ] && RAMSIZE="$(/usr/bin/expr $TOTALMEM / 5)" # Create additional dynamic ramdisk. test -z "$RAMSIZE" -o "$RAMSIZE" -lt "$MINSIZE" && RAMSIZE="$MINSIZE" mkdir -p /ramdisk # tmpfs/varsize version, can use swap -RAMSIZE=$(expr $RAMSIZE \* 4) +RAMSIZE=$(/usr/bin/expr $RAMSIZE \* 4) log_begin_msg "Creating /ramdisk (dynamic size=${RAMSIZE}k) on shared memory" # We need /bin/mount here for the -o size= option /bin/mount -t tmpfs -o "size=${RAMSIZE}k" /ramdisk /ramdisk && echo "$SUCCESS" -mkdir -p /ramdisk/tmp /ramdisk/home/grml && chmod 1777 /ramdisk/tmp && chown grml.grml /ramdisk/home/grml && ln -snf /ramdisk/home /home && mv /tmp /tmp.old && ln -s /ramdisk/tmp /tmp && rm -rf /tmp.old +mkdir -p /ramdisk/tmp /ramdisk/home/grml && chmod 1777 /ramdisk/tmp && chown grml.grml /ramdisk/home/grml && ln -snf /ramdisk/home /home && /bin/mv /tmp /tmp.old && ln -s /ramdisk/tmp /tmp && rm -rf /tmp.old stage=3 rundebugshell @@ -900,7 +899,7 @@ if test -n "$UNIONFS" && /bin/mount -t $UNIONFS_FILETYPE -o noatime${SECURE},dir for i in bin boot etc sbin var lib opt root usr; do # Move directories to unionfs if test -d /$i; then - mv /$i /$i.old && \ + /bin/mv /$i /$i.old && \ /GRML/lib/ld-linux.so.2 --library-path /GRML/lib /GRML/bin/ln -snf /UNIONFS/$i /$i && \ rm -rf /$i.old else @@ -958,7 +957,7 @@ echo "/sbin/modprobe" > /proc/sys/kernel/modprobe # Change root device from /dev/fd0 to /dev/ram0 echo "0x100" > /proc/sys/kernel/real-root-dev -umount /sys # (remount in grml-autoconfig) +/bin/umount /sys # (remount in grml-autoconfig) stage=4 rundebugshell