Commit 0cdc8a7d authored by Michael Shigorin's avatar Michael Shigorin

tar2fs: fixed broken sfdisk use

Yet another age old bug: `sfdisk -l' is mimicking what a person does by hand but the script is rather interested in what `sfdisk -g' provides, that is, geometry. And it's stupid enough to only grok C locale.
parent 1d0d1cea
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# tar2fs chroot.tar image.raw [size_in_bytes [fstype]] # tar2fs chroot.tar image.raw [size_in_bytes [fstype]]
. shell-error . shell-error
export LANG=C
if [ $# -lt 2 ]; then if [ $# -lt 2 ]; then
fatal "error: tar2fs needs at least two arguments" fatal "error: tar2fs needs at least two arguments"
...@@ -211,8 +212,8 @@ sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab" ...@@ -211,8 +212,8 @@ sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab"
if [ -x "$ROOTFS"/sbin/lilo ]; then if [ -x "$ROOTFS"/sbin/lilo ]; then
# configure and install bootloader # configure and install bootloader
REGEXP='^Disk .*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$' REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$'
set -- $(sfdisk -l "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@") set -- $(sfdisk -g "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@")
LILO_COMMON="lba32 LILO_COMMON="lba32
delay=1 delay=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment