From d31c50870d0bee042ce660e445c9294a59a3a65b Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Thu, 30 Jun 2016 20:26:57 +0000 Subject: Slackware 14.2 Thu Jun 30 20:26:57 UTC 2016 Slackware 14.2 x86_64 stable is released! The long development cycle (the Linux community has lately been living in "interesting times", as they say) is finally behind us, and we're proud to announce the release of Slackware 14.2. The new release brings many updates and modern tools, has switched from udev to eudev (no systemd), and adds well over a hundred new packages to the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-) --- usb-and-pxe-installers/usbimg2disk.sh | 61 ++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'usb-and-pxe-installers') diff --git a/usb-and-pxe-installers/usbimg2disk.sh b/usb-and-pxe-installers/usbimg2disk.sh index ec5a735a..57e8598e 100644 --- a/usb-and-pxe-installers/usbimg2disk.sh +++ b/usb-and-pxe-installers/usbimg2disk.sh @@ -21,9 +21,6 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Paranoid as usual: -set -e - # Define some variables ahead of time, so that cleanup knows about them: MNTDIR1="" MNTDIR2="" @@ -32,13 +29,13 @@ MNTDIR3="" # Clean up in case of failure: cleanup() { # Clean up by unmounting our loopmounts, deleting tempfiles: - echo "--- Cleaning up the staging area..." + echo "--- Syncing I/O..." sync + echo "--- Unmounting volumes and deleting temporary files..." [ ! -z "${MNTDIR1}" ] && ( umount -f ${MNTDIR1} ; rmdir $MNTDIR1 ) [ ! -z "${MNTDIR2}" ] && ( umount -f ${MNTDIR2} ; rmdir $MNTDIR2 ) [ ! -z "${MNTDIR3}" ] && rm -rf ${MNTDIR3} || true } -trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM showhelp() { echo "# " @@ -58,6 +55,7 @@ showhelp() { echo "# " echo "# $(basename $0) accepts the following parameters:" echo "# -h|--help This help" + echo "# -e|--errors Abort operations in case of any errors" echo "# -f|--format Format the USB drive before use" echo "# -i|--infile Full path to the usbboot.img file" echo "# -l|--logfile Optional logfile to catch fdisk output" @@ -94,9 +92,6 @@ reformat() { # Wipe the MBR: dd if=/dev/zero of=$TOWIPE bs=512 count=1 - # Temporarily accept errors (so that we can examine them): - set +e - # create a FAT32 partition (type 'b') /sbin/fdisk $TOWIPE <>$LOGFILE 2>&1 + ( reformat $TARGET "${FATLABEL}" ) 1>>$LOGFILE 2>&1 else # We do not format the drive, but apply a FAT label if required. @@ -358,12 +369,10 @@ else # User gave us a FAT label to use, so we will force that upon the drive: echo "--- Setting FAT partition label to '$FATLABEL'" MTOOLSRC=$MTOOLSRCFILE mlabel s:${FATLABEL} - elif [ -n "$(/sbin/blkid -t TYPE=vfat -s LABEL -o export $TARGETPART)" ] ; then + elif [ -n "$(/sbin/blkid -t TYPE=vfat -s LABEL -o value $TARGETPART)" ] ; then # User did not care, but the USB stick has a FAT label that we will use: - eval $(/sbin/blkid -t TYPE=vfat -s LABEL -o export $TARGETPART) - FATLABEL=$LABEL + FATLABEL="$(/sbin/blkid -t TYPE=vfat -s LABEL -o value $TARGETPART)" echo "--- Using current FAT partition label '$FATLABEL'" - unset LABEL else # No user-supplied label, nor a drive label present. We apply our default: echo "--- Setting FAT partition label to '$FATLABEL'" @@ -449,11 +458,9 @@ if [ $UNATTENDED -eq 0 ]; then fi fi -# Copy boot image files to the USB disk in its own subdirectory '/syslinux': +# Copy boot image files to the USB disk: echo "--- Copying boot files to the USB drive..." -mkdir -p $MNTDIR2/syslinux -cp -R $MNTDIR1/* $MNTDIR2/syslinux/ -rm -f $MNTDIR2/syslinux/ldlinux.sys +cp -R $MNTDIR1/* $MNTDIR2 # If we are creating a full Slackware installer, copy the package tree: if [ "$FULLINSTALLER" = "yes" ]; then @@ -469,7 +476,9 @@ cleanup # Run syslinux and write a good MBR: echo "--- Making the USB drive '$TARGET' bootable..." ( makebootable $TARGET ) 1>>$LOGFILE 2>&1 -/usr/bin/syslinux -s -d /syslinux $TARGETPART 1>>$LOGFILE 2>&1 +/usr/bin/syslinux -s $TARGETPART 1>>$LOGFILE 2>&1 dd if=$MBRBIN of=$TARGET 1>>$LOGFILE 2>&1 +echo "--- Done." + # THE END -- cgit v1.2.3