4
# This file is part of util-linux.
6
# This file is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# This file is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
17
TS_TOPDIR="$(dirname $0)/../.."
18
TS_DESC="doslabel tests"
20
. $TS_TOPDIR/functions.sh
23
FDISK_CMD_ID1="x\ni\n0x1\nr\nw\n"
24
FDISK_CMD_ID2="x\ni\n0x2\nr\nw\n"
26
ts_log "Initialize empty image"
27
TEST_IMAGE_NAME=$(ts_image_init 10)
29
ts_log "Create MBR with ID=0x1"
30
echo -e "${FDISK_CMD_ID1}" | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
31
$TS_CMD_FDISK -l ${TEST_IMAGE_NAME} | grep identifier >> $TS_OUTPUT
33
ts_log "Create MBR with ID=0x2"
34
echo -e "${FDISK_CMD_ID2}" | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
35
$TS_CMD_FDISK -l ${TEST_IMAGE_NAME} | grep identifier >> $TS_OUTPUT