Received: from lucy.icvn.de (lucy.icvn.de [185.190.70.70]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id B57C1782B97 for <~alpine/devel@lists.alpinelinux.org>; Tue, 28 Jan 2020 10:05:22 +0000 (UTC) Received: by lucy.icvn.de (Postfix, from userid 1000) id D80C4210A2; Tue, 28 Jan 2020 10:05:21 +0000 (UTC) Date: Tue, 28 Jan 2020 10:05:21 +0000 From: Nero To: ~alpine/devel@lists.alpinelinux.org Subject: Re: WIP: trying to add consolefont in mkinitfs Message-ID: <20200128100521.GA12136@lucy.icvn.de> References: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Jan 28, 2020 at 10:23:48AM +0100, David Demelier wrote: > Hello all, >=20 > I'm trying to create an additional features for mkinitfs, including setfo= nt > + console fonts. >=20 > Why? Because on some laptops with high dpi screens, the initramfs may ask > passphrase for cryptsetup or show an emergency shell. On my laptop this is > barely usable by default. >=20 > Thus, I've created a /etc/mkinitfs/features.d/consolefont with >=20 > /etc/conf.d/consolefont > /usr/sbin/setfont > /usr/share/consolefonts/*.psf.gz >=20 > Then, updated initramfs-init just before the first message [0] >=20 > --- initramfs-init.orig > +++ initramfs-init > @@ -353,6 +353,7 @@ > done > done >=20 > +# Just for testing yet. > +setfont /usr/share/consolefonts/ter-224n.psf.gz > [ "$KOPT_quiet" =3D yes ] || echo "Alpine Init $VERSION" >=20 > # enable debugging if requested >=20 > I've enabled consolefont in my mkinitfs.conf and rebooted. >=20 > At boot setfont complained that /dev/tty does not exist even though print= ing > on the screen does not work and cryptsetup asks the passphrase so... I'm > unable to understand how can I achieve this. Is it possible to create a > /dev/tty node? Should mdev be enabled earlier? >=20 > [0]: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n355 >=20 > Any help is welcomed. The stdio of the /init script in the initramfs is connected to /dev/console, which does not have all of the functionality a usual tty is expected to hav= e. Internally, /dev/console is wired to output on all tty devices that are specified via the console=3D kernel boot parameter. Despite this, the /dev/tty should be available from the devtmpfs. Maybe it might help to insert /bin/sh into the initramfs script to start an interactive shell and poke around manually with `setfont`. Having `strace` in the initramfs might be handy there. Also, maybe its worth trying with /dev/tty0 (current virtual console). Sett= ing the font is an operation that only applies to the linux virtual consoles. /dev/tty (current console) might end up pointing to some serial line. -- Nero --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEyYZWtVKjfO1xLiGkseQkGYqJnGgFAl4wB14ACgkQseQkGYqJ nGjDCQf+K2RQJY1Jkh3Uy1uQ1yMTnGRI3Vy3NUx8JqEGktV6Q1cHMF0Dtb8TOt+o KyKkXdduvSvfjIhGg204+1lNQj8rTXn6nMdFExkEgJ/1G+nJOXZi4pqNkI6l4jl2 DgYlfaWbmkGLJjSx6KhvVahLFHTorfJscn0B9UbXhB90+cO+Tdl7XQgQwiCOC2gO pp3daxSCF7MpKgGWg3MKaoMnsyCKuj4Gq40FpJp19PCZJl4fOpODOMTY0ZNge/kS 5k5rt/cqopou1c0Pj372uhZeY7oHmlkDaaB+9GOSDXXHOjmjzDs2Sq4e8XxCEufO ZCD1JjY065Xig8OmnqUpO5QbiS42Vw== =d4mY -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+--