├── LICENSE ├── Makefile ├── PKGBUILD ├── README.md ├── bin ├── btrfs-subvol-functions.in ├── check-translate.in ├── ma-launcher.in ├── manjaro-architect.in └── setup ├── data ├── dialogrc ├── dialogrc_gui ├── ma-launcher.desktop ├── manjaro-architect.desktop ├── manjaro-architect.png ├── menu_layout ├── package-lists │ ├── base-openrc-manjaro │ ├── base-systemd-manjaro │ └── input-drivers └── translations │ ├── danish.trans │ ├── dutch.trans │ ├── english.trans │ ├── french.trans │ ├── german.trans │ ├── hungarian.trans │ ├── italian.trans │ ├── polish.trans │ ├── portuguese.trans │ ├── portuguese_brasil.trans │ ├── russian.trans │ ├── spanish.trans │ └── ukrainian.trans └── lib ├── .directory ├── ini_val.sh ├── util-advanced.sh ├── util-base.sh ├── util-config.sh ├── util-desktop.sh ├── util-disk.sh ├── util-menu.sh └── util.sh /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | Version = $(shell git describe --abbrev=0 --tags) 2 | 3 | PREFIX = /usr 4 | LIBDIR = /lib/manjaro-architect 5 | DATADIR = /share/manjaro-architect 6 | 7 | BIN = \ 8 | bin/btrfs-subvol-functions \ 9 | bin/check-translate.in \ 10 | bin/ma-launcher \ 11 | bin/manjaro-architect 12 | 13 | LIBS = \ 14 | lib/ini_val.sh \ 15 | lib/util.sh \ 16 | lib/util-advanced.sh \ 17 | lib/util-base.sh \ 18 | lib/util-config.sh \ 19 | lib/util-desktop.sh \ 20 | lib/util-disk.sh \ 21 | lib/util-menu.sh 22 | 23 | LISTS = \ 24 | data/package-lists/base-openrc-manjaro \ 25 | data/package-lists/base-systemd-manjaro \ 26 | data/package-lists/input-drivers 27 | 28 | LANG = \ 29 | data/translations/danish.trans \ 30 | data/translations/dutch.trans \ 31 | data/translations/english.trans \ 32 | data/translations/french.trans \ 33 | data/translations/german.trans \ 34 | data/translations/hungarian.trans \ 35 | data/translations/italian.trans \ 36 | data/translations/polish.trans \ 37 | data/translations/portuguese.trans \ 38 | data/translations/portuguese_brasil.trans \ 39 | data/translations/russian.trans \ 40 | data/translations/spanish.trans 41 | 42 | ICONS = \ 43 | data/manjaro-architect.png 44 | 45 | LAUNCHER = \ 46 | data/manjaro-architect.desktop 47 | 48 | DIALOGRC = \ 49 | data/dialogrc \ 50 | data/dialogrc_gui 51 | 52 | LIVE = \ 53 | data/ma-launcher.desktop 54 | 55 | all: $(BIN) 56 | 57 | edit = \ 58 | sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)$(DATADIR)|g" \ 59 | -e "s|@libdir[@]|$(DESTDIR)$(PREFIX)$(LIBDIR)|g" \ 60 | -e "s|@version@|${Version}|" 61 | 62 | %: %.in Makefile 63 | @echo "GEN $@" 64 | @$(RM) "$@" 65 | @m4 -P $@.in | $(edit) >$@ 66 | @chmod a-w "$@" 67 | @chmod +x "$@" 68 | 69 | clean: 70 | rm -f $(BIN) 71 | 72 | install: 73 | install -dm0755 $(DESTDIR)$(PREFIX)/bin 74 | install -m0755 ${BIN} $(DESTDIR)$(PREFIX)/bin 75 | 76 | install -dm0755 $(DESTDIR)$(PREFIX)$(LIBDIR) 77 | install -m0644 ${LIBS} $(DESTDIR)$(PREFIX)$(LIBDIR) 78 | 79 | install -dm0755 $(DESTDIR)$(PREFIX)$(DATADIR)/package-lists 80 | install -m0644 ${LISTS} $(DESTDIR)$(PREFIX)$(DATADIR)/package-lists 81 | 82 | install -dm0755 $(DESTDIR)$(PREFIX)$(DATADIR)/translations 83 | install -m0644 ${LANG} $(DESTDIR)$(PREFIX)$(DATADIR)/translations 84 | 85 | install -dm0755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps 86 | install -m0644 ${ICONS} $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps 87 | 88 | install -dm0755 $(DESTDIR)$(PREFIX)/share/applications 89 | install -m0644 ${LAUNCHER} $(DESTDIR)$(PREFIX)/share/applications 90 | 91 | install -dm0755 $(DESTDIR)$(PREFIX)$(DATADIR) 92 | install -m0644 ${DIALOGRC} $(DESTDIR)$(PREFIX)$(DATADIR) 93 | 94 | install -dm0755 $(DESTDIR)/etc/skel/.config/autostart 95 | install -m0644 ${LIVE} $(DESTDIR)/etc/skel/.config/autostart 96 | 97 | uninstall: 98 | for f in ${BIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done 99 | for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)$(LIBDIR)/$$f; done 100 | for f in ${LISTS}; do rm -f $(DESTDIR)$(PREFIX)$(DATADIR)/package-lists/$$f; done 101 | for f in ${LANG}; do rm -f $(DESTDIR)$(PREFIX)$(DATADIR)/translations/$$f; done 102 | for f in ${ICONS}; do rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/$$f; done 103 | for f in ${LAUNCHER}; do rm -f $(DESTDIR)$(PREFIX)/share/applications/$$f; done 104 | for f in ${DIALOGRC}; do rm -f $(DESTDIR)$(PREFIX)$(DATADIR)/$$f; done 105 | for f in ${LIVE}; do rm -f $(DESTDIR)/etc/skel/.config/autostart/$$f; done 106 | 107 | install: install 108 | 109 | uninstall: uninstall 110 | 111 | dist: 112 | git archive --format=tar --prefix=manjaro-architect-$(Version)/ $(Version) | gzip -9 > manjaro-architect-$(Version).tar.gz 113 | gpg --detach-sign --use-agent manjaro-architect-$(Version).tar.gz 114 | 115 | .PHONY: all clean install uninstall dist 116 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Chrysostomus @forum.manjaro.org 2 | # Maintainer: Bernhard Landauer 3 | 4 | pkgbase=manjaro-architect 5 | pkgname=('manjaro-architect' 'manjaro-architect-launcher') 6 | pkgver=0.7.4.r78.g86f8c83 7 | pkgrel=1 8 | pkgdesc="Manjaro CLI net-installer, forked from the Archlinux Architect" 9 | arch=(any) 10 | url="https://github.com/Chrysostomus/$pkgbase" 11 | license=(GPL2) 12 | depends=('bash' 13 | 'dialog') 14 | makedepends=('git') 15 | optdepends=('maia-console' 16 | 'terminus-font') 17 | source=("git+$url.git#branch=master") 18 | md5sums=('SKIP') 19 | 20 | pkgver() { 21 | cd $pkgbase 22 | git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' 23 | } 24 | 25 | build() { 26 | cd $pkgbase 27 | make PREFIX=/usr 28 | } 29 | 30 | package_manjaro-architect() { 31 | depends+=('f2fs-tools' 32 | 'gptfdisk' 33 | 'manjaro-architect-launcher' 34 | 'manjaro-tools-base' 35 | 'mhwd' 36 | 'nilfs-utils' 37 | 'pacman-mirrorlist' 38 | 'parted') 39 | cd $pkgbase 40 | make PREFIX=/usr DESTDIR=${pkgdir} install 41 | } 42 | 43 | package_manjaro-architect-launcher() { 44 | cd $pkgbase 45 | install -Dm755 bin/setup $pkgdir/usr/bin/setup 46 | } 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Attention: all development has moved to Gitlab: https://gitlab.manjaro.org/applications/manjaro-architect 2 | 3 | # manjaro-architect 4 | CLI net-installer for Manjarolinux, forked from Carl Duff's Architect 5 | 6 | This installer provides netinstallation for different manjaro editions. It sources the iso-profiles git repo, so it should be always up to date. 7 | 8 | **menu overview of v0.9.9:** 9 | 10 | ``` 11 | Main Menu 12 | | 13 | ├── Prepare Installation 14 | | ├── Set Virtual Console 15 | | ├── List Devices 16 | | ├── Partition Disk 17 | | ├── LUKS Encryption 18 | | ├── Logical Volume Management 19 | | ├── Mount Partitions 20 | | ├── Configure Installer Mirrorlist 21 | | | ├── Edit Pacman Configuration 22 | | | ├── Edit Pacman Mirror Configuration 23 | | | └── Rank Mirrors by Speed 24 | | | 25 | │ └── Refresh Pacman Keys 26 | | 27 | ├── Install Desktop System 28 | │ ├── Install Manjaro Desktop 29 | │ ├── Install Bootloader 30 | │ ├── Configure Base 31 | | │ ├── Generate FSTAB 32 | | │ ├── Set Hostname 33 | | │ ├── Set System Locale 34 | | │ ├── Set Desktop Keyboard Layout 35 | | │ ├── Set Timezone and Clock 36 | | │ ├── Set Root Password 37 | | │ └── Add New User(s) 38 | | │ 39 | │ ├── System Tweaks 40 | | │ ├── Enable Automatic Login 41 | | │ ├── Enable Hibernation 42 | | │ ├── Performance 43 | | | │ ├── I/O schedulers 44 | | | │ ├── Swap configuration 45 | | | │ └── Preload 46 | | | │ 47 | | │ ├── Security and systemd Tweaks 48 | | | │ ├── Amend journald Logging 49 | | | │ ├── Disable Coredump Logging 50 | | | │ └── Restrict Access to Kernel Logs 51 | | | │ 52 | | │ └── Restrict Access to Kernel Logs 53 | | │ 54 | │ ├── Review Configuration Files 55 | │ └── Chroot into Installation 56 | | 57 | ├── Install CLI System 58 | │ ├── Install Base Packages 59 | │ ├── Install Bootloader 60 | │ ├── Configure Base 61 | | │ ├── Generate FSTAB 62 | | │ ├── Set Hostname 63 | | │ ├── Set System Locale 64 | | │ ├── Set Timezone and Clock 65 | | │ ├── Set Root Password 66 | | │ └── Add New User(s) 67 | | │ 68 | │ ├── Install Custom Packages 69 | │ ├── System tweaks 70 | | │ └── ... (see 'Install Desktop System') 71 | | │ 72 | │ ├── Review Configuration Files 73 | │ └── Chroot into Installation 74 | | 75 | ├── Install Custom System 76 | │ ├── Install Base Packages 77 | │ ├── Install Unconfigured Desktop Environments 78 | | │ ├── Install Display Server 79 | | │ ├── Install Desktop Environment 80 | | │ ├── Install Display Manager 81 | | │ ├── Install Networking Capabilities 82 | | │ | ├── Display Wireless Devices 83 | | │ | ├── Install Wireless Device Packages 84 | | │ | ├── Install Network Connection Manager 85 | | │ | └── Install CUPS / Printer Packages 86 | | │ | 87 | | │ └── Install Multimedia Support 88 | | │ ├── Install Sound Driver(s) 89 | | │ ├── Install Codecs 90 | | │ └── Accessibility Packages 91 | | │ 92 | │ ├── Install Bootloader 93 | │ ├── Configure Base 94 | | | └── ... (see 'Install Desktop System') 95 | | │ 96 | │ ├── Install Custom Packages 97 | │ ├── System Tweaks 98 | | | └── ... (see 'Install Desktop System') 99 | | │ 100 | │ ├── Review Configuration Files 101 | │ └── Chroot into Installation 102 | | 103 | └── System Rescue 104 | ├── Install Hardware Drivers 105 | │ ├── Install Display Drivers 106 | │ └── Install Network Drivers 107 | | 108 | ├── Install Bootloader 109 | ├── Configure Base 110 | | └── ... (see 'Install Desktop System') 111 | │ 112 | ├── Install Custom Packages 113 | ├── Remove Packages 114 | ├── Review Configuration Files 115 | ├── Chroot into Installation 116 | ├── Data Recovery 117 | │ ├── Clonezilla 118 | │ └── Photorec 119 | │ 120 | └── View System Logs 121 | ├── Dmesg 122 | ├── Pacman log 123 | ├── Xorg log 124 | └── Journalctl 125 | ``` 126 | -------------------------------------------------------------------------------- /bin/btrfs-subvol-functions.in: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | # scan and update btrfs devices 14 | btrfs_scan(){ 15 | btrfs device scan >/dev/null 2>&1 16 | } 17 | 18 | # mount btrfs for checks 19 | mount_btrfs(){ 20 | btrfs_scan 21 | BTRFSMP="$(mktemp -d /tmp/brtfsmp.XXXX)" 22 | mount ${PART} ${BTRFSMP} 23 | } 24 | 25 | # unmount btrfs after checks done 26 | umount_btrfs(){ 27 | umount ${BTRFSMP} 28 | rm -r ${BTRFSMP} 29 | } 30 | 31 | # Set BTRFS_DEVICES on detected btrfs devices 32 | find_btrfs_raid_devices(){ 33 | btrfs_scan 34 | if [[ "${DETECT_CREATE_FILESYSTEM}" = "no" && "${FSTYPE}" = "btrfs" ]]; then 35 | for i in $(btrfs filesystem show ${PART} | cut -d " " -f 11); do 36 | BTRFS_DEVICES="${BTRFS_DEVICES}#${i}" 37 | done 38 | fi 39 | } 40 | 41 | find_btrfs_raid_bootloader_devices(){ 42 | btrfs_scan 43 | BTRFS_COUNT=1 44 | if [[ "$(${_BLKID} -p -i ${bootdev} -o value -s TYPE)" = "btrfs" ]]; then 45 | BTRFS_DEVICES="" 46 | for i in $(btrfs filesystem show ${bootdev} | cut -d " " -f 11); do 47 | BTRFS_DEVICES="${BTRFS_DEVICES}#${i}" 48 | BTRFS_COUNT=$((${BTRFS_COUNT}+1)) 49 | done 50 | fi 51 | } 52 | 53 | # find btrfs subvolume 54 | find_btrfs_subvolume(){ 55 | if [[ "${DETECT_CREATE_FILESYSTEM}" = "no" ]]; then 56 | # existing btrfs subvolumes 57 | mount_btrfs 58 | for i in $(btrfs subvolume list ${BTRFSMP} | cut -d " " -f 7); do 59 | echo ${i} 60 | [[ "${1}" ]] && echo ${1} 61 | done 62 | umount_btrfs 63 | fi 64 | } 65 | 66 | find_btrfs_bootloader_subvolume(){ 67 | BTRFS_SUBVOLUME_COUNT=1 68 | if [[ "$(${_BLKID} -p -i ${bootdev} -o value -s TYPE)" = "btrfs" ]]; then 69 | BTRFS_SUBVOLUMES="" 70 | PART="${bootdev}" 71 | mount_btrfs 72 | for i in $(btrfs subvolume list ${BTRFSMP} | cut -d " " -f 7); do 73 | BTRFS_SUBVOLUMES="${BTRFS_SUBVOLUMES}#${i}" 74 | BTRFS_SUBVOLUME_COUNT=$((${BTRFS_COUNT}+1)) 75 | done 76 | umount_btrfs 77 | fi 78 | } 79 | 80 | # subvolumes already in use 81 | subvolumes_in_use(){ 82 | SUBVOLUME_IN_USE="" 83 | for i in $(grep ${PART}[:#] /tmp/.parts); do 84 | if [[ "$(echo ${i} | grep ":btrfs:")" ]]; then 85 | SUBVOLUME_IN_USE="${SUBVOLUME_IN_USE} $(echo ${i} | cut -d: -f 9)" 86 | fi 87 | done 88 | } 89 | 90 | # ask for btrfs compress option 91 | btrfs_compress(){ 92 | BTRFS_COMPRESS="NONE" 93 | BTRFS_COMPRESSLEVELS="lzo - zlib -" 94 | if [[ "${BTRFS_SUBVOLUME}" = "NONE" ]]; then 95 | DIALOG --defaultno --yesno "Would you like to compress the data on ${PART}?" 0 0 && BTRFS_COMPRESS="compress" 96 | else 97 | DIALOG --defaultno --yesno "Would you like to compress the data on ${PART} subvolume=${BTRFS_SUBVOLUME}?" 0 0 && BTRFS_COMPRESS="compress" 98 | fi 99 | if [[ "${BTRFS_COMPRESS}" = "compress" ]]; then 100 | DIALOG --menu "Select the compression method you want to use" 21 50 9 ${BTRFS_COMPRESSLEVELS} 2>${ANSWER} || return 1 101 | BTRFS_COMPRESS="compress=$(cat ${ANSWER})" 102 | fi 103 | } 104 | 105 | # ask for btrfs ssd option 106 | btrfs_ssd(){ 107 | BTRFS_SSD="NONE" 108 | if [[ "${BTRFS_SUBVOLUME}" = "NONE" ]]; then 109 | DIALOG --defaultno --yesno "Would you like to optimize the data for ssd disk usage on ${PART}?" 0 0 && BTRFS_SSD="ssd" 110 | else 111 | DIALOG --defaultno --yesno "Would you like to optimize the data for ssd disk usage on ${PART} subvolume=${BTRFS_SUBVOLUME}?" 0 0 && BTRFS_SSD="ssd" 112 | fi 113 | } 114 | 115 | # values that are only needed for btrfs creation 116 | clear_btrfs_values(){ 117 | : >/tmp/.btrfs-devices 118 | LABEL_NAME="" 119 | FS_OPTIONS="" 120 | BTRFS_DEVICES="" 121 | BTRFS_LEVEL="" 122 | } 123 | 124 | # do not ask for btrfs filesystem creation, if already prepared for creation! 125 | check_btrfs_filesystem_creation(){ 126 | DETECT_CREATE_FILESYSTEM="no" 127 | SKIP_FILESYSTEM="no" 128 | SKIP_ASK_SUBVOLUME="no" 129 | for i in $(grep ${PART}[:#] /tmp/.parts); do 130 | if [[ "$(echo ${i} | grep ":btrfs:")" ]]; then 131 | FSTYPE="btrfs" 132 | SKIP_FILESYSTEM="yes" 133 | # check on filesystem creation, skip subvolume asking then! 134 | [[ "$(echo ${i} | cut -d: -f 4 | grep yes)" ]] && DETECT_CREATE_FILESYSTEM="yes" 135 | [[ "${DETECT_CREATE_FILESYSTEM}" = "yes" ]] && SKIP_ASK_SUBVOLUME="yes" 136 | fi 137 | done 138 | } 139 | 140 | # remove devices with no subvolume from list and generate raid device list 141 | btrfs_parts(){ 142 | if [[ -s /tmp/.btrfs-devices ]]; then 143 | BTRFS_DEVICES="" 144 | for i in $(cat /tmp/.btrfs-devices); do 145 | BTRFS_DEVICES="${BTRFS_DEVICES}#${i}" 146 | # remove device if no subvolume is used! 147 | [[ "${BTRFS_SUBVOLUME}" = "NONE" ]] && PARTS="$(echo ${PARTS} | sed -e "s#${i}\ _##g")" 148 | done 149 | else 150 | [[ "${BTRFS_SUBVOLUME}" = "NONE" ]] && PARTS="$(echo ${PARTS} | sed -e "s#${PART}\ _##g")" 151 | fi 152 | } 153 | 154 | # choose raid level to use on btrfs device 155 | btrfs_raid_level(){ 156 | BTRFS_RAIDLEVELS="NONE - raid0 - raid1 - raid10 - single -" 157 | BTRFS_RAID_FINISH="" 158 | BTRFS_LEVEL="" 159 | BTRFS_DEVICE="${PART}" 160 | : >/tmp/.btrfs-devices 161 | DIALOG --msgbox "BTRFS RAID OPTIONS:\n\nBTRFS has options to control the raid configuration for data and metadata.\nValid choices are raid0, raid1, raid10 and single.\nsingle means that no duplication of metadata is done, which may be desired when using hardware raid. raid10 requires at least 4 devices.\n\nIf you don't need this feature select NONE." 0 0 162 | while [[ "${BTRFS_RAID_FINISH}" != "DONE" ]]; do 163 | DIALOG --menu "Select the raid level you want to use" 21 50 9 ${BTRFS_RAIDLEVELS} 2>${ANSWER} || return 1 164 | BTRFS_LEVEL=$(cat ${ANSWER}) 165 | if [[ "${BTRFS_LEVEL}" = "NONE" ]]; then 166 | echo "${BTRFS_DEVICE}" >>/tmp/.btrfs-devices 167 | break 168 | else 169 | # take selected device as 1st device, add additional devices in part below. 170 | select_btrfs_raid_devices 171 | fi 172 | done 173 | } 174 | 175 | # select btrfs raid devices 176 | select_btrfs_raid_devices (){ 177 | # show all devices with sizes 178 | # DIALOG --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)" 0 0 179 | # select the second device to use, no missing option available! 180 | : >/tmp/.btrfs-devices 181 | BTRFS_PART="${BTRFS_DEVICE}" 182 | BTRFS_PARTS="${PARTS}" 183 | echo "${BTRFS_PART}" >>/tmp/.btrfs-devices 184 | BTRFS_PARTS="$(echo ${BTRFS_PARTS} | sed -e "s#${BTRFS_PART}\ _##g")" 185 | RAIDNUMBER=2 186 | DIALOG --menu "Select device ${RAIDNUMBER}" 21 50 13 ${BTRFS_PARTS} 2>${ANSWER} || return 1 187 | BTRFS_PART=$(cat ${ANSWER}) 188 | echo "${BTRFS_PART}" >>/tmp/.btrfs-devices 189 | while [[ "${BTRFS_PART}" != "DONE" ]]; do 190 | BTRFS_DONE="" 191 | RAIDNUMBER=$((${RAIDNUMBER} + 1)) 192 | # RAID10 need 4 devices! 193 | [[ "${RAIDNUMBER}" -ge 3 && ! "${BTRFS_LEVEL}" = "raid10" ]] && BTRFS_DONE="DONE _" 194 | [[ "${RAIDNUMBER}" -ge 5 && "${BTRFS_LEVEL}" = "raid10" ]] && BTRFS_DONE="DONE _" 195 | # clean loop from used partition and options 196 | BTRFS_PARTS="$(echo ${BTRFS_PARTS} | sed -e "s#${BTRFS_PART}\ _##g")" 197 | # add more devices 198 | DIALOG --menu "Select device ${RAIDNUMBER}" 21 50 13 ${BTRFS_PARTS} ${BTRFS_DONE} 2>${ANSWER} || return 1 199 | BTRFS_PART=$(cat ${ANSWER}) 200 | [[ "${BTRFS_PART}" = "DONE" ]] && break 201 | echo "${BTRFS_PART}" >>/tmp/.btrfs-devices 202 | done 203 | # final step ask if everything is ok? 204 | DIALOG --yesno "Would you like to create btrfs raid like this?\n\nLEVEL:\n${BTRFS_LEVEL}\n\nDEVICES:\n$(for i in $(cat /tmp/.btrfs-devices); do echo "${i}\n"; done)" 0 0 && BTRFS_RAID_FINISH="DONE" 205 | } 206 | 207 | # prepare new btrfs device 208 | prepare_btrfs(){ 209 | btrfs_raid_level || return 1 210 | prepare_btrfs_subvolume || return 1 211 | } 212 | 213 | # prepare btrfs subvolume 214 | prepare_btrfs_subvolume(){ 215 | DOSUBVOLUME="no" 216 | BTRFS_SUBVOLUME="NONE" 217 | if [[ "${SKIP_ASK_SUBVOLUME}" = "no" ]]; then 218 | DIALOG --defaultno --yesno "Would you like to create a new subvolume on ${PART}?" 0 0 && DOSUBVOLUME="yes" 219 | else 220 | DOSUBVOLUME="yes" 221 | fi 222 | if [[ "${DOSUBVOLUME}" = "yes" ]]; then 223 | BTRFS_SUBVOLUME="NONE" 224 | while [[ "${BTRFS_SUBVOLUME}" = "NONE" ]]; do 225 | DIALOG --inputbox "Enter the SUBVOLUME name for the device, keep it short\nand use no spaces or special\ncharacters." 10 65 2>${ANSWER} || return 1 226 | BTRFS_SUBVOLUME=$(cat ${ANSWER}) 227 | check_btrfs_subvolume 228 | done 229 | else 230 | BTRFS_SUBVOLUME="NONE" 231 | fi 232 | } 233 | 234 | # check btrfs subvolume 235 | check_btrfs_subvolume(){ 236 | [[ "${DOMKFS}" = "yes" && "${FSTYPE}" = "btrfs" ]] && DETECT_CREATE_FILESYSTEM="yes" 237 | if [[ "${DETECT_CREATE_FILESYSTEM}" = "no" ]]; then 238 | mount_btrfs 239 | for i in $(btrfs subvolume list ${BTRFSMP} | cut -d " " -f 7); do 240 | if [[ "$(echo ${i} | grep "${BTRFS_SUBVOLUME}"$)" ]]; then 241 | DIALOG --msgbox "ERROR: You have defined 2 identical SUBVOLUME names or an empty name! Please enter another name." 8 65 242 | BTRFS_SUBVOLUME="NONE" 243 | fi 244 | done 245 | umount_btrfs 246 | else 247 | subvolumes_in_use 248 | if [[ "$(echo ${SUBVOLUME_IN_USE} | egrep "${BTRFS_SUBVOLUME}")" ]]; then 249 | DIALOG --msgbox "ERROR: You have defined 2 identical SUBVOLUME names or an empty name! Please enter another name." 8 65 250 | BTRFS_SUBVOLUME="NONE" 251 | fi 252 | fi 253 | } 254 | 255 | # create btrfs subvolume 256 | create_btrfs_subvolume(){ 257 | mount_btrfs 258 | btrfs subvolume create ${BTRFSMP}/${_btrfssubvolume} >${LOG} 259 | # change permission from 700 to 755 260 | # to avoid warnings during package installation 261 | chmod 755 ${BTRFSMP}/${_btrfssubvolume} 262 | umount_btrfs 263 | } 264 | 265 | # choose btrfs subvolume from list 266 | choose_btrfs_subvolume (){ 267 | BTRFS_SUBVOLUME="NONE" 268 | SUBVOLUMES_DETECTED="no" 269 | SUBVOLUMES=$(find_btrfs_subvolume _) 270 | # check if subvolumes are present 271 | [[ -n "${SUBVOLUMES}" ]] && SUBVOLUMES_DETECTED="yes" 272 | subvolumes_in_use 273 | for i in ${SUBVOLUME_IN_USE}; do 274 | SUBVOLUMES=$(echo ${SUBVOLUMES} | sed -e "s#${i}\ _##g") 275 | done 276 | if [[ -n "${SUBVOLUMES}" ]]; then 277 | DIALOG --menu "Select the subvolume to mount" 21 50 13 ${SUBVOLUMES} 2>${ANSWER} || return 1 278 | BTRFS_SUBVOLUME=$(cat ${ANSWER}) 279 | else 280 | if [[ "${SUBVOLUMES_DETECTED}" = "yes" ]]; then 281 | DIALOG --msgbox "ERROR: All subvolumes of the device are already in use. Switching to create a new one now." 8 65 282 | SKIP_ASK_SUBVOLUME=yes 283 | prepare_btrfs_subvolume || return 1 284 | fi 285 | fi 286 | } 287 | 288 | # boot on btrfs subvolume is not supported 289 | check_btrfs_boot_subvolume(){ 290 | if [[ "${MP}" = "/boot" && "${FSTYPE}" = "btrfs" && ! "${BTRFS_SUBVOLUME}" = "NONE" ]]; then 291 | DIALOG --msgbox "ERROR: \n/boot on a btrfs subvolume is not supported by any bootloader yet!" 8 65 292 | FILESYSTEM_FINISH="no" 293 | fi 294 | } 295 | 296 | # btrfs subvolume menu 297 | btrfs_subvolume(){ 298 | FILESYSTEM_FINISH="" 299 | if [[ "${FSTYPE}" = "btrfs" && "${DOMKFS}" = "no" ]]; then 300 | if [[ "${ASK_MOUNTPOINTS}" = "1" ]]; then 301 | # create subvolume if requested 302 | # choose btrfs subvolume if present 303 | prepare_btrfs_subvolume || return 1 304 | if [[ "${BTRFS_SUBVOLUME}" = "NONE" ]]; then 305 | choose_btrfs_subvolume || return 1 306 | fi 307 | else 308 | # use device if no subvolume is present 309 | choose_btrfs_subvolume || return 1 310 | fi 311 | btrfs_compress 312 | btrfs_ssd 313 | fi 314 | FILESYSTEM_FINISH="yes" 315 | } 316 | 317 | select_filesystem(){ 318 | FILESYSTEM_FINISH="" 319 | # don't allow vfat as / filesystem, it will not work! 320 | # don't allow ntfs as / filesystem, this is stupid! 321 | FSOPTS="" 322 | [[ "$(which mkfs.ext2 2>/dev/null)" ]] && FSOPTS="${FSOPTS} ext2 Ext2" 323 | [[ "$(which mkfs.ext3 2>/dev/null)" ]] && FSOPTS="${FSOPTS} ext3 Ext3" 324 | [[ "$(which mkfs.ext4 2>/dev/null)" ]] && FSOPTS="${FSOPTS} ext4 Ext4" 325 | [[ "$(which mkfs.btrfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} btrfs Btrfs-(Experimental)" 326 | [[ "$(which mkfs.nilfs2 2>/dev/null)" ]] && FSOPTS="${FSOPTS} nilfs2 Nilfs2-(Experimental)" 327 | [[ "$(which mkreiserfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} reiserfs Reiser3" 328 | [[ "$(which mkfs.xfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} xfs XFS" 329 | [[ "$(which mkfs.jfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} jfs JFS" 330 | [[ "$(which mkfs.ntfs 2>/dev/null)" && "${DO_ROOT}" = "DONE" ]] && FSOPTS="${FSOPTS} ntfs-3g NTFS" 331 | [[ "$(which mkfs.vfat 2>/dev/null)" && "${DO_ROOT}" = "DONE" ]] && FSOPTS="${FSOPTS} vfat VFAT" 332 | DIALOG --menu "Select a filesystem for ${PART}" 21 50 13 ${FSOPTS} 2>${ANSWER} || return 1 333 | FSTYPE=$(cat ${ANSWER}) 334 | } 335 | 336 | enter_mountpoint(){ 337 | FILESYSTEM_FINISH="" 338 | MP="" 339 | while [[ "${MP}" = "" ]]; do 340 | DIALOG --inputbox "Enter the mountpoint for ${PART}" 8 65 "/boot" 2>${ANSWER} || return 1 341 | MP=$(cat ${ANSWER}) 342 | if grep ":${MP}:" /tmp/.parts; then 343 | DIALOG --msgbox "ERROR: You have defined 2 identical mountpoints! Please select another mountpoint." 8 65 344 | MP="" 345 | fi 346 | done 347 | } 348 | 349 | # set sane values for paramaters, if not already set 350 | check_mkfs_values(){ 351 | # Set values, to not confuse mkfs call! 352 | [[ "${FS_OPTIONS}" = "" ]] && FS_OPTIONS="NONE" 353 | [[ "${BTRFS_DEVICES}" = "" ]] && BTRFS_DEVICES="NONE" 354 | [[ "${BTRFS_LEVEL}" = "" ]] && BTRFS_LEVEL="NONE" 355 | [[ "${BTRFS_SUBVOLUME}" = "" ]] && BTRFS_SUBVOLUME="NONE" 356 | [[ "${DOSUBVOLUME}" = "" ]] && DOSUBVOLUME="no" 357 | [[ "${LABEL_NAME}" = "" && -n "$(${_BLKID} -p -i -o value -s LABEL ${PART})" ]] && LABEL_NAME="$(${_BLKID} -p -i -o value -s LABEL ${PART})" 358 | [[ "${LABEL_NAME}" = "" ]] && LABEL_NAME="NONE" 359 | } 360 | 361 | create_filesystem(){ 362 | FILESYSTEM_FINISH="" 363 | LABEL_NAME="" 364 | FS_OPTIONS="" 365 | BTRFS_DEVICES="" 366 | BTRFS_LEVEL="" 367 | DIALOG --yesno "Would you like to create a filesystem on ${PART}?\n\n(This will overwrite existing data!)" 0 0 && DOMKFS="yes" 368 | if [[ "${DOMKFS}" = "yes" ]]; then 369 | while [[ "${LABEL_NAME}" = "" ]]; do 370 | DIALOG --inputbox "Enter the LABEL name for the device, keep it short\n(not more than 12 characters) and use no spaces or special\ncharacters." 10 65 \ 371 | "$(${_BLKID} -p -i -o value -s LABEL ${PART})" 2>${ANSWER} || return 1 372 | LABEL_NAME=$(cat ${ANSWER}) 373 | if grep ":${LABEL_NAME}$" /tmp/.parts; then 374 | DIALOG --msgbox "ERROR: You have defined 2 identical LABEL names! Please enter another name." 8 65 375 | LABEL_NAME="" 376 | fi 377 | done 378 | if [[ "${FSTYPE}" = "btrfs" ]]; then 379 | prepare_btrfs || return 1 380 | btrfs_compress 381 | btrfs_ssd 382 | fi 383 | DIALOG --inputbox "Enter additional options to the filesystem creation utility.\nUse this field only, if the defaults are not matching your needs,\nelse just leave it empty." 10 70 2>${ANSWER} || return 1 384 | FS_OPTIONS=$(cat ${ANSWER}) 385 | fi 386 | FILESYSTEM_FINISH="yes" 387 | } 388 | 389 | mountpoints(){ 390 | NAME_SCHEME_PARAMETER_RUN="" 391 | while [[ "${PARTFINISH}" != "DONE" ]]; do 392 | activate_special_devices 393 | : >/tmp/.device-names 394 | : >/tmp/.fstab 395 | : >/tmp/.parts 396 | # 397 | # Select mountpoints 398 | # 399 | DIALOG --msgbox "Available partitions:\n\n$(_getavailpartitions)\n" 0 0 400 | PARTS=$(findpartitions _) 401 | DO_SWAP="" 402 | while [[ "${DO_SWAP}" != "DONE" ]]; do 403 | FSTYPE="swap" 404 | DIALOG --menu "Select the partition to use as swap" 21 50 13 NONE - ${PARTS} 2>${ANSWER} || return 1 405 | PART=$(cat ${ANSWER}) 406 | if [[ "${PART}" != "NONE" ]]; then 407 | DOMKFS="no" 408 | if [[ "${ASK_MOUNTPOINTS}" = "1" ]]; then 409 | create_filesystem 410 | else 411 | FILESYSTEM_FINISH="yes" 412 | fi 413 | else 414 | FILESYSTEM_FINISH="yes" 415 | fi 416 | [[ "${FILESYSTEM_FINISH}" = "yes" ]] && DO_SWAP=DONE 417 | done 418 | check_mkfs_values 419 | if [[ "${PART}" != "NONE" ]]; then 420 | PARTS="$(echo ${PARTS} | sed -e "s#${PART}\ _##g")" 421 | echo "${PART}:swap:swap:${DOMKFS}:${LABEL_NAME}:${FS_OPTIONS}:${BTRFS_DEVICES}:${BTRFS_LEVEL}:${BTRFS_SUBVOLUME}:${DOSUBVOLUME}:${BTRFS_COMPRESS}:${BTRFS_SSD}" >>/tmp/.parts 422 | fi 423 | DO_ROOT="" 424 | while [[ "${DO_ROOT}" != "DONE" ]]; do 425 | DIALOG --menu "Select the partition to mount as /" 21 50 13 ${PARTS} 2>${ANSWER} || return 1 426 | PART=$(cat ${ANSWER}) 427 | PART_ROOT=${PART} 428 | # Select root filesystem type 429 | FSTYPE="$(${_BLKID} -p -i -o value -s TYPE ${PART})" 430 | DOMKFS="no" 431 | # clear values first! 432 | clear_btrfs_values 433 | check_btrfs_filesystem_creation 434 | if [[ "${ASK_MOUNTPOINTS}" = "1" && "${SKIP_FILESYSTEM}" = "no" ]]; then 435 | select_filesystem && create_filesystem && btrfs_subvolume 436 | else 437 | btrfs_subvolume 438 | fi 439 | [[ "${FILESYSTEM_FINISH}" = "yes" ]] && DO_ROOT=DONE 440 | done 441 | find_btrfs_raid_devices 442 | btrfs_parts 443 | check_mkfs_values 444 | echo "${PART}:${FSTYPE}:/:${DOMKFS}:${LABEL_NAME}:${FS_OPTIONS}:${BTRFS_DEVICES}:${BTRFS_LEVEL}:${BTRFS_SUBVOLUME}:${DOSUBVOLUME}:${BTRFS_COMPRESS}:${BTRFS_SSD}" >>/tmp/.parts 445 | ! [[ "${FSTYPE}" = "btrfs" ]] && PARTS="$(echo ${PARTS} | sed -e "s#${PART}\ _##g")" 446 | # 447 | # Additional partitions 448 | # 449 | while [[ "${PART}" != "DONE" ]]; do 450 | DO_ADDITIONAL="" 451 | while [[ "${DO_ADDITIONAL}" != "DONE" ]]; do 452 | DIALOG --menu "Select any additional partitions to mount under your new root (select DONE when finished)" 21 52 13 ${PARTS} DONE _ 2>${ANSWER} || return 1 453 | PART=$(cat ${ANSWER}) 454 | if [[ "${PART}" != "DONE" ]]; then 455 | FSTYPE="$(${_BLKID} -p -i -o value -s TYPE ${PART})" 456 | DOMKFS="no" 457 | # clear values first! 458 | clear_btrfs_values 459 | check_btrfs_filesystem_creation 460 | # Select a filesystem type 461 | if [[ "${ASK_MOUNTPOINTS}" = "1" && "${SKIP_FILESYSTEM}" = "no" ]]; then 462 | enter_mountpoint && select_filesystem && create_filesystem && btrfs_subvolume 463 | else 464 | enter_mountpoint 465 | btrfs_subvolume 466 | fi 467 | check_btrfs_boot_subvolume 468 | else 469 | FILESYSTEM_FINISH="yes" 470 | fi 471 | [[ "${FILESYSTEM_FINISH}" = "yes" ]] && DO_ADDITIONAL="DONE" 472 | done 473 | if [[ "${PART}" != "DONE" ]]; then 474 | find_btrfs_raid_devices 475 | btrfs_parts 476 | check_mkfs_values 477 | echo "${PART}:${FSTYPE}:${MP}:${DOMKFS}:${LABEL_NAME}:${FS_OPTIONS}:${BTRFS_DEVICES}:${BTRFS_LEVEL}:${BTRFS_SUBVOLUME}:${DOSUBVOLUME}:${BTRFS_COMPRESS}:${BTRFS_SSD}" >>/tmp/.parts 478 | ! [[ "${FSTYPE}" = "btrfs" ]] && PARTS="$(echo ${PARTS} | sed -e "s#${PART}\ _##g")" 479 | fi 480 | done 481 | DIALOG --yesno "Would you like to create and mount the filesytems like this?\n\nSyntax\n------\nDEVICE:TYPE:MOUNTPOINT:FORMAT:LABEL:FSOPTIONS:BTRFS_DETAILS\n\n$(for i in $(cat /tmp/.parts | sed -e 's, ,#,g'); do echo "${i}\n";done)" 0 0 && PARTFINISH="DONE" 482 | done 483 | # disable swap and all mounted partitions 484 | _umountall 485 | if [[ "${NAME_SCHEME_PARAMETER_RUN}" = "" ]]; then 486 | set_device_name_scheme || return 1 487 | fi 488 | printk off 489 | for line in $(cat /tmp/.parts); do 490 | PART=$(echo ${line} | cut -d: -f 1) 491 | FSTYPE=$(echo ${line} | cut -d: -f 2) 492 | MP=$(echo ${line} | cut -d: -f 3) 493 | DOMKFS=$(echo ${line} | cut -d: -f 4) 494 | LABEL_NAME=$(echo ${line} | cut -d: -f 5) 495 | FS_OPTIONS=$(echo ${line} | cut -d: -f 6) 496 | BTRFS_DEVICES=$(echo ${line} | cut -d: -f 7) 497 | BTRFS_LEVEL=$(echo ${line} | cut -d: -f 8) 498 | BTRFS_SUBVOLUME=$(echo ${line} | cut -d: -f 9) 499 | DOSUBVOLUME=$(echo ${line} | cut -d: -f 10) 500 | BTRFS_COMPRESS=$(echo ${line} | cut -d: -f 11) 501 | BTRFS_SSD=$(echo ${line} | cut -d: -f 12) 502 | if [[ "${DOMKFS}" = "yes" ]]; then 503 | if [[ "${FSTYPE}" = "swap" ]]; then 504 | DIALOG --infobox "Creating and activating swapspace on ${PART}" 0 0 505 | else 506 | DIALOG --infobox "Creating ${FSTYPE} on ${PART},\nmounting to ${DESTDIR}${MP}" 0 0 507 | fi 508 | _mkfs yes ${PART} ${FSTYPE} ${DESTDIR} ${MP} ${LABEL_NAME} ${FS_OPTIONS} ${BTRFS_DEVICES} ${BTRFS_LEVEL} ${BTRFS_SUBVOLUME} ${DOSUBVOLUME} ${BTRFS_COMPRESS} ${BTRFS_SSD} || return 1 509 | else 510 | if [[ "${FSTYPE}" = "swap" ]]; then 511 | DIALOG --infobox "Activating swapspace on ${PART}" 0 0 512 | else 513 | DIALOG --infobox "Mounting ${FSTYPE} on ${PART} to ${DESTDIR}${MP}" 0 0 514 | fi 515 | _mkfs no ${PART} ${FSTYPE} ${DESTDIR} ${MP} ${LABEL_NAME} ${FS_OPTIONS} ${BTRFS_DEVICES} ${BTRFS_LEVEL} ${BTRFS_SUBVOLUME} ${DOSUBVOLUME} ${BTRFS_COMPRESS} ${BTRFS_SSD} || return 1 516 | fi 517 | sleep 1 518 | done 519 | printk on 520 | DIALOG --msgbox "Partitions were successfully mounted." 0 0 521 | NEXTITEM="5" 522 | S_MKFS=1 523 | } 524 | 525 | # _mkfs() 526 | # Create and mount filesystems in our destination system directory. 527 | # 528 | # args: 529 | # domk: Whether to make the filesystem or use what is already there 530 | # device: Device filesystem is on 531 | # fstype: type of filesystem located at the device (or what to create) 532 | # dest: Mounting location for the destination system 533 | # mountpoint: Mount point inside the destination system, e.g. '/boot' 534 | 535 | # returns: 1 on failure 536 | _mkfs(){ 537 | local _domk=${1} 538 | local _device=${2} 539 | local _fstype=${3} 540 | local _dest=${4} 541 | local _mountpoint=${5} 542 | local _labelname=${6} 543 | local _fsoptions=${7} 544 | local _btrfsdevices="$(echo ${8} | sed -e 's|#| |g')" 545 | local _btrfslevel=${9} 546 | local _btrfssubvolume=${10} 547 | local _dosubvolume=${11} 548 | local _btrfscompress=${12} 549 | local _btrfsssd=${13} 550 | # correct empty entries 551 | [[ "${_fsoptions}" = "NONE" ]] && _fsoptions="" 552 | [[ "${_btrfsssd}" = "NONE" ]] && _btrfsssd="" 553 | [[ "${_btrfscompress}" = "NONE" ]] && _btrfscompress="" 554 | [[ "${_btrfssubvolume}" = "NONE" ]] && _btrfssubvolume="" 555 | # add btrfs raid level, if needed 556 | [[ ! "${_btrfslevel}" = "NONE" && "${_fstype}" = "btrfs" ]] && _fsoptions="${_fsoptions} -d ${_btrfslevel}" 557 | # we have two main cases: "swap" and everything else. 558 | if [[ "${_fstype}" = "swap" ]]; then 559 | swapoff ${_device} >/dev/null 2>&1 560 | if [[ "${_domk}" = "yes" ]]; then 561 | mkswap -L ${_labelname} ${_device} >${LOG} 2>&1 562 | if [[ $? != 0 ]]; then 563 | DIALOG --msgbox "Error creating swap: mkswap ${_device}" 0 0 564 | return 1 565 | fi 566 | fi 567 | swapon ${_device} >${LOG} 2>&1 568 | if [[ $? != 0 ]]; then 569 | DIALOG --msgbox "Error activating swap: swapon ${_device}" 0 0 570 | return 1 571 | fi 572 | else 573 | # make sure the fstype is one we can handle 574 | local knownfs=0 575 | for fs in xfs jfs reiserfs ext2 ext3 ext4 btrfs nilfs2 ntfs-3g vfat; do 576 | [[ "${_fstype}" = "${fs}" ]] && knownfs=1 && break 577 | done 578 | if [[ ${knownfs} -eq 0 ]]; then 579 | DIALOG --msgbox "unknown fstype ${_fstype} for ${_device}" 0 0 580 | return 1 581 | fi 582 | # if we were tasked to create the filesystem, do so 583 | if [[ "${_domk}" = "yes" ]]; then 584 | local ret 585 | case ${_fstype} in 586 | xfs) mkfs.xfs ${_fsoptions} -L ${_labelname} -f ${_device} >${LOG} 2>&1; ret=$? ;; 587 | jfs) yes | mkfs.jfs ${_fsoptions} -L ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 588 | reiserfs) yes | mkreiserfs ${_fsoptions} -l ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 589 | ext2) mkfs.ext2 ${_fsoptions} -F -L ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 590 | ext3) mke2fs ${_fsoptions} -F -L ${_labelname} -t ext3 ${_device} >${LOG} 2>&1; ret=$? ;; 591 | ext4) mke2fs ${_fsoptions} -F -L ${_labelname} -t ext4 ${_device} >${LOG} 2>&1; ret=$? ;; 592 | btrfs) mkfs.btrfs ${_fsoptions} -L ${_labelname} ${_btrfsdevices} >${LOG} 2>&1; ret=$? ;; 593 | nilfs2) mkfs.nilfs2 ${_fsoptions} -L ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 594 | ntfs-3g) mkfs.ntfs ${_fsoptions} -L ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 595 | vfat) mkfs.vfat ${_fsoptions} -n ${_labelname} ${_device} >${LOG} 2>&1; ret=$? ;; 596 | # don't handle anything else here, we will error later 597 | esac 598 | if [[ ${ret} != 0 ]]; then 599 | DIALOG --msgbox "Error creating filesystem ${_fstype} on ${_device}" 0 0 600 | return 1 601 | fi 602 | sleep 2 603 | fi 604 | if [[ "${_fstype}" = "btrfs" && -n "${_btrfssubvolume}" && "${_dosubvolume}" = "yes" ]]; then 605 | create_btrfs_subvolume 606 | fi 607 | btrfs_scan 608 | sleep 2 609 | # create our mount directory 610 | mkdir -p ${_dest}${_mountpoint} 611 | # prepare btrfs mount options 612 | _btrfsmountoptions="" 613 | [[ -n "${_btrfssubvolume}" ]] && _btrfsmountoptions="subvol=${_btrfssubvolume}" 614 | [[ -n "${_btrfscompress}" ]] && _btrfsmountoptions="${_btrfsmountoptions} ${_btrfscompress}" 615 | [[ -n "${_btrfsssd}" ]] && _btrfsmountoptions="${_btrfsmountoptions} ${_btrfsssd}" 616 | _btrfsmountoptions="$(echo ${_btrfsmountoptions} | sed -e 's#^ ##g' | sed -e 's# #,#g')" 617 | # mount the bad boy 618 | if [[ "${_fstype}" = "btrfs" && -n "${_btrfsmountoptions}" ]]; then 619 | mount -t ${_fstype} -o ${_btrfsmountoptions} ${_device} ${_dest}${_mountpoint} >${LOG} 2>&1 620 | else 621 | mount -t ${_fstype} ${_device} ${_dest}${_mountpoint} >${LOG} 2>&1 622 | fi 623 | if [[ $? != 0 ]]; then 624 | DIALOG --msgbox "Error mounting ${_dest}${_mountpoint}" 0 0 625 | return 1 626 | fi 627 | # change permission of base directories to correct permission 628 | # to avoid btrfs issues 629 | if [[ "${_mountpoint}" = "/tmp" ]]; then 630 | chmod 1777 ${_dest}${_mountpoint} 631 | elif [[ "${_mountpoint}" = "/root" ]]; then 632 | chmod 750 ${_dest}${_mountpoint} 633 | else 634 | chmod 755 ${_dest}${_mountpoint} 635 | fi 636 | fi 637 | # add to .device-names for config files 638 | local _fsuuid="$(getfsuuid ${_device})" 639 | local _fslabel="$(getfslabel ${_device})" 640 | 641 | if [[ "${GUID_DETECTED}" == "1" ]]; then 642 | local _partuuid="$(getpartuuid ${_device})" 643 | local _partlabel="$(getpartlabel ${_device})" 644 | 645 | echo "# DEVICE DETAILS: ${_device} PARTUUID=${_partuuid} PARTLABEL=${_partlabel} UUID=${_fsuuid} LABEL=${_fslabel}" >> /tmp/.device-names 646 | else 647 | echo "# DEVICE DETAILS: ${_device} UUID=${_fsuuid} LABEL=${_fslabel}" >> /tmp/.device-names 648 | fi 649 | 650 | # add to temp fstab 651 | if [[ "${NAME_SCHEME_PARAMETER}" == "FSUUID" ]]; then 652 | if [[ -n "${_fsuuid}" ]]; then 653 | _device="UUID=${_fsuuid}" 654 | fi 655 | elif [[ "${NAME_SCHEME_PARAMETER}" == "FSLABEL" ]]; then 656 | if [[ -n "${_fslabel}" ]]; then 657 | _device="LABEL=${_fslabel}" 658 | fi 659 | else 660 | if [[ "${GUID_DETECTED}" == "1" ]]; then 661 | if [[ "${NAME_SCHEME_PARAMETER}" == "PARTUUID" ]]; then 662 | if [[ -n "${_partuuid}" ]]; then 663 | _device="PARTUUID=${_partuuid}" 664 | fi 665 | elif [[ "${NAME_SCHEME_PARAMETER}" == "PARTLABEL" ]]; then 666 | if [[ -n "${_partlabel}" ]]; then 667 | _device="PARTLABEL=${_partlabel}" 668 | fi 669 | fi 670 | fi 671 | fi 672 | 673 | if [[ "${_fstype}" = "btrfs" && -n "${_btrfsmountoptions}" ]]; then 674 | echo -n "${_device} ${_mountpoint} ${_fstype} defaults,${_btrfsmountoptions} 0 " >>/tmp/.fstab 675 | else 676 | echo -n "${_device} ${_mountpoint} ${_fstype} defaults 0 " >>/tmp/.fstab 677 | fi 678 | if [[ "${_fstype}" = "swap" ]]; then 679 | echo "0" >>/tmp/.fstab 680 | else 681 | echo "1" >>/tmp/.fstab 682 | fi 683 | } 684 | 685 | # auto_fstab() 686 | # preprocess fstab file 687 | # comments out old fields and inserts new ones 688 | # according to partitioning/formatting stage 689 | # 690 | auto_fstab(){ 691 | # Modify fstab 692 | if [[ "${S_MKFS}" = "1" || "${S_MKFSAUTO}" = "1" ]]; then 693 | if [[ -f /tmp/.device-names ]]; then 694 | sort /tmp/.device-names >>${DESTDIR}/etc/fstab 695 | fi 696 | if [[ -f /tmp/.fstab ]]; then 697 | # clean fstab first from /dev entries 698 | sed -i -e '/^\/dev/d' ${DESTDIR}/etc/fstab 699 | sort /tmp/.fstab >>${DESTDIR}/etc/fstab 700 | fi 701 | fi 702 | } 703 | 704 | # check for btrfs bootpart and abort if detected 705 | abort_btrfs_bootpart(){ 706 | FSTYPE="$(${_BLKID} -p -i ${bootdev} -o value -s TYPE)" 707 | if [[ "${FSTYPE}" = "btrfs" ]]; then 708 | DIALOG --msgbox "Error:\nYour selected bootloader cannot boot from btrfs partition with /boot on it." 0 0 709 | return 1 710 | fi 711 | } 712 | -------------------------------------------------------------------------------- /bin/check-translate.in: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | fns=($(awk -F'=' '/^_/ {print $1}' "../data/translations/english.trans")) 14 | 15 | for lg in ../data/translations/*.trans ; do 16 | trans=$(<"${lg}") 17 | not=$(echo "${trans}" | grep -cE "#.*translate me") 18 | echo -e "\n-- $(basename "${lg}") ${not} to translate --" 19 | for key in "${fns[@]}"; do 20 | if [[ ! $trans =~ $key ]]; then 21 | echo -e "\t${key} not exist" 22 | fi 23 | done 24 | done 25 | 26 | #echo -e "${fns[*]}" -------------------------------------------------------------------------------- /bin/ma-launcher.in: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | if [ -e /run/miso/bootmnt/manjaro ]; then 14 | install -Dm755 /usr/share/applications/manjaro-architect.desktop \ 15 | $(xdg-user-dir DESKTOP)/manjaro-architect.desktop 16 | fi 17 | -------------------------------------------------------------------------------- /bin/manjaro-architect.in: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | version=@version@ 14 | 15 | LIBDIR='@libdir@' 16 | DATADIR='@datadir@' 17 | 18 | [[ -r ${LIBDIR}/util.sh ]] && source ${LIBDIR}/util.sh 19 | 20 | import ${LIBDIR}/ini_val.sh 21 | import ${LIBDIR}/util-base.sh 22 | import ${LIBDIR}/util-desktop.sh 23 | import ${LIBDIR}/util-disk.sh 24 | import ${LIBDIR}/util-menu.sh 25 | import ${LIBDIR}/util-advanced.sh 26 | import ${DATADIR}/translations/english.trans 27 | 28 | if [[ $TERM == "linux" ]] && [[ -e /usr/bin/maia-console ]]; then 29 | export DIALOGRC="/usr/share/manjaro-architect/dialogrc" 30 | else 31 | export DIALOGRC="/usr/share/manjaro-architect/dialogrc_gui" 32 | fi 33 | 34 | # run in debug mode with -d option 35 | [[ $1 == "-d" ]] && declare -i debug=1 36 | 37 | case $(tty) in /dev/tty[0-9]*) 38 | setterm -blank 0 -powersave off ;; 39 | esac 40 | 41 | check_root 42 | id_system 43 | set_language 44 | mk_connection 45 | check_connection 46 | #greeting 47 | if [[ -e /run/miso/bootmnt ]]; then 48 | hostcache=true 49 | else 50 | hostcache=false 51 | fi 52 | main_menu 53 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | [[ -e /run/miso/bootmnt ]] && [[ "$TERM" == linux ]] && setfont ter-116n 14 | 15 | while [[ ! -n "$(curl -Is https://manjaro.org | head -1)" ]]; do 16 | if [[ $(cat /proc/1/comm) == "systemd" ]];then 17 | if [[ $(systemctl is-active NetworkManager) == "active" ]]; then 18 | dialog --backtitle ":: Manjaro Architect ::" --yesno "\nPlease connect to the internet:\n" 0 0 && \ 19 | clear && nmtui && continue || \ 20 | clear && exit 0 21 | else 22 | dialog --backtitle ":: Manjaro Architect ::" --title " Error: " --msgbox "\nNo network service detected!\nquitting." 0 0 && \ 23 | clear && exit 0 24 | fi 25 | else 26 | dialog --title " Error: " --msgbox "\nAn active internet connection is needed!\n" 0 0 && \ 27 | clear && exit 0 28 | fi 29 | done 30 | 31 | echo "updating the installer ..." 32 | sleep 1 33 | sudo -E pacman -Sy manjaro-architect --noconfirm 34 | 35 | echo "launching Manjaro Architect ..." 36 | sudo -E manjaro-architect "$@" 37 | -------------------------------------------------------------------------------- /data/dialogrc: -------------------------------------------------------------------------------- 1 | # Provided under the GNU General Public License 2 | # as published by the Free Software Foundation. 3 | # 4 | # Shell dialog style by @oberon, designed to be used in combination with the 'maia-console' theme. 5 | # To achieve the same in the terminal you need to configure your terminal emulator. 6 | # 7 | # 8 | # colors used: 9 | # color00='232423' # BLACK | dark grey 10 | # color08='282928' 11 | # color01='BA2922' # RED 12 | # color09='CC372C' 13 | # color02='7E807E' # GREEN | very bright grey 14 | # color10='8D8F8D' 15 | # color03='4C4F4D' # YELLOW | grey 16 | # color11='4E524F' 17 | # color04='16A085' # BLUE | turquoise, maia highlight 18 | # color12='13BF9D' 19 | # color05='43746A' # MAGENTA | very bright grey 20 | # color13='487D72' 21 | # color06='00CCCC' # CYAN 22 | # color14='00D1D1' 23 | # color07='E0E0E0' # WHITE 24 | # color15='E8E8E8' 25 | 26 | screen_color = (green,black,off) 27 | dialog_color = (white,yellow,off) 28 | title_color = (green,yellow,on) 29 | border_color = dialog_color 30 | shadow_color = (black,black,on) 31 | 32 | button_inactive_color = dialog_color 33 | button_key_inactive_color = dialog_color 34 | button_label_inactive_color = dialog_color 35 | 36 | button_active_color = (white,blue,on) 37 | button_key_active_color = button_active_color 38 | button_label_active_color = (black,blue,on) 39 | tag_key_selected_color = (white,black,on) 40 | item_selected_color = tag_key_selected_color 41 | 42 | form_text_color = (yellow,green,on) 43 | form_item_readonly_color = (green,yellow,on) 44 | 45 | itemhelp_color = (white,blue,off) 46 | 47 | inputbox_color = dialog_color 48 | inputbox_border_color = dialog_color 49 | searchbox_color = dialog_color 50 | searchbox_title_color = title_color 51 | searchbox_border_color = border_color 52 | position_indicator_color = title_color 53 | menubox_color = dialog_color 54 | menubox_border_color = border_color 55 | item_color = dialog_color 56 | tag_color = title_color 57 | tag_selected_color = button_label_active_color 58 | tag_key_color = button_key_inactive_color 59 | check_color = dialog_color 60 | check_selected_color = button_active_color 61 | uarrow_color = screen_color 62 | darrow_color = screen_color 63 | form_active_text_color = button_active_color 64 | gauge_color = title_color 65 | border2_color = dialog_color 66 | searchbox_border2_color = dialog_color 67 | menubox_border2_color = dialog_color 68 | 69 | aspect = 0 70 | separate_widget = "" 71 | tab_len = 0 72 | visit_items = off 73 | use_shadow = off 74 | use_colors = on 75 | -------------------------------------------------------------------------------- /data/dialogrc_gui: -------------------------------------------------------------------------------- 1 | screen_color = (white,black,off) 2 | dialog_color = (white,black,off) 3 | title_color = (cyan,black,on) 4 | border_color = dialog_color 5 | shadow_color = (black,black,on) 6 | 7 | button_inactive_color = dialog_color 8 | button_key_inactive_color = dialog_color 9 | button_label_inactive_color = dialog_color 10 | 11 | button_active_color = (white,cyan,on) 12 | button_key_active_color = button_active_color 13 | button_label_active_color = (black,cyan,on) 14 | tag_key_selected_color = (white,cyan,on) 15 | item_selected_color = tag_key_selected_color 16 | 17 | form_text_color = (black,green,on) 18 | form_item_readonly_color = (green,black,on) 19 | 20 | itemhelp_color = (white,cyan,off) 21 | 22 | inputbox_color = dialog_color 23 | inputbox_border_color = dialog_color 24 | searchbox_color = dialog_color 25 | searchbox_title_color = title_color 26 | searchbox_border_color = border_color 27 | position_indicator_color = title_color 28 | menubox_color = dialog_color 29 | menubox_border_color = border_color 30 | item_color = dialog_color 31 | tag_color = title_color 32 | tag_selected_color = button_label_active_color 33 | tag_key_color = button_key_inactive_color 34 | check_color = dialog_color 35 | check_selected_color = button_active_color 36 | uarrow_color = screen_color 37 | darrow_color = screen_color 38 | form_active_text_color = button_active_color 39 | gauge_color = title_color 40 | border2_color = dialog_color 41 | searchbox_border2_color = dialog_color 42 | menubox_border2_color = dialog_color 43 | 44 | aspect = 0 45 | separate_widget = "" 46 | tab_len = 0 47 | visit_items = off 48 | use_shadow = off 49 | use_colors = on 50 | -------------------------------------------------------------------------------- /data/ma-launcher.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=ma-launcher 4 | Comment=create Manjaro-Architect launcher 5 | Exec=/usr/bin/ma-launcher 6 | -------------------------------------------------------------------------------- /data/manjaro-architect.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Version=1.0 4 | Name=Manjaro-Architect 5 | GenericName=CLI Installer 6 | Keywords=architect;system;installer 7 | TryExec=manjaro-architect 8 | Exec=sudo /usr/bin/setup 9 | Comment=Manjaro-Architect — CLI System Installer 10 | Icon=manjaro-architect 11 | Terminal=true 12 | StartupNotify=true 13 | Categories=System; 14 | -------------------------------------------------------------------------------- /data/manjaro-architect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrysostomus/manjaro-architect/2c7d3f8de824e43208285ccf196e76663033ca54/data/manjaro-architect.png -------------------------------------------------------------------------------- /data/menu_layout: -------------------------------------------------------------------------------- 1 | Main Menu 2 | │ 3 | ├── Prepare 4 | │ ├── show devices 5 | │ ├── partition 6 | │ ├── luks 7 | │ ├── lvm 8 | │ └── mount partitions 9 | │ 10 | ├── Install Base 11 | │ ├── config_mirrors 12 | │ ├── refresh_keys 13 | │ ├── install_base 14 | │ ├── install_manjaro_DE_WM 15 | │ └── install bootloader 16 | │ 17 | ├── Configure Base 18 | │ ├── fstab 19 | │ ├── hostname 20 | │ ├── locale 21 | │ ├── time_n_date / hw_clock 22 | │ ├── root_pw 23 | │ └── create_user 24 | │ 25 | ├── Edit config files 26 | │ ├── vconsole 27 | │ ├── locale 28 | │ ├── hostname 29 | │ ├── hosts 30 | │ ├── sudoers 31 | │ ├── mkinitcpio 32 | │ ├── fstab 33 | │ ├── crypttab 34 | │ ├── grub/syslinux 35 | │ ├── lxdm/lightdm/sddm 36 | │ ├── pacman 37 | │ └── xinitrc 38 | │ 39 | └── Advanced Installation 40 | ├── install manjaro dev profiles 41 | ├── unconfigured desktops 42 | │ ├── xorg 43 | │ ├── de_wm 44 | │ ├── dm 45 | │ ├── network 46 | │ ├── multimedia 47 | │ │ ├── alsa_pulse 48 | │ │ ├── codecs 49 | │ │ └── acc 50 | │ └── custom_pkgs 51 | ├── hardware drivers 52 | │ ├── graphics drivers 53 | │ │ ├── free drivers (automatic) 54 | │ │ ├── proprietary drivers (automatic) 55 | │ │ └── manual video-driver installation 56 | │ └── network drivers 57 | └── system_tweaks 58 | ├── journal logging 59 | ├── coredump logging 60 | └── kernel log access 61 | -------------------------------------------------------------------------------- /data/package-lists/base-openrc-manjaro: -------------------------------------------------------------------------------- 1 | acpi 2 | b43-fwcutter 3 | bash 4 | btrfs-progs 5 | bzip2 6 | coreutils 7 | crda 8 | dhclient 9 | diffutils 10 | dmraid 11 | dnsmasq 12 | dosfstools 13 | e2fsprogs 14 | ecryptfs-utils 15 | exfat-utils 16 | f2fs-tools 17 | file 18 | filesystem 19 | findutils 20 | gawk 21 | gcc-libs 22 | gettext 23 | glibc 24 | grep 25 | gzip 26 | inetutils 27 | intel-ucode 28 | iproute2 29 | iptables 30 | iputils 31 | ipw2100-fw 32 | ipw2200-fw 33 | jfsutils 34 | less 35 | licenses 36 | linux-firmware 37 | logrotate 38 | lsb-release 39 | man-db 40 | manjaro-firmware 41 | manjaro-release 42 | manjaro-system 43 | man-pages 44 | memtest86+ 45 | mhwd 46 | mhwd-db 47 | mkinitcpio-openswap 48 | nano 49 | nilfs-utils 50 | ntfs-3g 51 | acpid-openrc 52 | cpupower-openrc 53 | cronie-openrc 54 | cryptsetup-openrc 55 | dbus-openrc 56 | device-mapper-openrc 57 | dhcpcd-openrc 58 | eudev-systemd 59 | haveged-openrc 60 | libeudev-systemd 61 | lvm2-openrc 62 | mdadm-openrc 63 | netifrc 64 | nfs-utils-openrc 65 | rsync-openrc 66 | wpa_supplicant-openrc 67 | os-prober 68 | pacman 69 | pciutils 70 | pcmciautils 71 | perl 72 | procps-ng 73 | psmisc 74 | reiserfsprogs 75 | sed 76 | shadow 77 | s-nail 78 | sudo 79 | sysfsutils 80 | tar 81 | texinfo 82 | usbutils 83 | util-linux 84 | which 85 | xfsprogs 86 | zd1211-firmware 87 | -------------------------------------------------------------------------------- /data/package-lists/base-systemd-manjaro: -------------------------------------------------------------------------------- 1 | acpi 2 | b43-fwcutter 3 | bash 4 | btrfs-progs 5 | bzip2 6 | coreutils 7 | crda 8 | dhclient 9 | diffutils 10 | dmraid 11 | dnsmasq 12 | dosfstools 13 | e2fsprogs 14 | ecryptfs-utils 15 | exfat-utils 16 | f2fs-tools 17 | file 18 | filesystem 19 | findutils 20 | gawk 21 | gcc-libs 22 | gettext 23 | glibc 24 | grep 25 | gzip 26 | inetutils 27 | intel-ucode 28 | iproute2 29 | iptables 30 | iputils 31 | ipw2100-fw 32 | ipw2200-fw 33 | jfsutils 34 | less 35 | licenses 36 | linux-firmware 37 | logrotate 38 | lsb-release 39 | man-db 40 | manjaro-firmware 41 | manjaro-release 42 | manjaro-system 43 | man-pages 44 | memtest86+ 45 | mhwd 46 | mhwd-db 47 | mkinitcpio-openswap 48 | nano 49 | nilfs-utils 50 | ntfs-3g 51 | os-prober 52 | pacman 53 | pciutils 54 | pcmciautils 55 | perl 56 | procps-ng 57 | psmisc 58 | reiserfsprogs 59 | sed 60 | shadow 61 | s-nail 62 | sudo 63 | sysfsutils 64 | acpid 65 | cpupower 66 | cronie 67 | cryptsetup 68 | device-mapper 69 | dhcpcd 70 | haveged 71 | lvm2 72 | mdadm 73 | nfs-utils 74 | rsync 75 | systemd-sysvcompat 76 | tlp 77 | wpa_supplicant 78 | tar 79 | texinfo 80 | usbutils 81 | util-linux 82 | which 83 | xfsprogs 84 | zd1211-firmware 85 | -------------------------------------------------------------------------------- /data/package-lists/input-drivers: -------------------------------------------------------------------------------- 1 | xf86-input-elographics 2 | xf86-input-evdev 3 | xf86-input-keyboard 4 | xf86-input-libinput 5 | xf86-input-mouse 6 | xf86-input-void -------------------------------------------------------------------------------- /data/translations/english.trans: -------------------------------------------------------------------------------- 1 | ## 2 | ## 3 | ## English Translation File 4 | ## 5 | ## 6 | ## Written by Carl Duff (15-Feb-2016) 7 | ## 8 | ## 9 | 10 | # Generic 11 | _UseSpaceBar="Use [Spacebar] to de/select options listed." 12 | _AlreadyInst="Already installed:" 13 | _InstPkg="Install" 14 | _All="All" 15 | _Done="Done" 16 | _PlsWaitBody="Please wait..." 17 | _PassReEntBody="Re-enter the password." 18 | _ErrTitle="Error" 19 | _PassErrBody="The passwords entered do not match. Please try again." 20 | 21 | # Basics 22 | _SelLang="Select Language" 23 | _Lang="Language" 24 | _Keep="Keep" 25 | _Change="Change" 26 | _NoCon="No Internet Detected." 27 | _EstCon="Establish connection?" 28 | _Config="Configure" 29 | _ApplySet="Apply language settings ..." 30 | _ChMenu="Select Menu" 31 | _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." 32 | 33 | # Security and Tweaks 34 | _SecMenuTitle="Security and systemd Tweaks" 35 | _SecJournTitle="Amend journald Logging" 36 | _SecCoreTitle="Disable Coredump Logging" 37 | _SecKernTitle="Restrict Access to Kernel Logs" 38 | _SecKernBody="Kernel logs may contain information an attacker can use to identify and exploit kernel vulnerabilities, including sensitive memory addresses.\n\nIf systemd-journald logging has not been disabled, it is possible to create a rule in /etc/sysctl.d/ to disable access to these logs unless using root privilages (e.g. via sudo)." 39 | _Edit="Edit configuration file" 40 | _Disable="Disable" 41 | _SecMenuBody="A few useful and beginner-friendly tweaks are available to improve system security and performance.\n\nSelecting an option will provide details about it." 42 | _SecJournBody="systemd-journald collects and stores kernel logs, system logs, audit records, and standard outputs and error messages from services.\n\nBy default, a persistent (non-volatile) journal size limit is 10% of the root partition size: a 500G root means a 50G limit to data stored in /var/log/journal. 50M should be sufficent. Logging can also be disabled, although solving system problems may be more difficult." 43 | _SecCoreBody="A core dump is a record of computer memory when a process crashes.\n\nUseful for developers but not the average user, core dumps waste system resources and can also contain sensitive data such as passwords and encryption keys.\n\nThe default systemd behavior is to generate core dumps for all processes in /var/lib/systemd/coredump. This behavior can be overridden by creating a configuration file in the /etc/systemd/coredump.conf.d/ directory." 44 | 45 | # btrfs 46 | _btrfsSVTitle="btrfs Subvolumes" 47 | _btrfsSVBody="Create btrfs subvolumes?\n\nAn initial subvolume will be created and then mounted. Other subvolumes branching from this may then be created.\n\nOtherwise you can skip directly to the mounting options." 48 | _btrfsMSubBody1="Enter the name of the initial subvolume to mount (e.g. ROOT). Mounting options may then be selected. Once mounted, all other subvolumes created for" 49 | _btrfsMSubBody2="will branch from it." 50 | _btrfsSVErrBody="Blanks or spaces are not permitted. Please try again." 51 | _btrfsSVBody1="Enter the name of subvolume" 52 | _btrfsSVBody2="to create within" 53 | _btrfsSVBody3="This process will be repeated until an asterisk (*) is entered as the subvolume name.\n\nCreated Subvols:" 54 | _btrfsMntBody="Use [Space] to de/select the desired mount options and review carefully. Please do not select multiple versions of the same option." 55 | _btrfsMntConfBody="Confirm the following mount options:" 56 | 57 | # Autopartition 58 | _AutoPartBody1="Warning: ALL data on" 59 | _AutoPartBody2="will be destroyed.\n\nA 512MB boot partition will first be created, followed by a second (root or '/') partition using all remaining space." 60 | _AutoPartBody3="If intending to use SWAP, select the 'Swap File' option when mounting.\n\nDo you wish to continue?" 61 | 62 | # Error Messages. All others are generated by BASH. 63 | _ErrNoMount="Partition(s) must be mounted first." 64 | _ErrNoBase="The Manjaro base must be installed first." 65 | _ErrNoKernel="At least one kernel must be selected." 66 | 67 | # Vbox Installations 68 | _VBoxInstTitle="VirtualBox Installation" 69 | _VBoxInstBody="If for any reason the VirtualBox guest modules do not load for the installed system (e.g. low resolution and scrollbars after booting), a one-off series of commands will fix this:\n\n$ su\n# depmod -a\n# modprobe -a vboxvideo vboxguest vboxsf\n# reboot" 70 | 71 | # Select Config Files 72 | _SeeConfOptTitle="Review Configuration Files" 73 | _SeeConfOptBody="Select any file listed below to be reviewed or amended." 74 | _SeeConfErrBody="File does not exist." 75 | 76 | # Pacman 77 | _PrepPacKey="Refresh Pacman Keys" 78 | 79 | # LUKS / DM-Crypt / Encryption 80 | _PrepLUKS="LUKS Encryption (optional)" 81 | _LuksMenuBody="Devices and volumes encrypted using dm_crypt cannot be accessed or even seen without being unlocked via a key or password." 82 | _LuksMenuBody2="A seperate boot partition without encryption or logical volume management (LVM - unless using BIOS Grub) is required." 83 | _LuksMenuBody3="The Automatic option uses default encryption settings, and is recommended for beginners. Otherwise, it is possible to specify cypher and key size parameters manually." 84 | _LuksOpen="Open Encrypted Partition" 85 | _LuksErr="No LUKS-encrypted partition found." 86 | _LuksOpenBody="Specify a name for the encrypted block device. It is not necessary to prefix it with /dev/mapper/. An example has been provided." 87 | _LuksEncrypt="Automatic LUKS Encryption" 88 | _LuksEncryptAdv="Define Key-Size and Cypher" 89 | _LuksEncryptBody="Select a partition to encrypt." 90 | _LuksEncruptSucc="Done! Opened and ready for LVM (recommended) or direct mounting." 91 | _LuksPartErrBody="A minimum of two partitions are required for encryption:\n\n1. Root (/) - standard or lvm partition types.\n\n2. Boot (/boot or /boot/efi) - standard partition types only (except lvm where using BIOS Grub)." 92 | _SelLuksRootBody="Select the ROOT (/) partition to encrypt. This is where Manjaro will be installed." 93 | _LuksPassBody="Enter a password to un/encrypt the partition. This should not be the same as the Root account or user account passwords." 94 | _LuksWaitBody="Creating encrypted Root partition:" 95 | _LuksWaitBody2="Device or volume used:" 96 | _LuksCipherKey="Once the specified flags have been amended, they will automatically be used with the 'cryptsetup -q luksFormat /dev/...' command.\n\nNOTE: Key files are not supported; they can be added manually post-installation. Do not specify any additional flags such as -v (--verbose) or -y (--verify-passphrase)." 97 | 98 | # Logical Volume Management 99 | _PrepLVM="Logical Volume Management" 100 | _PrepLVM2="(optional)" 101 | _LvmMenu="Logical Volume Management (LVM) allows 'virtual' hard drives (Volume Groups) and partitions (Logical Volumes) to be created from existing drives and partitions. A Volume Group must be created first, then one or more Logical Volumes in it.\n\nLVM can also be used with an encrypted partition to create multiple logical volumes (e.g. root and home) in it." 102 | _LvmCreateVG="Create VG and LV(s)" 103 | _LvmDelVG="Delete Volume Groups" 104 | _LvMDelAll="Delete *ALL* VGs, LVs, PVs" 105 | _LvmDetBody="Existing Logical Volume Management (LVM) detected. Activating. Please Wait..." 106 | _LvmPartErrBody="There are no viable partitions available to use for Logical Volume Management. A minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) used for its Physical Volume(s) to be used again." 107 | _LvmNameVgBody="Enter the name of the Volume Group (VG) to create.\n\nThe VG is the new 'virtual device/hard-disk' to create out of the partition(s) selected next." 108 | _LvmNameVgErr="Invalid Name Entered or group name already in use.\nThe Volume Group name may be alpha-numeric, but may not contain spaces or start with a '/'." 109 | _LvmPvSelBody="Select the partition(s) to use for the Physical Volume (PV)." 110 | _LvmPvConfBody1="Confirm creation of Volume Group" 111 | _LvmPvConfBody2="with the following partitions:" 112 | _LvmPvActBody1="Creating and activating Volume Group" 113 | _LvmPvDoneBody1="Volume Group" 114 | _LvmPvDoneBody2="has been created" 115 | _LvmLvNumBody1="Enter the number of Logical Volumes (LVs) to create in" 116 | _LvmLvNumBody2="The last (or only) LV will automatically use 100% of the remaining space in the Volume Group." 117 | _LvmLvNameBody1="Enter the name of the Logical Volume (LV) to create.\n\nThis is like setting a name or label for a partition." 118 | _LvmLvNameBody2="NOTE: This LV will automatically use up all space remaining on the Volume Group" 119 | _LvmLvNameErrBody="Name is in use or not valid. Use alpha-numeric charactes only, no spaces or '/'!" 120 | _LvmLvSizeBody1="remaining" 121 | _LvmLvSizeBody2="Enter the size of the Logical Volume (LV) in Megabytes (M) or Gigabytes (G).\nFor example:\n100M will create a 100 Megabyte LV, 10G will create a 10 Gigabyte LV." 122 | _LvmLvSizeErrBody="Invalid value entered.\nA numeric value must be entered with an 'M' (Megabytes) or a 'G' (Gigabytes) at the end.\nExamples include, 100M, 10G, or 250M.\nThe value may also not be equal to or greater than the remaining size of the VG!" 123 | _LvmCompBody="Done! All Logical Volumes have been created for the Volume Group.\n\nDo you wish to view the new LVM scheme?" 124 | _LvmDelQ="Confirm deletion of Volume Group(s) and Logical Volume(s).\n\nIf deleting a Volume Group, all Logical Volumes within will be deleted as well." 125 | _LvmSelVGBody="Select Volume Group to delete. All Logical Volumes within will also be deleted." 126 | _LvmVGErr="No Volume Groups found." 127 | 128 | # Show devices and partitions 129 | _DevShowOpt="List Devices (optional)" 130 | 131 | # Check Requirements 132 | _ChkTitle="Rechecking Requirements" 133 | _ChkBody="Rechecking installer has been run as root and that there is an active internet connection. Please wait..." 134 | _RtFailBody="The installer must be run as root. Exiting." 135 | _ConFailBody="Internet connection test failed. Exiting." 136 | _ReqMetTitle="Requirements Met" 137 | _ReqMetBody="All checks passed!" 138 | _UpdDb="Updating database ..." 139 | 140 | # Installer Mirrorlist 141 | _MirrorlistTitle="Mirrorlist" 142 | _MirrorBranch="Choose Manjaro branch to use" 143 | _MirrorlistBody="The mirrorlist contains server addresses used by pacman to install packages. To find the fastest servers, FIRST generate a mirrorlist by country BEFORE running RankMirrors, otherwise the process will take a LONG TIME.\n\nThe pacman configuration file can be edited to enable multilib and other repositories.\n\nNOTE: Close text files with '[CTRL] + [x]'. If edited, then press [y] to save or [n] to discard changes." 144 | _RankMirrors="Select your custom mirrors using [Spacebar] or [Enter] and confirm with the [OK] button at the bottom." 145 | _MirrorbyCountry="Generate mirrorlist by Country" 146 | _MirrorEdit="Manually edit mirrorlist" 147 | _MirrorRankTitle="Rank Mirrors by Speed" 148 | _MirrorRestTitle="Restore Original Mirrorlist" 149 | _MirrorRankBody="Finding the fastest servers from the mirrorlist." 150 | _MirrorNoneBody="A copy of the original mirrorlist was not found." 151 | _MirrorCntryBody="A list of mirrors by the selected country will be generated." 152 | _MirrorGenQ="Use generated mirrorlist for installer?" 153 | _MirrorConfig="Edit Pacman Mirror Configuration" 154 | _MirrorPacman="Edit Pacman Configuration" 155 | _MIrrorPacQ="Use edited pacman configuration for installed system? If Yes, the file will be copied over after installing the base." 156 | 157 | # Set Keymap (vconsole) 158 | _VCKeymapTitle="Set Virtual Console" 159 | _DefKeymap="Currently configured keymap setting is:" 160 | _VCKeymapBody="A virtual console is a shell prompt in a non-graphical environment. Its keymap is independent of a desktop environment / terminal." 161 | 162 | # Set Xkbmap (environment) 163 | _XkbmapBody="Select Desktop Environment Keymap." 164 | 165 | # Set Locale 166 | _localeBody="Locales determine the languages displayed, time and date formats, etc.\n\nThe format is language_COUNTRY (e.g. en_US is english, United States; en_GB is english, Great Britain)." 167 | 168 | # Set Timezone 169 | _TimeZBody="The time zone is used to correctly set your system clock." 170 | _TimeSubZBody="Select the city nearest to you." 171 | _TimeZQ="Set Time Zone:" 172 | 173 | # Set Hardware Clock 174 | _HwCBody="UTC is the universal time standard, and is recommended unless dual-booting with Windows." 175 | 176 | # Generate FSTAB 177 | _FstabBody="The FSTAB file (File System TABle) sets what storage devices and partitions are to be mounted, and how they are to be used.\n\nUUID (Universally Unique IDentifier) is recommended.\n\nIf no labels were set for the partitions earlier, device names will be used for the label option." 178 | _FstabErr="The Part UUID option is only for UEFI/GPT installations." 179 | _FstabDevName="Device Name" 180 | _FstabDevLabel="Device Label" 181 | _FstabDevUUID="Device UUID" 182 | _FstabDevPtUUID="UEFI Part UUID" 183 | 184 | # Set Hostname 185 | _HostNameBody="The host name is used to identify the system on a network.\n\nIt is restricted to alphanumeric characters, can contain a hyphen (-) - but not at the start or end - and must be no longer than 63 characters." 186 | 187 | # Set Root Password 188 | _PassRtBody="Enter Root password" 189 | _PassRtBody2="Re-enter Root password" 190 | 191 | # Create New User 192 | _NUsrTitle="Create New User" 193 | _NUsrBody="Enter the user name. Letters MUST be lower case." 194 | 195 | # Username Error 196 | _NUsrErrTitle="User Name Error" 197 | _NUsrErrBody="An incorrect user name was entered. Please try again." 198 | 199 | # Set User 200 | _PassNUsrBody="Enter password for" 201 | _NUsrSetBody="Creating User and setting groups..." 202 | _DefShell="Choose the default shell." 203 | 204 | # Mounting (Partitions) 205 | _MntStatusTitle="Mount Status" 206 | _MntStatusSucc="Mount Successful!" 207 | _MntStatusFail="Mount Failed!" 208 | _WarnMount1="IMPORTANT: Partitions can be mounted without formatting them by selecting the" 209 | _WarnMount2="option listed at the top of the file system menu.\n\nEnsure the correct choices for mounting and formatting are made as no warnings will be provided, with the exception of the UEFI boot partition." 210 | 211 | # Select Device (installation) 212 | _DevSelTitle="Select Device" 213 | _DevSelBody="Devices (/dev/) are available hard-disks and USB-sticks to install on. The first is /sda, the second /sdb, and so on.\n\nIf you're booting Manjaro-Architect from a USB-stick, be careful as it will also be listed!" 214 | 215 | # Partitioning Tool 216 | _PartToolTitle="Partitioning Tool" 217 | _PartToolBody="An automatic partitioning option is available for beginners. Otherwise, cfdisk is recomended for BIOS, parted for UEFI.\n\nDO NOT select a UEFI/GPT-only partitioning tool for a BIOS/MBR system as this could cause serious problems, including an unbootable installation." 218 | _PartOptAuto="Automatic Partitioning" 219 | _PartOptWipe="Securely Wipe Device (optional)" 220 | _AutoPartWipeBody1="WARNING: ALL data on" 221 | _AutoPartWipeBody2="will be destroyed using the command 'wipe -Ifre'. This process may also take a long time depending on the size of the device.\n\nDo you wish to continue?" 222 | 223 | # Partitioning Error 224 | _PartErrBody="BIOS systems require a minmum of one partition (ROOT).\n\nUEFI systems require a minimum of two partitions (ROOT and UEFI)." 225 | 226 | # File System 227 | _FSTitle="Choose Filesystem" 228 | _FSBody="Ext4 is recommended. Not all filesystems are viable for Root or Boot partitions. All have different features and limitations." 229 | _FSSkip="Do not format" 230 | _FSMount="Mount" 231 | _FSWarn1="Data on" 232 | _FSWarn2="will be lost" 233 | 234 | # Select Root 235 | _SelRootBody="Select ROOT Partition. This is where Manjaro will be installed." 236 | 237 | # Select SWAP 238 | _SelSwpBody="Select SWAP Partition. If using a Swapfile, it will be initially set the same size as your RAM." 239 | _SelSwpNone="None" 240 | _SelSwpFile="Swapfile" 241 | 242 | # Select UEFI 243 | _SelUefiBody="Select UEFI Partition. This is a special partition for booting UEFI systems." 244 | 245 | # Format UEFI 246 | _FormUefiBody="The UEFI partition" 247 | _FormUefiBody2="has already been formatted.\n\nReformat? Doing so will erase ALL data already on that partition." 248 | 249 | # UEFI Mountpoint 250 | _MntUefiBody="Select UEFI Mountpoint.\n\n 251 | /boot/efi is recommended for multiboot systems.\n 252 | /boot is required for systemd-boot." 253 | _MntUefiCrypt="Select UEFI Mountpoint.\n\n 254 | /boot/efi is recommended for multiboot systems and required for full disk encryption. Encrypted /boot is supported only by grub and can lead to slow startup.\n\n 255 | /boot is required for systemd-boot and for refind when using encryption." 256 | 257 | # Extra Partitions 258 | _ExtPartBody="Select additional partitions in any order, or 'Done' to finish." 259 | 260 | # Extra Partitions 261 | _ExtPartBody1="Specify partition mountpoint. Ensure the name begins with a forward slash (/). Examples include:" 262 | 263 | # Extra Partition Naming Error 264 | _ExtErrBody="Partition cannot be mounted due to a problem with the mountpoint name. A name must be given after a forward slash." 265 | 266 | # Install Base 267 | _WarnInstBase="A Manjaro Base has already been installed on this partition.\nProceed anyway?" 268 | _InstBseTitle="Install Base" 269 | _InstFail="Installation failed." 270 | _InstBseBody="Standard: Recommended for beginners. Choose up to two kernels (linux and linux-lts) and optionally the base-devel package group. sudo, btrfs-progs, f2fs-tools will also be installed.\n\nAdvanced: Choose up to four kernels (linux, lts, grsec, zen) and control individual base and base-devel packages. Additional configuration for grsec and zen may be required for Virtualbox and NVIDIA.\n\nNOTE: Unless already installed, at least one kernel must be selected." 271 | _InstStandBseBody="The base package group will be installed automatically. The base-devel package group is required to use the Arch User Repository (AUR)." 272 | _InstStandBase="Standard Installation" 273 | _InstAdvBase="Advanced Installation" 274 | _InstAdvBseBody="WARNING: This is for experienced users only. Newer users should use the 'standard' installation option." 275 | _InstAdvWait="Gathering package descriptions." 276 | _InstGrub="Install Grub" 277 | 278 | # Install BIOS Bootloader 279 | _InstBiosBtTitle="Install BIOS Bootloader" 280 | _InstGrubBody="The installation device for GRUB can be selected in the next step.\n\nOs-prober is needed for automatic detection of already installed systems on other partitions." 281 | _InstBiosBtBody="Grub2 is recommended for beginners. The installation device can also be selected.\n\nSyslinux is a lighter and simpler alternative that will only work with ext/btrfs filesystems." 282 | _InstSysTitle="Install Syslinux" 283 | _InstSysBody="Install syslinux to Master Boot Record (MBR) or to Root (/)?" 284 | 285 | # Install UEFI Bootloader 286 | _InstUefiBtTitle="Install UEFI Bootloader" 287 | _InstUefiBtBody="Install UEFI Bootloader GRUB." 288 | _SetBootDefBody="Some UEFI firmware may not detect the bootloader unless it is set as default by copying its efi stub to" 289 | _SetBootDefBody2="and renaming it to bootx64.efi.\n\nIt is recommended to do so unless already using a default bootloader, or where intending to use multiple bootloaders.\n\nSet bootloader as default?" 290 | 291 | # efi file set for Grub 292 | _SetDefDoneBody="has been set as the default bootloader." 293 | 294 | # Graphics Card Menu 295 | _GCtitle="Graphics Card Menu" 296 | _GCBody="Pick Nouveau for older NVIDIA cards. If your card is not listed, pick 'Unknown / Generic'." 297 | _GCUnknOpt="Unknown / Generic" 298 | 299 | # NVIDIA Configruation Check 300 | _NvidiaConfTitle="NVIDIA Configuration Check" 301 | _NvidiaConfBody="A basic NVIDIA configuration file has been created. Please check it before closing to continue." 302 | 303 | # Graphics Card Detection 304 | _GCDetTitle="Detected" 305 | _GCDetBody="Is your graphics card or virtualisation software" 306 | _GCDetBody2="-Select 'Yes' to install its OPEN-SOURCE driver.\n\n-Select 'No' to open the graphics card menu, which includes proprietary NVIDIA drivers." 307 | 308 | # Install DE Info 309 | _DEInfoBody="Multiple environments can be installed.\n\nGnome and LXDE come with a display manager.\n\nCinnamon, Gnome and KDE come with a Network Manager." 310 | 311 | # Install DE Menu 312 | _InstDETitle="Install Desktop Environments" 313 | _DesktopInstalled="A Manjaro-Desktop has already been installed on this partition!\nInstalling another one will likely result in package conflicts and other issues.\nIt is recommended you format the partition and start a fresh install.\n\nIgnore and Proceed anyway?" 314 | _InstManDEBody="Please choose a desktop environment." 315 | _ErrInit="Wrong init system" 316 | _WarnInit="is currently available for systemd only.\nPlease adjust your selection:" 317 | _DiffPro="Select different profile" 318 | _InstSystd="Install systemd base" 319 | _InstDEBody="Desktop Environments and their related package groups are listed first." 320 | _ExtraTitle="Full or minimal?" 321 | _ExtraBody="This edition is offered in two versions" 322 | 323 | # Install Common Packages 324 | _InstComTitle="Install Common Packages" 325 | _InstComBody="Some environments require additional packages to function better." 326 | 327 | # Display Manager 328 | _DmChTitle="Install Display Manager" 329 | _DmChBody="gdm lists Gnome-shell as a dependency. sddm is recommended for plasma. lightdm will incude lightdm-gtk-greeter. slim is no longer maintained." 330 | _DmDoneBody="Display manager has been installed and enabled." 331 | 332 | # Network Manager 333 | _InstNMTitle="Install Network Manager" 334 | _InstNMBody="Network Manager is recommended, especially for wireless and PPPoE/DSL connections." 335 | _InstNMErrBody="Network connection manager has been installed and enabled." 336 | 337 | # Welcome 338 | _WelTitle="Welcome to" 339 | _WelBody="This installer will download the latest packages from the Manjaro repositories. \n\nMENU OPTIONS: Select by pressing the option number or by using the up/down arrow keys before pressing [enter] to confirm. Switch between buttons by using [Tab] or the left/right arrow keys before pressing [enter] to confirm. Long lists can be navigated using the [pg up] and [pg down] keys, and/or by pressing the first letter of the desired option.\n\nCONFIGURATION & PACKAGE OPTIONS: Default packages in checklists will be pre-checked. Use the [Spacebar] to de/select." 340 | 341 | # Preparation Menu 342 | _PrepMenuTitle="Prepare Installation" 343 | _PrepMenuBody="The console keyboard layout will be used for both the installer and the installed system." 344 | _PrepKBLayout="Set Desktop Keyboard Layout" 345 | _PrepMirror="Configure Installer Mirrorlist" 346 | _PrepPartDisk="Partition Disk" 347 | _PrepMntPart="Mount Partitions" 348 | _Back="Back" 349 | 350 | # Install Base Menu 351 | _PkgList="Processing package list" 352 | _InstBsMenuTitle="Install Base" 353 | _InstBseMenuBody="Packages to be installed will be downloaded from mirror servers. The default branch is 'stable'.\nTo optimize your download speed or to switch branch, use the entry [$_PrepMirror]." 354 | _InstBse="Install Base Packages" 355 | _ChsInit="Choose your initsystem" 356 | _Note="Note!" 357 | _WarnOrc="These Manjaro profiles are incompatible with openrc:" 358 | _ChsAddPkgs="Choose additional modules for your kernels" 359 | _InstBootldr="Install Bootloader" 360 | _InstDrvTitle="Install Hardware Drivers" 361 | _InstDrvBody="Some network and graphics cards \nmay need special drivers. \nOptions 1 and 2 choose drivers automatically, \noptions 3 and 4 let you choose specific drivers" 362 | _InstFree="Auto-install free drivers" 363 | _InstProp="Auto-install proprietary drivers" 364 | _SelDDrv="Select Display Driver" 365 | _InstAllDrv="Install all free drivers" 366 | 367 | # Configure Base Menu 368 | _ConfBseMenuTitle="Configure Base" 369 | _ConfBseBody="Basic configuration of the base." 370 | _ConfBseFstab="Generate FSTAB" 371 | _ConfBseHost="Set Hostname" 372 | _ConfBseTimeHC="Set Timezone and Clock" 373 | _ConfBseSysLoc="Set System Locale" 374 | _RunMkinit="Run Mkinitcpio" 375 | _RunUpGrub="Update GRUB" 376 | 377 | # User Menu 378 | _ConfUsrRoot="Set Root Password" 379 | _ConfUsrNew="Add New User(s)" 380 | 381 | # Graphics Menu 382 | _InstGrMenuTitle="Install Graphical Interface" 383 | _InstGrMenuBody="Prior to installing a desktop environment, graphics, input, and sound drivers MUST be installed first. This will include installing graphics card drivers." 384 | _InstDEMenuTitle="Choose a full Manjaro edition or vanilla desktop environments" 385 | _InstGrMenuDS="Install Display Server" 386 | _InstGrMenuDSBody="In addition to xorg and wayland options, drivers for input devices (xf86-input-) are also listed." 387 | _InstGrMenuDD="Install Display Driver" 388 | _InstGrDrv="Choose video-driver to be installed" 389 | _WarnInstGr="No Display Driver selected." 390 | _InstDEStable="Install Manjaro Desktop" 391 | _InstDEGit="Install Manjaro Desktop (development profiles)" 392 | _InstDE="Install Unconfigured Desktop Environments" 393 | _InstGrDE="Install Desktop environment" 394 | _InstPBody="This installs a package list and a desktop-settings package, corresponding to manjaro editions of the same name." 395 | _InstGrMenuGE="Install Graphical Environment" 396 | _InstGrMenuDM="Install Display Manager" 397 | 398 | # Networking Menu 399 | _InstNMMenuTitle="Install Networking Capabilties" 400 | _InstNWDrv="Install Network Drivers" 401 | _SelNWDrv="Select Network Driver" 402 | _InfoNWKernel="Support for your network card is built into the kernel,\nno need to install anything." 403 | _InstNMMenuBody="Supplementary packages may be required for networking and wireless devices. Some wireless devices may also require additional firmware to function." 404 | _InstNMMenuPkg="Install Wireless Device Packages" 405 | _InstNMMenuNM="Install Network Connection Manager" 406 | _InstNMMenuCups="Install CUPS / Printer Packages" 407 | _InstNMMenuPkgBody="Key wifi packages will be pre-checked if a wireless device was detected. If unsure about additional firmware, all packages can be installed." 408 | _SeeWirelessDev="Display Wireless Device (optional)" 409 | _WirelessShowTitle="Wireless Device" 410 | _WirelessErrBody="None Detected." 411 | _InstCupsBody="CUPS (Common Unix Printing System) is the standards-based, open source printing system developed by Apple Inc. for OS X and other UNIX-like operating systems. Samba allows file and printer sharing between Linux and Windows systems." 412 | _InstCupsQ="Enable org.cups.cupsd.service on installed system?" 413 | 414 | # Install Multimedia Support Menu 415 | _InstMultMenuTitle="Install Multimedia Support" 416 | _InstMultMenuBody="Accessibility packages aid those with sight and/or hearing impairments. The Custom Packages option allows for user-defined packages to be installed." 417 | _InstMulSnd="Install Sound Driver(s)" 418 | _InstMulSndBody="ALSA provides kernel driven sound card drivers. PulseAudio serves as a proxy to ALSA." 419 | _InstMulCodec="Install Codecs" 420 | _InstMulAcc="Install Accessibility Packages" 421 | _InstMulAccBody="Select desired accessibility packages." 422 | _InstMulCust="Install Custom Packages" 423 | 424 | # Codecs Menu 425 | _InstMulCodBody="GStreamer is a pipeline-based multimedia framework. The first two options are the current and legacy (gstreamer0.10) package groups. Xine is also listed." 426 | 427 | # Custom Packages Box 428 | _InstMulCustBody="Enter the (exact) names of packages to be installed from the Manjaro repositories, seperated by spaces.\n\nFor example, to install Firefox, VLC, and HTop: firefox vlc htop" 429 | 430 | # Main Menu 431 | _MMTitle="Main Menu" 432 | _MMBody="Steps should be followed IN ORDER. Once complete, select 'Done' to finalise the installation." 433 | _MMNewBody="After mounting the partitions in the preparation section, select your installation type. If you are unsure, choose Desktop System for a default Manjaro installation." 434 | 435 | # Final Check 436 | _BaseCheck="Base is not installed" 437 | _BootlCheck="Bootloader is not installed" 438 | _FstabCheck="Fstab has not been generated" 439 | _GCCheck="No graphics driver has been installed" 440 | _LocaleCheck="Locales have not been generated" 441 | _RootCheck="Root password is not set" 442 | _UserCheck="No user accounts have been generated" 443 | 444 | # Close Installer 445 | _CloseInstBody="Close installer?" 446 | _LogInfo="Would you like to save the installation-log to the installed system?\nIt will be copied to" 447 | 448 | # Chroot 449 | _ChrootReturn="\nYou will now chroot into your installed system. You can do changes almost as if you had booted into your installation.\n\nType \"exit\" to exit chroot and \"fg\" to return to the installer.\n " 450 | _EnterChroot="Enter your installation" 451 | _ChrootTitle="Chroot into Installation" 452 | 453 | #Refind 454 | _InstRefindTitle="Install refind" 455 | _InstRefindBody="This installs refind and configures it to automatically detect your kernels. No support for encrypted /boot or intel microcode. These require manual boot stanzas or using a different bootloader." 456 | _RefindReady="Refind was succesfully installed" 457 | _bootloaderInfo="Refind can be used standalone or in conjunction with other bootloaders as a graphical bootmenu. It autodetects all bootable systems at boot time.\nGrub supports encrypted /boot partition and detects all bootable systems when you update your kernels. It supports booting .iso files from a harddrive and automatic boot entries for btrfs snapshots.\nSystemd-boot is very light and simple and has little automation. It autodetects windows, but is otherwise unsuited for multibooting." 458 | 459 | # Systemd-boot 460 | _InstSystdBBody="This installs systemd-boot and generates boot entries for the currently installed kernels. This bootloader requires your kernels to be on the UEFI partition. This is achieved by mounting the UEFI partition to /boot." 461 | _SystdBReady="Systemd-boot was installed" 462 | 463 | #Meta menu 464 | _InstCrMenuTitle="Install CLI System" 465 | _InstCrMenuBody="This installs a Manjaro base-system without graphical desktop environment. Steps 1-3 are needed for a working system, the rest is optional." 466 | _InstDsMenuTitle="Install Desktop System" 467 | _InstDsMenuBody="This installs a full Manjaro edition with graphical desktop environment. Steps 1-3 are needed for a working system, the rest is optional." 468 | _InstCsMenuTitle="Install Custom System" 469 | _InstCsMenuBody="This installs a Manjaro base-system without graphical desktop environment. Steps 1-4 are needed for a working system, the rest is optional." 470 | 471 | #System rescue 472 | _SysRescTitle="System Rescue" 473 | _SysRescBody="This menu is a collection of tools to help restore a broken system to full functionality." 474 | _RmPkgs="Remove Packages" 475 | _RmPkgsMsg="Search packages by typing their name. 476 | Press tab to select multiple packages" 477 | _RmPkgsPrmpt="Package to remove" 478 | _AddPkgsPrmpt="Package" 479 | _AddPkgs="Choose any extra packages you would like to add. 480 | Search packages by typing their name. 481 | Press tab to select multiple packages and proceed or quit with Enter." 482 | 483 | #Extra 484 | _ExtraPkgTitle="Extra Packages" 485 | _ExtraPkgBody="Would you like to add any additional packages to your installation?" 486 | 487 | _TweaksMenuTitle="System Tweaks" 488 | _PerfBody="Settings to configure your system to a specific workload" 489 | _TweaksBody="Various configuration options" 490 | _PerfMenu="Performance" 491 | _SetSchd="I/O Schedulers" 492 | _SetSwap="Swap Configuration" 493 | _AutologEnable="Enable Automatic Login" 494 | _HibrnEnable="Enable Hibernation" 495 | 496 | _LogMenu="View System Logs" 497 | _LogBody="Parse system logs with fzf" 498 | _DataRecMenu="Data Recovery" 499 | _DataRecBody="Various tools for data backup and recovery" 500 | 501 | _HostCache="Choose pacman cache" 502 | _HostCacheBody="Do you want to use the pacman cache of the running system instead of the installation target? This can reduce the size of the required downloads in the installation." 503 | 504 | -------------------------------------------------------------------------------- /lib/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2018,2,7,12,14,19 4 | Version=4 5 | -------------------------------------------------------------------------------- /lib/ini_val.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # BASH3 Boilerplate: ini_val 3 | # 4 | # This file: 5 | # 6 | # - Can read and write .ini files using pure bash 7 | # 8 | # Limitations: 9 | # 10 | # - All keys inside the .ini file must be unique, regardless of the use of sections 11 | # 12 | # Usage as a function: 13 | # 14 | # source ini_val.sh 15 | # set: ini_val data.ini connection.host 127.0.0.1 16 | # read: ini_val data.ini connection.host 17 | # 18 | # Usage as a command: 19 | # 20 | # ini_val.sh data.ini connection.host 127.0.0.1 21 | # 22 | # Based on a template by BASH3 Boilerplate v2.3.0 23 | # http://bash3boilerplate.sh/#authors 24 | # 25 | # The MIT License (MIT) 26 | # Copyright (c) 2013 Kevin van Zonneveld and contributors 27 | # You are not obligated to bundle the LICENSE file with your b3bp projects as long 28 | # as you leave these references intact in the header comments of your source files. 29 | 30 | function ini_val() { 31 | local file="${1:-}" 32 | local sectionkey="${2:-}" 33 | local val="${3:-}" 34 | local delim=" = " 35 | local section="" 36 | local key="" 37 | 38 | # Split on . for section. However, section is optional 39 | IFS='.' read -r section key <<< "${sectionkey}" 40 | if [[ ! "${key}" ]]; then 41 | key="${section}" 42 | section="" 43 | fi 44 | 45 | local current 46 | current=$(awk -F "${delim}" "/^${key}${delim}/ {for (i=2; i> "${file}" 59 | else 60 | # add to section 61 | grep "^\[${section}\]" "${file}" &>/dev/null || echo -e "\n[${section}]">>"${file}" 62 | sed -i -e "/\[${section}\]/a ${key}${delim}${val}" "${file}" 63 | fi 64 | else 65 | # replace existing 66 | sed -i -e "/^${key}${delim}/s/${delim}.*/${delim}${val}/" "${file}" 67 | fi 68 | fi 69 | } 70 | 71 | if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then 72 | export -f ini_val 73 | else 74 | ini_val "${@}" 75 | exit ${?} 76 | fi 77 | -------------------------------------------------------------------------------- /lib/util-advanced.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | advanced_menu() { 14 | declare -i loopmenu=1 15 | while ((loopmenu)); do 16 | submenu 7 17 | DIALOG " $_InstAdvBase " --default-item ${HIGHLIGHT_SUB} \ 18 | --menu "\n " 0 0 7 \ 19 | "1" "$_InstDEGit" \ 20 | "2" "$_InstDE|>" \ 21 | "3" "$_InstDrvTitle|>" \ 22 | "4" "$_SecMenuTitle|>" \ 23 | "5" "Chroot into installation" \ 24 | "6" "$_InstMulCust" \ 25 | "7" "$_Back" 2>${ANSWER} || return 0 26 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 27 | 28 | case $(cat ${ANSWER}) in 29 | "1") check_base && install_manjaro_de_wm_git 30 | ;; 31 | "2") check_base && install_vanilla_de_wm 32 | ;; 33 | "3") check_base && install_drivers_menu 34 | ;; 35 | "4") check_base && security_menu 36 | ;; 37 | "5") check_base && chroot_interactive 38 | ;; 39 | "6") install_cust_pkgs 40 | ;; 41 | *) loopmenu=0 42 | return 0 43 | ;; 44 | esac 45 | done 46 | } 47 | 48 | install_cust_pkgs() { 49 | echo "" > ${PACKAGES} 50 | pacman -Ssq | fzf -m -e --header="$_AddPkgs" --prompt="$_AddPkgsPrmpt > " --reverse >${PACKAGES} || return 0 51 | 52 | clear 53 | # If at least one package, install. 54 | if [[ $(cat ${PACKAGES}) != "" ]]; then 55 | if $hostcache; then 56 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 57 | else 58 | basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 59 | fi 60 | check_for_error "$FUNCNAME $(cat ${PACKAGES})" "$?" 61 | fi 62 | } 63 | 64 | rm_pgs(){ 65 | manjaro-chroot /mnt "pacman -Qq" | fzf -m -e --header="$_RmPkgsMsg" --prompt="$_RmPkgsPrmpt > " --reverse > /tmp/.to_be_removed || return 0 66 | 67 | if [[ $(cat /tmp/.to_be_removed) != "" ]]; then 68 | arch_chroot "pacman -Rsn $(cat /tmp/.to_be_removed)" 2>$ERR 69 | check_for_error "$FUNCNAME $(cat /tmp/.to_be_removed)" "$?" 70 | fi 71 | } 72 | 73 | chroot_interactive() { 74 | 75 | DIALOG " $_EnterChroot " --infobox "$_ChrootReturn" 0 0 76 | echo "" 77 | echo "" 78 | arch_chroot bash 79 | } 80 | 81 | install_manjaro_de_wm_git() { 82 | if check_desktop; then 83 | PROFILES="$DATADIR/profiles" 84 | # Only show this information box once 85 | if [[ $SHOW_ONCE -eq 0 ]]; then 86 | DIALOG " $_InstDETitle " --msgbox "\n$_InstPBody\n " 0 0 87 | SHOW_ONCE=1 88 | fi 89 | clear 90 | # install git if not already installed 91 | inst_needed git 92 | # download manjaro-tools.-isoprofiles git repo 93 | if [[ -e $PROFILES ]]; then 94 | git -C $PROFILES pull 2>$ERR 95 | check_for_error "pull profiles repo" $? 96 | else 97 | git clone -b manjaro-architect --depth 1 https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git $PROFILES 2>$ERR 98 | check_for_error "clone profiles repo" $? 99 | fi 100 | 101 | install_manjaro_de_wm 102 | fi 103 | } 104 | 105 | install_vanilla_de_wm() { 106 | local PARENT="$FUNCNAME" 107 | declare -i loopmenu=1 108 | while ((loopmenu)); do 109 | ssubmenu 7 110 | DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SSUB} \ 111 | --menu "\n$_InstGrMenuBody\n " 0 0 6 \ 112 | "1" "$_InstGrMenuDS" \ 113 | "2" "$_InstGrDE" \ 114 | "3" "$_InstGrMenuDM" \ 115 | "4" "$_InstNMMenuTitle|>" \ 116 | "5" "$_InstMultMenuTitle|>" \ 117 | "6" "$_Back" 2>${ANSWER} 118 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 119 | 120 | case $(cat ${ANSWER}) in 121 | "1") install_xorg_input 122 | ;; 123 | "2") install_de_wm 124 | ;; 125 | "3") install_dm 126 | ;; 127 | "4") install_network_menu 128 | ;; 129 | "5") install_multimedia_menu 130 | ;; 131 | *) loopmenu=0 132 | return 0 133 | ;; 134 | esac 135 | done 136 | } 137 | 138 | # Install xorg and input drivers. Also copy the xkbmap configuration file created earlier to the installed system 139 | install_xorg_input() { 140 | echo "" > ${PACKAGES} 141 | 142 | DIALOG " $_InstGrMenuDS " --checklist "\n$_InstGrMenuDSBody\n\n$_UseSpaceBar\n " 0 0 11 \ 143 | "wayland" "-" off \ 144 | "xorg-server" "-" on \ 145 | "xorg-server-common" "-" off \ 146 | "xorg-xinit" "-" on \ 147 | "xorg-server-xwayland" "-" off \ 148 | "xf86-input-evdev" "-" off \ 149 | "xf86-input-keyboard" "-" on \ 150 | "xf86-input-libinput" "-" on \ 151 | "xf86-input-mouse" "-" on \ 152 | "xf86-input-synaptics" "-" off 2>${PACKAGES} 153 | 154 | clear 155 | # If at least one package, install. 156 | if [[ $(cat ${PACKAGES}) != "" ]]; then 157 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 158 | check_for_error "$FUNCNAME" $? 159 | fi 160 | 161 | # now copy across .xinitrc for all user accounts 162 | user_list=$(ls ${MOUNTPOINT}/home/ | sed "s/lost+found//") 163 | for i in ${user_list}; do 164 | [[ -e ${MOUNTPOINT}/home/$i/.xinitrc ]] || cp -f ${MOUNTPOINT}/etc/X11/xinit/xinitrc ${MOUNTPOINT}/home/$i/.xinitrc 165 | arch_chroot "chown -R ${i}:${i} /home/${i}" 166 | done 167 | 168 | HIGHLIGHT_SUB=1 169 | } 170 | 171 | install_de_wm() { 172 | # Only show this information box once 173 | if [[ $SHOW_ONCE -eq 0 ]]; then 174 | DIALOG " $_InstDETitle " --msgbox "\n$_DEInfoBody\n " 0 0 175 | SHOW_ONCE=1 176 | fi 177 | 178 | # DE/WM Menu 179 | DIALOG " $_InstDETitle " --checklist "\n$_InstDEBody\n\n$_UseSpaceBar\n " 0 0 13 \ 180 | "awesome + vicious" "-" off \ 181 | "budgie-desktop" "-" off \ 182 | "cinnamon" "-" off \ 183 | "deepin" "-" off \ 184 | "deepin-extra" "-" off \ 185 | "enlightenment + terminology" "-" off \ 186 | "fluxbox + fbnews" "-" off \ 187 | "gnome" "-" off \ 188 | "gnome-extra" "-" off \ 189 | "gnome-shell" "-" off \ 190 | "i3-wm + i3lock + i3status" "-" off \ 191 | "icewm + icewm-themes" "-" off \ 192 | "jwm" "-" off \ 193 | "kde-applications" "-" off \ 194 | "lxde" "-" off \ 195 | "lxqt + oxygen-icons" "-" off \ 196 | "mate" "-" off \ 197 | "mate-extra" "-" off \ 198 | "mate-extra-gtk3" "-" off \ 199 | "mate-gtk3" "-" off \ 200 | "openbox + openbox-themes" "-" off \ 201 | "pekwm + pekwm-themes" "-" off \ 202 | "plasma" "-" off \ 203 | "plasma-desktop" "-" off \ 204 | "windowmaker" "-" off \ 205 | "xfce4" "-" off \ 206 | "xfce4-goodies" "-" off 2>${PACKAGES} 207 | 208 | # If something has been selected, install 209 | if [[ $(cat ${PACKAGES}) != "" ]]; then 210 | clear 211 | sed -i 's/+\|\"//g' ${PACKAGES} 212 | if $hostcache; then 213 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 214 | else 215 | basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 216 | fi 217 | check_for_error "${FUNCNAME}: ${PACKAGES}" "$?" 218 | 219 | # Clear the packages file for installation of "common" packages 220 | echo "" > ${PACKAGES} 221 | 222 | # Offer to install various "common" packages. 223 | DIALOG " $_InstComTitle " --checklist "\n$_InstComBody\n\n$_UseSpaceBar\n " 0 50 14 \ 224 | "bash-completion" "-" on \ 225 | "gamin" "-" on \ 226 | "gksu" "-" on \ 227 | "gnome-icon-theme" "-" on \ 228 | "gnome-keyring" "-" on \ 229 | "gvfs" "-" on \ 230 | "gvfs-afc" "-" on \ 231 | "gvfs-smb" "-" on \ 232 | "polkit" "-" on \ 233 | "poppler" "-" on \ 234 | "python2-xdg" "-" on \ 235 | "ntfs-3g" "-" on \ 236 | "ttf-dejavu" "-" on \ 237 | "xdg-user-dirs" "-" on \ 238 | "xdg-utils" "-" on \ 239 | "xterm" "-" on 2>${PACKAGES} 240 | 241 | # If at least one package, install. 242 | if [[ $(cat ${PACKAGES}) != "" ]]; then 243 | clear 244 | 245 | if $hostcache; then 246 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 247 | else 248 | basestrap -c ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 249 | fi 250 | check_for_error "basestrap ${MOUNTPOINT} $(cat ${PACKAGES})" "$?" 251 | fi 252 | fi 253 | } 254 | 255 | # Display Manager 256 | install_dm() { 257 | if [[ $DM_ENABLED -eq 0 ]]; then 258 | # Prep variables 259 | echo "" > ${PACKAGES} 260 | dm_list="gdm lxdm lightdm sddm" 261 | DM_LIST="" 262 | DM_INST="" 263 | 264 | # Generate list of DMs installed with DEs, and a list for selection menu 265 | for i in ${dm_list}; do 266 | [[ -e ${MOUNTPOINT}/usr/bin/${i} ]] && DM_INST="${DM_INST} ${i}" && check_for_error "${i} already installed." 267 | DM_LIST="${DM_LIST} ${i} -" 268 | done 269 | 270 | DIALOG " $_DmChTitle " --menu "\n$_AlreadyInst$DM_INST\n\n$_DmChBody\n " 0 0 4 \ 271 | ${DM_LIST} 2>${PACKAGES} 272 | clear 273 | # If a selection has been made, act 274 | if [[ $(cat ${PACKAGES}) != "" ]]; then 275 | # check if selected dm already installed. If so, enable and break loop. 276 | for i in ${DM_INST}; do 277 | if [[ $(cat ${PACKAGES}) == ${i} ]]; then 278 | enable_dm 279 | break; 280 | fi 281 | done 282 | 283 | # If no match found, install and enable DM 284 | if [[ $DM_ENABLED -eq 0 ]]; then 285 | # Where lightdm selected, add gtk greeter package 286 | sed -i 's/lightdm/lightdm lightdm-gtk-greeter/' ${PACKAGES} 287 | if [[ -e /mnt/.openrc ]]; then 288 | echo "$(cat ${PACKAGES}) displaymanager-openrc" >${PACKAGES} 289 | fi 290 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 291 | check_for_error "install ${PACKAGES}" $? 292 | 293 | # Where lightdm selected, now remove the greeter package 294 | sed -i 's/lightdm-gtk-greeter//' ${PACKAGES} 295 | enable_dm 296 | fi 297 | fi 298 | fi 299 | 300 | # Show after successfully installing or where attempting to repeat when already completed. 301 | [[ $DM_ENABLED -eq 1 ]] && DIALOG " $_DmChTitle " --msgbox "\n$_DmDoneBody\n " 0 0 302 | } 303 | 304 | enable_dm() { 305 | if [[ -e /mnt/.openrc ]]; then 306 | sed -i "s/$(grep "DISPLAYMANAGER=" /mnt/etc/conf.d/xdm)/DISPLAYMANAGER=\"$(cat ${PACKAGES})\"/g" /mnt/etc/conf.d/xdm 307 | arch_chroot "rc-update add xdm default" 2>$ERR 308 | check_for_error "add default xdm" "$?" 309 | DM=$(cat ${PACKAGES}) 310 | DM_ENABLED=1 311 | else 312 | # enable display manager for systemd 313 | arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR 314 | check_for_error "enable $(cat ${PACKAGES})" "$?" 315 | DM=$(cat ${PACKAGES}) 316 | DM_ENABLED=1 317 | fi 318 | } 319 | 320 | install_network_menu() { 321 | declare -i loopmenu=1 322 | while ((loopmenu)); do 323 | local PARENT="$FUNCNAME" 324 | 325 | submenu 5 326 | DIALOG " $_InstNMMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstNMMenuBody\n " 0 0 5 \ 327 | "1" "$_SeeWirelessDev" \ 328 | "2" "$_InstNMMenuPkg" \ 329 | "3" "$_InstNMMenuNM" \ 330 | "4" "$_InstNMMenuCups" \ 331 | "5" "$_Back" 2>${ANSWER} 332 | 333 | case $(cat ${ANSWER}) in 334 | "1") # Identify the Wireless Device 335 | lspci -k | grep -i -A 2 "network controller" > /tmp/.wireless 336 | if [[ $(cat /tmp/.wireless) != "" ]]; then 337 | DIALOG " $_WirelessShowTitle " --textbox /tmp/.wireless 0 0 338 | else 339 | DIALOG " $_WirelessShowTitle " --msgbox "\n$_WirelessErrBody\n " 7 30 340 | fi 341 | ;; 342 | "2") install_wireless_packages 343 | ;; 344 | "3") install_nm 345 | ;; 346 | "4") install_cups 347 | ;; 348 | *) loopmenu=0 349 | return 0 350 | ;; 351 | esac 352 | done 353 | } 354 | 355 | # ntp not exactly wireless, but this menu is the best fit. 356 | install_wireless_packages() { 357 | WIRELESS_PACKAGES="" 358 | wireless_pkgs="dialog iw rp-pppoe wireless_tools wpa_actiond" 359 | 360 | for i in ${wireless_pkgs}; do 361 | WIRELESS_PACKAGES="${WIRELESS_PACKAGES} ${i} - on" 362 | done 363 | 364 | # If no wireless, uncheck wireless pkgs 365 | [[ $(lspci | grep -i "Network Controller") == "" ]] && WIRELESS_PACKAGES=$(echo $WIRELESS_PACKAGES | sed "s/ on/ off/g") 366 | 367 | DIALOG " $_InstNMMenuPkg " --checklist "\n$_InstNMMenuPkgBody\n\n$_UseSpaceBar\n " 0 0 13 \ 368 | $WIRELESS_PACKAGES \ 369 | "ufw" "-" off \ 370 | "gufw" "-" off \ 371 | "ntp" "-" off \ 372 | "b43-fwcutter" "Broadcom 802.11b/g/n" off \ 373 | "bluez-firmware" "Broadcom BCM203x / STLC2300 Bluetooth" off \ 374 | "ipw2100-fw" "Intel PRO/Wireless 2100" off \ 375 | "ipw2200-fw" "Intel PRO/Wireless 2200" off \ 376 | "zd1211-firmware" "ZyDAS ZD1211(b) 802.11a/b/g USB WLAN" off 2>${PACKAGES} 377 | 378 | if [[ $(cat ${PACKAGES}) != "" ]]; then 379 | clear 380 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 381 | check_for_error "$FUNCNAME" $? 382 | fi 383 | } 384 | 385 | # Network Manager 386 | install_nm() { 387 | if [[ $NM_ENABLED -eq 0 ]]; then 388 | # Prep variables 389 | echo "" > ${PACKAGES} 390 | nm_list="connman CLI dhcpcd CLI netctl CLI NetworkManager GUI wicd GUI" 391 | NM_LIST="" 392 | NM_INST="" 393 | 394 | # Generate list of DMs installed with DEs, and a list for selection menu 395 | for i in ${nm_list}; do 396 | [[ -e ${MOUNTPOINT}/usr/bin/${i} ]] && NM_INST="${NM_INST} ${i}" && check_for_error "${i} already installed." 397 | NM_LIST="${NM_LIST} ${i}" 398 | done 399 | 400 | # Remove netctl from selectable list as it is a PITA to configure via arch_chroot 401 | NM_LIST=$(echo $NM_LIST | sed "s/netctl CLI//") 402 | 403 | DIALOG " $_InstNMTitle " --menu "\n$_AlreadyInst $NM_INST\n$_InstNMBody\n " 0 0 4 \ 404 | ${NM_LIST} 2> ${PACKAGES} 405 | clear 406 | 407 | # If a selection has been made, act 408 | if [[ $(cat ${PACKAGES}) != "" ]]; then 409 | # check if selected nm already installed. If so, enable and break loop. 410 | for i in ${NM_INST}; do 411 | [[ $(cat ${PACKAGES}) == ${i} ]] && enable_nm && break 412 | done 413 | 414 | # If no match found, install and enable NM 415 | if [[ $NM_ENABLED -eq 0 ]]; then 416 | # Where networkmanager selected, add network-manager-applet 417 | sed -i 's/NetworkManager/networkmanager network-manager-applet/g' ${PACKAGES} 418 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 419 | check_for_error "$FUNCNAME" "$?" 420 | 421 | # Where networkmanager selected, now remove network-manager-applet 422 | sed -i 's/networkmanager network-manager-applet/NetworkManager/g' ${PACKAGES} 423 | enable_nm 424 | fi 425 | fi 426 | fi 427 | 428 | # Show after successfully installing or where attempting to repeat when already completed. 429 | [[ $NM_ENABLED -eq 1 ]] && DIALOG " $_InstNMTitle " --msgbox "\n$_InstNMErrBody\n " 0 0 430 | } 431 | 432 | enable_nm() { 433 | # Add openrc support. If openrcbase was installed, the file /mnt/.openrc should exist. 434 | if [[ $(cat ${PACKAGES}) == "NetworkManager" ]]; then 435 | if [[ -e /mnt/.openrc ]]; then 436 | arch_chroot "rc-update add NetworkManager default" 2>$ERR 437 | check_for_error "add default NetworkManager." $? 438 | else 439 | arch_chroot "systemctl enable NetworkManager NetworkManager-dispatcher" >/tmp/.symlink 2>$ERR 440 | check_for_error "enable NetworkManager." $? 441 | fi 442 | else 443 | if [[ -e /mnt/.openrc ]]; then 444 | arch_chroot "rc-update add $(cat ${PACKAGES}) default" 2>$ERR 445 | check_for_error "add default $(cat ${PACKAGES})." $? 446 | else 447 | arch_chroot "systemctl enable $(cat ${PACKAGES})" 2>$ERR 448 | check_for_error "enable $(cat ${PACKAGES})." $? 449 | fi 450 | fi 451 | NM_ENABLED=1 452 | } 453 | 454 | install_cups() { 455 | DIALOG " $_InstNMMenuCups " --checklist "\n$_InstCupsBody\n\n$_UseSpaceBar\n " 0 0 5 \ 456 | "cups" "-" on \ 457 | "cups-pdf" "-" off \ 458 | "ghostscript" "-" on \ 459 | "gsfonts" "-" on \ 460 | "samba" "-" off 2>${PACKAGES} 461 | 462 | if [[ $(cat ${PACKAGES}) != "" ]]; then 463 | clear 464 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 465 | check_for_error "$FUNCNAME" $? 466 | 467 | if [[ $(cat ${PACKAGES} | grep "cups") != "" ]]; then 468 | DIALOG " $_InstNMMenuCups " --yesno "\n$_InstCupsQ\n " 0 0 469 | if [[ $? -eq 0 ]]; then 470 | # Add openrc support. If openrcbase was installed, the file /mnt/.openrc should exist. 471 | if [[ -e /mnt/.openrc ]]; then 472 | arch_chroot "rc-update add cupsd default" 2>$ERR 473 | else 474 | arch_chroot "systemctl enable org.cups.cupsd.service" 2>$ERR 475 | fi 476 | check_for_error "enable cups" $? 477 | DIALOG " $_InstNMMenuCups " --infobox "\n$_Done!\n " 0 0 478 | sleep 2 479 | fi 480 | fi 481 | fi 482 | } 483 | 484 | install_multimedia_menu() { 485 | declare -i loopmenu=1 486 | while ((loopmenu)); do 487 | local PARENT="$FUNCNAME" 488 | 489 | submenu 4 490 | DIALOG " $_InstMultMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstMultMenuBody\n " 0 0 4 \ 491 | "1" "$_InstMulSnd" \ 492 | "2" "$_InstMulCodec" \ 493 | "3" "$_InstMulAcc" \ 494 | "4" "$_Back" 2>${ANSWER} 495 | 496 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 497 | case $(cat ${ANSWER}) in 498 | "1") install_alsa_pulse 499 | ;; 500 | "2") install_codecs 501 | ;; 502 | "3") install_acc_menu 503 | ;; 504 | *) loopmenu=0 505 | ;; 506 | esac 507 | done 508 | } 509 | 510 | install_alsa_pulse() { 511 | # Prep Variables 512 | echo "" > ${PACKAGES} 513 | ALSA="" 514 | PULSE_EXTRA="" 515 | alsa=$(pacman -Ss alsa | awk '{print $1}' | grep "/alsa-" | sed "s/extra\///g" | sort -u) 516 | pulse_extra=$(pacman -Ss pulseaudio- | awk '{print $1}' | sed "s/extra\///g" | grep "pulseaudio-" | sort -u) 517 | 518 | for i in ${alsa}; do 519 | ALSA="${ALSA} ${i} - off" 520 | done 521 | 522 | ALSA=$(echo $ALSA | sed "s/alsa-utils - off/alsa-utils - on/g" | sed "s/alsa-plugins - off/alsa-plugins - on/g") 523 | 524 | for i in ${pulse_extra}; do 525 | PULSE_EXTRA="${PULSE_EXTRA} ${i} - off" 526 | done 527 | 528 | DIALOG " $_InstMulSnd " --checklist "\n$_InstMulSndBody\n\n$_UseSpaceBar\n " 0 0 6 \ 529 | $ALSA "pulseaudio" "-" off $PULSE_EXTRA \ 530 | "paprefs" "pulseaudio GUI" off \ 531 | "pavucontrol" "pulseaudio GUI" off \ 532 | "ponymix" "pulseaudio CLI" off \ 533 | "volumeicon" "ALSA GUI" off \ 534 | "volwheel" "ASLA GUI" off 2>${PACKAGES} 535 | 536 | clear 537 | # If at least one package, install. 538 | if [[ $(cat ${PACKAGES}) != "" ]]; then 539 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 540 | check_for_error "$FUNCNAME" "$?" 541 | fi 542 | } 543 | 544 | install_codecs() { 545 | # Prep Variables 546 | echo "" > ${PACKAGES} 547 | GSTREAMER="" 548 | gstreamer=$(pacman -Ss gstreamer | awk '{print $1}' | grep "/gstreamer" | sed "s/extra\///g" | sed "s/community\///g" | sort -u) 549 | echo $gstreamer 550 | for i in ${gstreamer}; do 551 | GSTREAMER="${GSTREAMER} ${i} - off" 552 | done 553 | 554 | DIALOG " $_InstMulCodec " --checklist "\n$_InstMulCodBody\n\n$_UseSpaceBar\n " 0 0 14 \ 555 | $GSTREAMER "xine-lib" "-" off 2>${PACKAGES} 556 | 557 | clear 558 | # If at least one package, install. 559 | if [[ $(cat ${PACKAGES}) != "" ]]; then 560 | basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>$ERR 561 | check_for_error "$FUNCNAME" "$?" 562 | fi 563 | } 564 | 565 | # Install Accessibility Applications 566 | install_acc_menu() { 567 | echo "" > ${PACKAGES} 568 | 569 | DIALOG " $_InstMulAcc " --checklist "\n$_InstMulAccBody\n " 0 0 15 \ 570 | "accerciser" "-" off \ 571 | "at-spi2-atk" "-" off \ 572 | "at-spi2-core" "-" off \ 573 | "brltty" "-" off \ 574 | "caribou" "-" off \ 575 | "dasher" "-" off \ 576 | "espeak" "-" off \ 577 | "espeakup" "-" off \ 578 | "festival" "-" off \ 579 | "java-access-bridge" "-" off \ 580 | "java-atk-wrapper" "-" off \ 581 | "julius" "-" off \ 582 | "orca" "-" off \ 583 | "qt-at-spi" "-" off \ 584 | "speech-dispatcher" "-" off 2>${PACKAGES} 585 | 586 | clear 587 | # If something has been selected, install 588 | if [[ $(cat ${PACKAGES}) != "" ]]; then 589 | basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR 590 | check_for_error "$FUNCNAME" $? || return $? 591 | fi 592 | } 593 | 594 | security_menu() { 595 | declare -i loopmenu=1 596 | while ((loopmenu)); do 597 | local PARENT="$FUNCNAME" 598 | ssubmenu 4 599 | DIALOG " $_SecMenuTitle " --default-item ${HIGHLIGHT_SSUB} --menu "\n$_SecMenuBody\n " 0 0 4 \ 600 | "1" "$_SecJournTitle" \ 601 | "2" "$_SecCoreTitle" \ 602 | "3" "$_SecKernTitle " \ 603 | "4" "$_Back" 2>${ANSWER} 604 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 605 | 606 | case $(cat ${ANSWER}) in 607 | # systemd-journald 608 | "1") DIALOG " $_SecJournTitle " --menu "\n$_SecJournBody\n " 0 0 7 \ 609 | "$_Edit" "/etc/systemd/journald.conf" \ 610 | "10M" "SystemMaxUse=10M" \ 611 | "20M" "SystemMaxUse=20M" \ 612 | "50M" "SystemMaxUse=50M" \ 613 | "100M" "SystemMaxUse=100M" \ 614 | "200M" "SystemMaxUse=200M" \ 615 | "$_Disable" "Storage=none" 2>${ANSWER} 616 | 617 | if [[ $(cat ${ANSWER}) != "" ]]; then 618 | if [[ $(cat ${ANSWER}) == "$_Disable" ]]; then 619 | sed -i "s/#Storage.*\|Storage.*/Storage=none/g" ${MOUNTPOINT}/etc/systemd/journald.conf 620 | sed -i "s/SystemMaxUse.*/#&/g" ${MOUNTPOINT}/etc/systemd/journald.conf 621 | DIALOG " $_SecJournTitle " --infobox "\n$_Done!\n " 0 0 622 | sleep 2 623 | elif [[ $(cat ${ANSWER}) == "$_Edit" ]]; then 624 | nano ${MOUNTPOINT}/etc/systemd/journald.conf 625 | else 626 | sed -i "s/#SystemMaxUse.*\|SystemMaxUse.*/SystemMaxUse=$(cat ${ANSWER})/g" ${MOUNTPOINT}/etc/systemd/journald.conf 627 | sed -i "s/Storage.*/#&/g" ${MOUNTPOINT}/etc/systemd/journald.conf 628 | DIALOG " $_SecJournTitle " --infobox "\n$_Done!\n " 0 0 629 | sleep 2 630 | fi 631 | fi 632 | ;; 633 | # core dump 634 | "2") DIALOG " $_SecCoreTitle " --menu "\n$_SecCoreBody\n " 0 0 2 \ 635 | "$_Disable" "Storage=none" \ 636 | "$_Edit" "/etc/systemd/coredump.conf" 2>${ANSWER} 637 | 638 | if [[ $(cat ${ANSWER}) == "$_Disable" ]]; then 639 | sed -i "s/#Storage.*\|Storage.*/Storage=none/g" ${MOUNTPOINT}/etc/systemd/coredump.conf 640 | DIALOG " $_SecCoreTitle " --infobox "\n$_Done!\n " 0 0 641 | sleep 2 642 | elif [[ $(cat ${ANSWER}) == "$_Edit" ]]; then 643 | nano ${MOUNTPOINT}/etc/systemd/coredump.conf 644 | fi 645 | ;; 646 | # Kernel log access 647 | "3") DIALOG " $_SecKernTitle " --menu "\n$_SecKernBody\n " 0 0 2 \ 648 | "$_Disable" "kernel.dmesg_restrict = 1" \ 649 | "$_Edit" "/etc/systemd/coredump.conf.d/custom.conf" 2>${ANSWER} 650 | 651 | case $(cat ${ANSWER}) in 652 | "$_Disable") echo "kernel.dmesg_restrict = 1" > ${MOUNTPOINT}/etc/sysctl.d/50-dmesg-restrict.conf 653 | DIALOG " $_SecKernTitle " --infobox "\n$_Done!\n " 0 0 654 | sleep 2 ;; 655 | "$_Edit") [[ -e ${MOUNTPOINT}/etc/sysctl.d/50-dmesg-restrict.conf ]] && nano ${MOUNTPOINT}/etc/sysctl.d/50-dmesg-restrict.conf || \ 656 | DIALOG " $_SeeConfErrTitle " --msgbox "\n$_SeeConfErrBody1\n " 0 0 ;; 657 | esac 658 | ;; 659 | *) loopmenu=0 660 | return 0 661 | ;; 662 | esac 663 | done 664 | } 665 | 666 | enable_console_logging() { 667 | echo "ForwardToConsole=yes 668 | TTYPath=/dev/tty12" >> /mnt/etc/systemd/jounald.conf 669 | sed -i '/MaxLevelConsole/ s/#//' /mnt/etc/systemd/journald.conf 670 | } 671 | 672 | enable_hibernation() { 673 | if DIALOG " Hibernation setup " --yesno "\nAre you sure you want to enable hibernation automatically? \n " 0 0; then 674 | if ! [[ -e /mnt/etc/fstab ]]; then 675 | generate_fstab 676 | fi 677 | basestrap ${MOUNTPOINT} "hibernator" 678 | arch_chroot "hibernator" 2>$ERR 679 | check_for_error "Running hibernator" $? 680 | [[ $? == 0 ]] && DIALOG " Hibernation setup " --infobox "\nHibernator was successfully run \n " 0 0 681 | else 682 | return 0 683 | fi 684 | } 685 | 686 | enable_autologin() { 687 | dm=$(file /mnt/etc/systemd/system/display-manager.service 2>/dev/null | awk -F'/' '{print $NF}' | cut -d. -f1) 688 | [[ -z $dm ]] && dm=xlogin 689 | if DIALOG " Autologin setup " --yesno "\nThis option enables autologin using $dm.\n\nProceed? \n " 0 0; then 690 | #detect displaymanager 691 | if [[ $(echo /mnt/home/* | xargs -n1 | wc -l) == 1 ]]; then 692 | autologin_user=$(echo /mnt/home/* | cut -d/ -f4) 693 | else 694 | autologin_user=$(echo /mnt/home/* | cut -d/ -f4 | fzf --reverse --prompt="user> " --header="Choose the user to automatically log in") 695 | fi 696 | #enable autologin 697 | case "$(echo $dm)" in 698 | gdm) sed -i "s/^AutomaticLogin=*/AutomaticLogin=$autologin_user/g" /mnt/etc/gdm/custom.conf 699 | sed -i 's/^AutomaticLoginEnable=*/AutomaticLoginEnable=true/g' /mnt/etc/gdm/custom.conf 700 | sed -i 's/^TimedLoginEnable=*/TimedLoginEnable=true/g' /mnt/etc/gdm/custom.conf 701 | sed -i 's/^TimedLogin=*/TimedLoginEnable=$autologin_user/g' /mnt/etc/gdm/custom.conf 702 | sed -i 's/^TimedLoginDelay=*/TimedLoginDelay=0/g' /mnt/etc/gdm/custom.conf 703 | ;; 704 | lightdm) sed -i "s/^#autologin-user=/autologin-user=$autologin_user/" /mnt/etc/lightdm/lightdm.conf 705 | sed -i 's/^#autologin-user-timeout=0/autologin-user-timeout=0/' /mnt/etc/lightdm/lightdm.conf 706 | arch_chroot "groupadd -r autologin" 707 | arch_chroot "gpasswd -a $autologin_user autologin" 708 | ;; 709 | sddm) xsession=$(echo /mnt/usr/share/xsessions/* | xargs -n1 | head -n1 | rev | cut -d'/' -f 1 | rev) 710 | [[ -e /mnt/etc/sddm.conf ]] || arch_chroot "sddm --example-config > /etc/sddm.conf" 711 | sed -i "s/^User=/User=$autologin_user/g" /mnt/etc/sddm.conf 712 | sed -i "s~^Session=~Session=$xsession~g" /mnt/etc/sddm.conf 713 | ;; 714 | lxdm) sed -i "s/^# autologin=dgod/autologin=$autologin_user/g" /mnt/etc/lxdm/lxdm.conf 715 | ;; 716 | *) basestrap ${MOUNTPOINT} "xlogin" 717 | arch_chroot "systemctl enable xlogin@${autologin_user}" 718 | ;; 719 | esac 720 | fi 721 | } 722 | 723 | set_schedulers() { 724 | [[ -e /mnt/etc/udev/rules.d/60-ioscheduler.rules ]] || \ 725 | echo '# set scheduler for non-rotating disks 726 | # noop and deadline are recommended for non-rotating disks 727 | # for rotational disks, cfq gives better performance and bfq-sq more responsive desktop environment 728 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" 729 | # set scheduler for rotating disks 730 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq-sq"' > /mnt/etc/udev/rules.d/60-ioscheduler.rules 731 | nano /mnt/etc/udev/rules.d/60-ioscheduler.rules 732 | } 733 | 734 | set_swappiness() { 735 | [[ -e /mnt/etc/sysctl.d/99-sysctl.conf ]] || \ 736 | echo 'vm.swappiness = 10 737 | vm.vfs_cache_pressure = 50 738 | #vm.dirty_ratio = 3' > /mnt/etc/sysctl.d/99-sysctl.conf 739 | nano /mnt/etc/sysctl.d/99-sysctl.conf 740 | } 741 | 742 | preloader() { 743 | if DIALOG " Preload setup " --yesno "\n Enabling preload loads often used applications to ram in advance in order to start them up more quickly. \n\nProceed? \n " 0 0; then 744 | basestrap ${MOUNTPOINT} "preload" 745 | arch_chroot "systemctl enable preload" 746 | fi 747 | 748 | } 749 | -------------------------------------------------------------------------------- /lib/util-config.sh: -------------------------------------------------------------------------------- 1 | edit_mkinitcpio(){ 2 | nano "${MOUNTPOINT}/etc/mkinitcpio.conf" 3 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n${_RunMkinit}?\n " 0 0 && { arch_chroot "mkinitcpio -P" 2>$ERR; check_for_error "run mkinitcpio" $?; } 4 | } 5 | 6 | edit_grub(){ 7 | nano "${MOUNTPOINT}/etc/default/grub" 8 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n${_RunUpGrub}?\n " 0 0 && grub_mkconfig 9 | } 10 | 11 | edit_configs() { 12 | 13 | shopt -s nullglob 14 | 15 | local PARENT="$FUNCNAME" 16 | # Clear the file variables 17 | local options=() functions=("-") i=0 f='' choice=0 fn='' 18 | 19 | for f in ${MOUNTPOINT}/home/*/.extend.xinitrc; do 20 | ((i++)) 21 | options+=( $i ".extend.xinitrc ($(echo "$f"|cut -d'/' -f4 ))" ) 22 | functions+=( "nano ${f}" ) 23 | done 24 | for f in ${MOUNTPOINT}/home/*/.xinitrc; do 25 | ((i++)) 26 | options+=( $i ".xinitrc ($(echo "$f"|cut -d'/' -f4 ))" ) 27 | functions+=( "nano ${f}" ) 28 | done 29 | for f in ${MOUNTPOINT}/home/*/.extend.Xresources; do 30 | ((i++)) 31 | options+=( $i ".extend.Xresources ($(echo "$f"|cut -d'/' -f4 ))" ) 32 | functions+=( "nano ${f}" ) 33 | done 34 | for f in ${MOUNTPOINT}/home/*/.Xresources; do 35 | ((i++)) 36 | options+=( $i ".Xresources ($(echo "$f"|cut -d'/' -f4 ))" ) 37 | functions+=( "nano ${f}" ) 38 | done 39 | if [[ -e ${MOUNTPOINT}/etc/crypttab ]]; then 40 | ((i++)) 41 | options+=( $i "crypttab" ) 42 | functions+=( "nano ${MOUNTPOINT}/etc/crypttab" ) 43 | fi 44 | if [[ -e ${MOUNTPOINT}/etc/fstab ]]; then 45 | ((i++)) 46 | options+=( $i "fstab" ) 47 | functions+=( "nano ${MOUNTPOINT}/etc/fstab" ) 48 | fi 49 | if [[ -e ${MOUNTPOINT}/etc/default/grub ]]; then 50 | ((i++)) 51 | options+=( $i "grub" ) 52 | functions+=( "edit_grub" ) 53 | fi 54 | if [[ -e ${MOUNTPOINT}/boot/refind_linux.conf ]]; then 55 | ((i++)) 56 | options+=( $i "refind_linux.conf" ) 57 | functions+=( "nano ${MOUNTPOINT}/boot/refind_linux.conf" ) 58 | fi 59 | if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind_linux.conf ]]; then 60 | ((i++)) 61 | options+=( $i "refind.conf" ) 62 | functions+=( "nano ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind.conf" ) 63 | fi 64 | if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/loader/loader.conf ]]; then 65 | ((i++)) 66 | options+=( $i "systemd-boot" ) 67 | functions+=( "nano ${MOUNTPOINT}${UEFI_MOUNT}/loader/entries/*" ) 68 | fi 69 | if [[ -e ${MOUNTPOINT}/etc/hostname ]]; then 70 | ((i++)) 71 | options+=( $i "hostname" ) 72 | functions+=( "nano ${MOUNTPOINT}/etc/hostname" ) 73 | fi 74 | if [[ -e ${MOUNTPOINT}/etc/hosts ]]; then 75 | ((i++)) 76 | options+=( $i "hosts" ) 77 | functions+=( "nano ${MOUNTPOINT}/etc/hosts" ) 78 | fi 79 | if [[ -e ${MOUNTPOINT}/etc/systemd/journald.conf ]]; then 80 | ((i++)) 81 | options+=( $i "journald" ) 82 | functions+=( "nano ${MOUNTPOINT}/etc/systemd/journald.conf" ) 83 | fi 84 | if [[ -e ${MOUNTPOINT}/etc/conf.d/keymaps ]]; then 85 | ((i++)) 86 | options+=( $i "keymaps" ) 87 | functions+=( "nano ${MOUNTPOINT}/etc/conf.d/keymaps" ) 88 | fi 89 | if [[ -e ${MOUNTPOINT}/etc/locale.conf ]]; then 90 | ((i++)) 91 | f=$(grep -o "=.*$" ${MOUNTPOINT}/etc/locale.conf -m 1) 92 | options+=( $i "locales (${f:1})" ) 93 | functions+=( "nano ${MOUNTPOINT}/etc/locale.conf" ) 94 | fi 95 | if [[ -e ${MOUNTPOINT}/etc/lightdm/lightdm.conf ]]; then 96 | ((i++)) 97 | options+=( $i "lightdm" ) 98 | functions+=( "nano ${MOUNTPOINT}/etc/lightdm/lightdm.conf" ) 99 | fi 100 | if [[ -e ${MOUNTPOINT}/etc/lxdm/lxdm.conf ]]; then 101 | ((i++)) 102 | options+=( $i "lxdm" ) 103 | functions+=( "nano ${MOUNTPOINT}/etc/lxdm/lxdm.conf" ) 104 | fi 105 | if [[ -e ${MOUNTPOINT}/etc/mkinitcpio.conf ]]; then 106 | ((i++)) 107 | options+=( $i "mkinitcpio" ) 108 | functions+=( "edit_mkinitcpio" ) 109 | fi 110 | if [[ -e ${MOUNTPOINT}/etc/rc.conf ]]; then 111 | ((i++)) 112 | options+=( $i "openrc" ) 113 | functions+=( "nano ${MOUNTPOINT}/etc/rc.conf" ) 114 | fi 115 | if [[ -e ${MOUNTPOINT}/etc/pacman.conf ]]; then 116 | ((i++)) 117 | options+=( $i "pacman" ) 118 | functions+=( "nano ${MOUNTPOINT}/etc/pacman.conf" ) 119 | fi 120 | if [[ -e ${MOUNTPOINT}/etc/sddm.conf ]]; then 121 | ((i++)) 122 | options+=( $i "sddm" ) 123 | functions+=( "nano ${MOUNTPOINT}/etc/sddm.conf" ) 124 | fi 125 | if [[ -e ${MOUNTPOINT}/etc/sudoers.conf ]]; then 126 | ((i++)) 127 | options+=( $i "sudoers" ) 128 | functions+=( "nano ${MOUNTPOINT}/etc/sudoers.conf" ) 129 | fi 130 | if [[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]]; then 131 | ((i++)) 132 | options+=( $i "syslinux" ) 133 | functions+=( "nano ${MOUNTPOINT}/boot/syslinux/syslinux.cfg" ) 134 | fi 135 | if [[ -e ${MOUNTPOINT}/etc/vconsole.conf ]]; then 136 | ((i++)) 137 | options+=( $i "vconsole" ) 138 | functions+=( "nano ${MOUNTPOINT}/etc/vconsole.conf" ) 139 | fi 140 | ((i++)) 141 | 142 | shopt -u nullglob 143 | 144 | while ((1)); do 145 | ssubmenu 13 146 | DIALOG " $_SeeConfOptTitle " --default-item ${HIGHLIGHT_SSUB} --menu "\n$_SeeConfOptBody\n " 0 0 $i \ 147 | "${options[@]}" 2>${ANSWER} 148 | HIGHLIGHT_SSUB=$(<${ANSWER}) 149 | choice="${HIGHLIGHT_SSUB:-0}" 150 | 151 | case "$choice" in 152 | 0) break ;; # btn cancel 153 | *) 154 | fn="${functions[$choice]}" # find attach working function in array 155 | [ -n "$fn" ] && $fn 156 | esac 157 | done 158 | } 159 | -------------------------------------------------------------------------------- /lib/util-desktop.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | setup_graphics_card() { 14 | DIALOG " $_GCDetBody " --radiolist "\n$_UseSpaceBar\n " 0 0 12 \ 15 | $(mhwd -l | awk '/ video-/{print $1}' | awk '$0=$0" - off"' | sort | uniq) 2>/tmp/.driver || return 0 16 | 17 | if [[ $(cat /tmp/.driver) != "" ]]; then 18 | clear 19 | arch_chroot "mhwd -f -i pci $(cat /tmp/.driver)" 2>$ERR 20 | check_for_error "install $(cat /tmp/.driver)" $? 21 | touch /mnt/.video_installed 22 | 23 | GRAPHIC_CARD=$(lspci | grep -i "vga" | sed 's/.*://' | sed 's/(.*//' | sed 's/^[ \t]*//') 24 | 25 | # All non-NVIDIA cards / virtualisation 26 | if [[ $(echo $GRAPHIC_CARD | grep -i 'intel\|lenovo') != "" ]]; then 27 | install_intel 28 | elif [[ $(echo $GRAPHIC_CARD | grep -i 'ati') != "" ]]; then 29 | install_ati 30 | elif [[ $(cat /tmp/.driver) == "video-nouveau" ]]; then 31 | sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf 32 | fi 33 | else 34 | DIALOG " $_ErrTitle " --msgbox "\n$_WarnInstGr\n " 0 0 35 | check_for_error "No video-driver selected." 36 | fi 37 | } 38 | 39 | setup_network_drivers() { 40 | DIALOG " $_InstNWDrv " --menu "\n " 0 0 3 \ 41 | "1" "$_InstFree" \ 42 | "2" "$_InstProp" \ 43 | "3" "$_SelNWDrv" 2>${ANSWER} || return 0 44 | 45 | case $(cat ${ANSWER}) in 46 | "1") clear 47 | arch_chroot "mhwd -a pci free 0200" 2>$ERR 48 | check_for_error "$FUNCNAME free" $? 49 | ;; 50 | "2") clear 51 | arch_chroot "mhwd -a pci nonfree 0200" 2>$ERR 52 | check_for_error "$FUNCNAME nonfree" $? 53 | ;; 54 | "3") if [[ $(mhwd -l | awk '/ network-/' | wc -l) -eq 0 ]]; then 55 | DIALOG " $_InstNWDrv " --msgbox "\n$_InfoNWKernel\n " 0 0 56 | else 57 | DIALOG " $_InstGrDrv " --checklist "\n$_UseSpaceBar\n " 0 0 12 \ 58 | $(mhwd -l | awk '/ network-/{print $1}' |awk '$0=$0" - off"') 2> /tmp/.network_driver || return 0 59 | 60 | if [[ $(cat /tmp/.driver) != "" ]]; then 61 | clear 62 | arch_chroot "mhwd -f -i pci $(cat /tmp/.network_driver)" 2>$ERR 63 | check_for_error "install $(cat /tmp/.network_driver)" $? || return 1 64 | else 65 | DIALOG " $_ErrTitle " --msgbox "\nNo network driver selected\n " 0 0 66 | check_for_error "No network-driver selected." 67 | fi 68 | fi 69 | ;; 70 | esac 71 | } 72 | 73 | install_network_drivers() { 74 | if [[ $(mhwd -l | awk '/network-/' | wc -l) -gt 0 ]]; then 75 | for driver in $(mhwd -l | awk '/^network-/{print $1}'); do 76 | arch_chroot "mhwd -f -i pci ${driver}" 2>$ERR 77 | check_for_error "install ${driver}" $? 78 | done 79 | else 80 | echo "No special network drivers installed because no need detected." 81 | fi 82 | } 83 | 84 | install_intel() { 85 | sed -i 's/MODULES=""/MODULES="i915"/' ${MOUNTPOINT}/etc/mkinitcpio.conf 86 | 87 | # Intel microcode (Grub, Syslinux and systemd-boot). 88 | # Done as seperate if statements in case of multiple bootloaders. 89 | if [[ -e ${MOUNTPOINT}/boot/grub/grub.cfg ]]; then 90 | DIALOG " grub-mkconfig " --infobox "\n$_PlsWaitBody\n " 0 0 91 | sleep 1 92 | grub_mkconfig 93 | fi 94 | # Syslinux 95 | [[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]] && sed -i "s/INITRD /&..\/intel-ucode.img,/g" ${MOUNTPOINT}/boot/syslinux/syslinux.cfg 96 | 97 | # Systemd-boot 98 | if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/loader/loader.conf ]]; then 99 | update=$(ls ${MOUNTPOINT}${UEFI_MOUNT}/loader/entries/*.conf) 100 | for i in ${upgate}; do 101 | sed -i '/linux \//a initrd \/intel-ucode.img' ${i} 102 | done 103 | fi 104 | } 105 | 106 | install_all_drivers() { 107 | 108 | cat $PROFILES/shared/Packages-Mhwd > /tmp/.all_drivers 109 | 110 | # Remove any packages tagged with >openrc and remove >systemd tags 111 | sed -i '/>openrc/d' /tmp/.all_drivers 112 | sed -i 's/>systemd //g' /tmp/.all_drivers 113 | sed -i '/>multilib/d' /tmp/.all_drivers 114 | sed -i '/>nonfree_multilib/d' /tmp/.all_drivers 115 | sed -i '/>nonfree_default/d' /tmp/.all_drivers 116 | sed -i '/virtualbox/d' /tmp/.all_drivers 117 | grep "KERNEL-" /tmp/.all_drivers > /tmp/.kernel_dependent 118 | for kernel in $(cat /tmp/.chosen_kernels); do 119 | cat /tmp/.kernel_dependent | sed "s/KERNEL/\n$kernel/g" >> /tmp/.all_drivers 120 | echo "" >> /tmp/.all_drivers 121 | done 122 | sed -i '/KERNEL-/d' /tmp/.all_drivers 123 | if $hostcache; then 124 | basestrap ${MOUNTPOINT} $(cat /tmp/.all_drivers) 125 | else 126 | basestrap -c ${MOUNTPOINT} $(cat /tmp/.all_drivers) 127 | fi 128 | } 129 | install_ati() { 130 | sed -i 's/MODULES=""/MODULES="radeon"/' ${MOUNTPOINT}/etc/mkinitcpio.conf 131 | } 132 | 133 | # Set keymap for X11 134 | set_xkbmap() { 135 | XKBMAP_LIST="" 136 | keymaps_xkb=("af al am at az ba bd be bg br bt bw by ca cd ch cm cn cz de dk ee es et eu fi fo fr\ 137 | gb ge gh gn gr hr hu ie il in iq ir is it jp ke kg kh kr kz la lk lt lv ma md me mk ml mm mn mt mv\ 138 | ng nl no np pc ph pk pl pt ro rs ru se si sk sn sy tg th tj tm tr tw tz ua us uz vn za") 139 | 140 | for i in ${keymaps_xkb}; do 141 | XKBMAP_LIST="${XKBMAP_LIST} ${i} -" 142 | done 143 | 144 | DIALOG " $_PrepKBLayout " --menu "\n$_XkbmapBody\n " 0 0 16 ${XKBMAP_LIST} 2>${ANSWER} || return 0 145 | XKBMAP=$(cat ${ANSWER} |sed 's/_.*//') 146 | echo -e "Section "\"InputClass"\"\nIdentifier "\"system-keyboard"\"\nMatchIsKeyboard "\"on"\"\nOption "\"XkbLayout"\" "\"${XKBMAP}"\"\nEndSection" \ 147 | > ${MOUNTPOINT}/etc/X11/xorg.conf.d/00-keyboard.conf 2>$ERR 148 | check_for_error "$FUNCNAME ${XKBMAP}" "$?" 149 | } 150 | 151 | install_manjaro_de_wm_pkg() { 152 | if check_desktop; then 153 | PROFILES="/usr/share/manjaro-tools/iso-profiles" 154 | # Only show this information box once 155 | if [[ $SHOW_ONCE -eq 0 ]]; then 156 | DIALOG " $_InstDETitle " --msgbox "\n$_InstPBody\n " 0 0 157 | SHOW_ONCE=1 158 | fi 159 | clear 160 | pacman -Sy --noconfirm $p manjaro-iso-profiles-{base,official,community} 2>$ERR 161 | check_for_error "update profiles pkgs" $? 162 | 163 | install_manjaro_de_wm 164 | fi 165 | } 166 | 167 | install_manjaro_de_wm() { 168 | # Clear packages after installing base 169 | echo "" > /tmp/.desktop 170 | 171 | # DE/WM Menu 172 | DIALOG " $_InstDETitle " --radiolist "\n$_InstManDEBody\n$(evaluate_profiles)\n\n$_UseSpaceBar\n " 0 0 12 \ 173 | $(echo $PROFILES/{manjaro,community}/* | xargs -n1 | cut -f7 -d'/' | grep -vE "netinstall|architect" | awk '$0=$0" - off"') 2> /tmp/.desktop 174 | 175 | # If something has been selected, install 176 | if [[ $(cat /tmp/.desktop) != "" ]]; then 177 | check_for_error "selected: [Manjaro-$(cat /tmp/.desktop)]" 178 | clear 179 | # Source the iso-profile 180 | profile=$(echo $PROFILES/*/$(cat /tmp/.desktop)/profile.conf) 181 | . $profile 182 | overlay=$(echo $PROFILES/*/$(cat /tmp/.desktop)/desktop-overlay/) 183 | echo $displaymanager > /tmp/.display-manager 184 | 185 | # Parse package list based on user input and remove parts that don't belong to pacman 186 | pkgs_src=$(echo $PROFILES/*/$(cat /tmp/.desktop)/Packages-Desktop) 187 | pkgs_target=/mnt/.desktop 188 | echo "" > $pkgs_target 189 | filter_packages 190 | # remove already installed base pkgs and 191 | # basestrap the parsed package list to the new root 192 | check_for_error "packages to install: $(grep -vf /mnt/.base /mnt/.desktop | sort | tr '\n' ' ')" 193 | clear 194 | set -o pipefail 195 | if $hostcache; then 196 | basestrap ${MOUNTPOINT} $(cat /mnt/.desktop) 2>$ERR |& tee /tmp/basestrap.log 197 | else 198 | basestrap -c ${MOUNTPOINT} $(cat /mnt/.desktop) 2>$ERR |& tee /tmp/basestrap.log 199 | fi 200 | local err=$? 201 | set +o pipefail 202 | check_for_error "install desktop-pkgs" $err || return $err 203 | 204 | # copy the profile overlay to the new root 205 | echo "Copying overlay files to the new root" 206 | cp -r "$overlay"* ${MOUNTPOINT} 2>$ERR 207 | check_for_error "copy overlay" "$?" 208 | 209 | # Copy settings to root account 210 | cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR 211 | check_for_error "copy root config" "$?" 212 | 213 | # copy settings to already created users 214 | if [[ -e "$(echo /mnt/home/*)" ]]; then 215 | for home in $(echo $MOUNTPOINT/home/*); do 216 | cp -ar $MOUNTPOINT/etc/skel/. $home/ 217 | user=$(echo $home | cut -d/ -f4) 218 | arch_chroot "chown -R ${user}:${user} /home/${user}" 219 | done 220 | fi 221 | # Enable services in the chosen profile 222 | enable_services 223 | install_graphics_menu 224 | touch /mnt/.desktop_installed 225 | # Stop for a moment so user can see if there were errors 226 | echo "" 227 | echo "" 228 | echo "" 229 | echo "press Enter to continue" 230 | read 231 | # Clear the packages file for installation of "common" packages 232 | echo "" > ${PACKAGES} 233 | 234 | # Offer to install various "common" packages. 235 | #install_extra 236 | fi 237 | } 238 | install_desktop() { 239 | if [[ -e /mnt/.base_installed ]]; then 240 | DIALOG " $_InstBseTitle " --yesno "\n$_WarnInstBase\n " 0 0 && rm /mnt/.base_installed || return 0 241 | fi 242 | # Prep variables 243 | touch /tmp/.git_profiles 244 | setup_profiles 245 | pkgs_src=$PROFILES/shared/Packages-Root 246 | pkgs_target=/mnt/.base 247 | BTRF_CHECK=$(echo "btrfs-progs" "" off) 248 | F2FS_CHECK=$(echo "f2fs-tools" "" off) 249 | mhwd-kernel -l | awk '/linux/ {print $2}' > /tmp/.available_kernels 250 | kernels=$(cat /tmp/.available_kernels) 251 | 252 | # Create the base list of packages 253 | echo "" > /mnt/.base 254 | 255 | declare -i loopmenu=1 256 | while ((loopmenu)); do 257 | # Choose kernel and possibly base-devel 258 | DIALOG " $_InstBseTitle " --checklist "\n$_InstStandBseBody$_UseSpaceBar\n " 0 0 13 \ 259 | "yaourt + base-devel" "-" off \ 260 | $(cat /tmp/.available_kernels | awk '$0=$0" - off"') 2>${PACKAGES} || { loopmenu=0; return 0; } 261 | if [[ ! $(grep "linux" ${PACKAGES}) ]]; then 262 | # Check if a kernel is already installed 263 | ls ${MOUNTPOINT}/boot/*.img >/dev/null 2>&1 264 | if [[ $? == 0 ]]; then 265 | DIALOG " Check Kernel " --msgbox "\nlinux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2 | grep -v ucode.img | sort -u) detected \n " 0 0 266 | check_for_error "linux-$(ls ${MOUNTPOINT}/boot/*.img | cut -d'-' -f2) already installed" 267 | loopmenu=0 268 | else 269 | DIALOG " $_ErrTitle " --msgbox "\n$_ErrNoKernel\n " 0 0 270 | fi 271 | else 272 | cat ${PACKAGES} | sed 's/+ \|\"//g' | tr ' ' '\n' | tr '+' '\n' >> /mnt/.base 273 | echo " " >> /mnt/.base 274 | grep -f /tmp/.available_kernels /mnt/.base > /tmp/.chosen_kernels 275 | check_for_error "selected: $(cat ${PACKAGES})" 276 | loopmenu=0 277 | fi 278 | done 279 | 280 | # Choose wanted kernel modules 281 | DIALOG " $_ChsAddPkgs " --checklist "\n$_UseSpaceBar\n " 0 0 12 \ 282 | "KERNEL-headers" "-" off \ 283 | "KERNEL-acpi_call" "-" off \ 284 | "KERNEL-ndiswrapper" "-" off \ 285 | "KERNEL-broadcom-wl" "-" off \ 286 | "KERNEL-r8168" "-" off \ 287 | "KERNEL-rt3562sta" "-" off \ 288 | "KERNEL-tp_smapi" "-" off \ 289 | "KERNEL-vhba-module" "-" off \ 290 | "KERNEL-virtualbox-guest-modules" "-" off \ 291 | "KERNEL-virtualbox-host-modules" "-" off \ 292 | "KERNEL-spl" "-" off \ 293 | "KERNEL-zfs" "-" off 2>/tmp/.modules || return 0 294 | 295 | if [[ $(cat /tmp/.modules) != "" ]]; then 296 | check_for_error "modules: $(cat /tmp/.modules)" 297 | for kernel in $(cat ${PACKAGES} | grep -vE '(yaourt|base-devel)'); do 298 | cat /tmp/.modules | sed "s/KERNEL/\n$kernel/g" >> /mnt/.base 299 | done 300 | echo " " >> /mnt/.base 301 | fi 302 | 303 | choose_mjr_desk 304 | 305 | filter_packages 306 | # remove grub 307 | sed -i '/grub/d' /mnt/.base 308 | echo "nilfs-utils" >> /mnt/.base 309 | check_for_error "packages to install: $(cat /mnt/.base | sort | tr '\n' ' ')" 310 | clear 311 | set -o pipefail 312 | if $hostcache; then 313 | basestrap ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR |& tee /tmp/basestrap.log 314 | else 315 | basestrap -c ${MOUNTPOINT} $(cat /mnt/.base) 2>$ERR |& tee /tmp/basestrap.log 316 | fi 317 | 318 | local err=$? 319 | set +o pipefail 320 | check_for_error "install basepkgs" $err || { 321 | DIALOG " $_InstBseTitle " --msgbox "\n$_InstFail\n " 0 0; HIGHLIGHT_SUB=2; 322 | if [[ $err == 255 ]]; then 323 | cat /tmp/basestrap.log 324 | read -n1 -s # or ? exit $err 325 | fi 326 | return 1; 327 | } 328 | 329 | # copy keymap and consolefont settings to target 330 | echo -e "KEYMAP=$(ini linux.keymap)\nFONT=$(ini linux.font)" > ${MOUNTPOINT}/etc/vconsole.conf 331 | check_for_error "configure vconsole" 332 | 333 | # If root is on btrfs volume, amend mkinitcpio.conf 334 | if [[ -e /tmp/.btrfsroot ]]; then 335 | BTRFS_ROOT=1 336 | sed -e '/^HOOKS=/s/\ fsck//g' -e '/^MODULES=/s/"$/ btrfs"/g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf 337 | check_for_error "root on btrfs volume. Amend mkinitcpio." 338 | # Adjust tlp settings to avoid filesystem corruption 339 | if [[ -e /mnt/etc/default/tlp ]]; then 340 | sed -i 's/SATA_LINKPWR_ON_BAT.*/SATA_LINKPWR_ON_BAT=max_performance/' /mnt/etc/default/tlp 341 | fi 342 | fi 343 | 344 | # If root is on nilfs2 volume, amend mkinitcpio.conf 345 | [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == nilfs2 ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf && \ 346 | check_for_error "root on nilfs2 volume. Amend mkinitcpio." 347 | 348 | recheck_luks 349 | 350 | # add luks and lvm hooks as needed 351 | ([[ $LVM -eq 1 ]] && [[ $LUKS -eq 0 ]]) && { sed -i 's/block filesystems/block lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add lvm2 hook" $?; } 352 | ([[ $LVM -eq 0 ]] && [[ $LUKS -eq 1 ]]) && { sed -i 's/block filesystems keyboard/block consolefont keymap keyboard encrypt filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add luks hook" $?; } 353 | [[ $((LVM + LUKS)) -eq 2 ]] && { sed -i 's/block filesystems keyboard/block consolefont keymap keyboard encrypt lvm2 filesystems/g' ${MOUNTPOINT}/etc/mkinitcpio.conf 2>$ERR; check_for_error "add lvm/luks hooks" $?; } 354 | 355 | [[ $((LVM + LUKS + BTRFS_ROOT)) -gt 0 ]] && { arch_chroot "mkinitcpio -P" 2>$ERR; check_for_error "re-run mkinitcpio" $?; } 356 | 357 | # If specified, copy over the pacman.conf file to the installation 358 | if [[ $COPY_PACCONF -eq 1 ]]; then 359 | cp -f /etc/pacman.conf ${MOUNTPOINT}/etc/pacman.conf 360 | check_for_error "copy pacman.conf" 361 | fi 362 | 363 | # if branch was chosen, use that also in installed system. If not, use the system setting 364 | [[ -z $(ini branch) ]] && ini branch $(ini system.branch) 365 | sed -i "s/Branch =.*/Branch = $(ini branch)/;s/# //" ${MOUNTPOINT}/etc/pacman-mirrors.conf 366 | 367 | touch /mnt/.base_installed 368 | check_for_error "base installed succesfully." 369 | 370 | 371 | ## Setup desktop 372 | if [[ $(cat /tmp/.desktop) != "" ]]; then 373 | # copy the profile overlay to the new root 374 | echo "Copying overlay files to the new root" 375 | cp -r "$overlay"* ${MOUNTPOINT} 2>$ERR 376 | check_for_error "copy overlay" "$?" 377 | 378 | # Copy settings to root account 379 | cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR 380 | check_for_error "copy root config" "$?" 381 | 382 | # copy settings to already created users 383 | if [[ -e "$(echo /mnt/home/*)" ]]; then 384 | for home in $(echo $MOUNTPOINT/home/*); do 385 | cp -ar $MOUNTPOINT/etc/skel/. $home/ 386 | user=$(echo $home | cut -d/ -f4) 387 | arch_chroot "chown -R ${user}:${user} /home/${user}" 388 | done 389 | fi 390 | # Enable services in the chosen profile 391 | enable_services 392 | install_graphics_menu 393 | touch /mnt/.desktop_installed 394 | # Stop for a moment so user can see if there were errors 395 | echo "" 396 | echo "" 397 | echo "" 398 | echo "press Enter to continue" 399 | read 400 | else 401 | install_network_drivers 402 | fi 403 | } 404 | 405 | choose_mjr_desk() { 406 | # Clear packages after installing base 407 | echo "" > /tmp/.desktop 408 | 409 | # DE/WM Menu 410 | DIALOG " $_InstDETitle " --radiolist "\n$_InstManDEBody\n\n$_UseSpaceBar\n " 0 0 12 \ 411 | $(echo $PROFILES/{manjaro,community}/* | xargs -n1 | cut -f7 -d'/' | grep -vE "netinstall|architect" | awk '$0=$0" - off"') 2> /tmp/.desktop 412 | 413 | # If something has been selected, install 414 | if [[ $(cat /tmp/.desktop) != "" ]]; then 415 | check_for_error "selected: [Manjaro-$(cat /tmp/.desktop)]" 416 | clear 417 | # Source the iso-profile 418 | profile=$(echo $PROFILES/*/$(cat /tmp/.desktop)/profile.conf) 419 | . $profile 420 | overlay=$(echo $PROFILES/*/$(cat /tmp/.desktop)/desktop-overlay/) 421 | echo $displaymanager > /tmp/.display-manager 422 | 423 | cat $(echo $PROFILES/*/$(cat /tmp/.desktop)/Packages-Desktop) > /mnt/.desktop 424 | echo "" >> /mnt/.desktop 425 | DIALOG " $_ExtraPkgTitle " --yesno "\n$_ExtraPkgBody \n " 0 0 && \ 426 | echo "$(pacman -Ssq) $(pacman -Sg)" | fzf -m -e --header="$_AddPkgs" --prompt="$_AddPkgsPrmpt > " --reverse >> /mnt/.desktop 427 | 428 | fi 429 | } 430 | 431 | set_lightdm_greeter() { 432 | local greeters=$(ls /mnt/usr/share/xgreeters/*greeter.desktop) name 433 | for g in ${greeters[@]}; do 434 | name=${g##*/} 435 | name=${name%%.*} 436 | case ${name} in 437 | lightdm-gtk-greeter) 438 | break 439 | ;; 440 | lightdm-*-greeter) 441 | sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /mnt/etc/lightdm/lightdm.conf 442 | ;; 443 | esac 444 | done 445 | } 446 | 447 | set_sddm_ck() { 448 | local halt='/usr/bin/shutdown -h -P now' \ 449 | reboot='/usr/bin/shutdown -r now' 450 | sed -e "s|^.*HaltCommand=.*|HaltCommand=${halt}|" \ 451 | -e "s|^.*RebootCommand=.*|RebootCommand=${reboot}|" \ 452 | -e "s|^.*MinimumVT=.*|MinimumVT=7|" \ 453 | -i "/mnt/etc/sddm.conf" 454 | arch_chroot "gpasswd -a sddm video" 2>$ERR 455 | check_for_error "$FUNCNAME" $? 456 | } 457 | -------------------------------------------------------------------------------- /lib/util-menu.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | import /usr/lib/manjaro-architect/util-desktop.sh 14 | 15 | main_menu() { 16 | declare -i loopmenu=1 17 | while ((loopmenu)); do 18 | if [[ $HIGHLIGHT != 6 ]]; then 19 | HIGHLIGHT=$(( HIGHLIGHT + 1 )) 20 | fi 21 | 22 | DIALOG " $_MMTitle " --default-item ${HIGHLIGHT} \ 23 | --menu "\n$_MMNewBody\n " 0 0 6 \ 24 | "1" "$_PrepMenuTitle|>" \ 25 | "2" "$_InstDsMenuTitle|>" \ 26 | "3" "$_InstCrMenuTitle|>" \ 27 | "4" "$_InstCsMenuTitle|>" \ 28 | "5" "$_SysRescTitle|>" \ 29 | "6" "$_Done" 2>${ANSWER} 30 | HIGHLIGHT=$(cat ${ANSWER}) 31 | 32 | case $(cat ${ANSWER}) in 33 | "1") prep_menu 34 | ;; 35 | "2") check_mount && install_desktop_system_menu 36 | ;; 37 | "3") check_mount && install_core_menu 38 | ;; 39 | "4") check_mount && install_custom_menu 40 | ;; 41 | "5") system_rescue_menu 42 | ;; 43 | *) loopmenu=0 44 | exit_done 45 | ;; 46 | esac 47 | done 48 | } 49 | 50 | 51 | install_core_menu() { 52 | local PARENT="$FUNCNAME" 53 | declare -i loopmenu=1 54 | while ((loopmenu)); do 55 | submenu 8 56 | DIALOG " $_InstCrMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_MMBody\n$_InstCrMenuBody\n " 0 0 8 \ 57 | "1" "$_InstBse" \ 58 | "2" "$_InstBootldr|>" \ 59 | "3" "$_ConfBseMenuTitle|>" \ 60 | "4" "$_InstMulCust" \ 61 | "5" "$_TweaksMenuTitle|>" \ 62 | "6" "$_SeeConfOptTitle|>" \ 63 | "7" "$_ChrootTitle" \ 64 | "8" "$_Back" 2>${ANSWER} 65 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 66 | 67 | case $(cat ${ANSWER}) in 68 | "1") check_mount && install_base && setup_network_drivers 69 | ;; 70 | "2") check_base && install_bootloader 71 | ;; 72 | "3") check_base && config_cli_base_menu 73 | ;; 74 | "4") install_cust_pkgs 75 | ;; 76 | "5") check_base && tweaks_menu 77 | ;; 78 | "6") check_base && { 79 | type edit_configs &>/dev/null || import ${LIBDIR}/util-config.sh 80 | edit_configs 81 | } 82 | ;; 83 | "7") check_base && chroot_interactive 84 | ;; 85 | *) loopmenu=0 86 | return 0 87 | ;; 88 | esac 89 | done 90 | } 91 | 92 | install_desktop_system_menu() { 93 | local PARENT="$FUNCNAME" 94 | declare -i loopmenu=1 95 | while ((loopmenu)); do 96 | submenu 7 97 | DIALOG " $_InstDsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_MMBody\n$_InstDsMenuBody\n " 0 0 7 \ 98 | "1" "$_InstDEStable|>" \ 99 | "2" "$_InstBootldr|>" \ 100 | "3" "$_ConfBseMenuTitle|>" \ 101 | "4" "$_TweaksMenuTitle|>" \ 102 | "5" "$_SeeConfOptTitle|>" \ 103 | "6" "$_ChrootTitle" \ 104 | "7" "$_Back" 2>${ANSWER} 105 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 106 | 107 | case $(cat ${ANSWER}) in 108 | "1") check_mount && install_desktop 109 | ;; 110 | "2") check_base && install_bootloader 111 | ;; 112 | "3") check_base && config_base_menu 113 | ;; 114 | "4") check_base && tweaks_menu 115 | ;; 116 | "5") check_base && { 117 | type edit_configs &>/dev/null || import ${LIBDIR}/util-config.sh 118 | edit_configs 119 | } 120 | ;; 121 | "6") check_base && chroot_interactive 122 | ;; 123 | *) loopmenu=0 124 | return 0 125 | ;; 126 | esac 127 | done 128 | } 129 | 130 | install_custom_menu() { 131 | local PARENT="$FUNCNAME" 132 | declare -i loopmenu=1 133 | while ((loopmenu)); do 134 | submenu 9 135 | DIALOG " $_InstCsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstCsMenuBody\n " 0 0 9 \ 136 | "1" "$_InstBse" \ 137 | "2" "$_InstDE|>" \ 138 | "3" "$_InstBootldr|>" \ 139 | "4" "$_ConfBseMenuTitle|>" \ 140 | "5" "$_InstMulCust" \ 141 | "6" "$_TweaksMenuTitle|>" \ 142 | "7" "$_SeeConfOptTitle" \ 143 | "8" "$_ChrootTitle" \ 144 | "9" "$_Back" 2>${ANSWER} 145 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 146 | 147 | case $(cat ${ANSWER}) in 148 | "1") check_mount && install_base && install_drivers_menu 149 | ;; 150 | "2") check_base && install_vanilla_de_wm 151 | ;; 152 | "3") check_base && install_bootloader 153 | ;; 154 | "4") check_base && config_base_menu 155 | ;; 156 | "5") install_cust_pkgs 157 | ;; 158 | "6") check_base && tweaks_menu 159 | ;; 160 | "7") check_base && { 161 | type edit_configs &>/dev/null || import ${LIBDIR}/util-config.sh 162 | edit_configs 163 | } 164 | ;; 165 | "8") check_base && chroot_interactive 166 | ;; 167 | *) loopmenu=0 168 | return 0 169 | ;; 170 | esac 171 | done 172 | } 173 | 174 | system_rescue_menu() { 175 | local PARENT="$FUNCNAME" 176 | declare -i loopmenu=1 177 | while ((loopmenu)); do 178 | submenu 8 179 | DIALOG " $_SysRescTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_SysRescBody\n " 0 0 10 \ 180 | "1" "$_InstDrvTitle|>" \ 181 | "2" "$_InstBootldr|>" \ 182 | "3" "$_ConfBseMenuTitle" \ 183 | "4" "$_InstMulCust" \ 184 | "5" "$_RmPkgs" \ 185 | "6" "$_SeeConfOptTitle|>" \ 186 | "7" "$_ChrootTitle" \ 187 | "8" "$_DataRecMenu|>" \ 188 | "9" "$_LogMenu|>" \ 189 | "10" "$_Back" 2>${ANSWER} 190 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 191 | 192 | case $(cat ${ANSWER}) in 193 | "1") check_mount && check_base && install_drivers_menu 194 | ;; 195 | "2") check_mount && check_base && install_bootloader 196 | ;; 197 | "3") check_mount && check_base && config_base_menu 198 | ;; 199 | "4") check_mount && install_cust_pkgs 200 | ;; 201 | "5") check_mount && check_base && rm_pgs 202 | ;; 203 | "6") check_mount && check_base && { 204 | type edit_configs &>/dev/null || import ${LIBDIR}/util-config.sh 205 | edit_configs 206 | } 207 | ;; 208 | "7") check_mount && check_base && chroot_interactive 209 | ;; 210 | "8") recovery_menu 211 | ;; 212 | "9") check_mount && check_base && logs_menu 213 | ;; 214 | *) loopmenu=0 215 | return 0 216 | ;; 217 | esac 218 | done 219 | } 220 | 221 | # Preparation 222 | prep_menu() { 223 | local PARENT="$FUNCNAME" 224 | declare -i loopmenu=1 225 | while ((loopmenu)); do 226 | submenu 9 227 | DIALOG " $_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_PrepMenuBody\n " 0 0 10 \ 228 | "1" "$_VCKeymapTitle" \ 229 | "2" "$_DevShowOpt" \ 230 | "3" "$_PrepPartDisk" \ 231 | "4" "$_PrepLUKS" \ 232 | "5" "$_PrepLVM $_PrepLVM2" \ 233 | "6" "$_PrepMntPart" \ 234 | "7" "$_PrepMirror|>" \ 235 | "8" "$_PrepPacKey" \ 236 | "9" "$_HostCache" \ 237 | "10" "$_Back" 2>${ANSWER} 238 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 239 | 240 | case $(cat ${ANSWER}) in 241 | "1") select_keymap 242 | set_keymap 243 | ;; 244 | "2") show_devices 245 | ;; 246 | "3") umount_partitions 247 | select_device && create_partitions 248 | ;; 249 | "4") luks_menu 250 | ;; 251 | "5") lvm_menu 252 | ;; 253 | "6") mount_partitions 254 | ;; 255 | "7") configure_mirrorlist 256 | ;; 257 | "8") clear 258 | ( 259 | ctrlc(){ 260 | return 0 261 | } 262 | trap ctrlc SIGINT 263 | trap ctrlc SIGTERM 264 | pacman-key --init;pacman-key --populate archlinux manjaro;pacman-key --refresh-keys; 265 | check_for_error 'refresh pacman-keys' 266 | ) 267 | ;; 268 | "9") set_cache 269 | ;; 270 | *) loopmenu=0 271 | return 0 272 | ;; 273 | esac 274 | done 275 | } 276 | 277 | # Base Installation 278 | install_base_menu() { 279 | local PARENT="$FUNCNAME" 280 | declare -i loopmenu=1 281 | while ((loopmenu)); do 282 | submenu 6 283 | DIALOG " $_InstBsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_InstBseMenuBody\n " 0 0 6 \ 284 | "1" "$_PrepMirror|>" \ 285 | "2" "$_PrepPacKey" \ 286 | "3" "$_InstBse" \ 287 | "4" "$_InstDEStable|>" \ 288 | "5" "$_InstBootldr" \ 289 | "6" "$_Back" 2>${ANSWER} 290 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 291 | 292 | case $(cat ${ANSWER}) in 293 | "1") configure_mirrorlist 294 | ;; 295 | "2") clear 296 | ( 297 | ctrlc(){ 298 | return 0 299 | } 300 | trap ctrlc SIGINT 301 | trap ctrlc SIGTERM 302 | pacman-key --init;pacman-key --populate archlinux manjaro;pacman-key --refresh-keys; 303 | check_for_error 'refresh pacman-keys' 304 | ) 305 | ;; 306 | "3") install_base 307 | ;; 308 | "4") check_base && install_manjaro_de_wm_pkg 309 | local err=$? 310 | if [[ $err > 0 ]]; then 311 | DIALOG " $_InstBseTitle " --msgbox "\n$_InstFail\n " 0 0; 312 | if [[ $err == 255 ]]; then 313 | cat /tmp/basestrap.log 314 | read -n1 -s 315 | fi 316 | fi 317 | ;; 318 | "5") install_bootloader 319 | ;; 320 | *) loopmenu=0 321 | return 0 322 | ;; 323 | esac 324 | done 325 | } 326 | 327 | # Base Configuration 328 | config_base_menu() { 329 | local PARENT="$FUNCNAME" 330 | declare -i loopmenu=1 331 | while ((loopmenu)); do 332 | ssubmenu 8 333 | DIALOG " $_ConfBseMenuTitle " --default-item ${HIGHLIGHT_SSUB} --menu "\n$_ConfBseBody\n " 0 0 8 \ 334 | "1" "$_ConfBseFstab" \ 335 | "2" "$_ConfBseHost" \ 336 | "3" "$_ConfBseSysLoc" \ 337 | "4" "$_PrepKBLayout" \ 338 | "5" "$_ConfBseTimeHC" \ 339 | "6" "$_ConfUsrRoot" \ 340 | "7" "$_ConfUsrNew" \ 341 | "8" "$_Back" 2>${ANSWER} 342 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 343 | 344 | case $(cat ${ANSWER}) in 345 | "1") generate_fstab 346 | ;; 347 | "2") set_hostname 348 | ;; 349 | "3") set_locale 350 | ;; 351 | "4") set_xkbmap 352 | ;; 353 | "5") set_timezone && set_hw_clock 354 | ;; 355 | "6") set_root_password 356 | ;; 357 | "7") create_new_user 358 | ;; 359 | *) loopmenu=0 360 | return 0 361 | ;; 362 | esac 363 | done 364 | } 365 | 366 | # Base Configuration 367 | config_cli_base_menu() { 368 | local PARENT="$FUNCNAME" 369 | declare -i loopmenu=1 370 | while ((loopmenu)); do 371 | ssubmenu 7 372 | DIALOG " $_ConfBseMenuTitle " --default-item ${HIGHLIGHT_SSUB} --menu "\n$_ConfBseBody\n " 0 0 7 \ 373 | "1" "$_ConfBseFstab" \ 374 | "2" "$_ConfBseHost" \ 375 | "3" "$_ConfBseSysLoc" \ 376 | "4" "$_ConfBseTimeHC" \ 377 | "5" "$_ConfUsrRoot" \ 378 | "6" "$_ConfUsrNew" \ 379 | "7" "$_Back" 2>${ANSWER} 380 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 381 | 382 | case $(cat ${ANSWER}) in 383 | "1") generate_fstab 384 | ;; 385 | "2") set_hostname 386 | ;; 387 | "3") set_locale 388 | ;; 389 | "4") set_timezone && set_hw_clock 390 | ;; 391 | "5") set_root_password 392 | ;; 393 | "6") create_new_user 394 | ;; 395 | *) loopmenu=0 396 | return 0 397 | ;; 398 | esac 399 | done 400 | } 401 | 402 | install_drivers_menu() { 403 | local PARENT="$FUNCNAME" 404 | declare -i loopmenu=1 405 | while ((loopmenu)); do 406 | ssubmenu 3 407 | DIALOG " $_InstDrvTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n " 0 0 3 \ 408 | "1" "$_InstGrMenuDD|>" \ 409 | "2" "$_InstNWDrv|>" \ 410 | "3" "$_Back" 2>${ANSWER} 411 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 412 | 413 | case $(cat ${ANSWER}) in 414 | "1") install_graphics_menu 415 | ;; 416 | "2") setup_network_drivers || DIALOG " $_InstBseTitle " --infobox "\n$_InstFail\n " 0 0 417 | ;; 418 | *) loopmenu=0 419 | return 0 420 | ;; 421 | esac 422 | done 423 | } 424 | 425 | install_graphics_menu() { 426 | DIALOG " $_InstGrMenuDD " --menu "\n " 0 0 4 \ 427 | "1" "$_InstFree" \ 428 | "2" "$_InstProp" \ 429 | "3" "$_SelDDrv" \ 430 | "4" "$_InstAllDrv" 2>${ANSWER} || return 0 431 | 432 | case $(cat ${ANSWER}) in 433 | "1") clear 434 | arch_chroot "mhwd -a pci free 0300" 2>$ERR 435 | check_for_error "$_InstFree" $? 436 | touch /mnt/.video_installed 437 | ;; 438 | "2") clear 439 | arch_chroot "mhwd -a pci nonfree 0300" 2>$ERR 440 | check_for_error "$_InstProp" $? 441 | touch /mnt/.video_installed 442 | ;; 443 | "3") setup_graphics_card 444 | ;; 445 | "4") install_all_drivers 446 | check_for_error "$_InstAllDrv" $? 447 | touch /mnt/.video_installed 448 | ;; 449 | esac 450 | } 451 | 452 | tweaks_menu() { 453 | local PARENT="$FUNCNAME" 454 | declare -i loopmenu=1 455 | while ((loopmenu)); do 456 | submenu 7 457 | DIALOG " $_TweaksMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "\n$_TweaksBody " 0 0 5 \ 458 | "1" "$_AutologEnable" \ 459 | "2" "$_HibrnEnable" \ 460 | "3" "$_PerfMenu|>" \ 461 | "4" "$_SecMenuTitle|>" \ 462 | "5" "$_Back" 2>${ANSWER} 463 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 464 | 465 | case $(cat ${ANSWER}) in 466 | "1") enable_autologin 467 | ;; 468 | "2") enable_hibernation 469 | ;; 470 | "3") performance_menu 471 | ;; 472 | "4") security_menu 473 | ;; 474 | *) loopmenu=0 475 | return 0 476 | ;; 477 | esac 478 | done 479 | } 480 | 481 | performance_menu() { 482 | local PARENT="$FUNCNAME" 483 | declare -i loopmenu=1 484 | while ((loopmenu)); do 485 | submenu 3 486 | DIALOG " $_PerfMenu " --default-item ${HIGHLIGHT_SUB} --menu "\n$_PerfBody\n " 0 0 4 \ 487 | "1" "$_SetSchd" \ 488 | "2" "$_SetSwap" \ 489 | "3" "Preload" \ 490 | "4" "$_Back" 2>${ANSWER} 491 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 492 | 493 | case $(cat ${ANSWER}) in 494 | "1") set_schedulers 495 | ;; 496 | "2") set_swappiness 497 | ;; 498 | "3") preloader 499 | ;; 500 | *) loopmenu=0 501 | return 0 502 | ;; 503 | esac 504 | done 505 | } 506 | 507 | recovery_menu() { 508 | local PARENT="$FUNCNAME" 509 | declare -i loopmenu=1 510 | while ((loopmenu)); do 511 | submenu 3 512 | DIALOG " $_DataRecMenu " --default-item ${HIGHLIGHT_SUB} --menu "\n$_DataRecBody\n " 0 0 3 \ 513 | "1" "Clonezilla" \ 514 | "2" "Photorec" \ 515 | "3" "$_Back" 2>${ANSWER} 516 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 517 | 518 | case $(cat ${ANSWER}) in 519 | "1") if which clonezilla &>/dev/null; then 520 | clonezilla 521 | else 522 | pacman -S clonezilla && clonezilla 523 | fi 524 | ;; 525 | "2") if which photorec &>/dev/null; then 526 | photorec 527 | else 528 | pacman -S photorec && photorec 529 | fi 530 | ;; 531 | *) loopmenu=0 532 | return 0 533 | ;; 534 | esac 535 | done 536 | } 537 | 538 | logs_menu() { 539 | local PARENT="$FUNCNAME" 540 | declare -i loopmenu=1 541 | while ((loopmenu)); do 542 | submenu 3 543 | DIALOG " $_LogMenu " --default-item ${HIGHLIGHT_SUB} --menu "\n$_LogBody\n " 0 0 5 \ 544 | "1" "Dmesg" \ 545 | "2" "Pacman log" \ 546 | "3" "Xorg log" \ 547 | "4" "Journalctl" \ 548 | "5" "$_Back" 2>${ANSWER} 549 | HIGHLIGHT_SUB=$(cat ${ANSWER}) 550 | 551 | case $(cat ${ANSWER}) in 552 | "1") arch_chroot "dmesg" | fzf --reverse --header="Exit by pressing esc" --prompt="Type to filter log entries > " 553 | ;; 554 | "2") fzf --reverse --header="Exit by pressing esc" --prompt="Type to filter log entries > " < /mnt/var/log/pacman.log 555 | ;; 556 | "3") fzf --reverse --header="Exit by pressing esc" --prompt="Type to filter log entries > " < /mnt/var/log/Xorg.0.log 557 | ;; 558 | "4") arch_chroot "journalctl" | fzf --reverse --header="Exit by pressing esc" --prompt="Type to filter log entries > " 559 | ;; 560 | *) loopmenu=0 561 | return 0 562 | ;; 563 | esac 564 | done 565 | } -------------------------------------------------------------------------------- /lib/util.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | # 3 | # Architect Installation Framework (2016-2017) 4 | # 5 | # Written by Carl Duff and @mandog for Archlinux 6 | # Heavily modified and re-written by @Chrysostomus to install Manjaro instead 7 | # Contributors: @papajoker, @oberon and the Manjaro-Community. 8 | # 9 | # This program is free software, provided under the GNU General Public License 10 | # as published by the Free Software Foundation. So feel free to copy, distribute, 11 | # or modify it as you wish. 12 | 13 | # Header 14 | VERSION="Manjaro Architect Installer v$version" 15 | 16 | # Host system information 17 | ARCHI=$(uname -m) # Display whether 32 or 64 bit system 18 | SYSTEM="Unknown" # Display whether system is BIOS or UEFI. Default is "unknown" 19 | H_INIT="" # Host init-sys 20 | NW_CMD="" # command to launch the available network client 21 | 22 | # Locale and Language 23 | CURR_LOCALE="en_US.UTF-8" # Default Locale 24 | FONT="" # Set new font if necessary 25 | KEYMAP="us" # Virtual console keymap. Default is "us" 26 | XKBMAP="us" # X11 keyboard layout. Default is "us" 27 | ZONE="" # For time 28 | SUBZONE="" # For time 29 | LOCALE="en_US.UTF-8" # System locale. Default is "en_US.UTF-8" 30 | PROFILES="" # iso-profiles path 31 | 32 | # Menu highlighting (automated step progression) 33 | HIGHLIGHT=0 # Highlight items for Main Menu 34 | HIGHLIGHT_SUB=0 # Highlight items for submenus 35 | SUB_MENU="" # Submenu to be highlighted 36 | PARENT="" # the parent menu 37 | 38 | # Temporary files to store menu selections and errors 39 | ANSWER="/tmp/.answer" # Basic menu selections 40 | PACKAGES="/tmp/.pkgs" # Packages to install 41 | MOUNT_OPTS="/tmp/.mnt_opts" # Filesystem Mount options 42 | INIT="/tmp/.init" # init systemd|openrc 43 | ERR="/tmp/.errlog" 44 | BRANCH="/tmp/.branch" 45 | 46 | # Installer-Log 47 | LOGFILE="/var/log/m-a.log" # path for the installer log in the live environment 48 | [[ ! -e $LOGFILE ]] && touch $LOGFILE 49 | TARGLOG="/mnt/.m-a.log" # path to copy the installer log to target install 50 | INIFILE="/tmp/manjaro-architect.ini" 51 | 52 | # file systems 53 | BTRFS=0 54 | LUKS=0 55 | LUKS_DEV="" 56 | LUKS_NAME="" 57 | LUKS_OPT="" # Default or user-defined? 58 | LUKS_UUID="" 59 | LVM=0 60 | LVM_LV_NAME="" # Name of LV to create or use 61 | LVM_VG="" 62 | LVM_VG_MB=0 63 | VG_PARTS="" 64 | LVM_SEP_BOOT=0 # 1 = Seperate /boot, 2 = seperate /boot & LVM 65 | LV_SIZE_INVALID=0 # Is LVM LV size entered valid? 66 | VG_SIZE_TYPE="" # Is VG in Gigabytes or Megabytes? 67 | 68 | # Mounting 69 | MOUNT="" # Installation: All other mounts branching 70 | MOUNTPOINT="/mnt" # Installation: Root mount from Root 71 | FS_OPTS="" # File system special mount options available 72 | CHK_NUM=16 # Used for FS mount options checklist length 73 | INCLUDE_PART='part\|lvm\|crypt' # Partition types to include for display and selection. 74 | ROOT_PART="" # ROOT partition 75 | UEFI_PART="" # UEFI partition 76 | UEFI_MOUNT="" # UEFI mountpoint (/boot or /boot/efi) 77 | 78 | # Edit Files 79 | FILE="" # File(s) to be reviewed 80 | 81 | # Installation 82 | DM_INST="" # Which DMs have been installed? 83 | DM_ENABLED=0 # Has a display manager been enabled? 84 | NM_INST="" # Which NMs have been installed? 85 | NM_ENABLED=0 # Has a network connection manager been enabled? 86 | GRAPHIC_CARD="" # graphics card 87 | INTEGRATED_GC="" # Integrated graphics card for NVIDIA 88 | NVIDIA_INST=0 # Indicates if NVIDIA proprietary driver has been installed 89 | NVIDIA="" # NVIDIA driver(s) to install depending on kernel(s) 90 | VB_MOD="" # headers packages to install depending on kernel(s) 91 | SHOW_ONCE=0 # Show de_wm information only once 92 | COPY_PACCONF=0 # Copy over installer /etc/pacman.conf to installed system? 93 | 94 | import(){ 95 | if [[ -r $1 ]];then 96 | source $1 97 | else 98 | echo "Could not import $1" 99 | fi 100 | } 101 | 102 | DIALOG() { 103 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --column-separator "|" --exit-label "$_Back" --title "$@" 104 | } 105 | 106 | # store datas in ini file 107 | # read: value=$(ini system.init) 108 | # set: ini system.init "openrc" 109 | ini() { 110 | local section="$1" value="$2" 111 | [[ ! -f "$INIFILE" ]] && echo "">"$INIFILE" 112 | if [[ ! "$section" =~ \. ]]; then 113 | section="manjaro-architect.${section}" 114 | fi 115 | ini_val "$INIFILE" "$section" "$value" 2>/dev/null 116 | } 117 | 118 | function finishini { 119 | [[ -f "$INIFILE" ]] && mv "$INIFILE" "/var/log/m-a.ini" &>/dev/null 120 | ((debug)) && cat "/var/log/m-a.ini" 121 | } 122 | trap finishini EXIT 123 | 124 | # progress through menu entries until number $1 is reached 125 | submenu() { 126 | if [[ $SUB_MENU != "$PARENT" ]]; then 127 | SUB_MENU="$PARENT" 128 | HIGHLIGHT_SUB=1 129 | elif [[ $HIGHLIGHT_SUB != "$1" ]]; then 130 | HIGHLIGHT_SUB=$(( HIGHLIGHT_SUB + 1 )) 131 | fi 132 | } 133 | 134 | ssubmenu() { 135 | if [[ $SSUB_MENU != "$PARENT" ]]; then 136 | SSUB_MENU="$PARENT" 137 | HIGHLIGHT_SSUB=1 138 | elif [[ $HIGHLIGHT_SSUB != "$1" ]]; then 139 | HIGHLIGHT_SSUB=$(( HIGHLIGHT_SSUB + 1 )) 140 | fi 141 | } 142 | 143 | check_root() { 144 | if [[ `whoami` != "root" ]]; then 145 | DIALOG " $_ErrTitle " --infobox "\n$_RtFailBody\n " 0 0 146 | sleep 3 147 | clear 148 | exit 1 149 | fi 150 | } 151 | 152 | # Adapted from AIS. Checks if system is made by Apple, whether the system is BIOS or UEFI, 153 | # and for LVM and/or LUKS. 154 | id_system() { 155 | printf "\n :: $(pacman -Q manjaro-architect) ::\n\n" >> ${LOGFILE} 156 | 157 | echo "">"$INIFILE" 158 | ini version "$version" 159 | ini date "$(date +%D\ %T)" 160 | 161 | # Apple System Detection 162 | if [[ "$(cat /sys/class/dmi/id/sys_vendor)" == 'Apple Inc.' ]] || [[ "$(cat /sys/class/dmi/id/sys_vendor)" == 'Apple Computer, Inc.' ]]; then 163 | modprobe -r -q efivars || true # if MAC 164 | else 165 | modprobe -q efivarfs # all others 166 | fi 167 | 168 | # BIOS or UEFI Detection 169 | if [[ -d "/sys/firmware/efi/" ]]; then 170 | # Mount efivarfs if it is not already mounted 171 | if [[ -z $(mount | grep /sys/firmware/efi/efivars) ]]; then 172 | mount -t efivarfs efivarfs /sys/firmware/efi/efivars 173 | fi 174 | SYSTEM="UEFI" 175 | else 176 | SYSTEM="BIOS" 177 | fi 178 | ini system.bios "$SYSTEM" 179 | 180 | # init system 181 | if [ $(cat /proc/1/comm) == "systemd" ]; then 182 | H_INIT="systemd" 183 | else 184 | H_INIT="openrc" 185 | fi 186 | ini system.init "$H_INIT" 187 | 188 | ## TODO: Test which nw-client is available, including if the service according to $H_INIT is running 189 | [[ $H_INIT == "systemd" ]] && [[ $(systemctl is-active NetworkManager) == "active" ]] && NW_CMD=nmtui 2>$ERR 190 | 191 | check_for_error "system: $SYSTEM, init: $H_INIT nw-client: $NW_CMD" 192 | 193 | # evaluate host branch 194 | ini system.branch "$(grep -oE -m 1 "unstable|stable|testing" /etc/pacman.d/mirrorlist)" 195 | } 196 | 197 | # If there is an error, display it and go back to main menu. In any case, write to logfile. 198 | # param 2 : error code is optional 199 | # param 3 : return menu function , optional, default: main_menu_online 200 | check_for_error() { 201 | local _msg="$1" 202 | local _err="${2:-0}" 203 | local _function_menu="${3:-main_menu}" 204 | ((${_err}!=0)) && _msg="[${_msg}][${_err}]" 205 | [[ -f "${ERR}" ]] && { 206 | _msg="${_msg} $(head -n1 ${ERR})" 207 | rm "${ERR}" 208 | } 209 | if ((${_err}!=0)) ; then 210 | # and function varsdump ? _msg="$_msg \n $(declare -p | grep -v " _")" 211 | local _fpath="${FUNCNAME[*]:1:2}()" 212 | _fpath=" --${_fpath// /()<-}" 213 | ! ((debug)) && _fpath="" 214 | echo -e "$(date +%D\ %T) ERROR ${_msg}${_fpath}" >> "${LOGFILE}" 215 | if [[ "${_function_menu}" != "SKIP" ]]; then 216 | DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0 217 | # return error for return to parent menu 218 | return $_err 219 | fi 220 | else 221 | # add $FUNCNAME limit to 20 max for control if recursive 222 | ((debug)) && _msg="${_msg} --${FUNCNAME[*]:1:20}" 223 | echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}" 224 | fi 225 | } 226 | 227 | set_language() { 228 | if [[ ! $(grep font /var/log/m-a.ini 2>/dev/null) ]]; then 229 | select_language 230 | else 231 | CURR_LOCALE="$(grep lang /var/log/m-a.ini | cut -d' ' -f3)" 232 | KEYMAP="$(grep keymap /var/log/m-a.ini | cut -d' ' -f3)" 233 | FONT="$(grep font /var/log/m-a.ini | cut -d' ' -f3)" 234 | TRANS="$(grep translation /var/log/m-a.ini | cut -d' ' -f3)" 235 | import $DATADIR/translations/$TRANS.trans 236 | ini translation "$TRANS" 237 | 238 | # does user want to change the old settings? 239 | DIALOG " $_SelLang " --yes-label "$_Keep" --no-label "$_Change" --yesno "\n${_Lang}: ${TRANS^}\n " 0 0 || select_language 240 | fi 241 | 242 | # Generate locale and set language 243 | DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 244 | sed -i "s/#${CURR_LOCALE}/${CURR_LOCALE}/" /etc/locale.gen 245 | locale-gen >/dev/null 2>$ERR 246 | export LANG=${CURR_LOCALE} 247 | check_for_error "set LANG=${CURR_LOCALE}" $? 248 | ini system.lang "$CURR_LOCALE" 249 | 250 | setfont $FONT 2>$ERR 251 | check_for_error "set font $FONT" $? 252 | ini linux.font "$FONT" 253 | 254 | set_keymap 255 | } 256 | 257 | # set locale, keymap and font and source translation file for installer 258 | select_language() { 259 | fl="1" # terminus-font variation supporting most languages 260 | DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 12 \ 261 | "1" $"Danish|(da_DK)" \ 262 | "2" $"Dutch|(nl_NL)" \ 263 | "3" $"English|(en_**)" \ 264 | "4" $"French|(fr_FR)" \ 265 | "5" $"German|(de_DE)" \ 266 | "6" $"Hungarian|(hu_HU)" \ 267 | "7" $"Italian|(it_IT)" \ 268 | "8" $"Polish|(pl_PL)" \ 269 | "9" $"Portuguese|(pt_PT)" \ 270 | "10" $"Portuguese [Brasil]|(pt_BR)" \ 271 | "11" $"Russian|(ru_RU)" \ 272 | "12" $"Spanish|(es_ES)" 2>${ANSWER} 273 | 274 | case $(cat ${ANSWER}) in 275 | "1") TRANS="danish" 276 | CURR_LOCALE="da_DK.UTF-8" 277 | KEYMAP="dk" 278 | ;; 279 | "2") TRANS="dutch" 280 | CURR_LOCALE="nl_NL.UTF-8" 281 | KEYMAP="nl" 282 | ;; 283 | "3") TRANS="english" 284 | CURR_LOCALE="en_US.UTF-8" 285 | KEYMAP="us" 286 | ;; 287 | "4") TRANS="french" 288 | CURR_LOCALE="fr_FR.UTF-8" 289 | KEYMAP="fr" 290 | ;; 291 | "5") TRANS="german" 292 | CURR_LOCALE="de_DE.UTF-8" 293 | KEYMAP="de" 294 | ;; 295 | "6") TRANS="hungarian" 296 | CURR_LOCALE="hu_HU.UTF-8" 297 | KEYMAP="hu" 298 | fl="2" 299 | ;; 300 | "7") TRANS="italian" 301 | CURR_LOCALE="it_IT.UTF-8" 302 | KEYMAP="it" 303 | ;; 304 | "8") TRANS="polish" 305 | CURR_LOCALE="pl_PL.UTF-8" 306 | KEYMAP="pl" 307 | fl="v" 308 | ;; 309 | "9") TRANS="portuguese" 310 | CURR_LOCALE="pt_PT.UTF-8" 311 | KEYMAP="pt-latin1" 312 | ;; 313 | "10") TRANS="portuguese_brasil" 314 | CURR_LOCALE="pt_BR.UTF-8" 315 | KEYMAP="pt-latin1" 316 | ;; 317 | "11") TRANS="russian" 318 | CURR_LOCALE="ru_RU.UTF-8" 319 | KEYMAP="ru" 320 | fl="u" 321 | ;; 322 | "12") TRANS="spanish" 323 | CURR_LOCALE="es_ES.UTF-8" 324 | KEYMAP="es" 325 | ;; 326 | *) clear && exit 0 327 | ;; 328 | esac 329 | 330 | # source translation file 331 | import $DATADIR/translations/$TRANS.trans 332 | ini translation "$TRANS" 333 | 334 | # adjust terminus font size depending on resolution 335 | biggest_resolution=$(head -n 1 /sys/class/drm/card*/*/modes | awk -F'[^0-9]*' '{print $1}' | awk 'BEGIN{a= 0}{if ($1>a) a=$1 fi} END{print a}') 336 | if [[ $biggest_resolution -gt 1920 ]]; then 337 | fs="24" 338 | elif [[ $biggest_resolution -eq 1920 ]]; then 339 | fs="18" 340 | else 341 | fs="16" 342 | fi 343 | 344 | FONT="ter-${fl}${fs}n" 345 | ini linux.font "$FONT" 346 | } 347 | 348 | select_keymap() { 349 | # does user want to change the default settings? 350 | DIALOG " $_VCKeymapTitle " --yes-label "$_Keep" --no-label "$_Change" --yesno "\n${_DefKeymap}\n\n[ ${KEYMAP} ]\n " 0 0 && return 0 351 | 352 | KEYMAPS="" 353 | for i in $(ls -R /usr/share/kbd/keymaps | grep "map.gz" | sed 's/\.map\.gz//g' | sort); do 354 | KEYMAPS="${KEYMAPS} ${i} -" 355 | done 356 | 357 | DIALOG " $_VCKeymapTitle " --menu "\n$_VCKeymapBody\n " 20 40 20 ${KEYMAPS} 2>${ANSWER} || return 0 358 | KEYMAP=$(cat ${ANSWER}) 359 | } 360 | 361 | set_keymap() { 362 | loadkeys $KEYMAP 2>$ERR 363 | check_for_error "loadkeys $KEYMAP" "$?" 364 | ini linux.keymap "$KEYMAP" 365 | } 366 | 367 | mk_connection() { 368 | if [[ ! -n "$(curl -Is https://manjaro.org | head -1)" ]]; then 369 | DIALOG " $_NoCon " --yesno "\n$_EstCon\n " 0 0 && $NW_CMD && return 0 || clear 370 | fi 371 | } 372 | 373 | # Check user is root, and that there is an active internet connection 374 | # Seperated the checks into seperate "if" statements for readability. 375 | check_connection() { 376 | # DIALOG " $_ChkTitle " --infobox "\n$_ChkBody\n " 0 0 377 | # sleep 2 378 | 379 | if [[ $(ping -c 1 google.com) ]]; then 380 | DIALOG " $_ReqMetTitle " --infobox "\n$_ReqMetBody\n\n$_UpdDb\n " 0 0 381 | sleep 2 382 | clear 383 | echo "" > $ERR 384 | pacman -Sy 2>$ERR 385 | check_for_error "refresh database" $? SKIP 386 | greeting 387 | else 388 | true 389 | fi 390 | 391 | # The error log is also cleared, just in case something is there from a previous use of the installer. 392 | 393 | } 394 | 395 | # Greet the user when first starting the installer 396 | greeting() { 397 | DIALOG " $_WelTitle $VERSION " --msgbox "\n$_WelBody\n " 0 0 398 | } 399 | 400 | # Originally adapted from AIS. Added option to allow users to edit the mirrorlist. 401 | configure_mirrorlist() { 402 | local PARENT="$FUNCNAME" 403 | declare -i loopmenu=1 404 | while ((loopmenu)); do 405 | ssubmenu 4 406 | DIALOG " $_MirrorlistTitle " --default-item ${HIGHLIGHT_SSUB} --menu "\n$_MirrorlistBody\n " 0 0 4 \ 407 | "1" "$_MirrorPacman" \ 408 | "2" "$_MirrorConfig" \ 409 | "3" "$_MirrorRankTitle" \ 410 | "4" "$_Back" 2>${ANSWER} 411 | HIGHLIGHT_SSUB=$(cat ${ANSWER}) 412 | 413 | case $(cat ${ANSWER}) in 414 | "1") nano /etc/pacman.conf 415 | DIALOG " $_MirrorPacman " --yesno "\n$_MIrrorPacQ\n " 0 0 && COPY_PACCONF=1 || COPY_PACCONF=0 416 | check_for_error "edit pacman.conf $COPY_PACCONF" 417 | DIALOG "" --infobox "\n$_UpdDb\n " 0 0 418 | pacman -Syy 419 | ;; 420 | "2") nano /etc/pacman-mirrors.conf 421 | check_for_error "edit pacman-mirrors.conf" 422 | ;; 423 | "3") rank_mirrors 424 | ;; 425 | 426 | *) loopmeu=0 427 | return 0 428 | ;; 429 | esac 430 | done 431 | } 432 | 433 | rank_mirrors() { 434 | #Choose the branch for mirrorlist 435 | local branch="" 436 | local oldbranch="$(grep -oE -m 1 "unstable|stable|testing" /etc/pacman.d/mirrorlist)" 437 | branch=$(DIALOG " $_MirrorBranch " --radiolist "\n$_UseSpaceBar\n " 0 0 3 \ 438 | "stable" "-" on \ 439 | "testing" "-" off \ 440 | "unstable" "-" off 3>&1 1>&2 2>&3) 441 | [[ -z "${branch}" ]] && return 0 442 | clear 443 | DIALOG " $_MirrorBranch " --msgbox "\n$_RankMirrors\n " 0 0 444 | clear 445 | pacman-mirrors -iaB "${branch}" 446 | [[ "$oldbranch" != "$branch" ]] && pacman -Syy 447 | echo "" 448 | ini branch "${branch}" 449 | } 450 | 451 | # Simple code to show devices / partitions. 452 | show_devices() { 453 | lsblk -o NAME,MODEL,TYPE,FSTYPE,SIZE,MOUNTPOINT | grep "disk\|part\|lvm\|crypt\|NAME\|MODEL\|TYPE\|FSTYPE\|SIZE\|MOUNTPOINT" > /tmp/.devlist 454 | DIALOG " $_DevShowOpt " --textbox /tmp/.devlist 0 0 455 | } 456 | 457 | # Adapted from AIS. An excellent bit of code! 458 | arch_chroot() { 459 | manjaro-chroot $MOUNTPOINT "${1}" 460 | } 461 | 462 | # Ensure that a partition is mounted 463 | check_mount() { 464 | if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) == "" ]]; then 465 | DIALOG " $_ErrTitle " --msgbox "\n$_ErrNoMount\n " 0 0 466 | ANSWER=0 467 | HIGHLIGHT=0 468 | return 1 469 | fi 470 | } 471 | 472 | # Ensure that Manjaro has been installed 473 | check_base() { 474 | check_mount 475 | if [[ $? -eq 0 ]]; then 476 | if [[ ! -e /mnt/usr/bin/pacman ]]; then 477 | DIALOG " $_ErrTitle " --msgbox "\n$_ErrNoBase\n " 0 0 478 | ANSWER=1 479 | HIGHLIGHT=1 480 | HIGHLIGHT_SUB=2 481 | return 1 482 | fi 483 | else 484 | return 1 485 | fi 486 | } 487 | 488 | check_desktop() { 489 | if [[ -e /mnt/.desktop_installed ]]; then 490 | DIALOG " $_InstDETitle " --yesno "\n$_DesktopInstalled\n " 0 0 || return 1 491 | fi 492 | } 493 | 494 | # install a pkg in the live session if not installed 495 | inst_needed() { 496 | if [[ ! $(pacman -Q $1) ]]; then 497 | DIALOG " $_InstPkg " --infobox "\n$_InstPkg '${1}'\n " 0 0 498 | sleep 2 499 | clear 500 | pacman -Sy --noconfirm $1 2>$ERR 501 | check_for_error "Install needed pkg $1." $? 502 | fi 503 | } 504 | 505 | # return list of profiles not containing >openrc flag in Packages-Desktop 506 | evaluate_profiles() { 507 | echo "" > /tmp/.systemd_only 508 | for p in $(find $PROFILES/{manjaro,community} -mindepth 1 -maxdepth 1 -type d ! -name 'netinstall' ! -name 'architect'); do 509 | [[ ! $(grep ">openrc" $p/Packages-Desktop) ]] && echo $p | cut -f7 -d'/' >> /tmp/.systemd_only 510 | done 511 | echo $(cat /tmp/.systemd_only) 512 | } 513 | 514 | # verify if profile is available for openrc 515 | evaluate_openrc() { 516 | if [[ ! $(grep ">openrc" $PROFILES/*/$(cat /tmp/.desktop)/Packages-Desktop) ]]; then 517 | DIALOG " $_ErrInit " --menu "\n[Manjaro-$(cat /tmp/.desktop)] $_WarnInit\n " 0 0 2 \ 518 | "1" "$_DiffPro" \ 519 | "2" "$_InstSystd" 2>${ANSWER} 520 | check_for_error "selected systemd-only profile [$(cat /tmp/.desktop)] with openrc base. -> $(cat ${ANSWER})" 521 | case $(cat ${ANSWER}) in 522 | "1") install_desktop_menu 523 | ;; 524 | "2") install_base 525 | ;; 526 | esac 527 | fi 528 | } 529 | 530 | grub_mkconfig() { 531 | arch_chroot "grub-mkconfig -o /boot/grub/grub.cfg" 2>$ERR 532 | check_for_error "grub-mkconfig" $? 533 | } 534 | 535 | final_check() { 536 | CHECKLIST=/tmp/.final_check 537 | # Empty the list 538 | echo "" > ${CHECKLIST} 539 | 540 | # Check if base is installed 541 | if [[ ! -e /mnt/.base_installed ]]; then 542 | echo "- $_BaseCheck" >> ${CHECKLIST} 543 | else 544 | # Check if bootloader is installed 545 | if [[ $SYSTEM == "BIOS" ]]; then 546 | arch_chroot "pacman -Qq grub" &> /dev/null || echo "- $_BootlCheck" >> ${CHECKLIST} 547 | elif ! [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/EFI/manjaro_grub/grubx64.efi ]] && ! [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind_x64.efi ]] && ! [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/EFI/systemd/systemd-bootx64.efi ]]; then 548 | echo "- $_BootlCheck" >> ${CHECKLIST} 549 | fi 550 | 551 | # Check if fstab is generated 552 | $(grep -qv '^#' /mnt/etc/fstab 2>/dev/null) || echo "- $_FstabCheck" >> ${CHECKLIST} 553 | 554 | # Check if video-driver has been installed 555 | [[ ! -e /mnt/.video_installed ]] && echo "- $_GCCheck" >> ${CHECKLIST} 556 | 557 | # Check if locales have been generated 558 | [[ $(manjaro-chroot /mnt 'locale -a' | wc -l) -ge '3' ]] || echo "- $_LocaleCheck" >> ${CHECKLIST} 559 | 560 | # Check if root password has been set 561 | manjaro-chroot /mnt 'passwd --status root' | cut -d' ' -f2 | grep -q 'NP' && echo "- $_RootCheck" >> ${CHECKLIST} 562 | 563 | # check if user account has been generated 564 | [[ $(ls /mnt/home 2>/dev/null) == "" ]] && echo "- $_UserCheck" >> ${CHECKLIST} 565 | fi 566 | } 567 | 568 | exit_done() { 569 | if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT} 2>/dev/null) != "" ]]; then 570 | final_check 571 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$(printf "\n$_CloseInstBody\n$(cat ${CHECKLIST})\n ")" 0 0 572 | if [[ $? -eq 0 ]]; then 573 | check_for_error "exit installer." 574 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo ${TARGLOG}\n " 0 0 575 | if [[ $? -eq 0 ]]; then 576 | [[ -e ${TARGLOG} ]] && cat ${LOGFILE} >> ${TARGLOG} || cp ${LOGFILE} ${TARGLOG} 577 | fi 578 | umount_partitions 579 | clear 580 | exit 0 581 | else 582 | [[ menu_opt == "advanced" ]] && main_menu_full || main_menu 583 | fi 584 | else 585 | dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_CloseInstBody\n " 0 0 586 | if [[ $? -eq 0 ]]; then 587 | umount_partitions 588 | clear 589 | exit 0 590 | else 591 | [[ menu_opt == "advanced" ]] && main_menu_full || main_menu 592 | fi 593 | fi 594 | } 595 | 596 | set_cache() 597 | { 598 | DIALOG " $_HostCache " --yesno "\n$_HostCacheBody\n " 0 0 599 | if [[ $? -eq 0 ]]; then 600 | hostcache=true 601 | else 602 | hostcache=false 603 | fi 604 | } --------------------------------------------------------------------------------