Episode: 4401
Title: HPR4401: hajime
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr4401/hpr4401.mp3
Transcribed: 2025-10-26 00:17:06

---

This is Hacker Public Radio Episode 4401 from Monday the 16th of June 2025.
Today's show is entitled Hedge-Ein.
It is part of a series bash scripting.
It is hosted by OXO and is about 24 minutes long.
It carries an explicit flag.
The summary is, let's see how OXO is using Hedge-Ein in order to install Arch Linux on
a old network.
Hello and welcome to another episode of mine for Hacker Public Radio.
This is my 5th episode.
My name is OXO and today I'm going to talk about Hedge-Ein.
You can find Hedge-Ein on my Codeberg repository.
Like all the tools that I mentioned later in this episode, you can find them on codeberg.org
slash OXO.
Hedge-Ein is a script that I have written in the last maybe almost 10 years now.
With that script I am installing my Arch Linux operating system, my desktop environment,
my personal settings and basically it is now in a state that I am inserting a USB
device, switching the computer on, pressing a few buttons now and then and then my
L system is standing, so that is what I want to demonstrate today.
Meanwhile I have switched my computer on and it has no operating system on it and this
computer is a very old one.
It is a Dell latitude 3189 I think, well yeah 3189 I can see it here in the BIOS.
Which has been booted meanwhile.
This computer has only four gigabytes of RAM, no megabytes.
It has gigabytes of RAM for to be precise and yeah what I have done is I have inserted
this USB device with Arch ISO on it which I have made with ISO latest.
I am now going to select that device so it can boot and that was the annoying sound
which occurs on some machines when you are running Arch ISO and now it is booting
up the Arch environment.
And meanwhile I have inserted the second USB stick that I have prepared for this installation.
So now my computer has booted into the Arch Linux environment to be precise it has booted
now into Arch Linux 6.14.4-Arge1-2 and we are in a TTY1 environment now.
So this is basically normally this normal stuff like are you boot from an ISO if you
have done that before you probably will be familiar with it.
And I am currently root at Arch ISO so I have root privileges so I don't have to worry
about SUDO and we are going to start the installation shortly.
First I want to talk about the second USB device I have prepared.
On this device I have made three partitions and those partitions are called code repo
and keys.
In the keys partition I have all my GPG keys, my SSH keys my password fault is on there
and stuff like that personal things that have to be kept secret.
On this second partition that I have made on this USB device there is my code repository
and this is basically the same as you can find online on Codeberg.
The third partition that I have made on this USB device is called repo and there are all
the installation files for the applications that I want to install.
So basically that is what you normally download from the internet is now on my USB device
and as copied locally without an internet connection.
Why did I do this?
Well because I have basically no internet connection so the internet that I use is via
my telephone so I have to be very careful not to use too much data and that is why I have
developed this system.
So in the meantime my computer has been booted like I said before and what I first always
do is directory creating a directory TMP TangleMike Papa.
That is the directory in which I will mount one of the partitions.
Then I'm going to check always with LSBLK that is a lemasherra bravo lemakilo which partition
I have to mount and then I say mount slash dev slash sd and in this case it is bravo
and then number three I always connect code to number three because I now have to mount
my code partition in order to be able to run hojime and so I say mount dev sdb3 to TMP.
Now I check if it is mounted properly via LSBLK again and then I can see sdb3 has a partition
on mounted on root TMP.
So what I then do is start a shell script shspace temp and then code slash rgma slash
zero in it dot sh and then I give it a config a config flag dash dash config space TMP
slash code rgma and then setup I have prepared a configuration file for this so I say setup
machine dl3189 which is this machine.
You can run hojime in two ways and now I'm using a configuration file and that is a development
that I have made in the last few months in which I have set all the important data for
partitions for sizes of partitions for mount points encryption stuff like that.
What it basically is is all the questions that are normally asked during an installation.
The answers on those questions I have put into this configuration file that is how you
can basically see it.
So I use a name, a password, the root user name, the root password etc.
So now I don't have to be interactive anymore and I can press enter and basically walk away
come back in 10 minutes and then I have passed the first three stages of hojime.
But I will talk you through it.
So now we have this line here shtmp code hojime 0enit.sh.
So 0enit is the first script that hojime will run and it is an initialization script and
then I give it a flag config dash dash config and then I can say which configuration file
I wanted to use.
And I have designated my dl3189.gov which is the configuration file for this del specific
this del latitude and then I press enter.
The first screen I will see and I have to be interactive with is a warning basically it
says quotient active configuration file and it says which file it wanted to use.
That is the same file as we entered as our value of our config flag of course.
But yeah just to be sure you can check it here and then it says this file will be used
for an intended installation hojime repository resource is offline.
So you can have three different kinds of repository modes so to say which is offline online
and a hybrid mode.
And now I am using the offline mode.
Before continuing be 100% sure that the file designates this machine so that is the file
mentioned configuration file and all the parameters in the file are correct.
So I know that those parameters are correct and I press Y to continue.
And now it is copying the hrgmail to the root and it has done that now and then I get a
big blob of text that is at my own risk that will erase all data from the designated
devices and if you want to continue I have to do that with full consent by pressing Y
and which I do right now.
So now basically I can wait for a minute or ten maybe the arch Linux installation will
be done.
What it is doing now is it is creating partitions and then it is encrypting the LVM partition.
It is creating the LVM volumes and then it makes the file system which has done already.
And now it is initializing the GPG so it is initializing the GPG key and this is necessary
for for example for Pacman, the package manager of arch Linux and now we are waiting.
I said this one is not so fast but it is working fine.
So now it has created the GPG keys and now Pacman is started and installing the base group
of packages which are packages like I see now for instance Pacman, the mirror list,
pearl, stuff like read lines, sad, pseudo system, all these basic things which you can find
in the base package group, those are installed now and this is about 600 megabytes and it
is pretty fast of course because it is local.
If I had to do this online it would be taking a lot of more time because my internet connection
is not fast and the other downside of that is that I am losing my data.
So now I only have to update my main machine and then make a copy of those packages which
are my USB device and I can run that gladly on this machine without worrying.
What is it doing now?
Let's see, it's creating simlink, it has created groups and users and it is now installing
the stuff that it has copied and now it is basically starting to install.
The post transaction hooks are now run, I can see now the first time that the make-in-it
CPIO is run, this is a little bit annoying for me because that make-in-it CPIO is running
maybe four times I think because every time when there is a package that is touching hooks
on make-in-it CPIO then it will regenerate that old image again and that's a little bit annoying
but nevermind because it also takes quite a while so the first time it is running now and you
see the usual warnings that do not find firmware for a few of these modules which are
warnings that I see also in these ten years so that's that's interesting stuff which I don't
know much about but it's running happily and then it's copying the root Hachime which has
copied before basically one thing is important to notice now now we are entering the second stage
in which we are entering the charute jail and now we are going to install inside the charute jail
so the what the true jail is is it is basically a virtual environment and which is the future
how can I say that the future image of the operating system disk the file system so now it is
entering that charute jail and it's it is creating the operating system in that jail and then the whole
two-conve part of my Hachime is running into that inside that charute jail and it's almost finished
so I have two kernels that I normally install which is the bleeding edge kernel of arglinux and then
the LTS kernel as well so I've always a fullback kernel in the LTS so meanwhile I'm going to
tell you where you can find this Hachime repository it's of course on codeback.org slash oxo
Hachime okay there we have Hachime and meanwhile my del is running the last time makes in its CPIO
with basically if you see the the readme file on this page Hachime then we are now running inside
two-conve and after two-conve I have to reboot and because we are in the charute jail I cannot
do that automatically so that's where the system stops and wait for you to reboot and that's a
downside and which I have to circumvent one day but it's fine for now so what this and this readme
file says in one base the script creates a partition table and a UAV system partition
which system de-boot in order to bootstrap the user space for the latest stable release and the
long-term support arglinux kernel and then in two cons the script configures settings for time
network mirror lists bootloader entries for the both kernels the RAM disk and creates a user
environment and after execution of comp the system is able to boot independently and that's
where we have come now so I'm going to exit here and then I'm going to you mount
my slash mnt and then I'm going to reboot reboot I don't forget to remove the usb devices from
the system so it can reboot quickly for the first time from the NVMe device or in this case it's
an sva device I see the two kernels so that's working fine arch and arch lts
archlinux is booting and then the script setup is asking for the password for crypt lvm
well for the set of purposes I have made it lvks and then I'm set my insert my usb device again
not the arch iso but the usb device with the three partitions which again are code repo and keys
archlinux 614-7-2-1 so I think we were starting out on the arch iso with 614-4 something or two
I'm not sure but now we're on seven because meanwhile my main system has done a few updates already
for the kernel and now we're on kernel 14.7 and then basically we have to log in as user
and then I can see connect code and repo media these are the partitions on this usb device that I
told you about and then I continue archlinux in store with sh-h-h-lash-tree-post.sh with
I have done now and then my suitable password for the first time it's copying a few latest packages
and then it will continue with four apps with it is done now so archlinux 4 apps
going back to the readme now prepares the system for a display manager running under
wland with wl roots as a modular compositor library and the script will set up sway
tiling window manager but it can easily modify it to set up for x11 based managers when preferred
and the script also installs a variety of tools among others for video text file manager
network management internet system monitoring virtual environments and so on and so forth
yeah basically you can expand the list at your liking and it will install those packages as well
of course you must have the packages on your repo the partition on your usb device if you use the
offline mode of azimuth if you use online mode you can just expand the list at your liking
and then after apps which is not a brand fully yet but I think it's halfway now after apps there
is a dtcf and it installs the dot file configuration which contains settings for apps and compositor
to run smoothly basically that's my desktop environment rice so to say so there we have it and
in the readme file you can see the requirements the host machine and the usb rs iso and the repo code
usb2 also know you can have a separate boot device for this computer i don't have a separate boot
device or meanwhile i see the errors coming in because i still have a problem with installing
our packages i have to look into that but now it already is at five dtcf and it's
copying my configuration files right now so this episode is now running for more than half an hour
now and if within this half an hour i have explained a lot about rgme and meanwhile the computer
has installed the desktop environment and now also my personal settings it is copying my notes
as well which you can find also on the codeberg repository and then there is a last question
starting pwgn which will ever ring out as well i have to check that as well and then there are some
errors to finish it off with and yeah i still have to look into this but yeah it's a work of 10
years now and it's not finished yet removing my usb device here and after rebooting
well don't be too quick so now i see the dialogo i don't do anything and i'm choosing for the
arch bleeding edge kernel i enter my crypt setup password for the crypt ovm and then again enter my
username that was a little bit too quick i will be answering out or not now that's fine and then i can
say sway and then it's running my sway environment i have my bar on top with the work space numbers
and my clock is working and if i press the mate enter and then i have my electricity terminal
emulator running smoothly and my colors are as i like it which is base 16 colors and
the ir black theme so everything is working fine it's about time to get out of here i hope you
liked this rather quick demonstration of a gmail the arch Linux installation script that was it
for today i'll see you later in the next episode goodbye
you have been listening to hacker public radio at hacker public radio does work today show was
contributed by a hbrlisnet like yourself if you ever thought of recording podcast and click on
our contribute link to find out how easy it really is hosting for hbr has been kindly provided by
an honesthost.com the internet archive and our sims.net on this otherwise stated today's show is
released under creative comments attribution 4.0 international license
