slitaz-tools rev 651

bootfloppybox: no default target directory in install.sh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 17 13:31:29 2011 +0200 (2011-07-17)
parents d564f29ba19e
children 4a255568f7fa
files tinyutils/bootfloppybox
line diff
     1.1 --- a/tinyutils/bootfloppybox	Sun Jul 10 22:29:10 2011 +0200
     1.2 +++ b/tinyutils/bootfloppybox	Sun Jul 17 13:31:29 2011 +0200
     1.3 @@ -240,6 +240,9 @@
     1.4  buildinit()
     1.5  {
     1.6  	mv $1/init $1/init.org
     1.7 +	for i in /dev/tty0 /dev/[sh]d[ab]? ; do
     1.8 +		[ -e $1$i ] || cp -a $i $1/dev
     1.9 +	done
    1.10  	cat > $1/init <<EOTEOT
    1.11  #!/bin/sh
    1.12  
    1.13 @@ -325,7 +328,10 @@
    1.14  	cat > /mnt/slitaz/install.sh <<EOT
    1.15  #!/bin/sh
    1.16  
    1.17 -[ -n "\\\$1" ] || set -- .
    1.18 +if [ -z "\\\$1" ]; then
    1.19 +	echo "Usage: \\\$0 target-directory"
    1.20 +	exit 1
    1.21 +fi
    1.22  cd \\\$1
    1.23  dir=\\\$(dirname \\\$0)
    1.24  for i in 0 \$rootfslist ; do
    1.25 @@ -359,7 +365,7 @@
    1.26  	chmod +x /mnt/slitaz/install.sh
    1.27  	num=1
    1.28  	name="the Linux kernel"
    1.29 -	dd count=0 of=/mnt/slitaz/bzImage.fd
    1.30 +	dd count=0 of=/mnt/slitaz/bzImage.fd > /dev/null 2>&1
    1.31  	fullsize=1
    1.32  	while [ \$(stat -c %s /mnt/slitaz/bzImage.fd) -lt \$fullsize ]; do
    1.33  		cat_floppy /mnt/slitaz/bzImage.fd
    1.34 @@ -383,7 +389,7 @@
    1.35  	dd if=/mnt/slitaz/bzImage.fd bs=512 skip=\$((\$setup+1+\$cmdline/512)) >> /mnt/slitaz/bzImage
    1.36  	rm -f /mnt/slitaz/bzImage.fd
    1.37  	size=\$((512 + \$setup * 512 + \$syssize * 16))
    1.38 -	dd bs=1 seek=\$size count=0 of=/mnt/slitaz/bzImage
    1.39 +	dd bs=1 seek=\$size count=0 of=/mnt/slitaz/bzImage > /dev/null 2>&1
    1.40  	[ \$(stat -c %s /mnt/slitaz/bzImage) -eq \$size ] ||
    1.41  	mv -f /mnt/slitaz /mnt/slitaz-aborted
    1.42  fi