Translating...
This commit is contained in:
parent
8e886174c1
commit
b8824774ce
|
@ -0,0 +1,90 @@
|
|||
Date: 2023-01-13 09:33:00
|
||||
Lang: en
|
||||
Slug: black-screen-at-boot-on-my-pinephone
|
||||
Summary: My phone was no longer booting…
|
||||
Title: Black screen at boot on my PinePhone
|
||||
|
||||
OK so today my [PinePhone](https://fr.wikipedia.org/wiki/PinePhone)
|
||||
does no longer boot, it goes like this:
|
||||
|
||||
- Press power button to boot it,
|
||||
- type rootfs passphrase (I use full disk encryption),
|
||||
- Mobian "spash screen" for a short time,
|
||||
- black screen, and that's it.
|
||||
|
||||
My first bet was a graphical issue due to a recent upgrade ("sweet"
|
||||
memories of Ubuntu failing to start its X server after almost any
|
||||
upgrade...) so I try to ssh to it first... "no route to host", damned!
|
||||
It don't have its IP yet so it failed before network setup.
|
||||
|
||||
But it's a PinePhone, and it runs
|
||||
[Mobian](https://mobian-project.org/), a Debian for mobiles, so I'm
|
||||
not in the dark, let's read the boot logs first before going down the
|
||||
rabbit hole of connecting a UART on the jack port to debug it over
|
||||
serial:
|
||||
|
||||
- Press power button,
|
||||
- type rootfs passphrase again,
|
||||
- press a volume button to get rid of the Mobian splash to see logs
|
||||
|
||||
```text
|
||||
The root filesystem on /dev/mapper/calamares_crypt requires a manual fsck
|
||||
```
|
||||
|
||||
OK!
|
||||
|
||||
Looks easy, but without a keyboard? Let's mount the
|
||||
[eMMC](https://en.wikipedia.org/wiki/MultiMediaCard#eMMC) over USB!
|
||||
|
||||
As my phone boots using [Tow-Boot](https://tow-boot.org/) it's easy:
|
||||
|
||||
- Shut it down (~8s on the power button).
|
||||
- Plug it to laptop with a USB-C cable.
|
||||
- Make it enter "USB Mass Storage mode" (by holding the
|
||||
volume up button at startup before and during the second
|
||||
vibration).
|
||||
- Instantly my laptop sees it and udisks auto mounts it, gnome asks
|
||||
for main partition passphrase to mount it too, nice!
|
||||
- Boom, it disappears... and on `journalctl -e` I see `usb 1-5: device
|
||||
descriptor read/64, error -71` ... `I/O error, dev sda` ...
|
||||
|
||||
At this point I think there's just two options: either my USB-C cable
|
||||
was badly plugged, or my eMMC is dead. I vote for the USB-C cable
|
||||
issue and try again.
|
||||
|
||||
- Rebooting phone in USB mass storage mode again, but this time
|
||||
without giving my passphrase to avoid automount: it
|
||||
needs an fsck anyway.
|
||||
- I can browse `/media/mdk/boot` and see no read error in `sudo journalctl -f`.
|
||||
- `sudo fdisk -l /dev/sda` sees ~30GiB and both partitions.
|
||||
|
||||
|
||||
I use encryption so to fsck the root partition, I have to use `cryptsetup` first:
|
||||
|
||||
```bash
|
||||
$ sudo cryptsetup open /dev/sda2 mobian # it asks for my passphrase
|
||||
$ file /dev/mapper/mobian # That's the unencrypted view of my partition
|
||||
/dev/mapper/mobian: symbolic link to ../dm-0
|
||||
$ sudo fdisk -l /dev/mapper/mobian # Just out of curiosity
|
||||
Disk /dev/mapper/mobian : 28.47 GiB, 30574379008 octets, 59715584 secteurs
|
||||
$ sudo fsck /dev/mapper/mobian # Running fsck manually!
|
||||
fsck from util-linux 2.38.1
|
||||
e2fsck 1.46.6-rc1 (12-Sep-2022)
|
||||
root contains a file system with errors, check forced.
|
||||
[many many errors]
|
||||
$ sudo mount /dev/mapper/mobian /mnt # To check if it works
|
||||
$ ls /mnt # Yeah!
|
||||
bin boot dev etc home lib lost+found media mnt opt proc root run sbin srv sys tmp usr var
|
||||
$ sudo umount /mnt
|
||||
$ sudo cryptsetup close mobian
|
||||
```
|
||||
|
||||
It looks OK, let's reboot the phone...
|
||||
|
||||
It works!!!
|
||||
|
||||
I know, your grandma would not be able to do fix it that way (mine
|
||||
neither), but I'm still very happy to be able to fix my phone myself
|
||||
when it has issues.
|
||||
|
||||
What would people do when a phone does no longer boot? Buy another?
|
|
@ -1,90 +1,92 @@
|
|||
---
|
||||
Title: Black screen at boot on my PinePhone
|
||||
Date: 2023-01-13 09:33:00
|
||||
Summary: My phone was no longer booting…
|
||||
---
|
||||
Lang: fr
|
||||
Slug: black-screen-at-boot-on-my-pinephone
|
||||
Summary: OK, aujourd’hui mon [PinePhone](https://fr.wikipedia.org/wiki/PinePhone) ne boot plus.
|
||||
Title: Écran noir au démarrage de mon PinePhone
|
||||
|
||||
OK so today my [PinePhone](https://fr.wikipedia.org/wiki/PinePhone)
|
||||
does no longer boot, it goes like this:
|
||||
OK, aujourd’hui mon [PinePhone](https://fr.wikipedia.org/wiki/PinePhone)
|
||||
ne boot plus. Ça me fait ça :
|
||||
|
||||
- Press power button to boot it,
|
||||
- type rootfs passphrase (I use full disk encryption),
|
||||
- Mobian "spash screen" for a short time,
|
||||
- black screen, and that's it.
|
||||
- J’appuie sur le bouton pour le démarrer,
|
||||
- je lui donne la passephrase pour déchiffrer la partition,
|
||||
- J’ai le joli logo « Mobian » pendant quelques instants,
|
||||
- Et boom, écran noir, terminé.
|
||||
|
||||
My first bet was a graphical issue due to a recent upgrade ("sweet"
|
||||
memories of Ubuntu failing to start its X server after almost any
|
||||
upgrade...) so I try to ssh to it first... "no route to host", damned!
|
||||
It don't have its IP yet so it failed before network setup.
|
||||
Je parie d’abord que c’est un problème graphique dû à une mise à jour
|
||||
récente. Ça me rappelle l’époque où j’ai cru bon de mettre une Ubuntu
|
||||
sur la machine de ma maman : à chaque mise à jour le serveur X ne
|
||||
démarrait plus. Vous vous souvenez de la blague « C’est quoi un Ubuntu
|
||||
Server ? C’est un Ubuntu Desktop avec le serveur X qui ne démarre
|
||||
pas ! » ?
|
||||
|
||||
But it's a PinePhone, and it runs
|
||||
[Mobian](https://mobian-project.org/), a Debian for mobiles, so I'm
|
||||
not in the dark, let's read the boot logs first before going down the
|
||||
rabbit hole of connecting a UART on the jack port to debug it over
|
||||
serial:
|
||||
Si mon pari est bon, j’ai juste à me `ssh`… « `no route to host` », damned !
|
||||
|
||||
- Press power button,
|
||||
- type rootfs passphrase again,
|
||||
- press a volume button to get rid of the Mobian splash to see logs
|
||||
Donc il plante **avant** d’avoir configuré son interface réseau.
|
||||
|
||||
Mais c’est un PinePhone, avec [Mobian](https://mobian-project.org/)
|
||||
(une Debian avec deux-trois patch pour mobiles), donc je sais que je
|
||||
vais m’en sortir, commencons simplement par lire les logs avant de
|
||||
suivre le lapin blanc et de plonger au fond du terrier de
|
||||
l’UART-over-jack…
|
||||
|
||||
- J’appuie sur le bouton « power » pour le démarrer,
|
||||
- je lui donne sa passephrase à nouveau,
|
||||
- et j’appuie sur un bouton de « volume » : comme sur une Debian, l’appui d’une touche chasse le « splash screen » et laisse lire les logs :
|
||||
|
||||
```text
|
||||
The root filesystem on /dev/mapper/calamares_crypt requires a manual fsck
|
||||
```
|
||||
|
||||
OK!
|
||||
OK ! Facile. Mais sans clavier ?
|
||||
|
||||
Looks easy, but without a keyboard? Let's mount the
|
||||
[eMMC](https://en.wikipedia.org/wiki/MultiMediaCard#eMMC) over USB!
|
||||
C’est le moment de monter l’[eMMC](https://en.wikipedia.org/wiki/MultiMediaCard#eMMC) via USB !
|
||||
|
||||
As my phone boots using [Tow-Boot](https://tow-boot.org/) it's easy:
|
||||
Mon téléphone démarre avec [Tow-Boot](https://tow-boot.org/), exposer la MMC via USB c’est facile :
|
||||
|
||||
- Shut it down (~8s on the power button).
|
||||
- Plug it to laptop with a USB-C cable.
|
||||
- Make it enter "USB Mass Storage mode" (by holding the
|
||||
volume up button at startup before and during the second
|
||||
vibration).
|
||||
- Instantly my laptop sees it and udisks auto mounts it, gnome asks
|
||||
for main partition passphrase to mount it too, nice!
|
||||
- Boom, it disappears... and on `journalctl -e` I see `usb 1-5: device
|
||||
descriptor read/64, error -71` ... `I/O error, dev sda` ...
|
||||
- Je l’éteins (~8s sur le bouton power).
|
||||
- Je le branche à mon ordinateur portable avec un câble USB-C.
|
||||
- Je le démarre en mode « USB Mass Storage » (en maintenant « volume up » enfoncé au démarrage jusqu’à la 2 vibration).
|
||||
- Instantanément mon ordinateur portable détecte un nouveau périphérique USB, `udisks` veut le monter, `Gnome` me demande la passephrase, `udisks` monte les deux partitions : que j’aime quand tout roule !
|
||||
- Boom, tout disparaît. Un coup d’œil à `journalctl -e` : `usb 1-5: device
|
||||
descriptor read/64, error -71` ... `I/O error, dev sda`…
|
||||
|
||||
At this point I think there's just two options: either my USB-C cable
|
||||
was badly plugged, or my eMMC is dead. I vote for the USB-C cable
|
||||
issue and try again.
|
||||
Donc là soit mon câble USB-C est mal branché ou mal en point, soit ma
|
||||
MMC est morte. Je vais parier pour le câble (c’est plus facile à résoudre).
|
||||
|
||||
- Rebooting phone in USB mass storage mode again, but this time
|
||||
without giving my passphrase to avoid automount: it
|
||||
needs an fsck anyway.
|
||||
- I can browse `/media/mdk/boot` and see no read error in `sudo journalctl -f`.
|
||||
- `sudo fdisk -l /dev/sda` sees ~30GiB and both partitions.
|
||||
- Redémarrage du téléphonne en mode « USB Mass Storage »
|
||||
- Je ne donne pas la passephrase à Gnome cette fois, de toutes façons on a besoin de lui passer un `fsck`, pas de le monter.
|
||||
- Un petit `ls` dans `/media/mdk/boot`, pas de `read error` dans `sudo journalctl -f`, rassurant.
|
||||
- `sudo fdisk -l /dev/sda` m’annonce ~30GiB et les deux paritions, rassurant.
|
||||
|
||||
|
||||
I use encryption so to fsck the root partition, I have to use `cryptsetup` first:
|
||||
Vu que la partition est chiffrée j’ai besoin de la déchiffrer (sans la
|
||||
monter) **avant** de passer le **fsck**, à coup de `cryptsetup` :
|
||||
|
||||
```bash
|
||||
$ sudo cryptsetup open /dev/sda2 mobian # it asks for my passphrase
|
||||
$ file /dev/mapper/mobian # That's the unencrypted view of my partition
|
||||
$ sudo cryptsetup open /dev/sda2 mobian # ça me demande ma passphrase
|
||||
$ file /dev/mapper/mobian # Ça c’est la « vue » déchiffrée de la partition
|
||||
/dev/mapper/mobian: symbolic link to ../dm-0
|
||||
$ sudo fdisk -l /dev/mapper/mobian # Just out of curiosity
|
||||
$ sudo fdisk -l /dev/mapper/mobian # Je suis curieux, et j’ai besoin d’être rassuré
|
||||
Disk /dev/mapper/mobian : 28.47 GiB, 30574379008 octets, 59715584 secteurs
|
||||
$ sudo fsck /dev/mapper/mobian # Running fsck manually!
|
||||
$ sudo fsck /dev/mapper/mobian # On m’a dit d’exécuter `fsck` manuellement, je le fais.
|
||||
fsck from util-linux 2.38.1
|
||||
e2fsck 1.46.6-rc1 (12-Sep-2022)
|
||||
root contains a file system with errors, check forced.
|
||||
[many many errors]
|
||||
$ sudo mount /dev/mapper/mobian /mnt # To check if it works
|
||||
$ ls /mnt # Yeah!
|
||||
[plein plein plein d’erreurs]
|
||||
$ sudo mount /dev/mapper/mobian /mnt # Juste pour me rassurer
|
||||
$ ls /mnt # Youpi !
|
||||
bin boot dev etc home lib lost+found media mnt opt proc root run sbin srv sys tmp usr var
|
||||
$ sudo umount /mnt
|
||||
$ sudo cryptsetup close mobian
|
||||
```
|
||||
|
||||
It looks OK, let's reboot the phone...
|
||||
Ça me semble bon, je reboot le téléphone…
|
||||
|
||||
It works!!!
|
||||
Ça marche !!!
|
||||
|
||||
I know, your grandma would not be able to do fix it that way (mine
|
||||
neither), but I'm still very happy to be able to fix my phone myself
|
||||
when it has issues.
|
||||
Je sais, je sais, ta grand-mère n’aurait pas sû réparer le sien (ma
|
||||
grand-mère non plus), mais je reste très satisfait d’être capable de
|
||||
réparer le mien moi-même : c’est une bonne première étape.
|
||||
|
||||
What would people do when a phone does no longer boot? Buy another?
|
||||
Si j’avais eu un téléphonne d’un GAFA, quelles auraient été mes
|
||||
solutions ? En acheter un autre.
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
Date: 2023-01-17 15:41:00
|
||||
Lang: en
|
||||
Slug: python-avance
|
||||
Title: Advanced Python
|
||||
|
||||
That's the last of my two Python trainings. While the [introduction
|
||||
training]({filename}/pages/python-initiation.md) covers using classes
|
||||
and libraries to create simple programs, this training focuses on the
|
||||
art of creating classes and libraries to build reusable chunks in
|
||||
arbitrary complex software.
|
||||
|
||||
|
||||
## Goals
|
||||
|
||||
At the end of this training, one is able to produce *readable*,
|
||||
*maintainable*, and *tested* code on any kind of project.
|
||||
|
||||
Focus is set on sharing and reusing code:
|
||||
|
||||
- Creating libraries (modules, packages).
|
||||
- Packaging and distributing libraries.
|
||||
- Managing dependencies in libraries and in projects.
|
||||
- Tests and documentation.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The pre-requisite to follow this training is either to have followed
|
||||
the [Python Introduction]({filename}/pages/python-initiation.md) one,
|
||||
or have an equivalent level, that is: be able to read and modify
|
||||
Python code, be able to write Python code to solve a given problem
|
||||
from scratch.
|
||||
|
||||
## Content
|
||||
|
||||
- Python protocols (iteration protocol, any "dunder", …).
|
||||
- Classes and their instances (where we speak about the MRO and `super()`).
|
||||
- The descriptor protocol.
|
||||
- The *garbage collector*.
|
||||
- IEEE 754 *floats*, knowing their limits.
|
||||
- Create, raise, and handle exception. `try`'s `else` and `finally`.
|
||||
- Context managers.
|
||||
- Decorators.
|
||||
- List comprehensions.
|
||||
- The Walrus Operator (`:=`).
|
||||
- String encodings.
|
||||
- Packaging using `pyproject.toml`, `python -m build`, `twine`, …
|
||||
- Asynchronous Python with `async` and `await`.
|
||||
|
||||
|
||||
## Duration
|
||||
|
||||
This training best spam over five days, but I'm acustomed to give a 3 day version of it too.
|
||||
|
||||
|
||||
## Contact
|
||||
|
||||
To know more, please shoot me an email at [julien@palard.fr](mailto:julien@palard.fr).
|
|
@ -1,5 +1,7 @@
|
|||
Title: Python avancé
|
||||
Date: 2023-01-17 15:41:00
|
||||
Lang: fr
|
||||
Slug: python-avance
|
||||
Title: Python avancé
|
||||
|
||||
C’est la seconde de mes deux formations Python. Alors que la
|
||||
[formation *initiation*]({filename}/pages/python-initiation.md)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Title: Python introduction
|
||||
Slug: python-initiation
|
||||
Date: 2023-01-17 15:41:00
|
||||
Lang: en
|
||||
Slug: python-initiation
|
||||
Title: Python introduction
|
||||
|
||||
This is the first one of my two Python trainings, it has no prerequisites.
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ I18N_SUBSITES = {
|
|||
'LOCALE': 'en_US',
|
||||
'THEME_STATIC_DIR': '../theme',
|
||||
'MENUITEMS': (
|
||||
("Trainings", "/pages/formations.html"),
|
||||
("Talks", "/pages/talks.html"),
|
||||
("Articles", "/blog/"),
|
||||
("Trainings", "/en/pages/formations.html"),
|
||||
("Talks", "/en/pages/talks.html"),
|
||||
("Articles", "/en/blog/"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue