issue154:certifie_linux
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue154:certifie_linux [2020/03/15 11:47] – auntiee | issue154:certifie_linux [2020/03/16 15:13] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 10: | Ligne 10: | ||
PUISQU' | PUISQU' | ||
- | Celui-ci sera notre dernier regard aux prérequis d'une certification. La dernière fois, nous avons examiné des astuces pour la compilation du noyau. Cette fois-ci, ce sera la gestion runtime du noyau et la résolution des problèmes. Le noyau de base Linux a parfois besoin d'un peu d'aide et c'est là où les LKM (loadable kernel modules ou modules chargeables du noyau) entrent en scène. Comme leur nom le suggère, ces modules sont chargés dans le noyau lorsque cela est nécessaire. Ainsi, quand le noyau démarre, ils n' | + | Celui-ci sera notre dernier regard aux prérequis d'une certification. La dernière fois, nous avons examiné des astuces pour la compilation du noyau. Cette fois-ci, ce sera la gestion |
- | Alors, quand est la dernière fois où vous avez regardé dans le dossier / | + | Alors, quand est-ce la dernière fois où vous avez regardé dans le dossier / |
**Now some people will say kernel objects. The extension is “.ko” after all. Just be aware of this, but do not get hung up on terminology. If you need to add a pre-compiled kernel object, you need to be aware of the dependencies. That is number 1. Your system also needs to know these things. Our lives are, however, simplified by a nifty tool named depmod (module dependencies). Now, if you look at the man page for depmod, under description, | **Now some people will say kernel objects. The extension is “.ko” after all. Just be aware of this, but do not get hung up on terminology. If you need to add a pre-compiled kernel object, you need to be aware of the dependencies. That is number 1. Your system also needs to know these things. Our lives are, however, simplified by a nifty tool named depmod (module dependencies). Now, if you look at the man page for depmod, under description, | ||
Ligne 18: | Ligne 18: | ||
You should see a whole bunch of .ko-files. This is all the detected modules on the system. You may need to scroll back a bit to see some kernel modules with a colon after them and more kernel modules after that. Like Windows services that depend on another service, this is how you find out which kernel module depends on which other kernel module. Anything BEFORE the colon depends on the listed modules AFTER the colon (very easy once you know it). Just like Windows services, multiple modules may depend on one module and vice-versa. You can do this on a modern release of Ubuntu, you do not need to be in your CentOS 5 VM. However, in your Ubuntu workstation, | You should see a whole bunch of .ko-files. This is all the detected modules on the system. You may need to scroll back a bit to see some kernel modules with a colon after them and more kernel modules after that. Like Windows services that depend on another service, this is how you find out which kernel module depends on which other kernel module. Anything BEFORE the colon depends on the listed modules AFTER the colon (very easy once you know it). Just like Windows services, multiple modules may depend on one module and vice-versa. You can do this on a modern release of Ubuntu, you do not need to be in your CentOS 5 VM. However, in your Ubuntu workstation, | ||
- | Certaines personnes diront kernel objects. Après tout, l' | + | Certaines personnes diront kernel objects. Après tout, l' |
- | Vous devriez voir une voule de fichiers .ko. Ce sont tous les modules détectés sur le système. Vous devriez | + | Vous devriez voir une foule de fichiers .ko. Ce sont tous les modules détectés sur le système. Vous devrez |
- | So how do we add or remove modules then? Why would we even want to remove any loadable kernel modules? Well, for one, it frees up memory. IOT is the current buzzword and usually IOT devices are spec’ed very low. But before we start removing modules, how about we look at them first? To list the currently installed modules, we remember back to LPIC level one and use the lsmod command. When you run the lsmod command, translate “used by” to “dependent on”, in your mind. That way you will know if a module can be removed safely or other modules or processes depend on it. It is a good idea to always check with lsmod, BEFORE using rmmod. | + | **So how do we add or remove modules then? Why would we even want to remove any loadable kernel modules? Well, for one, it frees up memory. IOT is the current buzzword and usually IOT devices are spec’ed very low. But before we start removing modules, how about we look at them first? To list the currently installed modules, we remember back to LPIC level one and use the lsmod command. When you run the lsmod command, translate “used by” to “dependent on”, in your mind. That way you will know if a module can be removed safely or other modules or processes depend on it. It is a good idea to always check with lsmod, BEFORE using rmmod. |
- | This is especially true when using the -f switch, not that I ever advise you to use the -f switch. Now, if you have read the chapter in the book, you will know we have lsmod, rmmod and insmod. (yes, I know, but we are getting to it). Think of insmod as the dumb one. When you use insmod, you need the full path of where the particular module is. So we also need to know about modprobe and modinfo. Instead of telling you to peruse the manpages on this, I am going to suggest that you try bropages or cheat or even TL;DR. The modinfo command will list what you need to know about that particular module. | + | This is especially true when using the -f switch, not that I ever advise you to use the -f switch. Now, if you have read the chapter in the book, you will know we have lsmod, rmmod and insmod. (yes, I know, but we are getting to it). Think of insmod as the dumb one. When you use insmod, you need the full path of where the particular module is. So we also need to know about modprobe and modinfo. Instead of telling you to peruse the manpages on this, I am going to suggest that you try bropages or cheat or even TL;DR. The modinfo command will list what you need to know about that particular module. |
- | For example type: modinfo psmouse | + | Alors comment ajouter ou enlever des modules ? De toute façon, pourquoi voudrions-nous enlever quelque module chargeable du noyau que ce soit ? Une raison est que cela libère de la mémoire. Le mot à la mode est actuellement IOT (Internet of Things, ou Objets connectés) et généralement les dispositifs IOT ont des spécifications minimes. Mais avant de commencer à enlever des modules, regardons-les d' |
- | The “filename” lists the full path for your pleasure. That license macro I mentioned earlier should be next, telling you what you can do with said module. This is very handy when you work with say, a libre-only distribution. Notice “depends”, as this is the module it would depend on, so you may need to install a module before this one, if it was not installed. So if you wanted to add the psmouse | + | C'est particulièrement vrai quand vous utilisez le commutateur -f ; mais je ne vous conseille jamais d' |
- | Know that modinfo and modprobe work the same way. That’s why I say you should think of modprobe as the smart one. Put a blonde wig on insmod, if you cannot remember which is which. A fun command is to type: modprobe sams_brain (If Sam was the slow kid in class) and you should get back: “module sams_brain not found.” Go ahead and add and remove the dummy file, so you can get used to the way of doing things. Add the dummy file with insmod as well as modprobe, then remove it with rmmod and with modprobe. (You need to know both ways for the LPIC-201 exam). | + | **For example |
- | One thing I skipped was the”parm” that you see in modinfo. This is actually parameters that you can specify | + | The “filename” lists the full path for your pleasure. That license macro I mentioned earlier should be next, telling |
- | There is obviously | + | Know that modinfo and modprobe work the same way. That’s why I say you should think of modprobe as the smart one. Put a blonde wig on insmod, if you cannot remember which is which. A fun command is to type: modprobe sams_brain (If Sam was the slow kid in class) and you should get back: “module sams_brain not found.” Go ahead and add and remove the dummy file, so you can get used to the way of doing things. Add the dummy file with insmod as well as modprobe, then remove it with rmmod and with modprobe. (You need to know both ways for the LPIC-201 exam).** |
+ | Par exemple, tapez : modinfo psmouse | ||
+ | « filename » vous donne le chemin entier ! Le macro de la licence, que j'ai mentionné plus tôt, devrait venir ensuite, vous détaillant ce que vous pouvez faire avec le dit module. Cela est très utile quand vous travaillez avec, disons, une distribution uniquement libre. Notez les « depends », car c'est le module dont il dépendrait ; aussi, vous devrez peut-être installer un autre module avant celui-ci, s'il n'est pas déjà installé. Ainsi, si vous voulez ajouter le module psmouse, vous devrez copier le chemin « file name » à partir de modinfo (le fichier.ko). | ||
+ | Sachez que modinfo et modprobe fonctionnent de la même façon. c'est pourquoi je vous conseille de penser à modprobe comme étant celui qui est intelligent. Si vous ne pouvez pas bien distinguer les deux, mettez une perruque blonde sur insmod [Ndt : serait-ce une remarque sexiste ?!]. Une commande amusante est de taper modprobe sams_brain (le cerveau de Sam, si Sam portait le bonnet d'âne dans votre classe) et vous devriez avoir comme résultat : « module sams_brain not found ». Allez-y, ajoutez et enlevez ce fichier bidon, pour que vous puissiez vous accoutumer à la façon de faire les choses. Ajoutez le fichier bidon avec insmod aussi bien qu' | ||
+ | **One thing I skipped was the”parm” that you see in modinfo. This is actually parameters that you can specify when loading a module. Now one of the tricks , if you roll your own kernel, is to tweak some of these values, like resolution: 800 , for instance. Which you can use to match the dpi of your mouse. However, this is not a constant value, as after the next boot, the parameters are gone. You need to make these constant / permanent in another way. Sometimes you need to blacklist a module, like Nvidia, for instance. You will find those configuration files in / | ||
+ | There is obviously a lot more here, but unless there is interest, next month we will start something new.** | ||
+ | Une chose que j'ai sautée était le « parm » visible dans modinfo. Il s'agit en fait des paramètres que vous pouvez spécifier quand vous chargez un module. Un des trucs que vous pouvez faire, si vous compilez votre propre noyau, est l' | ||
+ | IL y a, bien évidemment, | ||
- | + | **If you would like to jump ahead, or test your skills at an LPI exam, do a test paper here: https:// | |
- | + | ||
- | + | ||
- | If you would like to jump ahead, or test your skills at an LPI exam, do a test paper here: https:// | + | |
• The new exam number is 201-400, and 117-201 was the old one. | • The new exam number is 201-400, and 117-201 was the old one. | ||
• The site does require signing up, but sign up with temporary email – not your real email. | • The site does require signing up, but sign up with temporary email – not your real email. | ||
Ligne 53: | Ligne 57: | ||
Let us know how you did – good or bad, it does not matter. ‘Good’ means you are ready to write and confident in your skills. ‘Bad’ means you will be learning new stuff!! Yay! There is no downside here. If you do not know why an answer is the way it is, contact us. | Let us know how you did – good or bad, it does not matter. ‘Good’ means you are ready to write and confident in your skills. ‘Bad’ means you will be learning new stuff!! Yay! There is no downside here. If you do not know why an answer is the way it is, contact us. | ||
- | As always, comments or corrections to: misc@fullcirclemagazine.org | + | As always, comments or corrections to: misc@fullcirclemagazine.org** |
+ | |||
+ | Si vous aimez prendre de l' | ||
+ | |||
+ | ••Le numéro du nouvel examen est 201-400 et 117-201 était l' | ||
+ | |||
+ | ••Le site nécessite une inscription, | ||
+ | |||
+ | ••N' | ||
+ | |||
+ | Faites-nous savoir votre résultat - bon ou mauvais, ça n'a pas d' | ||
+ | |||
+ | Comme toujours, envoyez vos commentaires ou corrections à : misc@fullcirclemagazine.org | ||
issue154/certifie_linux.1584269258.txt.gz · Dernière modification : 2020/03/15 11:47 de auntiee