The officially official Devuan Forum!

You are not logged in.

#1 2019-07-19 15:56:48

nemo76
Member
Registered: 2019-07-13
Posts: 7  

Serial console install

Hi All,
        I plan to install Devuan on an APU machine from PC Engines
(https://www.pcengines.ch). This is a quite classical PC except
that it has no graphic card and no keyboard. It works only with a serial console.

A lot of linux run on it, but I have no idea how I can install
devuan by using a serial console. I have looked on most CD (live ISO, netinst  and minimal)
without finding a grub menu entry for booting with a serial console.

I suppose I should pass the commands manually at the grub prompt.

If anyone could give me some hints, this will be very helpful for me.

Thanks,

nemo76

Offline

#2 2019-07-19 17:34:37

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: Serial console install

https://a.custura.eu/post/debian-via-serial-console/

Next time ask a search engine, it will be quicker smile


Brianna Ghey — Rest In Power

Offline

#3 2019-07-19 19:06:18

nemo76
Member
Registered: 2019-07-13
Posts: 7  

Re: Serial console install

Hello,

Thanks for the tip. I have googled but with "Devuan" instead of "Debian". Soon
after my post, I have found this page https://teklager.se/en/knowledge-base/i … apu-board/
which was helpful. I have forgotten how Devuan is near (at least on some features)
of the Debian distribution.

Unfortunately, by using the netinst image it is not possible to have the
directory "/boot" and the rest of the system on the same encrypted partition.
At least not automatically.

I would appreciate some pointers on how to do that manually (the installer provided
with the "desktop-live" image permit to have only one encrypted partition
but without giving indications on how this is achieved).

Is it possible to have only one encrypted partition with the image "minimal-live"?
I haven't yet tried it and I don't know if it is possible to add the required instructions
to the grub entry and if it allows only one encrypted partition.

Thanks for your help,

Best regards,

Nemo76

Offline

#4 2019-07-20 09:31:56

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: Serial console install

nemo76 wrote:

Unfortunately, by using the netinst image it is not possible to have the
directory "/boot" and the rest of the system on the same encrypted partition.
At least not automatically.

I would appreciate some pointers on how to do that manually (the installer provided
with the "desktop-live" image permit to have only one encrypted partition
but without giving indications on how this is achieved).

Section 6.3.4.6 of the official Debian installation guide might help. Devuan uses the same installer so the information should apply.

EDIT: s/6.3.3.6/6.3.4.6/

Last edited by Head_on_a_Stick (2019-07-20 18:12:07)


Brianna Ghey — Rest In Power

Offline

#5 2019-07-20 11:01:22

nemo76
Member
Registered: 2019-07-13
Posts: 7  

Re: Serial console install

I have made some progress by trying the image "minimal-live". Without too much success.

After editing the grub entry to add "console=ttyS0,115200n8" the system start booting but
after the start of the openssh server  just hangs.

Before hanging, 3 strange sounds are emited by the APU (which has no speaker!).

I have tried the grub entry "std" and "access to ram" with the same effect and
the entry which disable the different probes. With these latter the system hangs but elsewhere in the boot process.

Offline

#6 2019-07-20 12:02:29

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,251  

Re: Serial console install

Have you tried with init=/bin/sh as boot parameter? That parameter might give you a shell prompt instead of the normal boot process, but subsequent to the initrd set up. And it might not. I'm afraid it's some few decades since I toyed at that level, so don't expect miracles.

If it brings you that far, you should enable getty on the serial console by appending the line

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

to /etc/inittab in the root file system (not the initrd file system), which you need to mount first. Then reboot without the init=...

Offline

#7 2019-07-20 16:11:03

nemo76
Member
Registered: 2019-07-13
Posts: 7  

Re: Serial console install

I have tried the instruction

init=/bin/sh

but the system does not boot.
Anyway, I think this is not very useful, since the file system on the USB stick is in format
squashfs (a read-only compressed file system). It is impossible to modify it without rebuilding it.

I think the only one solution is "netinst" image. It would be interesting however
if the "minimal-live" image had the possibility to boot over serial line.

In order to have only one encrypted partition, one has to work with the "netinst" image
and do the job manually. It is doubtful if this is really interesting since typing
the passphrase at each boot is certainly not usable. Perhaps by using
a special GPG key to unlock the partition, full disk encryption is practical.

The interest to have a such solution is that, if the disk is broken, it can be replaced
without worrying about to erase it (which is often impossible if the disk is broken).

Contrary to what is suggested in a previous post, the Debian installation manual
is not very helpful. It states explicitely that it is impossible to have
"/boot" and the rest of the system on a single encrypted partition.

Offline

#8 2019-07-20 18:14:26

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: Serial console install

nemo76 wrote:

After editing the grub entry to add "console=ttyS0,115200n8" the system start booting but
after the start of the openssh server  just hangs.

Try not specifying the baud rate, let it auto-select.

nemo76 wrote:

Contrary to what is suggested in a previous post, the Debian installation manual
is not very helpful. It states explicitely that it is impossible to have
"/boot" and the rest of the system on a single encrypted partition.

Still having trouble using a search engine, eh?

Here, let me get my feeding spoon out:

https://libreboot.org/docs/gnulinux/enc … ebian.html


Brianna Ghey — Rest In Power

Offline

#9 2019-07-20 22:07:38

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,251  

Re: Serial console install

but the system does not boot.
Anyway, I think this is not very useful, since the file system on the USB stick is in format
squashfs (a read-only compressed file system). It is impossible to modify it without rebuilding it.

Well, I think it boots the first stage, and enters a shell prompt instead of booting the second stage, but after "pivot_root", and having "/" overlayed by a tmpfs. Therefore /etc/inittab is editable, although whatever you do to it is not persistent.

In other words, the steps are as follows. First use the advice by @Head_on_a_Stick to get serial boot console, plus the init=/bin/sh parameter to get a shell after first stage boot:

console=ttyS0 init=/bin/sh

Then modify /etc/inittab (non-persistently) for an autologin on the serial line:

# echo "T0:23:respawn:/sbin/getty -a root ttyS0 vt100" >> /etc/inittab

And then, enter second stage init:

# exec /sbin/init

Obviously you'll need to do all that every time you boot, until you get persistence set up.

Offline

#10 2019-07-20 23:23:04

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: Serial console install

ralph.ronnquist wrote:

Obviously you'll need to do all that every time you boot, until you get persistence set up.

That's true only for booting from usb. The changes to inittab will be present in the running  system. Since this is a live iso that uses refractainstaller, those changes will be copied to the hard drive (or SD card?) during installation and be persistent.

You might want to look at these before you run the installer. The install guide is for the graphical installer, but the cli installer is similar. Instead of getting lists of partitions to select from, you type in the partition (like /dev/sda1 or /dev/mmcblk0p1).

https://devuan.org/os/documentation/ins … e-gui.html
https://refracta.org/docs/readme.refractainstaller.txt

Offline

#11 2019-07-22 18:58:17

nemo76
Member
Registered: 2019-07-13
Posts: 7  

Re: Serial console install

Hi all,
         With all your explanations I am able to boot with the minimal image and to
install the system in a very similar way as with the graphical install.

My last problem is that the grub entry is incorrectly generated.
Grub is starting now in text mode after I have corrected the file "/etc/default/grub" to allow serial
console for grub. Unfortunately I am not able to start the Linux
kernel in text mode.

Setting GRUB_CMDLINE_LINUX="console=ttyS0,115200n8" is not enough to switch
the loading of the kernel in text mode.

I will do further research and keep you informed of the results. Anyway, if you
have some new ideas, I will be very happy. It's a little painful to start again and again
the system on the USB stick to correct the installed system.

best regards

Offline

#12 2019-07-23 00:43:30

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: Serial console install

If you're getting a grub prompt instead of a normal boot menu, the easiest thing to do is use that command line to boot the installed system. Then you can run update-grub to generate a new boot menu.

grub prompt looks like this:

grub>

If you iinstalled the system on /dev/sda1, you would use the following commands:

set root=(hd0,msdos1)
linux /vmlinux ro root=/dev/sda1
initrd /initrd.img
boot

Note: it's possible your computer will see the usb as the first drive. In that case, (hd0,msdos1) would need to be changed to (hd1,msdos1). You can use tab-completion to figure it out. Type set root=(hd0 and press TAB (maybe twice) and it will show you the partitions on that drive.

Once you've booted the system run update-grub

Offline

Board footer