 Hi, I'm Denji. And in today's video, I'm doing a calm, no-nonsense guide on how to install Gen2 Linux. Now, the first thing you'll notice is that I'm in a Linux Mint live environment over here. I'm not in the Gen2 ISO, which you can download from the Gen2 page. The reason for this is because Gen2 requires no special software or specific package manager to install it onto a base system. This means that we can easily download any existing Linux live environment, in this case, Linux Mint, to make this install process much, much easier than typing everything manually on the terminal. In fact, a lot of this install is just gonna be copying and pasting commands. But anyways, without further ado, the first thing I recommend is you make yourself the root user over here on Linux Mint, so I'm just gonna run sudo su, and there you go, we're now the root user. I'm just gonna type cd to make the prompt smaller. And now I'm gonna move on to the first step of the installation that matters to us, at least, and that's preparing the disks. Now, if you're installing Gen2, you should still be relatively familiar with how to partition disks and how to just lay out a Linux system before you start working on it. We're just gonna partition everything with CF disks, so I'm gonna run CF disks. And then for label type, I'm gonna pick GPT because this is a UEFI system. Since this is a UEFI system, I guess we gotta make a 100 megabyte partition here and go down and press enter and make a four gigabyte swap partition or however big you want your virtual memory. Just make that as big as your memory or twice your memory or something like that. And then the rest of the space is just gonna be root, so just press enter twice for that one. Then go over to write, type yes, press enter, then over to quit. And there you go, we've partitioned our disks. Now let's format them to all the appropriate file system. So let's just list them again just to be sure. There they are. We're going to mkfs.ext4 then devsda3, that's gonna be our root in the ext4 file system. And there you go. Now it's gonna be mkfs.fat-capitalf32devsda1 for our boot partition. And then the easiest one is just gonna be mkswapdevsda2 for our swap partition. Now it's time to mount all these things. Now one thing you'll notice in the gen2 guide, if you scroll down all the way to where it starts to mount and stuff, is that over here it recommends you mount everything to mnt gen2 as a root and not just mnt as you would on Arch Linux. That means we're gonna have to make that directory. So I'm gonna run mkdir for it slash mnt for it slash gen2. There you go. And then I'm gonna mount devsda3, which is our root partition to slash mnt slash gen2. And just to be sure, so I do it now, I'm also gonna mount my boot partition. But to do that, I'm gonna have to create the bootefi directory just like we did on Arch Linux. So mkdir-p to make them recursively, slash mnt gen2 bootefi, and then mount devsda1 mnt gen2 bootefi. And then finally the easiest step, swap on devsda2 to turn on that swap. So you run lspok one last time. There you go, everything's looking fine. Now moving on to the next step, which is installing stage three. Today we're gonna be doing a very minimal install and that's gonna play into which stage we pick. Okay, so we're gonna run date just to make sure that the date is correct. So any SSL downloads don't mess up. So everyone date and yeah, that's definitely not right. It's not 2 a.m. here, it's actually 6 a.m. I just woke up a few minutes ago so I could do this gen2 guide. I don't think a few hours like that is really gonna throw it off, but if the date is completely wrong, like if it says October 1st or September something here or any other date that isn't the current day, then you should go into your settings and change that. I'm just gonna move on to the next step, which is choosing your stage tarball. Now if you go over to the download section, which is linked over here, you can pick between various stage archives. So all these are are a base gen2 system that's sort of been packaged into a little tar file, which you can then untar and install Kernelon and then boot from basically. I'm gonna pick the first one, which is the stage three OpenRC. Stage three system D, as the name suggests, includes system D instead of OpenRC as the init system. The no multi-lib variants are the same thing except they have no support for 32 bit programs and the stage three 32 bit, that's just a 32 bit version for 32 bit computers. Anyways, I'm gonna pick this one over here so right click and copy link. And now I'm gonna go into MNT gen2, which is where you're sort of recommended to untar it. And I'm gonna run doubly get and then that. So just give it a sec to start downloading this. Might take a while. Okay, so it's been downloaded. And now as it says in the guide, you gotta untar it. So just run this command basically and there you go, tar xpvf stage three and the tar ball and enter. Once again, this also might take a while depending on your CPU and disk speed. I don't know if you can hear it, but my fans have started to rile up. That's gonna happen a lot. Okay, so now that it's extracted, we can move on to configuring compile options. Now what's weird to me is that this guide to configure C flags, CSX flags, and also make OPTS flags. All of this is done before you go and modify the use flags, which is something we'll take a look at later in the guide. Anyways, we're just gonna follow the way the guide says to do it for now. We might rebel later. Nano, MNT, Gen2, etsyportagemake.com. We wanna edit this file. This is gonna be the magic file to edit in this tutorial. We're gonna go through this file so many times. Now as you can see here, there's already some stuff to find in here. The only line I wanna add is this one over here, make OPTS. So we're gonna add make OPTS and then equals and in quotation marks, you wanna put dash j then a number of processes. A good rule of thumb is you divide the amount of memory you have by two and then round it to the lowest thread. In today's case, I've especially picked 10 gigs of RAM and five threads. So we can do dash j five because five times two is 10 and there's enough threads for that. Make sure you lower and increase this number based off any experience you have compiling maybe with this increase it's faster or maybe it just uses too much memory in your system, memory fills up and that kind of stuff. Anyways, we're gonna do control O and press enter then control X and move on to the next step, which is going to be installing the actual base system. This is going to be the biggest and most complex part of the guide so don't be ashamed if you mess something up. Anyways, the first thing is gonna be selecting the mirrors. We don't really have to do this but it's recommended to get faster mirrors than what you regularly have. And in this case, I'm gonna go over to the Gen2 page at gen2.org then go over to the downloads page then over to the mirrors section and over here you can get a list of all of the mirrors. I'm gonna pick any Turkish mirrors actually. Oh yeah, there you go, there's one. I'm gonna just copy paste that URL and then I'm gonna go into mnt gen2 etsy portage make.conf and we wanna add the variable maybe at the bottom of the file gen2 underscore mirrors and then make that equal to that mirror or any other list of mirrors which you can find online. I'm gonna write and quit and move on to the next step. We're just gonna be copying the DNS info so this is basically just copy paste a command. The etsy resolve file, if you check that on your system this includes the name server so the DNS server which your system is using. In today's case we're just gonna copy that over dereference it and send that over to the Gen2 root so I'm gonna just run enter there you go, we've copied the DNS information. This is gonna be the most tedious part of the guy this is mounting the necessary file systems this is just copying and pasting like this is nothing complex about it you just copy and paste and there's gonna be a lot of that in this guy just run this and paste that and run it copy, paste and run copy, paste and run copy, paste and run and copy, paste and run. There you go, we've mounted everything. Finally it is a warning over here it says when not using Gen2 installation media this might not be sufficient. Some distros make devshm a symbolic link to run shm which after the truth becomes invalid. Now this actually does happen on Linux Mint if you run ls-l run then shm as you can see it's linked over to devshm so you do want to follow this tutorial so I'm gonna just run this stuff then run this and then change the mode over here so there you go now we can move on to the next step which is changing root once again this is just basic copying and pasting we wanna trute slash mnt gen2 or whatever mount point you're using then to bin bash as our shell there you go we're in the gen2 root now except it does say mint our source is gonna be etsy profile there we go now we've got executable programs basically just copy paste this part all this really does is adds a little trute right there so we can know that we are in the trute mounting the boot partition we've already mounted it if we run lsp okay there's everything now we're gonna learn how to use portage that's a gen2 package manager the first command we're gonna learn is emerge webr sync if you run this emerge dash webr sync it synchronizes the repository so pressing enter this might take a while to download so I'm just gonna give it a sec okay so now that we've synced the repositories we can skip this step because it's optional and move straight to reading news items this is going to be your introduction to the e-select command which will be used quite a little bit in this guide we run e-select news list you'll see there's a few news items dating back from 2060 to 2021 and then if you wanna read any of them just run the e-select news read then it'll say I wanna read the latest one 10 and if you run that you'll just get a raw text copy of it so what you can do is then send that over either to a file or pipe it straight into less and then you can go through and and read through that if you want to but anyways I'm not gonna do that I'm just gonna go to the next section which is choosing the right profile this is very important depending on what kind of system you wanna get today we can stick to the number one profile because I'm not really gonna be installing anything like desktop environments or XORG or a display server however if you do plan to use XORG I recommend you pick this option over here and you know depending on whether you wanna use GNOME or KDE pick one of these options but to see the actual full list of options you wanna run e-select profile list and there you go we've got all the options so it's already set to number one which is perfectly fine by me however if you're however once again if you wanna run XORG you gotta choose this one if you want to run GNOME you should choose this one and of course there's options for all these to have them as system D or with no multi-lib support like this one for example and there's developer and stable versions but anyways we're gonna stick to the default because that should be perfectly fine for us so I'm not gonna select anything but if you did wanna select one of them you would have to run e-select profile set and then let's say five for the desktop one and now if you run that list again you'll see that it says that we have selected the fifth one which is the desktop one but I'm gonna set this to one because that's the one I want now what do these profiles actually do well they modify two aspects of our system primarily number one the packages in the at world set so the at world set is essentially all the packages installed co-on-co on the system or at least the packages the system plans to update in the future so if I picked the fifth one for example I would have a ton more packages to install in my world set than I would in the first one the second thing these things change is use flags so if you go and run this command emerge dash dash info you're gonna get a lot of information about the current variables that emerge is using you can then pipe that into grep and then run this little hat symbol and use to check all the use variables so here they are if you list them I think it's just this basically all use flags are our different components or functions which each program is told they either need or not need and depending on the use flags you say you may end up installing more programs or less programs or different programs depending on the stuff that you've picked these are the default use variables in the number one profile if you were to pick a desktop environment there would be so much more stuff here there would be stuff like Pam and E-Login D and Bluetooth support and all this kind of stuff that your system is configured to compile and there's not only use flags here there's stuff like audio cards also cards over here it's a whole list of different audio cards you can pick between so just delete the ones you don't need and stuff but how do I configure any of this well it's pretty simple if you want to get rid of any of the use flags first of all let's just copy paste all of these and put them in our make.com file because that's where we modify the use flags so nano, etsy, portage, make.com since you know we're in the truth so we gotta use etsy not MNT Gen2 we're gonna add that use variable here just gonna copy paste it and there it is there's all of our use flags now the thing about use flags that makes them unique from all the other flags in the system is that if I remove one it doesn't actually remove it from the global list of use flags because you saw before that all of those use flags were there even though I didn't put them in this file the only way to get rid of a use flag is to put a minus in front of it so if I put a minus in front of I don't know let's say Unicode, there it is I will not have any Unicode support but if I just delete Unicode I will still have Unicode support because that's how use flags work now it's a little bit different when it comes to different flags which are not declared now one flag that's not included on the system is Bluetooth and because it's not in that default set which we took a look at before when we run emerge dash dash info if I want Bluetooth support I'm gonna have to type Bluetooth here same thing goes for other things like for example if you want desktop support you're gonna need Pam, E-Log and D and I think you're gonna need Harfbuzz and a few other flags and these are not included by default in the first set now I'm perfectly fine with the default use flags so I'm not gonna change this however do know that when you're doing a desktop system this becomes very very useful because removing support for something like Bluetooth or CDs or DVDs and stuff as soon as you do that suddenly you're gonna get a lot less dependencies to download for each package because the system knows you don't wanna use those functions anyway I'm just gonna write and quit here and move on to the actual important step which is updating all the packages so if you run emerge dash dash ask and verbose and then dash dash update dash dash deep dash dash new use and then with the at world set which once again are those packages specified when we selected our profile and press enter you'll see that it's calculating dependencies and then it's asking us if you want to update these packages we're gonna say yes just by pressing enter and it's gonna start compiling them but this might take a while especially if you're installing lots of desktop stuff like with the desktop you're talking about over 100 or even 200 packages you gotta install not to mention KDE and stuff like that so I'm just gonna let this do what it needs to do and I'll be back in a sec okay so all the packages have been compiled over here so we can move on to the next step which is configuring the accept license variable this is also something you might wanna do before installing your packages just in case you want some special proprietary software that isn't allowed by default if we go into etsyportagemake.conf and add this variable accept underscore license we can give it various parameters to decide what sort of licenses we want to accept so I'm just gonna put a star in here because I'm assuming most of the people watching this are not really gonna be super bothered about the license of the software however if you are concerned about using free software then do put one of these various options or a mix of them to make sure that everything is indeed free software now I'm gonna do control O plus enter control X we can move on to the next steps now these are quite similar to Arch Linux stuff like setting the time zone and locale so you should be quite familiar with these concepts first thing is gonna be picking a time zone now if you already know your Unix time zone you can easily just type echo then the time zone in my case is gonna be Asia slash Dubai and then send that over to etsy time zone just like that now if we run cat etsy time zone there you go it says Asia to Dubai that's good if you run this command over here emerge config sys libraries time zone data and there you go it's set a correct time zone now locale generation is different from Arch Linux as well instead of uncommitting something from a file you actually have to type it in manually so locale.gen right over there and we're gonna type in en underscore us.utf-8 and then space utf-8 seems a little bit redundant I have to type it twice but that's just how it is control O press enter control X now if you run locale.gen it's gonna generate those two locales there you go and then moving on to locale selection we have to use e-select again oh what a wonderful thing e-select locale list and we're gonna pick locale number five so e-select locale set number five and there you go now we can run this to change our profile but we're just gonna run it as it says on the guide with this environment update command so there you go copy and pasting that and there you go we've now changed our locale anyways the next step is gonna be configuring the kernel the first thing you wanna do if you want to compile the kernel yourself is to download the kernel sources so run this command then going to user src then the name of your kernels it might be linux you know dash 5 point 10 point 13 or something like that right and then from there you can run make menu config and then you can get a menu similar to the one that I show in my Linux compilation guide I'll have that linked in the description so once you get to that menu config option you can just watch my guide on how to configure the kernel but in today's case we're gonna just be installing a binary kernel so if you go over here to using distribution kernels first of all we have to install an install kernel so do the kind of configuration around the kernel you can either pick one for systemdboot or for just any other boot loader now we're not gonna be using systemdboot because once you can run openrc not systemd so we're gonna run this command emerge sys dash kernel forward slash install kernel dash gen 2 and now it's going to install the gen 2 install kernels give it a second and there you go it's installed anyway now to actually install the kernel the kernel is called gen 2 dash kernel dash bin for the binary so emerge sys kernel forward slash gen 2 dash kernel dash bin and run that and then it's gonna start downloading it now this is gonna take a few dependencies it'll take a while to download everything so I'm gonna come back in a second okay so the kernel binary is now been installed we can move on to the next step which is kernel module now if you want to enable a specific kernel module follow this guide but udev as it says in this note will automatically enable any kernel modules you need just by checking what's supported by the hardware so you don't really have to do this manually this step over here which is installing firmware is something I definitely recommend you do if you're on physical hardware but I'm on a VM so I don't really have to do that so I can skip over to the next step we're just configuring the system so the first big thing we're gonna do today is do the FS tab now we could do this manually and type everything manually but personally I don't trust myself to manually type an FS tab so instead what I'm gonna do is use the Gen FS tab script which you can get from GitHub so I'm gonna just link that in the description so over here in this repository by Glaceon you can go to Gen FS tab and there's a script that will automatically make an FS tab for you so I'm just gonna download this and run it but to do that I'm gonna need to go back to my Linux Mint environment over here not the Gen 2 Trute so I'm gonna right click make a new window and just make this little bigger and then put this over here and then I'm gonna just make sure I'm a super user and I'm gonna get the script alright so I've got the script over there I'm just gonna make sure it's executable so chmod plus x to an FS tab and I'm gonna run it and then with slash MNT Gen 2 and it should generate an appropriate FS tab there you go there's an appropriate FS tab I'm gonna send that over to MNT Gen 2 at CFS tab and now going back to my Gen 2 live environments I'm just gonna close this terminal I'm gonna use nano to go into at CFS tab just take a look okay so you can ignore the red spaces that's just it not interpreting the tabs correctly however this FEVR FS none and Trace FS we can get rid of that because those are just mounted temporarily so we can delete all of those just make sure those are gone because you don't really need them to boot into the system the important stuff is you have the dev sd1 sd2 and sd3 over there anyway pressing enter and right quitting move on to the next step after this which is networking information now this is only really useful if you're manually configuring the network I'm gonna be using an Ethernet cable so I'm perfectly fine the only tool I need is DHCPCD which we will install later however one thing we definitely do wanna do is set our host name so if you go nano atcconf.d then host name I'm gonna change this name to I don't know a fun little computer name Gen 2y there you go Gen 2y press enter and right and quit that then you can configure things like your domain and stuff I don't really need any of that it should be fine the host's file is important to configure so nano atchost then I'm gonna add a line in here it says 12700.1 and then with my host name so Gen 2y now setting the root password now Gen 2 is interesting because it requires a certain complexity to your root password you can change this but you know having a complex password is good so I'm gonna set one so password I'm gonna type a complex password it does suggest one for you there's tech39bleak I don't really know what that's meant to mean but you know you can have that as your password if you really want it oh it doesn't match I'm gonna type it again that lovely7krueljoseph what are these words and now there's in a inboot configuration we can basically skip this unless you want to specify a different key map or you want to change your hardware clock stuff now we can move on to installing tools I hear you're recommended to install various things the big thing you probably want is the DHCP client so we're gonna run emergeDHCPCD and then I'm also going to want out of my system I might want sudo so we can have super user privileges and stuff and I guess you know just for fun we can have screenfetch just so we have something funky to look at and of course we want grub because that's gonna be our boot manager and EFI boot MGR that's gonna be useful for having EFI work on our system anyways it's pressing enter it should start merging those packages just give it a second it might take a while cause there's 16 things to install I'll come back in a minute okay so now that all those packages have been installed we can move on to the next step which is configuring the boot loader now we don't even really need to read this section because I'm pretty sure if you've installed Arch Linux you're probably quite familiar with installing a boot loader but just to be sure I'm just gonna check through this and yeah it's basically the same we're gonna run grub-installdev-sda to install it first of all also make sure you do have that EFI boot manager package that I installed before because without that your system is not gonna boot then we're gonna run grub-mkconfig-o forward slash boot grub-grub.cfg press enter and there you go it made our grub config and once again that OS proper error we can just ignore that because we're not dual booting now that that's all done we can move on to the next step we're not gonna reboot the system now because there's a few more things I wanna do and that's create our user and set him as a super user so before you know that we've installed the sudo package we wanna make sure that all users of the wheel group have access to super user privileges so we're gonna run editor equals nano then vsuda then as you can see here's the etsy sudoers file we're gonna go all the way to the bottom and uncomment the iconic line wheel all equals all all and there you go now now wheel users can run commands with sudo privileges so control O press enter control X and now we can finally add a user this is just the same as on Arch Linux it's user add dash m dash g we're gonna add us to the wheel to the users group and if you want video and audio and everything you can do video audio USB all these different groups but I'm not gonna have that because we're just gonna be using a base terminal install we're not gonna be doing any extra good stuff our shell is going to be bash and then our username is gonna be denshi so there we can ignore that mailbox file thing now we're going to change our password now I'm gonna set it for denshi so denshi gonna just set the same password although in real life about what is that different password is for these two different accounts the last thing I want to do is do some disk cleanup maybe so go into your root directory there's still the stage three there so let's just remove that arm dash RF stage three and there you go we've pretty much done everything we really need to set up this gen two systems now we exit and exit again we're back in Linux Mint I guess we can just quickly unmount all just to unmount everything we could ignore the fact they're busy because we're not really doing anything on these different things and now we can run reboot okay here we are in grub there's gen two linux press enter and see if that boots up so just give it a sec there's openrc booting up and there's a small text and there's our login that was quite quick now I'm gonna type denshi and then my password over here and there I am in gen two I'm just gonna make that text bigger so set font then dash D just to make my font twice as big and now just for fun like we always do on these tutorials we're gonna run screen fetch and there you go there's gen two how beautiful now if you wanted to install Xorg and set up a graphical environment you'd have to run this command so just go into editportagemake.com there you go type my password in just to make sure that sudo is working I guess yeah it's working and then go down to use and you wanna add a few things you probably wanna add X for Xorg support Pam for Pam support you log in D for logging in support and permission support and harf buzz for all that kind of support and I think true type as well and a few other things but I'm not gonna install Xorg today because I'm just doing a base gen two install but if you did want to install it do know that you're gonna need a few various use flag changes and there might be a few hurdles on the road with those use flags if you ever stuck the best ways just Google your answer maybe ask me send me an email or write something in our tech support chat which is on matrix discord and xmpp anyways, besides that I've been Denshi that was a gen two install done as calmly and simply as possible goodbye