Ńņ 68Qc @s{ddkZddkZddkZddkZddkZddkZeiidƒddkZddd„ƒYZ dS(i’’’’Ns/usr/lib/anacondatRocksPartitioncBseZgZdZgZd„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Z RS(tcCs“g}tddƒ}xm|iƒD]_}ti|ƒ}t|ƒdjo7|ddjo&x#|dD]}|i|ƒqfWq"q"W|iƒ|S(Ns/tmp/discovered.diskstrisdisks:i(topent readlineststringtsplittlentappendtclose(tselftdiskstfiletlinetltd((s7/export/profile/include/installclass/rocks_partition.pytgetDiskss $  c Csg}tddƒ}xU|iƒD]G}ti|ƒ}t|ƒdjo|ddjo|d}q"q"W|iƒy|tddƒ}x\|iƒD]N}ti|ƒ}t|ƒdjo&|d|jo|i|dƒq–q–W|iƒWnnX|S(Ns/tmp/discovered.disksRisraids:is/dev/md/md-device-map(RRRRRR R(R traidsR R R((s7/export/profile/include/installclass/rocks_partition.pytgetRaids4s& $  $cCsød}d|i|f}d}x’ti|ƒiƒD]{}t|ƒt|ƒjo\|dt|ƒ!|joBti|ƒ}t|ƒdjo|ddjo d}Pq°q5q5W|S(Nis %s /dev/%s print -s 2> /dev/nullsPartition Table:itgpti(tpartedtostpopenRRRR(R tdevnametretvaltcmdtlabelR R((s7/export/profile/include/installclass/rocks_partition.pytgptDriveIs$ cCsFd}ti|dƒ}t|ƒdjo|d}nti|ƒS(NRs/dev/i(RRRtstrip(R tstrtdeviceta((s7/export/profile/include/installclass/rocks_partition.pyt getDevice_s cCsjd}ti|dƒ}t|ƒdjo(ti|dƒdjo|d}n |d}ti|ƒS(NRt=iitstart(RRRR(R Rt sectorstartR((s7/export/profile/include/installclass/rocks_partition.pytgetSectorStartis - cCsjd}ti|dƒ}t|ƒdjo(ti|dƒdjo|d}n |d}ti|ƒS(NRR!iitsize(RRRR(R Rt partitionsizeR((s7/export/profile/include/installclass/rocks_partition.pytgetPartitionSizeus - cCsjd}ti|dƒ}t|ƒdjo(ti|dƒdjo|d}n |d}ti|ƒS(NRR!iitId(RRRR(R RtpartidR((s7/export/profile/include/installclass/rocks_partition.pyt getPartIds - cCs |i|ƒS(N(tfindFsTypeInFstab(R tmntpoint((s7/export/profile/include/installclass/rocks_partition.pyt getFsTypescCs ti|ƒS(N(RR(R R((s7/export/profile/include/installclass/rocks_partition.pyt getBootFlags‘scCs d}d|}|d7}ti|ƒiƒ}t|ƒdjo|i|dd ƒ}n|djo|id|ƒ}n|djo|i|ƒ}n|djoXd|i|f}ti|ƒiƒ}ti|ƒ}d|d }|i|ƒ}n|S( NRs$blkid -o export /dev/%s | grep UUID s 2> /dev/nullii’’’’s/dev/s%s /dev/%s 2> /dev/nullsLABEL=%s( RRRRtfindMntInFstabt getRaidNamete2labelRtjoin(R t devicenameR,RtuuidRtid((s7/export/profile/include/installclass/rocks_partition.pyt getMountPoint•s$     cCscd}xV|iD]K}t|ƒdjo2|\}}}}||jod|}Pq[qqW|S(NRisraid.%s(traidinfoR(R tpartition_devicetraidnametinfoRt partitionst raidleveltnum_partitions((s7/export/profile/include/installclass/rocks_partition.pyR0“s    cCsXxQ|iD]F}ti|ƒ}t|ƒdjo|d|jo |dSq q WdS(NiiR(t saved_fstabRRR(R t identifierR R((s7/export/profile/include/installclass/rocks_partition.pyR/Ćs cCsXxQ|iD]F}ti|ƒ}t|ƒdjo|d|jo |dSq q WdS(NiiR(R>RRR(R R,R R((s7/export/profile/include/installclass/rocks_partition.pyR+Ķs cCs g}d}xŅ|D]Ź}ti|d ƒ}t|ƒdjoŠtid|dƒos|dd!djo |}nLt|ƒdjo*|dd!djo|d |d}n||d}d }n2t|ƒd jo|dd jo d }qq|d }|d } d } |dd!djo't|ƒdjo|d} d } n@d} t|ƒdjoU|i|ƒ oDd|djpd|djo|d} d } q|d} n\d } t|ƒdjoB|i|ƒo2|d} t|ƒdjo|dg} qn| o!t|ƒdjo|d} n| o@g}x$| D]}|i|idƒƒqUWdi |ƒ} nd } | djo d}n|i |ƒ}|id||| | | | d |fƒqW|gjo|od|g}n|S(Nii’’’’is[0-9]+tmdiitccisstpitDiskiRtraidtbootit,t s linux-swaptswaps%s,%s,%s,%s,%s,%s,%s,%s s %s,,,,,,, ( RRRtretmatchtNoneRRtrstripR2R6(R RR:tpartinfotisDiskR RRR#R&R)tfstypet bootflagstbfstbftbR,((s7/export/profile/include/installclass/rocks_partition.pytformatPartedNodePartInfo×sh*  $   '  $ "  #      c CsŽti|dƒ}t|ƒdjod Sti|dƒ}ti|dƒ}ti|dƒ}ti|dƒ}ti|dƒ}ti|d ƒ}ti|d ƒ} ti|d ƒ} ||||||| | fS( NRFiRiiiiiiii(RRRRRRRR(RRRR( R R:tnRR#R&R)RORPt partflagsR,((s7/export/profile/include/installclass/rocks_partition.pyt parsePartInfo>s cCsXtid|ƒd|i|f}|d7}ti|ƒiƒ}tid|ƒ|S(NsgetDiskInfo: disk:%ss %s /dev/%s sprint -s 2> /dev/nullsgetNodePartInfo: diskinfo:%s(tsyslogRRRR(R tdiskRtdiskinfo((s7/export/profile/include/installclass/rocks_partition.pyt getDiskInfoQs  cCsµd}d|i}|d|7}xti|ƒiƒD]v}|iƒ}t|ƒdjoQ|ddjo@|ddjo/|ddd!d jo|dd}Pq­q7q7W|S( Ns%s --query --detail s/dev/%siitRaiditLeveliRD(RKtmdadmRRRRR(R RtlevelRR R((s7/export/profile/include/installclass/rocks_partition.pyt getRaidLevel]s  5 cCsēg}d}d|i}|d|7}x°ti|ƒiƒD]™}|iƒ}t|ƒdjo|ddjo d}q=n|djoq=nt|ƒdjoq=n|did ƒ}|id |dƒq=Wd i|ƒS( Nis%s --query --detail s/dev/%siit RaidDeviceii’’’’t/sraid.%sRG(R^RRRRRRR2(R Rtpartst foundpartsRR Rtpart((s7/export/profile/include/installclass/rocks_partition.pyt getRaidPartsls"  $ cCsDtiƒd}g}h}x'|i|ƒD]}|ii|ƒq,Wx3|D]+}|i|ƒ}||i||ƒ7}qMWtid|ƒxŸ|D]—}|i|ƒ} | \} } } } }}}}t | ƒdjoX| dd!djoDd|i | ƒ}|i | ƒ}| | | | ||||f} nQ|djoCd|i ƒjo,d | }| | | | ||||f} q‚n| djoœd}xL|D]D}t |ƒt | ƒjo%|| dt |ƒ!jo |}PqœqœW|djo6|i |ƒp| g||RR[RTRXRWRR`RfRthas_key(R R tarchRMt nodedisksR RRZtnodeRUt nodedevicetnodesectorstarttnodepartitionsizet nodepartidt nodefstypet nodebootflagst nodepartflagst nodemntpointtkeyRY((s7/export/profile/include/installclass/rocks_partition.pytgetNodePartInfo„s^ '     cCs™g}d}|dd!djo|dfgSxd|i|ƒD]S}ti|ƒ}t|ƒdjo|ddjo d}q>n|oq>nd}t|ƒdjo+tid|dƒot|dƒ}n|djo®t|ƒdjo"|dd !d jo|d }nt|ƒd jo|d }n8d }t|ƒdjo|i|ƒo|d}n|id ||f|fƒq>q>W|S(NiiiR@tdummytNumbers[0-9]+iiRARBRs%s%d( R[RRRRIRJtintRR(R RYtlisttinHeaderReRt partnumberRO((s7/export/profile/include/installclass/rocks_partition.pytlistDiskPartitionsÉs4$* '#cCsŠd}g}d}x2d||f}||ijoPn|d}qd}|d|7}|d|7}|ii|ƒ|i|ƒ|S(Ns/state/partitionis%s%dspart s %s --size=1 s!--fstype=ext4 --grow --ondisk=%s (t mountpointsR(R RYtbasenameRctitnextnameRB((s7/export/profile/include/installclass/rocks_partition.pytdefaultDataDisküs  cCsOd}|djo d}n/|djo d}n|djo d}n|S(Nitrooti€>tvari RHič((R t mountpointR%((s7/export/profile/include/installclass/rocks_partition.pytRocksGetPartsizes      cCs*tiƒd}g}|djod}|d|7}nd}|d|idƒ7}|d|7}|iid ƒ|i|ƒd}|d |id ƒ7}|d|7}|iid ƒ|i|ƒd}|d |idƒ7}|d|7}|iidƒ|i|ƒ||i|ƒ7}|S(Nitia64s)part /boot/efi --size=1000 --fstype=vfat s --ondisk=%s spart s / --size=%d Rƒs--fstype=ext4 --ondisk=%s Rbs/var --size=%d R„s/varsswap --size=%d RHs--fstype=swap --ondisk=%s (RRgR†R~RR‚(R RYRjRcRB((s7/export/profile/include/installclass/rocks_partition.pytdefaultRootDisks,    c Csdtiidƒo'tdƒ}|iƒ}|iƒ|Stiƒ}ti|ƒ|d}g}xß|D]×}x¶|i |ƒD]„\}}| p |djoq€nti d||fdƒtii|ƒo&t|ƒ}|iƒ}|iƒnti d|ƒt |ƒdjoPq€q€Wt |ƒdjoPqjqjWyti |ƒWnnX|S(Ns/upgrade/etc/fstabs /etc/fstabs linux-swapsmount /dev/%s %ss > /dev/null 2>&1sumount %s 2> /dev/nulli( RtpathtexistsRRR ttempfiletmktemptmakedirsR}tsystemRt removedirs( R R R tlinesR…tfstabRYt partitionRO((s7/export/profile/include/installclass/rocks_partition.pyRh?sD              ic Cs(d}tiƒ}ti|ƒxē|D]ß}|\}}}} } } } } | p | djoq&nd|}tid||fƒyM|d}|djotid|ƒntii|ƒo d}nWnnXtid|d ƒ|djoPq&q&Wyti|ƒWnnX|S( Nis linux-swaps/dev/%ss mount %s %ss/.rocks-releaseistouch %ss umount %ss > /dev/null 2>&1(R‹RŒRRRŽR‰RŠR(R RMttouchitRR…RetdevR"R%R5RORPRVtmntRtfilename((s7/export/profile/include/installclass/rocks_partition.pyt isRocksDiskos6        c Cshtiƒd}g}xK|D]C}t|ƒdjoqn|\}}}} } } } } |djo2| djo d} qš| djo d} qšn| djoqn| d jo|i|ƒpqqÖn| g}t| ƒd jo5| d d!d jo!|id ƒ|ddg7}nh| djo| djo| o|id ƒn5| djo|d|ig7}n|d| g7}d }t|ƒdjoZ|d d!djoFd}|d|g7}|dg7}| djo|| g7}qn|d|g7}|o|idti|ƒƒn|idti|ƒƒ|ii| ƒqW|S(NiiR‡tfat32tvfats linux-swapRHRtfdiiRDs --noformats--sizet1Rbs/vars--fstypeiR@s --device=%ss --useexistings--onpartsraid %sspart %s( RRgRtgetRaidMountPointRRORR2R~(R t nodepartinfotformatRjRcRlRmRnRoRpRqRrRsRttargstisraid((s7/export/profile/include/installclass/rocks_partition.pyt addPartitions™sR          '  c Cs,t|ƒt|ƒjodSx|D]’}t|ƒdjoq%n|\}}}}}} } } d} x¬|D]¤} t| ƒdjoqpn| \}}}}}}}}||joY||joL||jo?||jo2| |jo%| |jo| |jo d} PqpqpW| pdSq%WdS(Nii(R(R t dbpartinfoRtdbtdbdevicet dbsectorstartt dbpartsizetdbpartidtdbfstypet dbbootflagst dbpartflagst dbmntpointtfoundRlRmRnt nodepartsizeRpRqRrRsRt((s7/export/profile/include/installclass/rocks_partition.pytcompareDiskInfočs2         cCsŒtidƒtiidƒo d|_n d|_tiidƒo d|_n d|_tiidƒo d|_n d|_dS(NtROCKSs/mnt/runtime/usr/sbin/parteds /sbin/parteds/mnt/runtime/usr/sbin/e2labels /sbin/e2labels/mnt/runtime/usr/sbin/mdadms /sbin/mdadm(RXtopenlogRR‰RŠRR1R^(R ((s7/export/profile/include/installclass/rocks_partition.pyt__init__s       (!t__name__t __module__R>R7R~RRRR R$R'R*R-R.R6R0R/R+RTRWR[R`RfRvR}R‚R†RˆRhR—R”R®R±(((s7/export/profile/include/installclass/rocks_partition.pyRs>        g    E 3  " 0 * O )(( RXRRRIR‹tsysR‰RttimeR(((s7/export/profile/include/installclass/rocks_partition.pyts