[BusyBox 0001619]: BusyBox 1.8.2 fdisk doesn't read from stdin
bugs at busybox.net
bugs at busybox.net
Wed Jan 30 20:55:20 UTC 2008
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=1619
======================================================================
Reported By: vicser
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 1619
Category: Standards Compliance
Reproducibility: always
Severity: major
Priority: normal
Status: feedback
======================================================================
Date Submitted: 11-30-2007 01:53 PST
Last Modified: 01-30-2008 12:55 PST
======================================================================
Summary: BusyBox 1.8.2 fdisk doesn't read from stdin
Description:
busybox is used for unattended Linux installations.
During the installation hard drive is partitioned by means of fdisk.
fdisk is used in a batch mode.
This means text file with fdisk commands is prepared -
see attached fdisk-commands file
(partition size values are variable, fdisk-commands is used to create 3
partitions -boot root and swap).
And then fdisk-commands file is passed to fdisk through the stdin.
Somthing like
fdisk /dev/hda < fdisk-commands
In all busybox till 1.7.3 this works fine
But in busybox 1.8.0-1.8.2 fdisk doesn't read commands from stdin.
======================================================================
----------------------------------------------------------------------
vda - 12-01-07 19:41
----------------------------------------------------------------------
Just built busybox 1.8.2 and tested it:
# echo q >Q
# strace -o fdisk.log ./busybox fdisk /dev/sda1 <Q
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF
disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
Warning: invalid flag 0x00,0x00 of partition table 4 will be corrected by
w(rite)
Command (m for help): q
#
strace log clearly shows that it did read from stdin:
write(1, "Command (m for help): ", 22) = 22
read(0, "q", 1) = 1
write(1, "q", 1) = 1
read(0, "\n", 1) = 1
write(1, "\n", 1) = 1
Please provide more details (your .config, and strace log of fdisk
invocation which doesn't work for you)
----------------------------------------------------------------------
iluxa - 01-30-08 12:55
----------------------------------------------------------------------
Apparently this busybox version expects all input to be line-buffered.
As a workaround, calling sync after sending each line will fix the
problem.
(line reading should be fixed instead, of course)
Issue History
Date Modified Username Field Change
======================================================================
11-30-07 01:53 vicser New Issue
11-30-07 01:53 vicser Status new => assigned
11-30-07 01:53 vicser Assigned To => BusyBox
11-30-07 01:53 vicser File Added: fdisk-commands
11-30-07 02:04 vicser Issue Monitored: vicser
11-30-07 02:04 vicser Issue End Monitor: vicser
12-01-07 19:41 vda Note Added: 0002994
12-01-07 19:41 vda Status assigned => feedback
01-30-08 12:55 iluxa Note Added: 0003624
======================================================================
More information about the busybox-cvs
mailing list