From 6691c7517325e564b34cc9b8f169cbaa576130f7 Mon Sep 17 00:00:00 2001 From: Danny Jiang Date: Thu, 17 Aug 2023 15:26:22 +0200 Subject: [PATCH] Implemented % unit feature, removed some unnecessary comments. --- examples/partitionContainer/README.md | 13 +++++++++---- .../__pycache__/commitHelper.cpython-311.pyc | Bin 0 -> 2333 bytes .../__pycache__/inputParser.cpython-311.pyc | Bin 0 -> 3240 bytes .../__pycache__/translateUUID.cpython-311.pyc | Bin 0 -> 4416 bytes examples/partitionContainer/inputScript.sh | 1 - examples/partitionContainer/interactive.sh | 4 ---- examples/partitionContainer/partition.py | 16 +++++----------- 7 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 examples/partitionContainer/__pycache__/commitHelper.cpython-311.pyc create mode 100644 examples/partitionContainer/__pycache__/inputParser.cpython-311.pyc create mode 100644 examples/partitionContainer/__pycache__/translateUUID.cpython-311.pyc diff --git a/examples/partitionContainer/README.md b/examples/partitionContainer/README.md index d8160d4..276d44b 100644 --- a/examples/partitionContainer/README.md +++ b/examples/partitionContainer/README.md @@ -3,6 +3,7 @@ ## What does it do? The container will partition the hard disk into a user specified number of partitions. The user can define the specific size of each partition and what type of partition it is _(eg. EFI, swap, root etc...)_. Users also have the option of specifying each partition's type through UUID (https://uapi-group.org/specifications/specs/discoverable_partitions_specification/) as well as its mount point. + ## Inputting Configurations All of the configuration will be passed through a JSON file with the following format: ```json @@ -15,14 +16,17 @@ All of the configuration will be passed through a JSON file with the following f "device_name": { "blkSize": "512B", "partitions": [{ - "size": "1000MiB", + "size": "512MiB", "type": "efi" },{ - "size": "2000MiB", + "size": "2GiB", + "type": "swap" + },{ + "size": "16GiB", "type": "linux", "optional": { - "UUID": "75250d76-8cc6-458e-bd66-bd47cc81a812", - "mountPoint": "/usr/" + "UUID": "44479540-f297-41b2-9af7-d131d5f0458a", + "mountPoint": "/" } } ] @@ -30,6 +34,7 @@ All of the configuration will be passed through a JSON file with the following f } } ``` + ### Explanation: Accepted units for sizes: B, KB, kB, MB, MiB, GB, GiB, TB, TiB * **general** diff --git a/examples/partitionContainer/__pycache__/commitHelper.cpython-311.pyc b/examples/partitionContainer/__pycache__/commitHelper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec9b8ef7521bddc5edb08811fa46a17c911a1469 GIT binary patch literal 2333 zcma)7-D?|15Z}EI>10d(iodG3tzx@Y&uJ_yNKK$PP2IYMQuQGv5WO51-Psm7eRS`H zZ6Oyw7%EDkrO-N13hs+jAFy|P4oYI03G~_*+ z7LCAtqAGvkXO+5iKI2<>e}X?admn^v!Lv!y)F5f0O4g`B_Y{~9{?n2n0+$U5cmVv8 zbg)XcXj%c^0eAR|?Uh0;J- zb4J5p@H4217j(7}gLQ0>+b!u`tMP_>sAu&1>AM{8n$s zoq7dlM}X~;lkusl^nHI79)@3D7o7p;cSUq;5azLA^yzK8A5ou~H(K#b^~Q6l?Z=s| zXrixY!VhJztJ1FZ##fNUkBzLd^P`Mvpz6aSKzYbQ29+%_zZ^Eap*G`zKcVj1q6AlNnXdiT)i+>yO4pv_YQIhLjG?pb|2l2 z;Gm^X-Mwu`tWbL`1i1P?op472yAEG1pU_u@irC#*dF{^-2eIzcEMf2M$PVtbPZjw9 zP}57@QFiA;$wTPKJMuR&_9rfF(oM1@J|vrPwLqB)sZ}-TM);NSWf2>f&71aEMz=C0 zOLt7aHLNqexZwtP<8?!yY-LQ(o=reh3;_n$PtbM>4B+eb+mEwF%{Lz4|5|}B;9kpZ z`zj4q;n$Sg&pRStCS1BjO!7C%FVXtJLI11OA5AKb2wsf{spH+34lS&!ao zL~qrkiIe{ECXwaYrXYo8Pog(oMwgyPm+H|wjp&`~=O^K7Kcv1(Jz1{ZT&{=jHo|vn zt@r$Na1!b-G<(TT!^1zS`wKrU)JLWpBh&TpOd~u~yXrj$YKkx!|3kPu#$e+{{XTy$ zLY_tXJ`%-e6F2THi_ey2kW(sMRV6kD7Va=VjrIlpAju(yIUf;T=XjG`C?9YvFS7+0 pA|mZHFj$$=6Eaq7y-jI|0(yE`ZBqRkKmT*7n^P!6`wHf*{V(!E1)=}| literal 0 HcmV?d00001 diff --git a/examples/partitionContainer/__pycache__/inputParser.cpython-311.pyc b/examples/partitionContainer/__pycache__/inputParser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c394501c9f2296fc55fd6a51d4fa232d4cad1fb GIT binary patch literal 3240 zcma)9T}&I<6~1GS|Nmi)F|omhHI4y6$Sz64PeQx|0tAwZL|af&G+_pIh#9*x<3Pwv zg{nTF)k^DBkrt&Z#j4blHZQbK^r2EzscIfQ)>ODxMMA3fVc#5OS4vk^)iVZcOoEh| z@tJea-*@gg_uhfuIUH65*Khv$FIuQU=-=Al@X{SHuRjFlD?}rjNT8YhH!(xNSeMY< zM6~{wXhu&HQz%A$tGP_Z2u!ri5eM$t%K|?={9gAOv{2#^odjW@0o3zDIMjn=Le#7e zuEnxOBA$Wg^RllUDqMB7Wsl_H ze{DfxZN*}-v{AIN)(>vK-zFz%GZj)ij1z6Jgd-w zYD8G!0jWlIzh{0Q9Ldkc{hWa&0ZUwy!8_(O>&vxu|wo3PDp@FsYbTBBzK?T#nQk8 z##5hOzJcw)#7D1B&Bm`^zln`7x-xYG8&bSBQOlK;Ii^&0Y@||<4;`z;=6N>3OhV3> zn8(&qiDqebPUN-2dB2(3Cl*`xTYildU_tEjrKw`)!2t3R89=eYj8e1vLYN;%Gb`9q zE)TEm9PB>q{uCpMEVm$FN7>>gbiPzNY}91197wHu*r>%F9TK#IGxYZL!$8+($t9+X zra10F7rT(AII4?Tp_Wn!M(8R>{{*t6U`6p=rK#Sac!A+NQxC8`#V27!3!~a1;rjpt z{+>X>kKn7mhQ2o=t8@Lc4ZUIssFpwx5r*b0vFr6ep5FM`quY;fuUm_Hkd+iA@=7!L zP9qiBySO)R-n>g(bR(DlOYU=SV|r7kINMcc``XB!z4puT&&M}RS+8P`s`lvGl|qgG ztM*^DZ!B%zQffX@Yd%^V-}BV2jqOFdw_<9ve2@wey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