~pr0gg3d/ubuntu/oneiric/util-linux/bug-805886

« back to all changes in this revision

Viewing changes to tests/ts/fdisk/align-512-4K

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2010-03-22 17:35:40 UTC
  • mfrom: (1.6.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100322173540-sm083tdtvne1wa5w
Tags: 2.17.2-0ubuntu1
* Merge from Debian experimental, remaining changes:
  - Since udev is required in Ubuntu, the hwclock.sh init script is
    not called on startup and the hwclockfirst.sh init script is
    removed.
  - Use wildcards for symbols file, since they use versioned symbols
    properly.
  - Remove /etc/adjtime on upgrade if it was not used.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - No lsb_release call in mount.preinst since we'd need Pre-Depends
    (LP: #383697).
  - Do not install initramfs hook, since our initramfs already handles
    including blkid.
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.

* For the case where mount is called with a directory to mount, look
  that directory up in mountall's /lib/init/fstab if we couldn't find
  it mentioned anywhere else.  This means "mount /proc", "mount /sys",
  etc. work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
#
 
4
# This file is part of util-linux-ng.
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
16
 
 
17
 
 
18
#
 
19
# Test alignment for 512/512 disk *with* topology -- aligned to optimal
 
20
# I/O size (32KiB)
 
21
#
 
22
 
 
23
TS_TOPDIR="$(dirname $0)/../.."
 
24
TS_DESC="align 512/4K"
 
25
 
 
26
. $TS_TOPDIR/functions.sh
 
27
ts_init "$*"
 
28
ts_skip_nonroot
 
29
 
 
30
modprobe --dry-run --quiet scsi_debug
 
31
[ "$?" == 0 ] || ts_skip "missing scsi_debug module"
 
32
 
 
33
rmmod scsi_debug &> /dev/null
 
34
modprobe scsi_debug dev_size_mb=50 sector_size=512 physblk_exp=3
 
35
[ "$?" == 0 ] || ts_die "Cannot init device"
 
36
 
 
37
sleep 3
 
38
 
 
39
DEVNAME=$(grep scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}')
 
40
[ "x${DEVNAME}" == "x" ] && ts_die "Cannot found device"
 
41
 
 
42
DEVICE="/dev/${DEVNAME}"
 
43
 
 
44
ts_log "Create partitions"
 
45
$TS_CMD_FDISK ${DEVICE} >> $TS_OUTPUT 2>&1 <<EOF
 
46
c
 
47
u
 
48
n
 
49
p
 
50
1
 
51
 
 
52
+10M
 
53
n
 
54
p
 
55
2
 
56
 
 
57
+10M
 
58
n
 
59
p
 
60
3
 
61
 
 
62
+10M
 
63
n
 
64
e
 
65
 
 
66
 
 
67
n
 
68
 
 
69
+5M
 
70
n
 
71
 
 
72
+5M
 
73
n
 
74
 
 
75
 
 
76
p
 
77
w
 
78
q
 
79
EOF
 
80
 
 
81
ts_log "Alignment offsets:"
 
82
cat /sys/block/${DEVNAME}/${DEVNAME}{1,2,3,4,5,6,7}/alignment_offset >> $TS_OUTPUT 2>&1
 
83
 
 
84
sleep 3
 
85
rmmod scsi_debug
 
86
 
 
87
# remove disk ID
 
88
sed -i -e 's/Disk identifier:.*//g' $TS_OUTPUT
 
89
sed -i -e 's/Building a new.*//g' $TS_OUTPUT
 
90
 
 
91
ts_finalize