Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Patch is based from /usr/lib
- --- python2.7/dist-packages/curtin/commands/block_meta.py.orig 2014-10-28 02:19:38.000000000 +1000
- +++ python2.7/dist-packages/curtin/commands/block_meta.py 2014-12-13 14:17:02.763444917 +1000
- @@ -15,6 +15,7 @@
- # You should have received a copy of the GNU Affero General Public License
- # along with Curtin. If not, see <http://www.gnu.org/licenses/>.
- +import os
- from collections import OrderedDict
- from curtin import block
- from curtin import util
- @@ -199,6 +200,9 @@
- rootdev = devnode + "1"
- bootdev = None
- + if not os.path.exists(rootdev):
- + rootdev = devnode + "p1"
- +
- LOG.debug("rootdev=%s bootdev=%s fmt=%s bootpt=%s",
- rootdev, bootdev, ptfmt, bootpt)
- logtime("creating partition with: %s" % ' '.join(ptcmd),
- --- python2.7/dist-packages/curtin/block/__init__.py.orig 2014-10-28 02:19:38.000000000 +1000
- +++ python2.7/dist-packages/curtin/block/__init__.py 2014-12-13 14:18:26.055446550 +1000
- @@ -25,7 +25,7 @@
- def get_dev_name_entry(devname):
- - bname = os.path.basename(devname)
- + bname = devname.split('/dev/')[-1]
- return (bname, "/dev/" + bname)
- @@ -62,12 +62,14 @@
- 'TYPE', 'UUID']
- if args is None:
- args = []
- + args = [x.replace('!', '/') for x in args]
- # in order to avoid a very odd error with '-o' and all output fields above
- # we just drop one. doesn't really matter which one.
- keys.remove('SCHED')
- basecmd = ['lsblk', '--noheadings', '--bytes', '--pairs',
- '--output=' + ','.join(keys)]
- (out, _err) = util.subp(basecmd + list(args), capture=True)
- + out = out.replace('!', '/')
- return _lsblock_pairs_to_dict(out)
- @@ -132,9 +134,11 @@
- bname = os.path.basename(rpath)
- syspath = "/sys/class/block/%s" % bname
- -
- if not os.path.exists(syspath):
- - raise ValueError("%s had no syspath (%s)" % (devpath, syspath))
- + syspath2 = "/sys/class/block/cciss!%s" % bname
- + if not os.path.exists(syspath2):
- + raise ValueError("%s had no syspath (%s)" % (devpath, syspath))
- + syspath = syspath2
- ptpath = os.path.join(syspath, "partition")
- if not os.path.exists(ptpath):
- --- curtin/helpers/common.orig 2014-10-28 02:19:38.000000000 +1000
- +++ curtin/helpers/common 2014-12-13 14:20:44.335449262 +1000
- @@ -153,8 +153,8 @@
- if $isblk; then
- blockdev --rereadpt "$target"
- udevadm settle
- - [ -b "${target}1" ] ||
- - { error "no partition found ${target}1"; return 1; }
- + [ -b "${target}1" ] || [ -b "${target}p1" ] ||
- + { error "no partition found ${target}1 or ${target}p1"; return 1; }
- [ -b "${target}15" ] ||
- { error "no partition found ${target}15"; return 1; }
- if [ "$boot" = true ]; then
- @@ -191,8 +191,8 @@
- if $isblk; then
- blockdev --rereadpt "$target"
- udevadm settle
- - [ -b "${target}1" ] ||
- - { error "no partition found ${target}1"; return 1; }
- + [ -b "${target}1" ] || [ -b "${target}p1" ] ||
- + { error "no partition found ${target}1 or ${target}p1"; return 1; }
- [ -b "${target}15" ] ||
- { error "no partition found ${target}15"; return 1; }
- fi
- @@ -250,8 +250,8 @@
- if $isblk; then
- blockdev --rereadpt "$target"
- udevadm settle
- - [ -b "${target}1" ] ||
- - { error "no partition found ${target}1"; return 1; }
- + [ -b "${target}1" ] || [ -b "${target}p1" ] ||
- + { error "no partition found ${target}1 or ${target}p1"; return 1; }
- fi
- out=$(wipefs "--offset=$(($start*512))" "$target" 2>&1) || {
- error "$out";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement