usbimg2disk.sh FAILED at line 464
by babydr from LinuxQuestions.org on (#5RS23)
Pre-fdisked the usb stick (as seen below) .
/sbin/mkdosfs -F32 -n SWCURENT /dev/sdh1
Then ...
Code:# ~/bin/usbimg2disk.sh -l ~/usbimg2disk-slackwarecurrent-usb-20211106.log \
-i /home/ftp/pub/Linux/Slackware/slackware-current/\
usb-and-pxe-installers/usbboot.img \
-s /home/ftp/pub/Linux/Slackware/slackware-current -o /dev/sdh
# We are going to use this device - '/dev/sdh':
# Vendor : General
# Model : UDisk
# Size : 15400 MB
#
# FDISK OUTPUT:
# Disk /dev/sdh: 15 GiB, 16148070400 bytes, 31539200 sectors
# Units: sectors of 1 * 512 = 512 bytes
# Sector size (logical/physical): 512 bytes / 512 bytes
# I/O size (minimum/optimal): 512 bytes / 512 bytes
# Disklabel type: gpt
# Disk identifier: 3585108A-4F3D-40DE-BA0F-2557B5BFEB1F
#
# Device Start End Sectors Size Type
# /dev/sdh1 2099200 31539166 29439967 14G Microsoft basic data
# /dev/sdh2 2048 2099199 2097152 1G EFI System
#
# Partition table entries are not in disk order.
*** ***
*** If this is the wrong drive, then press CONTROL-C now! ***
*** ***
Or press ENTER to continue:
--- Using current FAT partition label 'SWCURENT'
--- Available free space on the the USB drive is 14617728 KB
--- Required free space for installer: 88448 KB
--- Your USB drive contains directories 'syslinux' and/or 'slackware-current'
--- These will be overwritten. Press CTRL-C to abort now!
Or press ENTER to continue:
--- Copying boot files to the USB drive...
--- Extracting Slackware initrd.img...
*** /root/bin/usbimg2disk.sh FAILED at line 464 ***
--- Cleaning up the staging area...The offending line in the script from the 'at line' above ...
Code:# Copy boot image files to the USB disk in its own subdirectory '/syslinux':
echo "--- Copying boot files to the USB drive..."
mkdir -p $MNTDIR2/syslinux
cp -R $MNTDIR1/* $MNTDIR2/syslinux/
rm -f $MNTDIR2/syslinux/ldlinux.sys
# If we are creating a full Slackware installer, there is a lot more to do:
if [ "$FULLINSTALLER" = "yes" ]; then
# Extract the Slackware initrd for modifications we have to do:
echo "--- Extracting Slackware initrd.img..."
( cd ${MNTDIR3}/
gunzip -cd ${MNTDIR2}/syslinux/initrd.img | cpio -i -d -H newc --no-absolute-filenames
) 2>>$LOGFILE
[^^^ line 464 of 502 (92%), character 15396 of 16901 (91%) ^^^ ]
# Modify installer files so that installing from USB stick will be easier:
echo "--- Modifying installer files..."
( cd ${MNTDIR3}/
# Try to automatically mount the installer partition:
mkdir usbinstall
echo "mount -t vfat -o ro,shortname=mixed \$(/sbin/blkid -t LABEL=$FATLABEL | cut -f1 -d:) /usbinstall 1>/dev/null 2>&1" >> etc$
# Adapt the dialogs so that pressing [OK] will be all there is to it:
sed -i -e 's# --menu# --default-item 6 --menu#' usr/lib/setup/SeTmedia
sed -i -e "s# 2> \$TMP/sourcedir# /usbinstall/$(basename $REPOSROOT)/$PKGDIR 2> \$TMP/sourcedir#" usr/lib/setup/INSdir
FIXF=$(find usr/lib/setup -name SeTp*media)
sed -i -e 's# --menu# --default-item 3 --menu#' $FIXF
) 2>>$LOGFILEContents of Log file seems to hit the nail on the head , Now just need to see why ...
Code:# cat ~/usbimg2disk-slackwarecurrent-usb-20211106.log
gzip: /mnt/usb.R6lb7c/syslinux/initrd.img: not in gzip format
cpio: premature end of file
/sbin/mkdosfs -F32 -n SWCURENT /dev/sdh1
Then ...
Code:# ~/bin/usbimg2disk.sh -l ~/usbimg2disk-slackwarecurrent-usb-20211106.log \
-i /home/ftp/pub/Linux/Slackware/slackware-current/\
usb-and-pxe-installers/usbboot.img \
-s /home/ftp/pub/Linux/Slackware/slackware-current -o /dev/sdh
# We are going to use this device - '/dev/sdh':
# Vendor : General
# Model : UDisk
# Size : 15400 MB
#
# FDISK OUTPUT:
# Disk /dev/sdh: 15 GiB, 16148070400 bytes, 31539200 sectors
# Units: sectors of 1 * 512 = 512 bytes
# Sector size (logical/physical): 512 bytes / 512 bytes
# I/O size (minimum/optimal): 512 bytes / 512 bytes
# Disklabel type: gpt
# Disk identifier: 3585108A-4F3D-40DE-BA0F-2557B5BFEB1F
#
# Device Start End Sectors Size Type
# /dev/sdh1 2099200 31539166 29439967 14G Microsoft basic data
# /dev/sdh2 2048 2099199 2097152 1G EFI System
#
# Partition table entries are not in disk order.
*** ***
*** If this is the wrong drive, then press CONTROL-C now! ***
*** ***
Or press ENTER to continue:
--- Using current FAT partition label 'SWCURENT'
--- Available free space on the the USB drive is 14617728 KB
--- Required free space for installer: 88448 KB
--- Your USB drive contains directories 'syslinux' and/or 'slackware-current'
--- These will be overwritten. Press CTRL-C to abort now!
Or press ENTER to continue:
--- Copying boot files to the USB drive...
--- Extracting Slackware initrd.img...
*** /root/bin/usbimg2disk.sh FAILED at line 464 ***
--- Cleaning up the staging area...The offending line in the script from the 'at line' above ...
Code:# Copy boot image files to the USB disk in its own subdirectory '/syslinux':
echo "--- Copying boot files to the USB drive..."
mkdir -p $MNTDIR2/syslinux
cp -R $MNTDIR1/* $MNTDIR2/syslinux/
rm -f $MNTDIR2/syslinux/ldlinux.sys
# If we are creating a full Slackware installer, there is a lot more to do:
if [ "$FULLINSTALLER" = "yes" ]; then
# Extract the Slackware initrd for modifications we have to do:
echo "--- Extracting Slackware initrd.img..."
( cd ${MNTDIR3}/
gunzip -cd ${MNTDIR2}/syslinux/initrd.img | cpio -i -d -H newc --no-absolute-filenames
) 2>>$LOGFILE
[^^^ line 464 of 502 (92%), character 15396 of 16901 (91%) ^^^ ]
# Modify installer files so that installing from USB stick will be easier:
echo "--- Modifying installer files..."
( cd ${MNTDIR3}/
# Try to automatically mount the installer partition:
mkdir usbinstall
echo "mount -t vfat -o ro,shortname=mixed \$(/sbin/blkid -t LABEL=$FATLABEL | cut -f1 -d:) /usbinstall 1>/dev/null 2>&1" >> etc$
# Adapt the dialogs so that pressing [OK] will be all there is to it:
sed -i -e 's# --menu# --default-item 6 --menu#' usr/lib/setup/SeTmedia
sed -i -e "s# 2> \$TMP/sourcedir# /usbinstall/$(basename $REPOSROOT)/$PKGDIR 2> \$TMP/sourcedir#" usr/lib/setup/INSdir
FIXF=$(find usr/lib/setup -name SeTp*media)
sed -i -e 's# --menu# --default-item 3 --menu#' $FIXF
) 2>>$LOGFILEContents of Log file seems to hit the nail on the head , Now just need to see why ...
Code:# cat ~/usbimg2disk-slackwarecurrent-usb-20211106.log
gzip: /mnt/usb.R6lb7c/syslinux/initrd.img: not in gzip format
cpio: premature end of file