depenguin-me / depenguin-run

Installer script for mfsBSD image to install FreeBSD 14.1 with zfs-on-root using qemu
MIT License
19 stars 7 forks source link

Need a list of commands in provider rescue console #5

Closed bretton closed 2 years ago

bretton commented 2 years ago

The depenguinme.sh script can only work with the binaries that exist in the linux rescue environment, or with statically-compiled binaries that are downloaded.

It would be useful to have a list of binaries available /bin and /usr/bin and /usr/sbin etc from a rescue console such as Hetzner.

For example: Is it possible to create an ISO file in the rescue system? Does mkisofs exist by default or do we need a statically-compiled copy?

grembo commented 2 years ago

I can look into this soonish (just need to reboot one of the machines…).

Depending on available memory on servers, using apt-get install could also be an option, at least for smaller tools. Ideally, users won’t have to download any binaries from untrusted locations.

bretton commented 2 years ago

Cool beans, specifically need the following available, possibly others:

grembo commented 2 years ago

PX62 server:

root@rescue ~ # df -h
Filesystem                    Size  Used Avail Use% Mounted on
udev                           32G     0   32G   0% /dev
[2a01:4ff:ff00::b007:1]:/nfs 1007G  551G  406G  58% /root/.oldroot/nfs
overlay                        32G  8.2M   32G   1% /
tmpfs                          32G     0   32G   0% /dev/shm
tmpfs                          13G  868K   13G   1% /run
tmpfs                         5.0M     0  5.0M   0% /run/lock
tmpfs                         6.3G     0  6.3G   0% /run/user/0

genisoimage and mkisofs (both part of the same package) are not installed by default, but installing them with apt-get is no problem at all, only require 1.6MB.

# apt-get install mkisofs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'genisoimage' instead of 'mkisofs'
Suggested packages:
  wodim cdrkit-doc
The following NEW packages will be installed:
  genisoimage
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 380 kB of archives.
After this operation, 1692 kB of additional disk space will be used.
Get:1 http://mirror.hetzner.com/debian/packages bullseye/main amd64 genisoimage amd64 9:1.1.11-3.2 [380 kB]
Fetched 380 kB in 0s (34.0 MB/s)    
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package genisoimage.
(Reading database ... 62163 files and directories currently installed.)
Preparing to unpack .../genisoimage_9%3a1.1.11-3.2_amd64.deb ...
Unpacking genisoimage (9:1.1.11-3.2) ...
Setting up genisoimage (9:1.1.11-3.2) ...
Processing triggers for man-db (2.9.4-2) ...

Also, after running apt-get update once, I could also install qemu easily, it only required an additional 100kb:

# apt-get install qemu
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  qemu
0 upgraded, 1 newly installed, 0 to remove and 107 not upgraded.
Need to get 71.0 kB of archives.
After this operation, 99.3 kB of additional disk space will be used.
Get:1 http://mirror.hetzner.com/debian/packages bullseye/main amd64 qemu amd64 1:5.2+dfsg-11+deb11u2 [71.0 kB]
Fetched 71.0 kB in 0s (4077 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package qemu.
(Reading database ... 62187 files and directories currently installed.)
Preparing to unpack .../qemu_1%3a5.2+dfsg-11+deb11u2_amd64.deb ...
Unpacking qemu (1:5.2+dfsg-11+deb11u2) ...
Setting up qemu (1:5.2+dfsg-11+deb11u2) ...

You can find the full file list (right after booting) here: https://people.freebsd.org/~grembo/filelist.txt.bz2

Based on these results, I would suggest to simply apt-get install the required bits (at least by default), as this would make sure that they come from an authoritative source (debian or hetzner repos) and are recent. Don't forget to run apt-get update once though.

bretton commented 2 years ago

Thanks! I've include the apt-get update and apt-get install mkisofs but not the qemu one yet.

I'm using custom uefi.bin for bios as per original posts in forums, and it will need testing to see if it works on Hetzner hosts with qemu from packages.

grembo commented 2 years ago

I think this can be closed now