homehowtokbslinksaboutcontactprojectsmusic

Index > My Projects > ThinOS Manager

ThinOS Manager Setup - Ubuntu 24 LTS

Table of contents

  1. Configure system for DHCP
  2. Install Zenity
  3. Configure GUI
  4. Scripts

Configure system for DHCP

Create configuration file & set permissions
cat << eot > /etc/netplan/config.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
eot
chmod 600 /etc/netplan/config.yaml
Go up

Install Google Chrome

Dowload the package
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Install it
sudo dpkg -i google-chrome-stable_current_amd64.deb
Force the installer to install missing libs
apt install -f
To install Google Chrome, run the following:
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome*.deb
Installed this way, the package has the name google-chrome-stable. If error messages pop up after running the command sudo apt install ./google-chrome*.deb then run the command
sudo apt-get install -f
Reference

Create base file system

Create and configure base file system Install package needed to create core image
apt install debootstrap
Create base file system [64 bit]
tosm=/tosm; debootstrap --arch amd64 noble $tosm
Delete existing timezone and locals setting from base system and copy the timezone, locals from local system to base system
rm $tosm/etc/{timezone,localtime}; cp /etc/{timezone,localtime} $tosm/etc
Create modules directory and copy intended kernel to it
mkdir -pv $tosm/lib/modules; cp -r /lib/modules/$(uname -r) $tosm/lib/modules/
Set the hostname
echo "tosm" > $tosm/etc/hostname
Login to base system (chroot)
chroot $tosm
Configure timezone and local time
locale-gen en_US.UTF-8; update-locale LANG=en_US.UTF-8; dpkg-reconfigure -u tzdata
Configure update repositories
cat << eot > /etc/apt/sources.list
# Core updates
deb http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
# Security updates
deb http://archive.ubuntu.com/ubuntu noble-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu noble-security main restricted universe multiverse
# Regular updates
deb http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
eot
Patch the base system
apt update; apt upgrade -y
Install base packages
apt install nano wget partclone ntfs-3g chntpw nfs-common pv dialog fdisk pigz -y
Disable IPv6 Add the following as kernel argument
ipv6.disable=1
Create init script (very important) and make it executable
cat << eot > /init
#!/bin/sh
mkdir -p /dev/{,pts,ptmx}

# Mount file system in ram.
mount -a

init=/sbin/init
exec \${init}
eot
chmod a+x /init
Create rule to change nic name to eth0
cat << eot > /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x11ab:0x4363 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth0"
eot
Configure the base system for dhcp
cat << eot > /etc/netplan/config.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
eot
chmod 600 /etc/netplan/config.yaml
Clear caches
apt-get autoremove; apt-get autoclean; apt-get clean; rm /var/lib/apt/lists/*
Remove some unnecessary files/folders and remove wireless drivers from kernel (optional)
rm -r /usr/share/GeoIP ; rm -r /usr/share/man ; rm -r /usr/share/doc
rm -r /lib/modules/$(uname -r)/kernel/net/wireless; rm -r /lib/modules/$(uname -r)/kernel/drivers/net/wireless
Configure autologin for root account
sed -i s,"^ExecStart=-/sbin/agetty.*","ExecStart=-/sbin/agetty -a root --noclear %I \$TERM",g /etc/systemd/system/getty.target.wants/getty\@tty1.service
Verify the auto login
grep "ExecStart" /etc/systemd/system/getty.target.wants/getty\@tty1.service | grep root
Setup password for root (optional)
passwd
Logout from base system (chrooted)
exit
Compress the base system (.gz)
cd $tosm; find . -print0 | sudo cpio --null -ov --format=newc | gzip -9 > ~/tosm_$(date +%Y%m%d).gz
Compress the base system (.xz)
cd $tosm; find . -print0 | sudo cpio --null -ov --format=newc > ~/tosm_$(date +%Y%m%d); xz -zvf -T0 -9 -C crc32 ~/tosm_$(date +%Y%m%d)
Congrats ! Your base file system is compressed and ready Go up

Install Zenity

apt install libgles2-mesa-dev zenity

Setup GUI

apt install xfce4 --no-install-recommends
apt install xserver-xorg --no-install-recommends
apt install xinit --no-install-recommends

Scripts

  1. Functions (core.sh)
    
    
  2. New functions (core.sh)