Skip to content
Fulgurance edited this page Jan 6, 2023 · 36 revisions

Welcome to the ISM wiki!

Introduction

This is the very first guide of usage for ISM.

This documentation focus on the Alpha-0.18.96 version and help actually the tester to setup a good environment to test the software. Please, contribute to ISM by test it in a virtual machine and report the bug you can found.

If you have as well any suggestions about the project, to improve it, feel free !

Setup

Actually all test was performed under virtual machine with VirtualBox. It's up to you about the hypervisor you use, but I'm not aware about the bugs you can have.

First install a random Linux distribution in a freshly new virtual machine. I recommand you Calculate Linux actually, because this distribution can build properly Crystal (the language used to code ISM), and follow properly the requirement for the Linux From Scratch Book. Just make sure to allocate enough memory, because ISM will install as well a new Linux system. Make sure as well the user you will use can have sudo access.

After, reboot your virtual machine and we can start to install required packages and set a proper environment before we use ISM.

System setup

We will start to check if the installed linux system have the requirements. Run in a terminal:

cat > version-check.sh << "EOF"
#!/bin/bash
# Simple script to list version numbers of critical development tools
export LC_ALL=C
bash --version | head -n1 | cut -d" " -f2-4
MYSH=$(readlink -f /bin/sh)
echo "/bin/sh -> $MYSH"
echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash"
unset MYSH

echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1

if [ -h /usr/bin/yacc ]; then
  echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
elif [ -x /usr/bin/yacc ]; then
  echo yacc is `/usr/bin/yacc --version | head -n1`
else
  echo "yacc not found" 
fi

bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1

if [ -h /usr/bin/awk ]; then
  echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
elif [ -x /usr/bin/awk ]; then
  echo awk is `/usr/bin/awk --version | head -n1`
else 
  echo "awk not found" 
fi

gcc --version | head -n1
g++ --version | head -n1
ldd --version | head -n1 | cut -d" " -f2-  # glibc version
grep --version | head -n1
gzip --version | head -n1
cat /proc/version
m4 --version | head -n1
make --version | head -n1
patch --version | head -n1
echo Perl `perl -V:version`
python3 --version
sed --version | head -n1
tar --version | head -n1
makeinfo --version | head -n1  # texinfo version
xz --version | head -n1

echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c
if [ -x dummy ]
  then echo "g++ compilation OK";
  else echo "g++ compilation failed"; fi
rm -f dummy.c dummy
EOF

bash version-check.sh

Check the result of the executed script and installed the missing programs.

At the end of your ~/.bash_profile, add the following line:

exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash

The same for the ~/.bashrc file:

set +h
umask 022
LC_ALL=POSIX
PATH=/usr/bin
if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
PATH=/mnt/ism/tools/bin:$PATH
export LC_ALL PATH

And to finish, as root, run this command:

[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE

Then, everytime you log in a terminal to use ISM, make sure to load the new ~/.bash_profile:

source ~/.bash_profile

Generate the default directory where we will install the new system:

sudo mkdir -pv /mnt/ism

And make sure actually the path /mnt/ism is owned by you current user, not root:

sudo chown -R username:username /mnt/ism

(Optional): You can change the path where you would like to install the new generated Linux system, it's not a problem. But if you do that , just make sure to change the path as well in the ~./bashrc you generated before, for the PATH variable, and as well in the future instructions when we will set the root path . To finish, make sure in the running system crystal and git are installed.

ISM setup

First clone the ISM repository:

git clone https://github.com/fulgurance/ism

Move to the cloned repository path:

cd ism

And build it:

crystal build Main.cr -o ism

Now you will be able to use ISM like that:

./ism

To be more comfortable, you can set an alias to just type ism in the terminal:

alias ism=./ism
Clone this wiki locally