Bug#951708: Info received (Bug#951708: buildd.debian.org: "which" command doesn't find /sbin/ssdisk causing script failure)
as superuser, makeHDD script ran fine in Debian 9 On 2/20/20 6:21 AM, Debian Bug Tracking System wrote: Thank you for the additional information you have supplied regarding this Bug report. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Debian Buildd Team If you wish to submit further information on this problem, please send it to 951...@bugs.debian.org. Please do not send mail to ow...@bugs.debian.org unless you wish to report a problem with the Bug-tracking system.
Bug#951708: buildd.debian.org: "which" command doesn't find /sbin/ssdisk causing script failure
I was trying to run attached script makeHDD, and it failed saying /sbin/sfdisk was not found. I ran the "which" command from the command line and it returned no result. I went to /sbin and found sfdisk is there. I also found blockdev in /sbin but the "which" command did not find it. So the "which" command, which is in the script, appears not to work for /sbin. Here's the script line: # check that sfdisk is available, exit if not sfdiskpath=`which sfdisk 2> /dev/null` if [ "$?" != "0" ]; then echo "Required file sfdisk (typically /sbin/sfdisk) not found on the system...exiting" echo exit 1 fi On 2/20/20 5:57 AM, Don Holmes wrote: Package: buildd.debian.org Severity: normal Dear Maintainer, *** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? * What exactly did you do (or not do) that was effective (or ineffective)? * What was the outcome of this action? * What outcome did you expect instead? *** End of the template - remove these template lines *** -- System Information: Debian Release: 10.3 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.19.0-8-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled #! /bin/bash . "${BASH_SOURCE%/*}/inisup" clear echo "~~" echo " The makeHDD script to install to hard drive or UFD - TeraByte, Inc." echo "~~" echo # Once installed to a partition (FAT16/32 or Ext2), that partition can be slid, # copied, imaged/restored and will still boot. If installed to ext2, the partition # can also be resized, but not for FAT16/32. # although root not required if permissions are correct, there's too much # chance that they aren't, and fixing it is dependent on distro and user's # knowledge of Linux # check running as root userid=`id -u` if [ ! "$userid" = "0" ]; then echo "This script must be run as root...exiting" echo exit 1 fi # check if running from iflnet or from a distro # if running from disk, determine if iflbuild dir contains the boot disk config items # if so, run as if intalled on a distro, with the same options to create custom disks if [ -f /tbu/utility/running ]; then rundir=`pwd` if [ "$rundir" = "/tbu/iflbuild" ] && [ "$0" = "./makeHDD" ]; then runmode=distro util=util tbosdtpath="./util/tbosdt" else runmode=running util=utility tbosdtpath="/tbu/tbosdt" cd /tbu fi else util=util tbosdtpath="./util/tbosdt" runmode=distro fi # get directory owner id currentdir=`pwd` if [ "$runmode" = "distro" ]; then # get directory owner and group currentdir=`pwd` ownerid=`stat -c %U $currentdir` groupid=`stat -c %G $currentdir` if [ "$ownerid" = "root" ]; then ownerid=0; fi if [ "$groupid" = "root" ]; then groupid=0; fi if [ "$currentdir" = "/" ]; then echo "This script cannot be run from the / directory...exiting" echo exit 1 fi # chown all files and directories to owner:group # as precaution make sure running from IFL dir, otherwise don't do it if [ "$0" = "./makeHDD" ]; then chown -R $ownerid:$groupid util 2> /dev/null chown -R $ownerid:$groupid help 2> /dev/null chown -R $ownerid:$groupid wireless 2> /dev/null chown -R $ownerid:$groupid scripts 2> /dev/null chown -R $ownerid:$groupid iscsi 2> /dev/null chown -R $ownerid:$groupid cdboot 2> /dev/null chown -R $ownerid:$groupid pxe 2> /dev/null chown -R $ownerid:$groupid grub 2> /dev/null chown -R $ownerid:$groupid tbosdtfiles 2> /dev/null chown $ownerid:$groupid * fi else ownerid=0; groupid=0 fi # check for read/write access and running on Linux fs tf1=0;tf2=0 for i in `seq 1 5000` do if [ "$tf1" = "0" ]; then if [ ! -f t$i ] && [ ! -d t$i ]; then tf1=t$i; fi elif [ "$tf2" = "0" ]; then if [ ! -f t$i ] && [ ! -d t$i ]; then tf2=t$i; fi else break fi done if [ ! "$tf1" = "0" ] && [ ! "$tf2" = "0" ]; then touch $tf1 2> /dev/null if [ ! -e $tf1 ]; then echo "Unable to create a test file. This indicates that this partition" echo "is mounted read only. To work with the IFL disk from Linux, the" echo "zip archive must be extracted on a *Linux* partition, and that" echo "partition must be mounted with read/write privileges...exiting" echo exit 1 fi chmod +x $tf1 chmod -x $tf1 cp $tf1 $tf2 if [ -x $tf2 ]; then rm $tf1; rm
Bug#951708: buildd.debian.org: "which" command doesn't find /sbin/ssdisk causing script failure
Package: buildd.debian.org Severity: normal Dear Maintainer, *** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? * What exactly did you do (or not do) that was effective (or ineffective)? * What was the outcome of this action? * What outcome did you expect instead? *** End of the template - remove these template lines *** -- System Information: Debian Release: 10.3 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.19.0-8-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled #! /bin/bash . "${BASH_SOURCE%/*}/inisup" clear echo "~~" echo " The makeHDD script to install to hard drive or UFD - TeraByte, Inc." echo "~~" echo # Once installed to a partition (FAT16/32 or Ext2), that partition can be slid, # copied, imaged/restored and will still boot. If installed to ext2, the partition # can also be resized, but not for FAT16/32. # although root not required if permissions are correct, there's too much # chance that they aren't, and fixing it is dependent on distro and user's # knowledge of Linux # check running as root userid=`id -u` if [ ! "$userid" = "0" ]; then echo "This script must be run as root...exiting" echo exit 1 fi # check if running from iflnet or from a distro # if running from disk, determine if iflbuild dir contains the boot disk config items # if so, run as if intalled on a distro, with the same options to create custom disks if [ -f /tbu/utility/running ]; then rundir=`pwd` if [ "$rundir" = "/tbu/iflbuild" ] && [ "$0" = "./makeHDD" ]; then runmode=distro util=util tbosdtpath="./util/tbosdt" else runmode=running util=utility tbosdtpath="/tbu/tbosdt" cd /tbu fi else util=util tbosdtpath="./util/tbosdt" runmode=distro fi # get directory owner id currentdir=`pwd` if [ "$runmode" = "distro" ]; then # get directory owner and group currentdir=`pwd` ownerid=`stat -c %U $currentdir` groupid=`stat -c %G $currentdir` if [ "$ownerid" = "root" ]; then ownerid=0; fi if [ "$groupid" = "root" ]; then groupid=0; fi if [ "$currentdir" = "/" ]; then echo "This script cannot be run from the / directory...exiting" echo exit 1 fi # chown all files and directories to owner:group # as precaution make sure running from IFL dir, otherwise don't do it if [ "$0" = "./makeHDD" ]; then chown -R $ownerid:$groupid util 2> /dev/null chown -R $ownerid:$groupid help 2> /dev/null chown -R $ownerid:$groupid wireless 2> /dev/null chown -R $ownerid:$groupid scripts 2> /dev/null chown -R $ownerid:$groupid iscsi 2> /dev/null chown -R $ownerid:$groupid cdboot 2> /dev/null chown -R $ownerid:$groupid pxe 2> /dev/null chown -R $ownerid:$groupid grub 2> /dev/null chown -R $ownerid:$groupid tbosdtfiles 2> /dev/null chown $ownerid:$groupid * fi else ownerid=0; groupid=0 fi # check for read/write access and running on Linux fs tf1=0;tf2=0 for i in `seq 1 5000` do if [ "$tf1" = "0" ]; then if [ ! -f t$i ] && [ ! -d t$i ]; then tf1=t$i; fi elif [ "$tf2" = "0" ]; then if [ ! -f t$i ] && [ ! -d t$i ]; then tf2=t$i; fi else break fi done if [ ! "$tf1" = "0" ] && [ ! "$tf2" = "0" ]; then touch $tf1 2> /dev/null if [ ! -e $tf1 ]; then echo "Unable to create a test file. This indicates that this partition" echo "is mounted read only. To work with the IFL disk from Linux, the" echo "zip archive must be extracted on a *Linux* partition, and that" echo "partition must be mounted with read/write privileges...exiting" echo exit 1 fi chmod +x $tf1 chmod -x $tf1 cp $tf1 $tf2 if [ -x $tf2 ]; then rm $tf1; rm $tf2 echo "This script must be run on a Linux file system. It appears to be" echo "either FAT/FAT32 or NTFS. Please extract the IFL zip archive on" echo "a Linux partition (ext2/3/4 or reiserfs)...exiting" echo exit 1 fi rm $tf1; rm $tf2 fi # if no /sys/block exit (usually means old kernel < 2.6.x) # script depends heavily on /sys/block to get device information # Note: contents of /sys/block vary between older/newer 2.6.x kernels # This script attempts to use only data that is common among them if [ ! -d /sys/block ]; then echo "The /sys/block directory is not present on this system." echo "makeHDD