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édenteProchaine révisionLes deux révisions suivantes | ||
installfreebsd [2019/03/10 14:05] – [Gestionnaire WIFI] cyrille | installfreebsd [2019/03/25 07:35] – [Arduino] cyrille | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
Sur laptop, DELL Latitude E5430 et DELL Latitude E6410 | Sur laptop, DELL Latitude E5430 et DELL Latitude E6410 | ||
+ | |||
+ | Attention si en parallèle d'un linux, laisser le Linux gérer le grub via le MBR et rajouter une entrée dans le grub. | ||
+ | |||
+ | Exemple : | ||
+ | <code bash>cat / | ||
+ | #!/bin/sh | ||
+ | exec tail -n +3 $0 | ||
+ | # This file provides an easy way to add custom menu entries. | ||
+ | # menu entries you want to add after this comment. | ||
+ | # the 'exec tail' line above. | ||
+ | menuentry " | ||
+ | set root=' | ||
+ | kfreebsd / | ||
+ | }</ | ||
+ | |||
+ | Si que freesbd sur le disque, utiliser <code bash> | ||
===== Installation ===== | ===== Installation ===== | ||
Ligne 61: | Ligne 77: | ||
Le recharger | Le recharger | ||
- | <code bash> | + | <code bash> |
=====Initialisation de pkg===== | =====Initialisation de pkg===== | ||
Ligne 69: | Ligne 85: | ||
=====AJOUTER un user===== | =====AJOUTER un user===== | ||
<code bash># adduser</ | <code bash># adduser</ | ||
- | L’inclure dans les groupes : wheel operator video | + | L’inclure dans les groupes : |
Ligne 75: | Ligne 91: | ||
=====Gestion du son===== | =====Gestion du son===== | ||
- | <code bash># | + | <code bash># kldload snd_driver</ |
<code bash>cat / | <code bash>cat / | ||
Installed devices: | Installed devices: | ||
Ligne 85: | Ligne 101: | ||
No devices installed from userspace.</ | No devices installed from userspace.</ | ||
- | <code bash># | + | <code bash># sysrc kld_list+=snd_hda</ |
Ligne 100: | Ligne 116: | ||
Vérifier | Vérifier | ||
<code bash> | <code bash> | ||
+ | |||
+ | |||
+ | |||
+ | ===== Network Manager ===== | ||
+ | |||
+ | |||
+ | ==== Network Manager ==== | ||
+ | |||
+ | |||
+ | <code bash>pkg show networkmgr | ||
+ | WWW : https:// | ||
+ | Comment | ||
+ | Annotations | ||
+ | repo_type | ||
+ | repository | ||
+ | Flat size : 1.71MiB | ||
+ | Description | ||
+ | NetworkMgr is an open source, Network Manager based on the look of the Linux | ||
+ | Network Manager user interface. It use ifconfig and netif if make all work. | ||
+ | </ | ||
+ | |||
+ | Il faudra ensuite configurer DOA pour que ça fonctionne | ||
+ | |||
+ | <code bash>cat / | ||
+ | |||
+ | permit nopass keepenv root | ||
+ | permit : | ||
+ | permit nopass keepenv :wheel cmd netcardmgr | ||
+ | permit nopass keepenv :wheel cmd ifconfig | ||
+ | permit nopass keepenv :wheel cmd service</ | ||
+ | |||
+ | Se delogguer, l' | ||
+ | |||
+ | |||
+ | Gestion de la connexion par ce fichier | ||
+ | |||
+ | <code bash> cat / | ||
+ | |||
+ | |||
+ | ==== CLI graphique de gestion ==== | ||
+ | |||
+ | <code bash> pkg install | ||
+ | ===== Devices : permissions ===== | ||
+ | Permettra en autres l' | ||
+ | |||
+ | <code bash>cat / | ||
+ | |||
+ | # Allow all users to access optical media | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | |||
+ | # Allow all USB Devices to be mounted | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | |||
+ | # Misc other devices | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | perm / | ||
+ | </ | ||
+ | |||
+ | <code bash>cat / | ||
+ | |||
+ | [devfsrules_common=7] | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | add path ' | ||
+ | | ||
+ | Mettre à jour le **/ | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | Prendre en compte les modifications sans rebooter | ||
+ | <code bash>/ | ||
Ligne 111: | Ligne 232: | ||
====Pour activer le suspend et resume ==== | ====Pour activer le suspend et resume ==== | ||
Créer ces 2 fichiers | Créer ces 2 fichiers | ||
- | <code bash>pkg info -D xfce4-session | ||
- | xfce4-session-4.12.1_4: | ||
- | Always: | ||
- | To be able to shutdown or reboot your system, you'll have to add .rules | ||
- | files in / | ||
- | like this (replace PUTYOURGROUPHERE by your group): | ||
- | polkit.addRule(function (action, subject) { | + | **/ |
+ | |||
+ | |||
+ | <code bash>polkit.addRule(function (action, subject) { | ||
if ((action.id == " | if ((action.id == " | ||
action.id == " | action.id == " | ||
Ligne 125: | Ligne 243: | ||
} | } | ||
}); | }); | ||
+ | </ | ||
- | For those who have working suspend/resume: | + | **/usr/ |
- | polkit.addRule(function (action, subject) { | + | <code bash>polkit.addRule(function (action, subject) { |
if (action.id == " | if (action.id == " | ||
&& subject.isInGroup(" | && subject.isInGroup(" | ||
Ligne 135: | Ligne 254: | ||
});</ | });</ | ||
+ | puis | ||
+ | <code bash> | ||
Ligne 145: | Ligne 266: | ||
<code bash>Pkg install dbus | <code bash>Pkg install dbus | ||
service dbus onestart</ | service dbus onestart</ | ||
+ | |||
+ | Démarrage auttomatique, | ||
+ | <code bash>cat / | ||
+ | dbus_enable=" | ||
On utilisera xinit pour le lacement de XFCE | On utilisera xinit pour le lacement de XFCE | ||
Ligne 159: | Ligne 284: | ||
/ | / | ||
+ | Lier xinitrc et xsession | ||
+ | <code bash> ln -s ~/.xinitrc ~/ | ||
Enfin lancer la session X | Enfin lancer la session X | ||
<code bash> | <code bash> | ||
- | |||
- | Lier xinitrc et xsession | ||
- | <code bash> ln -s ~/.xinitrc ~/ | ||
Pour démarrer la session de XFCE, j'ai choisi la façon manuelle sinon on peut passer, entre autre par SLIM. | Pour démarrer la session de XFCE, j'ai choisi la façon manuelle sinon on peut passer, entre autre par SLIM. | ||
Ligne 177: | Ligne 301: | ||
====anti-aliasing avec la police Helvetica===== | ====anti-aliasing avec la police Helvetica===== | ||
- | Editer ce fichier ainsi | + | Editer ce fichier ainsi : **/ |
<code bash><? | <code bash><? | ||
< | < | ||
Ligne 235: | Ligne 359: | ||
J' | J' | ||
- | <code bash>pkg info -D plank | ||
- | plank-0.11.4: | ||
- | Always: | ||
- | ===> | ||
- | |||
- | The plank port currently does not have a maintainer. As a result, it is | ||
- | more likely to have unresolved issues, not be up-to-date, or even be removed in | ||
- | the future. To volunteer to maintain this port, please create an issue at: | ||
- | |||
- | https:// | ||
- | |||
- | More information about port maintainership is available at: | ||
- | |||
- | https:// | ||
- | </ | ||
<code bash># pkg install plank</ | <code bash># pkg install plank</ | ||
Ligne 335: | Ligne 444: | ||
/ | / | ||
- | ==== XFCE / FLAUXBOX | + | ==== XFCE / FLUXBOX |
Pour avoir le choix entre plus Windows Manager : ici fluxbox, openbox | Pour avoir le choix entre plus Windows Manager : ici fluxbox, openbox | ||
Ligne 423: | Ligne 532: | ||
# / | # / | ||
Et hop, ça fonctionne…... | Et hop, ça fonctionne…... | ||
+ | |||
+ | =====Dropbox===== | ||
+ | Pas de portage Dropbox sous freeBSD | ||
+ | Le kernel de freeBSD ne prend pas en charge **inotify** donc pas de dropbox... En tout cas dropbox ne fournit pas de client freeBSD. Reste à trouver une alternative ou utiliser wine et le client windows (parait il)... Il y aussi [[https:// | ||
+ | |||
+ | En alternative, | ||
+ | |||
+ | < | ||
+ | rclone-1.43 | ||
+ | Name : rclone | ||
+ | Version | ||
+ | Installed on : Sat Feb 23 19:02:31 2019 CET | ||
+ | Origin | ||
+ | Architecture | ||
+ | Prefix | ||
+ | Categories | ||
+ | Licenses | ||
+ | Maintainer | ||
+ | WWW : https:// | ||
+ | Comment | ||
+ | Annotations | ||
+ | FreeBSD_version: | ||
+ | repo_type | ||
+ | repository | ||
+ | Flat size : 26.1MiB | ||
+ | Description | ||
+ | Sync files to and from Google Drive, S3, Swift, Cloudfiles, Dropbox and | ||
+ | Google Cloud Storage | ||
+ | |||
+ | WWW: https:// | ||
+ | |||
+ | On l' | ||
+ | <code bash># pkg install rclone</ | ||
+ | |||
+ | Puis on le configure | ||
+ | <code bash>$ rclone config</ | ||
+ | |||
+ | Toute la doc est là [[https:// | ||
+ | |||
+ | L' | ||
+ | |||
+ | Sur mon système mon répertoire **dropbox** et dans mon** / | ||
+ | |||
+ | J'ai écrit ce script qui fonctionne sur 3 arguments | ||
+ | * le premier : **IN** ou **OUT** : la synchronisation se fait vers la Dropbox ou depuis la Dropbox | ||
+ | * le second : **répertoire à mettre à jour** : COURS ou DIR | ||
+ | * le dernier : **dry** ou **write** : **dry** : on simule, **write** on met à jour | ||
+ | |||
+ | Puis 1 alias : | ||
+ | <code bash> | ||
+ | |||
+ | Pour mettre à jour le répertoire DIR depuis la Dropbox vers mon PC | ||
+ | <code bash> | ||
+ | |||
+ | Pour simuler une synchroniation du répertoire COURS de mon PC vers la Dropbox | ||
+ | <code bash> | ||
+ | |||
+ | Et c'est tout ! Le script ci-dessous : | ||
+ | |||
+ | |||
+ | <code bash># | ||
+ | echo == DEBUG == | ||
+ | echo "Nom du script : $0"; | ||
+ | echo argument 1 : $1 | ||
+ | echo argument 2 : $2 | ||
+ | echo "Tous les arguments : $* ($# arguments)" | ||
+ | echo == FIN DEBUG == | ||
+ | |||
+ | |||
+ | # ========================================= | ||
+ | case $# in | ||
+ | 0) echo "Aucun parametre" | ||
+ | echo " | ||
+ | 1) echo "Il manque un paramètre !" | ||
+ | echo " | ||
+ | 2) echo "2 parametres passes au programme : $1 et $2";; | ||
+ | 3) echo "Le 3eme argument ne peut être que --dry-run ou write";; | ||
+ | *) echo "TROP DE PARAMETRES !" | ||
+ | echo " | ||
+ | esac | ||
+ | |||
+ | # ========================================= | ||
+ | if [ $1 == " | ||
+ | then | ||
+ | echo " | ||
+ | source=" | ||
+ | dest="/ | ||
+ | |||
+ | elif [ $1 == " | ||
+ | then | ||
+ | echo "Vers la dropbox" | ||
+ | source="/ | ||
+ | dest=" | ||
+ | |||
+ | else | ||
+ | echo " | ||
+ | exit; | ||
+ | fi | ||
+ | # ========================================= | ||
+ | if [ $2 == " | ||
+ | then | ||
+ | echo " | ||
+ | dir=" | ||
+ | elif [ $2 == " | ||
+ | then | ||
+ | echo " | ||
+ | dir=" | ||
+ | elif [ $2 == " | ||
+ | then | ||
+ | echo " | ||
+ | dir=" | ||
+ | else | ||
+ | echo " | ||
+ | exit; | ||
+ | fi | ||
+ | # ========================================= | ||
+ | |||
+ | if [ $3 == " | ||
+ | then | ||
+ | echo " | ||
+ | option=" | ||
+ | elif [ $3 == " | ||
+ | then | ||
+ | echo " | ||
+ | option=""; | ||
+ | else | ||
+ | echo " | ||
+ | exit; | ||
+ | fi | ||
+ | # ========================================= | ||
+ | |||
+ | echo " | ||
+ | rclone sync $source$dir $dest$dir $option --progress | ||
+ | |||
+ | echo " --------------- Done."; | ||
+ | </ | ||
+ | ===== WINE ===== | ||
+ | Attention il faut installer le paquet i386 même si on est en 64bit, sinon erreur de segmentation. | ||
+ | |||
+ | Donc | ||
+ | <code bash>pkg install i386-wine</ | ||
+ | |||
+ | Puis peaufinage via | ||
+ | <code bash>$ winecfg</ | ||
+ | |||
+ | Accepter tout ce qu'il propose de télécharger et installer. | ||
+ | |||
+ | |||
+ | Fonctionne nickel, mais les polices sont vraiment bizarres. | ||
+ | |||
+ | Éditer **~/ | ||
+ | <code bash><? | ||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | <!-- antialias all fonts --> | ||
+ | <match target=" | ||
+ | <edit name=" | ||
+ | <edit name=" | ||
+ | <edit name=" | ||
+ | <edit name=" | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | =====Arduino===== | ||
+ | Surtout ne pas installer la version depuis les ports, elle ne passe pas (l'iDE d' | ||
+ | <code bash>pkg install arduino</ | ||
+ | |||
+ | Si nécessaire, | ||
+ | <code bash> | ||
+ | # sudo pw groupmod operator -m $USER | ||
+ | # sudo pw groupmod dialer -m $USER</ | ||
+ | |||
+ | Donner l' | ||
+ | # cat / | ||
+ | # | ||
+ | # Allow operators access to usb devices. | ||
+ | # | ||
+ | [operator_usb=5] | ||
+ | add path usbctl mode 0660 group operator | ||
+ | add path ' | ||
+ | add path ' | ||
+ | |||
+ | Prise en compte des changements | ||
+ | <code bash># sudo sysrc devfs_system_ruleset=operator_usb</ | ||
+ | Relance du service devfs | ||
+ | <code bash># sudo service devfs restart</ | ||
+ | |||
+ | On branche sa carte et on vérifie sa détection | ||
+ | <code bash>$ usbconfig | ||
+ | ... | ||
+ | ugen0.2: <Arduino (www.arduino.cc) product 0x0043> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) | ||
+ | </ | ||
+ | |||
+ | {{ :: | ||
+ | |||
+ | |||
+ | =====DUAL BOOT freeBSD / Linux===== | ||
+ | J' | ||
+ | |||
+ | <code bash>$ sudo fdisk -l | ||
+ | Disque /dev/sda : 111,8 GiB, 120034123776 octets, 234441648 secteurs | ||
+ | Unités : secteur de 1 × 512 = 512 octets | ||
+ | Taille de secteur (logique / physique) : 512 octets / 512 octets | ||
+ | taille d'E/S (minimale / optimale) : 512 octets / 512 octets | ||
+ | Type d' | ||
+ | Identifiant de disque : 0x0c3bb11c | ||
+ | |||
+ | Périphérique Amorçage | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Donc on voit | ||
+ | * sda1 : Partition primaire : Racine linux / | ||
+ | * sda2 : Partition étendue | ||
+ | * sda 3 : FreeBSD | ||
+ | * sda5 : swap Linux | ||
+ | |||
+ | **Configuration du grub sous LINUX** | ||
+ | Sous LINUX, éditer le fichier suivant : **/ | ||
+ | |||
+ | Attention hd0,3 car freeBSD est sur /dev/sda3, s'il était sur le 1, mettre hd0,1, sur le 2 hd0,2, sur la seconde partition d'un deuxième disque hd1,2... Donc à adapter à votre configuration | ||
+ | |||
+ | <code bash># | ||
+ | exec tail -n +3 $0 | ||
+ | # This file provides an easy way to add custom menu entries. | ||
+ | # menu entries you want to add after this comment. | ||
+ | # the 'exec tail' line above. | ||
+ | menuentry " | ||
+ | set root=' | ||
+ | kfreebsd / | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Prendre en compte les modifications de la configuration du grub | ||
+ | |||
+ | <code bash># update-grub | ||
+ | Création du fichier de configuration GRUB… | ||
+ | Image Linux trouvée : / | ||
+ | Image mémoire initiale trouvée : / | ||
+ | Found memtest86+ image: / | ||
+ | Found memtest86+ image: / | ||
+ | unknown Linux distribution trouvé sur /dev/sda3 | ||
+ | </ | ||
+ | |||
+ | Rebooter et la nouvelle entrée est fonctionnelle dans le grub. | ||
+ | |||
+ | ===== Bash ===== | ||
+ | |||
+ | ==== bash comme shell par défaut ==== | ||
+ | |||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | Attention ne pas changer le shell du root | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | <code bash># chsh -s / | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <code bash>cat /etc/fstab | ||
+ | ## append the following to /etc/fstab file ## | ||
+ | fdesc / | ||
+ | |||
+ | |||
+ | ==== Autocomplétion ==== | ||
+ | <code bash>add the following to your ~/.bashrc or ~/ | ||
+ | [[ $PS1 && -f / | ||
+ | . / | ||
+ | |||
+ | |||
+ | <code bash># pkg install bash-completion</ | ||
+ | |||
+ | ==== Alias ==== | ||
+ | Créer un fichier **.bash_aliases** | ||
+ | touch .bash_aliases | ||
+ | Et y mettre ses alias. Si non fait, insérer cette section dans le .bashrc | ||
+ | <code bash># Alias definitions. | ||
+ | # You may want to put all your additions into a separate file like | ||
+ | # ~/ | ||
+ | # See / | ||
+ | if [ -f ~/ | ||
+ | . ~/ | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | ===== SSD Config ===== | ||
+ | Rien d' | ||
+ | Chez moi ada0p2 (**/**) et ada0p4 (**/home**) | ||
+ | |||
+ | Rebooter et démarrer en mode :** Boot Single User** (le n°2). (Il ne faut pas que les partitions soient montées) | ||
+ | <code bash> | ||
+ | tunefs -t enable ada0p2 | ||
+ | tunefs -t enable ada0p4</ | ||
+ | |||
+ | Rebooter | ||
+ | |||
+ | Vérfier que ce soit pris en compte | ||
+ | < | ||
+ | tunefs: POSIX.1e ACLs: (-a) disabled | ||
+ | tunefs: NFSv4 ACLs: (-N) | ||
+ | tunefs: MAC multilabel: (-l) | ||
+ | tunefs: soft updates: (-n) | ||
+ | tunefs: soft update journaling: (-j) | ||
+ | tunefs: gjournal: (-J) | ||
+ | tunefs: trim: (-t) | ||
+ | tunefs: maximum blocks per file in a cylinder group: (-e) 4096 | ||
+ | tunefs: average file size: (-f) 16384 | ||
+ | tunefs: average number of files in a directory: (-s) 64 | ||
+ | tunefs: minimum percentage of free space: (-m) 8% | ||
+ | tunefs: space to hold for metadata blocks: (-k) 6408 | ||
+ | tunefs: optimization preference: (-o) time | ||
+ | tunefs: volume label: (-L) | ||
+ | </ | ||
+ | |||
+ | |||
Ligne 433: | Ligne 868: | ||
*[[https:// | *[[https:// | ||
*[[https:// | *[[https:// | ||
- | + | *[[https:// | |
+ | | ||
Et surtout | Et surtout | ||
*[[https:// | *[[https:// | ||
*[[https:// | *[[https:// | ||
*[[https:// | *[[https:// |