issue117:tutoriel1
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 | ||
issue117:tutoriel1 [2017/02/07 09:06] – d52fr | issue117:tutoriel1 [2017/02/11 15:32] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
However, repurposing a rather old laptop or notebook may also be a fun option, and economically advantageous.** | However, repurposing a rather old laptop or notebook may also be a fun option, and economically advantageous.** | ||
+ | |||
+ | L' | ||
+ | |||
+ | Cependant, la réutilisation d'un vieux portable ou notebook peut aussi être une solution amusante, et avantageuse économiquement. | ||
**Equipped with a Pentium-III-derived Intel Celeron M processor clocked at 900 MHz, ye olde Asus eeePC notebook is now a venerable piece of hardware. In fact, it is no secret that most modern Ubuntu desktop distributions will have a hard time fitting within the constraints of the 1 GByte RAM or 4 GByte onboard hard drive - though some ways of getting around these limits can be found, as I have had the occasion to point out previously in these pages. | **Equipped with a Pentium-III-derived Intel Celeron M processor clocked at 900 MHz, ye olde Asus eeePC notebook is now a venerable piece of hardware. In fact, it is no secret that most modern Ubuntu desktop distributions will have a hard time fitting within the constraints of the 1 GByte RAM or 4 GByte onboard hard drive - though some ways of getting around these limits can be found, as I have had the occasion to point out previously in these pages. | ||
Ligne 8: | Ligne 12: | ||
• The eeePC is a derivative of a mainstream Intel processor. As such, it is less power-efficient than the ARM family of CPUs, which were designed with operation off batteries prominent on the requirements list. We will need to run this one off AC power, though the onboard notebook battery may help us get over a (short) break in power supply, depending on its physical condition. | • The eeePC is a derivative of a mainstream Intel processor. As such, it is less power-efficient than the ARM family of CPUs, which were designed with operation off batteries prominent on the requirements list. We will need to run this one off AC power, though the onboard notebook battery may help us get over a (short) break in power supply, depending on its physical condition. | ||
• The eeePC packs some onboard peripherals that a more modern board may not, such as a VGA port, a modem, and a full-size SD card reader. These may come in handy, in addition to the screen that is naturally included in any laptop. There is an inbuilt WiFi card, and further peripherals may easily be connected over USB. ** | • The eeePC packs some onboard peripherals that a more modern board may not, such as a VGA port, a modem, and a full-size SD card reader. These may come in handy, in addition to the screen that is naturally included in any laptop. There is an inbuilt WiFi card, and further peripherals may easily be connected over USB. ** | ||
+ | |||
+ | Équipé d'un processeur Celeron M d' | ||
+ | |||
+ | Cependant, les spécifications matérielles sont très similaires à celles des appareils modernes conçus pour les plateformes d' | ||
+ | • Le eeePC est un dérivé d'un processeur principal d' | ||
+ | • Le eeePC intègre certains périphériques qu'une carte moderne n'a peut-être plus, comme un port VGA, un modem et un lecteur de carte SD grand format. Ceux-ci peuvent être pratiques, en complément de l' | ||
**It is worthwhile noting that since the eeePC is powered from an AC transformer or a notebook battery, the onboard USB ports are capable of delivering more power to peripherals than most hobbyist IoT devices. An external USB hard drive can be directly connected and powered, unlike with an RPi, for instance, where an external power source such as a second transformer will be necessary for the disk. | **It is worthwhile noting that since the eeePC is powered from an AC transformer or a notebook battery, the onboard USB ports are capable of delivering more power to peripherals than most hobbyist IoT devices. An external USB hard drive can be directly connected and powered, unlike with an RPi, for instance, where an external power source such as a second transformer will be necessary for the disk. | ||
Ligne 14: | Ligne 24: | ||
In my case, I took advantage of the recent announcement of version 16 of Ubuntu Snappy being available. This is based on Ubuntu 16.04, instead of 15.04 as were the previous releases. Since 16.04 is Long Term Support (LTS), this may be advantageous going forward. However, several things have changed on setting it up for the first time. Perhaps due to its beta status, and the relatively short period of time it has been made available (at the time of writing), precise instructions on setting it up are unfortunately still hard to find. ** | In my case, I took advantage of the recent announcement of version 16 of Ubuntu Snappy being available. This is based on Ubuntu 16.04, instead of 15.04 as were the previous releases. Since 16.04 is Long Term Support (LTS), this may be advantageous going forward. However, several things have changed on setting it up for the first time. Perhaps due to its beta status, and the relatively short period of time it has been made available (at the time of writing), precise instructions on setting it up are unfortunately still hard to find. ** | ||
+ | |||
+ | Notez bien que, comme le eeePC est alimenté par un transformateur secteur ou une batterie de portable, les ports USB intégrés sont capables de fournir plus d' | ||
+ | |||
+ | Aussi, si vous faites abstraction de l' | ||
+ | |||
+ | Dans mon cas, j'ai profité de l' | ||
**GETTING SNAPPY AND CREATING A PENDRIVE | **GETTING SNAPPY AND CREATING A PENDRIVE | ||
Ligne 28: | Ligne 44: | ||
Once the image has been uncompressed, | Once the image has been uncompressed, | ||
+ | |||
+ | Obtenir Snappy et créer une clé USB | ||
+ | |||
+ | J'ai téléchargé la version 32-bit (i386) de l' | ||
+ | |||
+ | unxz ubuntu-core-16-i386.img.xz | ||
+ | |||
+ | Si l' | ||
+ | |||
+ | sudo apt install xz-utils | ||
+ | |||
+ | Ce fichier image décompressé - avec l' | ||
+ | |||
+ | Une fois l' | ||
**However, we do have a simpler means of performing the transfer, which is to use the Ubuntu Snappy image itself. To use it, I used an USB pendrive of the appropriate size, 4 GBytes. Using an SD card of the same capacity is also an option, since the eeePC can also boot off this type of medium. This would probably be identified by your kernel as / | **However, we do have a simpler means of performing the transfer, which is to use the Ubuntu Snappy image itself. To use it, I used an USB pendrive of the appropriate size, 4 GBytes. Using an SD card of the same capacity is also an option, since the eeePC can also boot off this type of medium. This would probably be identified by your kernel as / | ||
Ligne 44: | Ligne 74: | ||
The pendrive is now a bootable image of Ubuntu Snappy. It can be extracted from the main computer, and used to boot the eeePC. ** | The pendrive is now a bootable image of Ubuntu Snappy. It can be extracted from the main computer, and used to boot the eeePC. ** | ||
+ | |||
+ | Cependant, nous avons un moyen plus simple de réaliser le transfert, qui est d' | ||
+ | |||
+ | En commençant sur l' | ||
+ | |||
+ | dmesg | grep sd | ||
+ | |||
+ | qui peut vous aider à vous assurer que vous allez bien écrire sur la clé et pas, par exemple, sur un des disques durs de votre ordinateur. Ensuite, j'ai vérifié que la clé était démontée, avant d' | ||
+ | |||
+ | sudo umount /dev/sdc* | ||
+ | |||
+ | sudo dd if=ubuntu-core-16-i386.img of=/dev/sdc bs=1M | ||
+ | |||
+ | L' | ||
+ | |||
+ | La clé est maintenant une image démarrable d' | ||
**CONFIGURING THE NEW SYSTEM ON THE PENDRIVE | **CONFIGURING THE NEW SYSTEM ON THE PENDRIVE | ||
Ligne 52: | Ligne 98: | ||
In many cases, we will be using the device to connect both wirelessly and with the Ethernet port. I used the dialogs to connect the Ethernet port (eth0) to my home network using DHCP over a network cable. This is the easiest option to complete the configuration, | In many cases, we will be using the device to connect both wirelessly and with the Ethernet port. I used the dialogs to connect the Ethernet port (eth0) to my home network using DHCP over a network cable. This is the easiest option to complete the configuration, | ||
+ | |||
+ | Configurer le nouveau système sur la clé | ||
+ | |||
+ | Vous devez appuyer sur la touche Échappement (ÉCHAP) pendant le démarrage de l' | ||
+ | |||
+ | La configuration initiale du système est un processus plutôt simple, bien que la seule utilisation d'une interface en mode texte puisse paraître étrange pour ceux qui sont plus habitués aux applications graphiques. Utilisez les touches fléchées pour vous déplacer de champ en champ, et configurez au strict minimum une interface pour vous connecter à Internet. | ||
+ | |||
+ | Dans beaucoup de cas, nous utiliserons sur l' | ||
**You will also need an account on the Ubuntu Snappy store to continue. This can be created from the Ubuntu One initial page at https:// | **You will also need an account on the Ubuntu Snappy store to continue. This can be created from the Ubuntu One initial page at https:// | ||
Ligne 60: | Ligne 114: | ||
ssh < | ssh < | ||
+ | |||
+ | Vous aurez aussi besoin d'un compte sur le Snappy Store pour poursuivre. Il peut être créé depuis la page d' | ||
+ | |||
+ | Ouvrez le fichier id_rsa.pub, dans le répertoire ~/.ssh, dans un éditeur de texte, et copiez/ | ||
+ | |||
+ | Une fois que le dispositif Snappy a été paramétré, | ||
+ | |||
+ | ssh < | ||
**We may need to consult our router to determine the new Snappy machine’s local IP address. Otherwise, a few judicious pings should also allow us to determine the address assigned through the router’s DHCP. | **We may need to consult our router to determine the new Snappy machine’s local IP address. Otherwise, a few judicious pings should also allow us to determine the address assigned through the router’s DHCP. | ||
Ligne 81: | Ligne 143: | ||
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-36-generic i686) | Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-36-generic i686) | ||
…** | …** | ||
+ | |||
+ | Nous pourrions avoir besoin de consulter notre routeur pour déterminer la nouvelle adresse IP locale de la machine Snappy. Autrement, quelques ping judicieux devraient aussi permettre de déterminer l' | ||
+ | |||
+ | Aucun mot de passe n'est demandé à la connexion, car notre clé publique est suffisante pour nous identifier. En vrai, notre nouvel utilisateur sur l' | ||
+ | |||
+ | Nous pouvons devenir root sur Snappy de la même manière que dans un Ubuntu normal, en utilisant la commande sudo : | ||
+ | |||
+ | sudo bash | ||
+ | |||
+ | root@localhost: | ||
+ | |||
+ | Il peut être utile de rendre l' | ||
+ | |||
+ | cp -r .ssh /root/ | ||
+ | |||
+ | Nous pouvons maintenant sortir de notre session SSH en utilisant la commande exit deux fois. Depuis notre ordinateur principal, nous pouvons nous connecter comme root en utilisant ssh, en réutilisant les mêmes identifiants SSH que nous avons utilisés précédemment pour la connexion : | ||
+ | |||
+ | ssh root@192.168.0.104 | ||
+ | |||
+ | Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-36-generic i686) | ||
+ | … | ||
+ | |||
**At this point, we have a fully working system, albeit on the USB pendrive. We can now copy it over onto the eeePC’s internal hard drive, if we so wish. Performance from the pendrive is adequate for simple tasks. However, using the internal hard drive would allow us to dispense with having a pendrive hanging off our device, thus freeing up a USB port. Speeds are also slightly better, even though the internal drive on the eeePC is not fast with about 32 MBytes/s bandwidth. | **At this point, we have a fully working system, albeit on the USB pendrive. We can now copy it over onto the eeePC’s internal hard drive, if we so wish. Performance from the pendrive is adequate for simple tasks. However, using the internal hard drive would allow us to dispense with having a pendrive hanging off our device, thus freeing up a USB port. Speeds are also slightly better, even though the internal drive on the eeePC is not fast with about 32 MBytes/s bandwidth. | ||
Ligne 97: | Ligne 181: | ||
This procedure would also work with a pendrive of a larger size. However, in this case there will be an error message as dd goes over the 4 GByte limit. If the file system on the USB pendrive has not been resized, this should not be of concern.** | This procedure would also work with a pendrive of a larger size. However, in this case there will be an error message as dd goes over the 4 GByte limit. If the file system on the USB pendrive has not been resized, this should not be of concern.** | ||
+ | |||
+ | À ce stade, nous avons un système opérationnel, | ||
+ | |||
+ | Copiez le contenu de la clé USB sur le disque dur avec la commande dd. Le disque dur interne de l' | ||
+ | |||
+ | sudo bash | ||
+ | |||
+ | dd if=/dev/sdb of=/dev/sda bs=1M | ||
+ | |||
+ | Nous réemployons la procédure utilisée pour copier l' | ||
+ | |||
+ | shutdown -h now | ||
+ | |||
+ | Rappelez-vous d' | ||
+ | |||
+ | Cette procédure fonctionnerait avec une clé plus grande. Dans ce cas, toutefois, vous aurez un message d' | ||
**ADMINISTERING YOUR NEW IOT DEVICE | **ADMINISTERING YOUR NEW IOT DEVICE | ||
Ligne 110: | Ligne 210: | ||
hello-world | hello-world | ||
Hello World!** | Hello World!** | ||
+ | |||
+ | Administrer votre nouveau dispositif connecté (IoT) | ||
+ | |||
+ | Terminons par une note rapide sur l' | ||
+ | |||
+ | Le premier changement majeur en venant d'un système Ubuntu standard est que la solution apt pour installer des logiciels ne fonctionne plus. À la place, les administrateurs utiliseront la commande snap pour interroger le magasin Ubuntu et gérer les paquets logiciels depuis cet endroit. Il y a de la documentation à ce sujet sur Internet et la commande elle-même intègre une bonne quantité de documentation. Certains exemples d' | ||
+ | |||
+ | sudo bash | ||
+ | snap help | ||
+ | snap list | ||
+ | snap install hello-world | ||
+ | hello-world | ||
+ | Hello World! | ||
**The other feature that may surprise administrators is how to alter environment variables. For instance, using the apt commands with a web proxy is a simple matter of exporting the appropriate environment variable before commencing. For instance: | **The other feature that may surprise administrators is how to alter environment variables. For instance, using the apt commands with a web proxy is a simple matter of exporting the appropriate environment variable before commencing. For instance: | ||
Ligne 138: | Ligne 251: | ||
snap install hello-world | snap install hello-world | ||
...** | ...** | ||
+ | |||
+ | L' | ||
+ | |||
+ | sudo bash | ||
+ | |||
+ | export http_proxy=”http:// | ||
+ | |||
+ | apt update | ||
+ | ... | ||
+ | |||
+ | Cependant, la commande snap ne semble pas respecter les variables d' | ||
+ | |||
+ | sudo bash | ||
+ | |||
+ | systemctl edit snapd.service | ||
+ | |||
+ | Ceci lancera l' | ||
+ | |||
+ | [Service] | ||
+ | Environment=" | ||
+ | Environment=" | ||
+ | |||
+ | Veuillez noter les MAJUSCULES dans les noms des variables d' | ||
+ | |||
+ | systemctl stop snapd | ||
+ | systemctl start snapd | ||
+ | snap install hello-world | ||
+ | … | ||
+ | |||
**SOME FINAL THOUGHTS | **SOME FINAL THOUGHTS | ||
Ligne 146: | Ligne 288: | ||
Converting an elderly device such as the eeePC into a Snappy device has several benefits. There is the obvious making use of a device that, otherwise, would probably end up on the scrap heap. But, from the user’s standpoint, getting accustomed to handling Ubuntu Snappy on such a platform will make things easier for us when we need to understand mobile devices with Ubuntu Touch. This is, in essence, built upon the base of Snappy, with the adjunction of the graphical user interface and other applications. For this reason, understanding Snappy can certainly be seen as an investment of time for those interested in dealing with Touch, for instance by designing and packaging applications for this platform.** | Converting an elderly device such as the eeePC into a Snappy device has several benefits. There is the obvious making use of a device that, otherwise, would probably end up on the scrap heap. But, from the user’s standpoint, getting accustomed to handling Ubuntu Snappy on such a platform will make things easier for us when we need to understand mobile devices with Ubuntu Touch. This is, in essence, built upon the base of Snappy, with the adjunction of the graphical user interface and other applications. For this reason, understanding Snappy can certainly be seen as an investment of time for those interested in dealing with Touch, for instance by designing and packaging applications for this platform.** | ||
+ | |||
+ | Quelques idées pour terminer | ||
+ | |||
+ | Les utilisateurs expérimentés et les administrateurs des distributions ordinaires d' | ||
+ | |||
+ | Cependant, Snappy apporte certains avantages. Le compartimentage de l' | ||
+ | |||
+ | La conversion d'un vieil ordinateur comme l' |
issue117/tutoriel1.1486454810.txt.gz · Dernière modification : 2017/02/07 09:06 de d52fr