cvs commit: hints uclibc-bootfloppy.txt

timothy at linuxfromscratch.org timothy at linuxfromscratch.org
Tue Jul 8 09:54:19 PDT 2003


timothy     03/07/08 10:54:19

  Modified:    .        uclibc-bootfloppy.txt
  Log:
  Using rdev as "rdev $DISK 0,0". Changes to mkbootdisk script. Typo fixes.
  
  Revision  Changes    Path
  1.4       +196 -171  hints/uclibc-bootfloppy.txt
  
  Index: uclibc-bootfloppy.txt
  ===================================================================
  RCS file: /home/cvsroot/hints/uclibc-bootfloppy.txt,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- uclibc-bootfloppy.txt	20 Jun 2003 20:18:28 -0000	1.3
  +++ uclibc-bootfloppy.txt	8 Jul 2003 16:54:19 -0000	1.4
  @@ -1,6 +1,6 @@
   TITLE:		uClibc-based bootfloppy
   LFS VERSION:	All (tested against LFS-pre4.0)
  -AUTHOR:		Csaba Henk <ekho at renyi.hu>
  +AUTHOR:		Csaba Henk <ekho at math-inst.hu>
   
   SYNOPSIS: 
   	This hints shows a quick and dirty way of creating a
  @@ -8,7 +8,7 @@
   	lightweight C library. "Quick and dirty" means using an ad-hoc,
   	non-chroot, but safe development environment. 
   
  -VERSION:	0.1.1
  +VERSION:	0.5
   
   CONTENTS
   
  @@ -30,11 +30,11 @@
   
   * For the most recent version check out 
   
  -http://www.renyi.hu/~ekho/lowlife/uclibc-bootfloppy.txt
  +http://www.math-inst.hu/~ekho/lowlife/uclibc-bootfloppy.txt
   
   * See changelog at 
   
  -http://www.renyi.hu/~ekho/lowlife/Changelog
  +http://www.math-inst.hu/~ekho/lowlife/Changelog
   
   * Comments, ideas, critics, flames are welcome.
   
  @@ -80,14 +80,14 @@
   machine to an X terminal. (Check out the svnc-x_terminal hint:
   
   http://hints.linuxfromscratch.org/hints/svnc-x_terminal.txt
  -http://www.renyi.hu/~ekho/lowlife/svnc-x_terminal.txt
  +http://www.math-inst.hu/~ekho/lowlife/svnc-x_terminal.txt
   
   ) 
   
   Additional info and downloadable bootdisk image with svnc can be found
   at my homepage (or at its mirror):
   
  -http://www.renyi.hu/~ekho/lowlife/
  +http://www.math-inst.hu/~ekho/lowlife/
   http://www.personal.ceu.hu/students/01/Csaba_Henk/lowlife/
   
   In this hint the assumption of using an x86 PC (both for making and
  @@ -96,9 +96,10 @@
   be hard. Doing it with another compiler depends on how much does
   uClibc support that compiler.  
   
  -If you copy command from this hint to your shell, be careful
  -that line-terminating backslashes (\) will keep their position (no
  -whitespace characters should follow them).
  +If you copy command from this hint to your shell, be careful that
  +line-terminating backslashes (\) will keep their position (no whitespace
  +characters should follow them). A possible solution is open this hint in
  +the Vim GUI, and copy'n'paste from there.
   
   What do we need?
   ----------------
  @@ -132,8 +133,8 @@
   
   make menuconfig
   
  -uClibc now has a configuration interface similar to the linux kernel.
  -Apply the following setting:
  +uClibc now has a configuration interface similar to that of the linux
  +kernel.  Apply the following setting:
   
   Library Installation Options  --->
   	(/lib) Shared library loader path 
  @@ -142,7 +143,7 @@
   not change anything (especially you need not use full math support). However,
   taking a look at the options never hurts; you should make sure that the "Linux
   kernel header location" field is filled in correctly (if the kernel release you
  -use for the floppy is not the some as the one used on the development platform,
  +use for the floppy is not the same as the one used on the development platform,
   you should use the headers of the release used for the floppy), and you may
   consider fine-tuning the target processor type. After you exit, 
   
  @@ -196,7 +197,7 @@
        
   A realization of mkbootdisk can be found in Appendix A, or at
   
  -http://www.renyi.hu/~ekho/lowlife/mkbootdisk
  +http://www.math-inst.hu/~ekho/lowlife/mkbootdisk
   
   Typing "mkbootdisk -h" will print a brief information on usage.
   
  @@ -213,7 +214,7 @@
   decompressed in $HOME (which is the same as the prior $BDISKHOME). 
   Software installation instructions always start at the point when the
   source tarball is already decompressed and you entered the source
  -directory.
  +directory (unless we explicitely claim to act differently).
   
   Creating the root filesystem
   -----------------------------------------
  @@ -231,7 +232,11 @@
   
   The etc/init.d/rcS file will be the startup script for the floppy. Put
   there what you want to be done in the beginnig -- eg., syslogd, klogd,
  -loading modules, starting gpm, etc.   
  +loading modules, starting gpm, etc.  
  +
  +A very minimal etc directory is used in this setup. Enriching it (with
  +files like passwd, group, fstab, modules.conf, and so on) is up to you
  +-- this minimalist solution works anyway. 
   
   Installing uClibc for the bootdisk 
   ----------------------------------
  @@ -319,7 +324,7 @@
   If you have troubles with configuring the kernel properly, my .config file
   might be of your help:
   
  -http://www.renyi.hu/~ekho/lowlife/linux-2.4.19/.config
  +http://www.math-inst.hu/~ekho/lowlife/linux-2.4.19/.config
   
   Installing busybox
   ------------------
  @@ -340,15 +345,13 @@
   
   Then install it with
   
  -sed  '/^CROSS/s%\(^.*$\)%\1 i386-uclibc-%' Makefile > Makefile.tmp &&
  -mv Makefile.tmp Makefile &&
  -make &&
  +make CROSS=i386-uclibc- &&
   make PREFIX=$HOME/rfloppy install
   
   If you have troubles with configuring busybox properly, my Config.h file
   might be of your help:
   
  -http://www.renyi.hu/~ekho/lowlife/busybox-0.60.5/Config.h
  +http://www.math-inst.hu/~ekho/lowlife/busybox-0.60.5/Config.h
   
   Installing gpm
   --------------
  @@ -383,11 +386,11 @@
   install it only if you know what you are doing. However, it needs to be
   hacked to get it compiled against uClibc. There is a patch for devfsd at 
   
  -http://www.renyi.hu/~ekho/lowlife/devfsd-1.3.25-uclibc.patch
  +http://www.math-inst.hu/~ekho/lowlife/devfsd-1.3.25-uclibc.patch
   
   and you can find some explanation on it at
   
  -http://www.renyi.hu/~ekho/lowlife/
  +http://www.math-inst.hu/~ekho/lowlife/
   
   Note that devfsd depends on the libdl.so.0 library of uClibc (which is a
   symlink to libdl-0.9.*.so). You have to put these to the /lib of your
  @@ -428,8 +431,8 @@
   the script (it is set to /dev/fd0 and no option can change it, in order
   to prevent the bootdisk user in being able to muck up the development
   platform), and whether the $MKE2FSAPP, $RDEVAPP variables in the script
  -store the correct path to the mke2fs, rdev utilities in your system. If
  -everything is fine, simply run 
  +store the correct path to the mke2fs, rdev utilities in your system
  +(they should if you follow standards). If everything is fine, simply run 
   
   cd &&
   sudo mkbootdisk
  @@ -465,7 +468,7 @@
   let KERNELSIZE=`dd bs=1k of=$DISK < linux-2.4.*/arch/i386/boot/bzImage 2>&1 | 
    sed -n '1s%\([0-9][0-9]*\).*%\1%p'`+1 &&
   # We perform some adjustments on the kernel copied to the floppy:
  -rdev $DISK $DISK &&
  +rdev $DISK 0,0 &&
   rdev -R $DISK 0 &&
   rdev -r $DISK `expr 16384 + $KERNELSIZE` &&
   # Finally we copy the compressed filesystem to its appropriate place \
  @@ -539,9 +542,9 @@
   
   
   DISK=/dev/fd0
  -DEVICE=$DISK
  +DEVICE="$DISK"
   FSDIR=rfloppy
  -FSGZ=/tmp/mkbootdisk-rootfs.gz.$$
  +unset FSGZ
   KERNEL=linux-`uname -r`/arch/i386/boot/bzImage
   TOADD=16384 # Comes from kernel internals, do no change!
   MKE2FSAPP=/sbin/mke2fs
  @@ -549,35 +552,34 @@
   # an absolute path because of the following: \
   # by my idea this script is used by a non-privileged user (via sudo) \
   # whose path does not contain the mke2fs, rdev executables 
  -MKBOOTREC=$HOME/.mkbootdisk
  +MKBOOTREC="$HOME"/.mkbootdisk
   EXTRA_SIZE=150 # Free space left on root filesystem of floppy
   EXTRA_INODES=100 # Free inodes left on filesystem of floppy
   FLOPPYSIZE=1440
  -VERSION="0.1.1"
  +VERSION="0.5"
   
   # Do not edit what follows unless your intention is hacking!
   
  -#ClearFSGZ=yes # Any value other than "no" implies the deletion of $FSGZ
   firstcheck=yes  
   compress=yes # Any value other than "no" defaults to production of a \
   #gzipped rootfs 
   KERNELSIZE=x
   [ -s "$MKBOOTREC" ] && KERNELSIZE=`cat "$MKBOOTREC"`
  -dokernelcopy=no
  -unset tmpfiles # tmpfiles are to be removed after all
  +dokernelcopy=no # Becomes yes if $KERNELSIZE set to a numerical value
  +unset TMPDIR
  +manuallysetkernelsize=no # This variable tracks down whether -r option is used
   
   #
   # Usage
   #
   
  -if [ "$1" = "-h" -o "$1" = "--help" ]
  -then 
  - echo "\
  ---------
  +if [ "$1" = "-h" -o "$1" = "--help" ]; then 
  +	echo "\
  +----------------
   Bootdisk creation utility, version $VERSION. Usage:
   With -h or --help being the 1st arg, this help is shown; otherwise
   
  -`basename $0` -k kernelimg -f filesys_dir -s filesys_size -i filesys_inodes \\
  +`basename "$0"` -k kernelimg -f filesys_dir -s filesys_size -i filesys_inodes \\
   -r kernelimg_size -c floppy_size [-g gzipped_filesys -d]
   
   where \"kernelimg\" is the linux kernel image to be booted by the floppy,
  @@ -605,18 +607,20 @@
   
   Further comments:
   
  -If kernel is copied, its size is stored in ~/`basename ${MKBOOTREC}` 
  -(delete that file before using a new kernel image, or use -r x !!)
  +If kernel is copied and -r was used with a non-numerical value, its size
  +is stored in ~/`basename "${MKBOOTREC}"` (delete that file before using a
  +new kernel image, or use -r x !!)
  +
  +For sake of safety, `basename "$0"` utilizes mktemp; if you don't have it
  +temporary file creation is still done as safely as it's possible
   
   Example:
   * A compressed filesystem is produced from the contents of filesys_dir by
  -	`basename $0` -r 0 -d > rootfs.gz
  +	`basename "$0"` -r 0 -d > rootfs.gz
   * A floppy can be made using this compressed filesystem by
  -	`basename $0` -g rootfs.gz
  -
  -And please avoid using space cakes in filenames :)
  ---------"
  - exit 1
  +	`basename "$0"` -g rootfs.gz
  +----------------"
  +	exit 1
   fi
   
   
  @@ -624,20 +628,21 @@
   # Getting options
   #
   
  -while getopts "g:k:f:dr:c:s:i:" option
  -do
  - case $option in 
  -  g) FSGZ=$OPTARG
  -     compress=no;;
  -  k) KERNEL=$OPTARG;;
  -  f) FSDIR=$OPTARG;;
  -  d) DEVICE="&1";;
  -  r) KERNELSIZE=$OPTARG ;;
  -  c) FLOPPYSIZE=$OPTARG;;
  -  i) INODES=$OPTARG;; 
  -  s) SIZE=$OPTARG;;
  -  *) exit 1;;
  - esac
  +while getopts "g:k:f:dr:c:s:i:" option; do
  +	case $option in 
  +		g) FSGZ="$OPTARG"
  +		   compress=no;;
  +		k) KERNEL="$OPTARG";;
  +		f) FSDIR="$OPTARG";;
  +		d) DEVICE="&1";;
  +		r) KERNELSIZE="$OPTARG"
  +		   [ "$OPTARG" -ge 0 ] &>/dev/null && 
  +		   manuallysetkernelsize=yes;;
  +		c) FLOPPYSIZE="$OPTARG";;
  +		i) INODES="$OPTARG";; 
  +		s) SIZE="$OPTARG";;
  +		*) exit 1;;
  +	 esac
   done
   
   
  @@ -655,29 +660,49 @@
   
   gzipimp()
   {
  - dd if=$1 bs=1k | gzip -v9 > $2
  -# I could not figure out why it is the way to do gzipping, but this is
  -# what is suggested by the clever guys. I'd be happy to be informed
  -# about it...
  -} #Be careful! Changing it might break check()
  +	dd if=$1 bs=1k | gzip -v9 > $2
  +	# I could not figure out why it is the way to do gzipping, but this is
  +	# what is suggested by the clever guys. I'd be happy to be informed
  +	# about it...
  +} 
   
   #cleanup -- removes temporary files
   
   cleanup()
   {
  - [ -z "$tmpfiles" ] || echo "Removing temporary files..." >&2 
  - rm -rf $tmpfiles >&2 
  +	[ -e "$TMPDIR" ] && echo "Removing temporary files..." >&2 
  +	rm -rf "$TMPDIR" >&2 
   }
   
   #error -- if something goes wrong... 
   
   error()
   {
  - echo Error: "$1" >&2
  - cleanup
  - exit 1
  +	echo Error: "$1" >&2
  +	cleanup
  +	exit 1
   } 
   
  +#maketmpdir -- creates a tmp dir as safely as possible
  +
  +maketmpdir()
  +{
  +	if ! TMPDIR=`mktemp -d /tmp/mkbootdisk.$$.XXXXXXXXXX 2>/dev/null`
  +	then
  +		TMPDIR=/tmp/mkbootdisk.$$.$RANDOM$RANDOM &&
  +		rm -rf "$TMPDIR" &&
  +		mkdir -m 700 "$TMPDIR"
  +	fi ||
  +	error "Unable to create temporary directory"	 
  +}
  +
  +#findoutFSGZ -- finds out the appropriate value of $FSGZ
  +
  +findoutFSGZ()
  +{
  +	[ $compress = yes ] && FSGZ="$TMPDIR"/mkbootdisk-gzipped_fs
  +}
  +
   #
   # Important fnc's
   
  @@ -686,54 +711,52 @@
   
   check()
   {
  - for v in RDEVAPP MKE2FS # Checking whether these apps can be found
  - do
  -  [ -x `eval echo \\$$v` ] ||
  -  error \
  -  "the value of \$$v is wrong -- `eval echo \\$$v` is not an executable"
  - done
  -
  - for v in SIZE INODES # Syntax check of variables
  - do
  -  [ -z `eval echo \\$$v` ] ||
  -  [ `eval echo \\$$v` -ge 0 ] &>/dev/null || 
  -  error "wrong value for option -- \$$v is not non-negative integer"  
  - done
  -
  - for v in FLOPPYSIZE KERNELSIZE
  - do 
  -  [ `eval echo \\$$v` = x ] ||
  -  [ `eval echo \\$$v` -ge 0 ] &>/dev/null ||
  -  error "Wrong value for option -- \$$v is neither x, nor non-negative \
  -integer"
  - done
  -
  - if [ "$compress" != no ]  # checking whether $FSDIR is a directory
  - then 
  -  [ -d $FSDIR ] ||
  -  error "$FSDIR is not a directory (symlinks are not supported)"
  - fi
  -
  - if [ "$KERNELSIZE" = x ]  #checking whether the kernelimg exists
  - then 
  -  file -L $KERNEL |grep 'x86 boot sector' >/dev/null || 
  -  error "$KERNEL is not a kernelimg." 
  - else 
  -  [ "$firstcheck" = yes ] && 
  -  echo "A kernelimg of size $KERNELSIZE is supposed to be on the disk" >&2 
  - fi
  +	for v in RDEVAPP MKE2FSAPP; do #Checking whether these apps can be found
  +		[ -x "`eval echo \\$$v`" ] ||
  +		error \
  +"the value of \$$v is wrong -- `eval echo \\$$v` is not an executable"
  +	done
  +
  +	for v in SIZE INODES; do # Syntax check of variables
  +		[ -z "`eval echo \\$$v`" ] ||
  +		[ "`eval echo \\$$v`" -ge 0 ] &>/dev/null || 
  +		error \
  +"wrong value for option -- \$$v is not a non-negative integer"  
  +	done
  +
  +	for v in FLOPPYSIZE KERNELSIZE; do 
  +		[ "`eval echo \\$$v`" = x ] ||
  +		[ "`eval echo \\$$v`" -ge 0 ] &>/dev/null ||
  +		error \
  +"Wrong value for option -- \$$v is neither x, nor non-negative integer"
  +	done
  +
  +	if [ "$compress" != no ]; then # checking whether $FSDIR is a directory
  +		[ "`file -bL "$FSDIR"`" = directory ] ||
  +		error "$FSDIR is not a directory."
  +	fi
  +
  +	if [ $KERNELSIZE = x ]; then #checking whether the kernelimg exists
  +		[ "`file -bL "$KERNEL"`" = 'x86 boot sector' ] || 
  +		error "$KERNEL is not a kernelimg." 
  +	else 
  +		[ "$firstcheck" = yes ] && 
  +		echo \
  +"A kernelimg of size $KERNELSIZE is supposed to be on the disk,
  +kernel copying is skipped" >&2 
  +	fi
    
  - if [ "$compress" = no ] #checking whether the gzipped fs exists
  - then  
  -  file -L $FSGZ | grep \
  -  'gzip compressed data, from Unix, max compression'>/dev/null || 
  -  error "$FSGZ is not a gzipped file"
  -  [ "$firstcheck" = yes ] && 
  -  echo "An existing compressed filesystem is used as root filesystem,
  +	if [ "$compress" = no ]; then #checking whether the gzipped fs exists
  +		file -bL "$FSGZ" | grep \
  +		'gzip compressed data' > /dev/null || 
  +		error "$FSGZ is not a gzipped file"
  +		[ "$firstcheck" = yes ] && 
  +		echo \
  +"An existing compressed filesystem is used as root filesystem,
   filesystem creation is skipped." >&2 
  - fi
  +	fi
   
  - firstcheck= 
  +	firstcheck= 
   }
   
   # getfsdata -- Finds out size and inode number param's of the filesystem
  @@ -741,11 +764,14 @@
   
   getfsdata()
   {
  - [ -z "$SIZE" ] &&
  - SIZE=$(expr $EXTRA_SIZE + `du -s $FSDIR | awk '{print $1}'`)
  +	if [ $compress = yes ]; then
  +		[ -z "$SIZE" ] &&
  +		SIZE=$(expr $EXTRA_SIZE + `du -sD "$FSDIR" | awk '{print $1}'`)
  +	
  +		[ -z "$INODES" ] &&
  +		INODES=$(expr $EXTRA_INODES + `find "$FSDIR" -follow | wc -l`)
   
  - [ -z "$INODES" ] &&
  - INODES=$(expr $EXTRA_INODES + `find $FSDIR | wc -l`)
  +	fi
   }
   
   # compressfs -- Adjusts and compresses the filesystem
  @@ -753,30 +779,27 @@
   
   compressfs()
   {
  - [ "$compress" = no ] && return 0
  - compress=no
  +	[ "$compress" = no ] && return 0
  +	compress=no
   
  - tmpfs=/tmp/mkbootdisk-rfloppy.$$
  - tmpmountpt=/tmp/mkbootdisk-mountpt.$$
  - tmpfiles="$tmpfiles $tmpfs $tmpmountpt"
  +	tmpfs="$TMPDIR"/mkbootdisk-rfloppy
  +	tmpmountpt="$TMPDIR"/mkbootdisk-mountpt
    
  - echo \
  - "Creating an ext2 filesystem of size ${SIZE}k and with $INODES inodes" >&2
  - dd if=/dev/zero of=$tmpfs bs=1k count=$SIZE
  - yes | $MKE2FSAPP -m 0 -N $INODES $tmpfs > /dev/null 
  - mkdir -p $tmpmountpt
  - mount $tmpfs -o loop $tmpmountpt
  - rmdir $tmpmountpt/lost+found 
  - cp -a $FSDIR/* $tmpmountpt
  - chown -R 0:0 $tmpmountpt/*
  - if umount $tmpmountpt 
  - then
  -  echo "Compressing the file system..." >&2
  -  gzipimp $tmpfs $FSGZ
  -   tmpfiles="$tmpfiles $FSGZ" 
  - else
  -  error "some problem occured with unmounting the file system."
  - fi
  +	echo \
  +"Creating an ext2 filesystem of size ${SIZE}k and with $INODES inodes" >&2
  +	dd if=/dev/zero of="$tmpfs" bs=1k count=$SIZE
  +	yes | "$MKE2FSAPP" -m 0 -N $INODES "$tmpfs" > /dev/null 
  +	mkdir -p "$tmpmountpt"
  +	mount "$tmpfs" -o loop "$tmpmountpt"
  +	rmdir "$tmpmountpt"/lost+found 
  +	cp -a "$FSDIR"/* "$tmpmountpt"
  +	chown -R 0:0 "$tmpmountpt"/*
  +	if umount "$tmpmountpt"; then
  +		echo "Compressing the filesystem..." >&2
  +		gzipimp "$tmpfs" "$FSGZ"
  +	else
  +		error "some problem occured with unmounting the file system."
  +	fi
   }
   
   
  @@ -784,11 +807,11 @@
   
   floppysizecheck()
   {
  - [ $FLOPPYSIZE = x ] && return 0
  - FSGZSIZE=$(( `dd if=$FSGZ of=/dev/null bs=1k 2>&1 |
  -  sed -n '1s%\([0-9][0-9]*\).*%\1%p'` + 1 ))
  - [ $(($KERNELSIZE + $FSGZSIZE)) -gt $FLOPPYSIZE ] &&
  - error "
  +	[ $FLOPPYSIZE = x ] && return 0
  +	FSGZSIZE=$(( `dd if="$FSGZ" of=/dev/null bs=1k 2>&1 |
  +	 sed -n '1s%\([0-9][0-9]*\).*%\1%p'` + 1 ))
  +	[ $(($KERNELSIZE + $FSGZSIZE)) -gt $FLOPPYSIZE ] &&
  +	error "
   size of kernel: 	       $KERNELSIZE
   size of compressed filesystem: $FSGZSIZE
   are altogether:		       $KERNELSIZE + $FSGZSIZE = \
  @@ -800,37 +823,37 @@
   
   kernelcopy()
   {
  - [ $KERNELSIZE = x ] || return 0
  +	[ $KERNELSIZE = x ] || return 0
    
  - tmpdiskimg=/tmp/mkbootdisk-diskimg.$$ 
  - KERNELSIZE=$(( `dd if=$KERNEL of=$tmpdiskimg bs=1k 2>&1 |
  - sed -n '1s%\([0-9][0-9]*\).*%\1%p'` + 1 )) 
  - tmpfiles="$tmpfiles $tmpdiskimg"
  -
  - echo Adjusting the kernelimg to mount the file system as rootfs... >&2 
  - $RDEVAPP $tmpdiskimg $DISK # I hope it's OK for values of $DISK other \
  -# than /dev/fd0
  - $RDEVAPP -R $tmpdiskimg 0
  - $RDEVAPP -r $tmpdiskimg `expr $TOADD + $KERNELSIZE`
  - dokernelcopy=yes
  +	tmpdiskimg="$TMPDIR"/mkbootdisk-diskimg 
  +	echo Copying kernel to diskimage file... >&2
  +	KERNELSIZE=$(( `dd if="$KERNEL" of="$tmpdiskimg" bs=1k 2>&1 |
  +	 sed -n '1s%\([0-9][0-9]*\).*%\1%p'` + 1 )) ||
  +	error "cannot create disk image file" 
  +	echo $(( $KERNELSIZE - 1 ))+1 records in/out >&2
  +	[ $manuallysetkernelsize = yes ] || echo $KERNELSIZE > "$MKBOOTREC" 
  +
  +	echo Adjusting the kernelimg to mount the file system as rootfs... >&2 
  +	"$RDEVAPP" "$tmpdiskimg" 0,0 
  +	"$RDEVAPP" -R "$tmpdiskimg" 0
  +	"$RDEVAPP" -r "$tmpdiskimg" `expr $TOADD + $KERNELSIZE`
  +	dokernelcopy=yes
   }
   
   diskwrite()
   {
  - if [ $dokernelcopy = yes ]
  - then 
  -  echo "Creating the diskimage..." >&2
  -  dd if=$FSGZ of=$tmpdiskimg bs=1k seek=$KERNELSIZE 
  -  echo Writing the diskimage to device... >&2
  -  eval "dd if=$tmpdiskimg bs=1k >$DEVICE" 
  - elif [ $dokernelcopy = no ] 
  - then
  -  echo Writing the compressed file system to device... >&2
  -  eval "dd if=$FSGZ bs=1k seek=$KERNELSIZE >$DEVICE"
  - else
  -  error 'bogus value for $dokernelcopy' 
  - fi || 
  - error "it seems that there is some problem with the target device."
  +	if [ $dokernelcopy = yes ]; then 
  +		echo "Completing the diskimage..." >&2
  +		dd if="$FSGZ" of="$tmpdiskimg" bs=1k seek=$KERNELSIZE 
  +		echo Writing the diskimage to device... >&2
  +		eval "dd if=$tmpdiskimg bs=1k >$DEVICE" 
  +	elif [ $dokernelcopy = no ]; then
  +		echo Writing the compressed file system to device... >&2
  +		eval "dd bs=1k seek=$KERNELSIZE >$DEVICE" < "$FSGZ"
  +	else
  +		error 'bogus value for $dokernelcopy' 
  +	fi || 
  +	error "it seems that there is some problem with the target device."
   }
   
   
  @@ -838,6 +861,8 @@
   # Program body
   #
   
  +maketmpdir
  +findoutFSGZ
   check
   getfsdata
   compressfs
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list