電気回路/z-turn/Linuxの設定 の履歴(No.2)
更新インストール直後のバージョン†
DVD のディスクイメージに含まれる Ubuntu のバージョン
LANG:console $ uname --all Linux localhost.localdomain 3.15.0-xilinx #9 SMP PREEMPT Tue May 26 17:26:14 CST 2015 armv7l armv7l armv7l GNU/Linux $ gcc --version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat /etc/apt/sources.list deb http://ports.ubuntu.com/ubuntu-ports/ precise main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ precise main restricted # deb http://ports.ubuntu.com/ubuntu-ports/ precise-updates main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ precise-updates main restricted # deb http://ports.ubuntu.com/ubuntu-ports/ precise-security main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ precise-security main restricted
ふむ。
Ubuntu のバージョンは
- precise (12.04LTS, Linux kernel 3.2)
https://ja.wikipedia.org/wiki/Ubuntu によればまだギリギリサポートは続いているけれど、 それも今年 2017 年の4月までなので、早めに
- trusty (14.04 LTS, Linux Kernel 3.13) あるいは
- xenial (16.04 LTS, Linux Kernel 4.3) に上げたい
ちなみに Debian は
- wheezy が Linux 3.2
- jessie が Linux 3.16
- stretch が Linux >= 4.8
アップグレード†
LANG:console $ su $ apt-get update $ apt-get upgrade ... 679 upgraded, 0 newly installed, 0 to remove and 22 not upgraded. Need to get 306 MB of archives. After this operation, 96.2 MB of additional disk space will be used. ... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.2.0-1412-omap4 grep: /boot/config-3.2.0-1412-omap4: No such file or directory WARNING: missing /lib/modules/3.2.0-1412-omap4 Device driver support needs thus be built-in linux image! WARNING: Couldn't open directory /lib/modules/3.2.0-1412-omap4: No such file or directory FATAL: Could not open /lib/modules/3.2.0-1412-omap4/modules.dep.temp for writing: No such file or directory FATAL: Could not load /lib/modules/3.2.0-1412-omap4/modules.dep: No such file or directory cryptsetup: WARNING: could not determine root device from /etc/fstab $ apt-get dist-upgrade 22 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. Need to get 44.9 MB of archives. After this operation, 135 MB of additional disk space will be used.
そのままやると時間が掛かりすぎるので、いらないパッケージを抜いてからの方がよかった。。。
LANG:console $ apt-get purge libx11-6 xserver-xorg-core linux-sound-base $ apt-get autoremove
これでいいかな?
ユーザー作成 & sshd 起動†
操作をミスってシステムを壊してしまったりしないように、 普段は一般ユーザーのアカウントで作業したい。
LANG:console $ adduser osamu $ gpasswd -a osamu sudo $ apt-get install openssh-server
いくつか必須アプリを入れる†
LANG:console $ apt-get install jed-common etckeeper
Example を試してみる†
led-test†
(DVD)/04-Linux_Source/Examples/leds から、
- led-test.c
- Makefile
を ~/z-turn/led-test/ へコピー
LANG:console $ make
これだけで led-test という実行ファイルができる。
root 以外で実行しようとするとエラーになるので、sudo しなければならない。
LANG:console $ ./led-test [usr_led1] Get trigger: 'none' Open /sys/class/leds/usr_led1/trigger failed! $ sudo ./led-test sudo: unable to resolve host localhost.localdomain [usr_led1] Get trigger: 'none' [usr_led1] Set trigger to 'none' [usr_led2] Get trigger: 'none' [usr_led2] Set trigger to 'none' [ led_r] Get trigger: 'none' [ led_r] Set trigger to 'none' [ led_g] Get trigger: 'none' [ led_g] Set trigger to 'none' [ led_b] Get trigger: 'none' [ led_b] Set trigger to 'none' ^C[usr_led1] Set trigger to 'none' [usr_led2] Set trigger to 'none' [ led_r] Set trigger to 'none' [ led_g] Set trigger to 'none' [ led_b] Set trigger to 'none' $ sudo chown root:root led-test sudo: unable to resolve host localhost.localdomain $ sudo chmod u+s led-test $ sudo chmod o+x led-test $ ./led-test [usr_led1] Get trigger: 'none' [usr_led1] Set trigger to 'none' [usr_led2] Get trigger: 'none' [usr_led2] Set trigger to 'none' [ led_r] Get trigger: 'none' [ led_r] Set trigger to 'none' [ led_g] Get trigger: 'none' [ led_g] Set trigger to 'none' [ led_b] Get trigger: 'none' [ led_b] Set trigger to 'none' ^C[usr_led1] Set trigger to 'none' [usr_led2] Set trigger to 'none' [ led_r] Set trigger to 'none' [ led_g] Set trigger to 'none' [ led_b] Set trigger to 'none'
セット uid しておかないと、実行に sudo が必要になるようだ。
trusty へ dist-update†
ディスクイメージのバックアップを取ったのち、 /etc/apt/sources.list の precise をすべて trusty に直して
LANG:console $ apt-get update $ apt-get upgrade $ apt-get dist-update $ apt-get autoremove
warning: Setting locale failed への対処†
http://d.hatena.ne.jp/tkrd/20120828/1346123699
LANG:console $ apt-get install language-pack-ja-base
tera term の設定もいじってみたけれど、なかなか消えない・・・
cryptsetup: WARNING: could not determine root device from /etc/fstab への対処†
Counter: 6013 (from 2010/06/03),
today: 3,
yesterday: 5