Thinstation / thinstation

A framework for making thin and light Linux based images for x86 based machines and thinclients.
https://www.thinstation.net/
804 stars 187 forks source link

Installing the build as a permanent system #742

Open AlexanderZhirov opened 2 years ago

AlexanderZhirov commented 2 years ago

I'm trying to try to install this system as a permanent build, so that it does not ship over the network and with the possibility of making changes (installing new packages, etc.), so that when rebooting it does not disappear anywhere and without constant reassembly of the distribution. For some things I have to make improvements, but constantly reassembling the image is not very convenient. In general, I decided to unpack initrd as the main system and use it when booting. I would like to understand what are the pitfalls? Since I'm stuck at the moment that the kernel can't recognize the root system.

изображение

I separately installed GRUB, copied the vmlinuz kernel to boot, which comes with the TS build.

I go to the chroot from under myself, everything works.

root@mypc /mnt/usb # chroot .
/ # ls -l
total 80
drwxr-xr-x    2 1000     1000         12288 Aug  8 14:17 bin
drwxr-xr-x    3 root     root          4096 Aug  8 14:16 boot
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 dev
drwxr-xr-x   23 1000     1000          4096 Aug  8 14:17 etc
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 home
lrwxrwxrwx    1 root     root            12 Aug  8 14:17 init -> /bin/busybox
drwxr-xr-x   30 1000     1000         12288 Aug  8 14:17 lib
drwxr-xr-x    3 root     root          4096 Aug  8 14:17 libexec
drwxr-xr-x    3 root     root          4096 Aug  8 14:17 mnt
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 net
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 proc
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 run
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 sbin
lrwxrwxrwx    1 root     root             4 Aug  8 14:17 share -> /lib
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 sys
drwxrwxrwt    2 root     root          4096 Aug  8 14:17 tmp
drwxr-xr-x    2 root     root          4096 Aug  8 14:17 usr
drwxr-xr-x   10 root     root          4096 Aug  8 14:17 var

GRUB settings are specified correctly, the kernel is picked up when loading:

/ # cat boot/grub/grub.cfg 
set default=0
set timeout=5

insmod ext2
set root=(hd0,2)

menuentry "Linux" {
    linux /boot/vmlinuz root=PARTUUID=27d31dd3-1857-4d83-a7e3-ffa5453d3cf6 rw
}

The UUID was also indicated, according to the information on my device:

$ sudo blkid
/dev/sdb2: UUID="a7d31693-a4e1-4e01-adc3-ebb92aed5e71" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="27d31dd3-1857-4d83-a7e3-ffa5453d3cf6"
/dev/sdb1: PARTUUID="a66ca78f-1515-4f48-93f1-b7a503740c45"

Maybe some other configuration is missing?

Thinstation commented 2 years ago

The problem with pulling the initrd apart, is that you no longer have an initrd. *Most of the time, Linux needs an initrd, though usually only a small one that helps it load file system modules and track down the root volume, then it switches to the files on the root volume. TS was not made to work that way. It's init system won't do that.

AlexanderZhirov commented 2 years ago

And I can't think of any workaround?)

Thinstation commented 2 years ago

No. A more traditional linux distro is maybe what you are looking for.

AlexanderZhirov commented 2 years ago

So, what if I create an initrd that will pass its download on to the unpacked distribution?

Thinstation commented 2 years ago

It should be a learning experience.