usbimg2disk.sh issue in -current / 14.1
Hello folks,
I was trying to make a bootable USB stick containing the 64bit kernel from -current, using a 64bit Slackware 14.1 install. It works fine & boots OK if I dd the usbboot.img straight to the stick, but the usbimg2disk.sh script (from slackware64-current/usb-and-pxe-installers) fails. From looking at the script, "fdisk" is used to partition the stick, then "sfdisk" is used to set a partition active (bootable). It seems as if "sfdisk" does not like the partition table previously made by Slackware's "fdisk". Code:
root@anvil:/home/marc/LinuxStuff/slackware/slackware64-current/usb-and-pxe-installers# sh usbimg2disk.sh -i ./usbboot.img -o /dev/sdd -f Code:
root@anvil:~# echo ',,,*' | /sbin/sfdisk /dev/sdd -N1 Code:
--- usbimg2disk.sh 2015-11-10 17:53:14.000000000 +0000 After this I can successfully make a bootable USB stick. It booted OK on the one machine I tried. Will try a few more. Marc |
Does it run partprobe after creating the new partition table? Maybe that would make a difference if it's not doing it.
|
I ran the following to make my usb stick ready before running the usbimg2disk.sh script:
# cfdisk -z /dev/XXX # that is the cfdisk command, not the cgdisk command. replace XXX with your device name(sdb, sdd, etc.). This opens the partition editor with a blank slate. Pick 'dos' for the label type if using the newest versions that support GPT, etc. Then just write-out a new blank table. The usbimg2disk script will partition it and format for you. Hope that helps. |
I don't think partprobe is needed. fdisk automatically re-reads the partition table.
I believe the issue is fdisk creates a partition table with a CHS geometry that sfdisk doesn't like. |
Retested with 14.2 beta (and a different USB stick) and the issue with usbimg2disk.sh remains.
Code:
root@anvil:/home/marc/LinuxStuff/slackware/slackware64-current/usb-and-pxe-installers# sh usbimg2disk.sh -f -i /home/marc/LinuxStuff/slackware/slackware64-current/usb-and-pxe-installers/usbboot.img -L Slack14.2B -o /dev/sdd The problem is caused by "sfdisk" (which is used in line 470 to make a partition active), which does not like the partition table created by "fdisk" on line 101. Code:
root@anvil:/home/marc/LinuxStuff/slackware/slackware64-current/usb-and-pxe-installers# echo ',,,*' | /sbin/sfdisk /dev/sdd -N1 The patch in the first post fixes this issue by using "parted" to set the active partition instead of sfdisk (but creates a dependency on parted being installed). Alternatively this patch fixes the issue using by using fdisk to set the active partition: Code:
--- usbimg2disk.sh 2015-11-10 17:53:14.000000000 +0000 |
All times are GMT -5. The time now is 04:28 PM. |