delete from hateblo.jp where 1=1;

タイトルに意味はありません。

pdbファイルは果たして悪なのか

対象

  • C# で開発している人
  • 公開アプリケーションを開発している人
  • pdbファイルが必要だと感じている人

対応策

無難なディレクトリでビルドする(推奨)

ばれても問題ないパスでビルドを行うと、余計な心配をしなくて済む。

DebugInfoを使用してデータを削除する

Remove full path of PDB file from C# dll or exe. (/pdbaltpath in c#)
DebugDir download | SourceForge.net

もともとはDebugDirという処理だけど、拡張してデバッグ情報を変更できる機能をつけてくれたらしい。
上記DebugInfoをダウンロードして、コマンドを実行すると、パスを削除できるようだ。
※パスの中にスペースがあるとことごとくデータが残るみたいなので、ビルドパスに注意しよう。
※署名があると検証に失敗する可能性があるため、確認が必要

経緯

過去に、Visual StudioユーザーがReleaseビルドをするときに必ずやってほしい2つの設定 - Qiitaをブックマークしたら、
ブコメにスターが無意味につくので、本気で調べてみようと思った午前1時。

現状調査

詳細は下記章に記載するが、まとめると以下の通りになる。

pdb 署名 結果
pdb-only なし exeなどにフルパスの記載あり
pdb-only あり exeなどにフルパスの記載あり
none なし フルパスの記載なし
none あり フルパスの記載なし
full 未調査 未調査
PDBファイル出力あり(pdb-only)

単純にデバッグ情報をpdb-onlyにした状態でReleaseビルドした結果、フルパスが記載された。
このとき、署名はしていない。想定通り。

もしかして、厳格な型の場合は、このあたりの動きが違うのではないかと調査してみたが、影響なしだった。

PDBファイル出力なし(none)

単純にデバッグ情報をnoneにした状態でReleaseビルドした結果、pdbファイルしか記載されなかった。
このとき、署名はしていない。想定通り。

MicrosoftがリリースしているDLLはどうだろうか。

Microsoft.CSharp.dllを参照してみる。
ファッ?!PDBファイル名しか記載がない。
→これは何か方法があるはず

2019/08/26 追記

次の手順でパスを書き換えることが可能。ただし、.NET Coreでのみ確認している手順なので、動作保証はできません。
なお、カバレッジツールを噛ます場合は正しい相対パスにしないとどうやってもカバレッジをとれなくなるので、
よく確認したうえで組み込むことをお勧めします。

参考文献

upgradeしたらzfsonlinuxがロードできなくて詰んだ

本件は、進行中の案件であるため、解決情報を含んでいません。→10/09 解決

対象

現象

起動すると、サービス開始時点で以下のメッセージを吐き、zfsを開始できなくなった。

[FAILED] Failed to start Import ZAL pools by device scanning.
See 'systemctl status zfs-import-scan.service'
         Starting Mont ZFS filesystems....

起動後、コマンドを実行するとzfsがロードされていない旨のエラーが出るので、dmesgを確認すると...

[    9.507863] SPL: Loaded module v0.6.5.8-2
[    9.565076] zfs: disagrees about version of symbol __cv_init
[    9.565078] zfs: Unknown symbol __cv_init (err -22)
[    9.565091] zfs: disagrees about version of symbol vn_close
[    9.565092] zfs: Unknown symbol vn_close (err -22)
[    9.565153] zfs: disagrees about version of symbol cv_timedwait_hires
[    9.565153] zfs: Unknown symbol cv_timedwait_hires (err -22)
[    9.565165] zfs: disagrees about version of symbol vn_seek
[    9.565166] zfs: Unknown symbol vn_seek (err -22)
[    9.565181] zfs: disagrees about version of symbol __cv_destroy
[    9.565182] zfs: Unknown symbol __cv_destroy (err -22)
[    9.565193] zfs: disagrees about version of symbol __cv_timedwait_sig
[    9.565194] zfs: Unknown symbol __cv_timedwait_sig (err -22)
[    9.565233] zfs: disagrees about version of symbol rootdir
[    9.565234] zfs: Unknown symbol rootdir (err -22)
[    9.565243] zfs: disagrees about version of symbol kobj_close_file
[    9.565244] zfs: Unknown symbol kobj_close_file (err -22)
[    9.565258] zfs: disagrees about version of symbol kobj_read_file
[    9.565259] zfs: Unknown symbol kobj_read_file (err -22)
[    9.565287] zfs: disagrees about version of symbol __kstat_delete
[    9.565288] zfs: Unknown symbol __kstat_delete (err -22)
[    9.565314] zfs: disagrees about version of symbol vn_open
[    9.565315] zfs: Unknown symbol vn_open (err -22)
[    9.565316] zfs: disagrees about version of symbol kobj_open_file
[    9.565317] zfs: Unknown symbol kobj_open_file (err -22)
[    9.565325] zfs: disagrees about version of symbol vn_getf
[    9.565326] zfs: Unknown symbol vn_getf (err -22)
[    9.565327] zfs: disagrees about version of symbol kobj_get_filesize
[    9.565328] zfs: Unknown symbol kobj_get_filesize (err -22)
[    9.565338] zfs: disagrees about version of symbol vn_fsync
[    9.565339] zfs: Unknown symbol vn_fsync (err -22)                                  
[    9.565343] zfs: disagrees about version of symbol __cv_wait                        
[    9.565343] zfs: Unknown symbol __cv_wait (err -22)                                 
[    9.565348] zfs: disagrees about version of symbol vn_getattr
[    9.565349] zfs: Unknown symbol vn_getattr (err -22)
[    9.565391] zfs: disagrees about version of symbol __cv_wait_sig
[    9.565391] zfs: Unknown symbol __cv_wait_sig (err -22)
[    9.565408] zfs: disagrees about version of symbol __kstat_install
[    9.565408] zfs: Unknown symbol __kstat_install (err -22)
[    9.565428] zfs: disagrees about version of symbol __cv_signal
[    9.565429] zfs: Unknown symbol __cv_signal (err -22)
[    9.565432] zfs: disagrees about version of symbol vn_rdwr
[    9.565433] zfs: Unknown symbol vn_rdwr (err -22)
[    9.565442] zfs: disagrees about version of symbol __cv_wait_io
[    9.565443] zfs: Unknown symbol __cv_wait_io (err -22)
[    9.565493] zfs: disagrees about version of symbol __kstat_create
[    9.565494] zfs: Unknown symbol __kstat_create (err -22)
[    9.565495] zfs: disagrees about version of symbol __cv_broadcast
[    9.565495] zfs: Unknown symbol __cv_broadcast (err -22)
[    9.565512] zfs: disagrees about version of symbol vn_openat
[    9.565513] zfs: Unknown symbol vn_openat (err -22)
[    9.565527] zfs: disagrees about version of symbol __kstat_set_raw_ops
[    9.565528] zfs: Unknown symbol __kstat_set_raw_ops (err -22)
[   12.245591] EXT4-fs (dm-0): re-mounted. Opts: errors=remount-ro
[   12.389671] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: errors=remount-ro
[   12.478719] EXT4-fs (sdb1): mounting ext2 file system using the ext4 subsystem
[   12.485896] EXT4-fs (sdb1): mounted filesystem without journal. Opts: (null)        
[   12.490565] systemd-journald[204]: Received request to flush runtime journal from PID 

ドライバのロードに失敗する。
issuesなどを参照すると、zfssqlバージョンがあっていない場合に発生するという記述があった。

現象(インストール時)

インストール時に以下のような現象が発生する。

$ sudo aptitude install debian-zfs
Setting up zfs-dkms (0.6.5.7-8-jessie) ...
Loading new zfs-0.6.5.7 DKMS files...
First Installation: checking all kernels...
Building only for 3.16.0-4-amd64
Building initial module for 3.16.0-4-amd64
configure: error: 
        *** Please make sure the kmod spl devel package for your distribution
        *** is installed then try again.  If that fails you can specify the
        *** location of the spl source with the '--with-spl=PATH' option.
Error! Bad return status for module build on kernel: 3.16.0-4-amd64 (x86_64)
Consult /var/lib/dkms/zfs/0.6.5.7/build/make.log for more information.

原因

splがインストール対象のzfsパッケージと一致しないことにより発生していた。
splのバージョンを確認する

$ aptitude versions spl-dkms
Package spl-dkms:
p   0.6.5.7-5-jessie     <NULL>         500 
i   0.6.5.8-2            unstable       500 

なぜかunstableがインストールされ、zfs-0.6.5.7とバージョンが合わない。

対応方法

いったんすべてをキレイキレイする。

$ sudo aptitude purge debian-zfs spl-modules-* spl spl-dkms zfs-dkms zfsutils

ここで再起動することを推奨する。
splをバージョン指定で取得する。

$ sudo aptitude install spl-dkms=0.6.5.7-5-jessie                                                                                       
The following NEW packages will be installed:
  spl{a} spl-dkms 
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 352 kB/371 kB of archives. After unpacking 2707 kB will be used.
Do you want to continue? [Y/n/?] 
(snip)
Setting up spl (0.6.5.8-2) ...
Setting up spl-dkms (0.6.5.7-5-jessie) ...
Loading new spl-0.6.5.7 DKMS files...
First Installation: checking all kernels...
Building only for 3.16.0-4-amd64
Building initial module for 3.16.0-4-amd64
Done.

spl:
(snip)
Running the post_install script:

depmod....

DKMS: install completed.

次に、zfs-dkmsをインストールする。

$ sudo aptitude install debian-zfs                                                                                       
The following NEW packages will be installed:
  debian-zfs zfs-dkms zfsutils{a} 
0 packages upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/1461 kB of archives. After unpacking 9222 kB will be used.
Do you want to continue? [Y/n/?] 
(snip)
Setting up zfs-dkms (0.6.5.7-8-jessie) ...
Loading new zfs-0.6.5.7 DKMS files...
First Installation: checking all kernels...
Building only for 3.16.0-4-amd64
Building initial module for 3.16.0-4-amd64
Done.

zavl:
(snip)
depmod....

DKMS: install completed.
Setting up zfsutils (0.6.5.7-8-jessie) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Processing triggers for initramfs-tools (0.120+deb8u2) ...
update-initramfs: Generating /boot/initrd.img-3.16.0-4-amd64
Setting up debian-zfs (7~jessie) ...
Processing triggers for systemd (215-17+deb8u5) ...

spl-dkmsパッケージがaptitude upgradeで更新されてしまうのを防ぐ。(zfsモジュールが上がった場合は注意する)

$ sudo aptitude hold spl-dkms zfs-dkms
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

wheezy(7.0)からjessie(8.0)へのバージョンアップ実行ログ(参考)

設定編集

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.18.0-trunk-rpi #1 PREEMPT Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv6l GNU/Linux
pi@raspberrypi ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           30G  4.6G   24G  17% /
udev             10M     0   10M   0% /dev
tmpfs            44M  260K   44M   1% /run
/dev/mmcblk0p2   30G  4.6G   24G  17% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   40M   17M  71% /boot
pi@raspberrypi ~ $ cat /etc/debian_version
7.11
pi@raspberrypi ~ $ sudo vi /etc/apt/sources.list
pi@raspberrypi ~ $ 
pi@raspberrypi ~ $ sudo apt-get clean all

更新

  • 最新の情報を取得する
  • jessieがGet、wheezyがIgnとなっていることを確認する
pi@raspberrypi ~ $ sudo apt-get update
Hit http://raspberrypi.collabora.com wheezy Release.gpg
Get:1 http://mirrordirector.raspbian.org jessie Release.gpg [473 B]
Hit http://archive.raspberrypi.org wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release
Get:2 http://mirrordirector.raspbian.org jessie Release [14.4 kB]
Hit http://archive.raspberrypi.org wheezy Release
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,981 kB]
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Get:4 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB]
Get:5 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB]
Get:6 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 9,105 kB in 52s (172 kB/s)
Reading package lists... Done
pi@raspberrypi ~ $ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 706 not upgraded.

更新(upgrade)

pi@raspberrypi ~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  alsa-utils apt apt-utils aptitude aptitude-common base-passwd bind9-host blt bluez bsdutils build-essential 
  cifs-utils colord consolekit cpp cpp-4.6 cpp-4.7 cups cups-bsd cups-client cups-filters cups-ppdc curl dbus 
  dconf-gsettings-backend dconf-service dictionaries-common dillo dmsetup dpkg fakeroot fontconfig 
  fontconfig-config g++ g++-4.6 gcc gcc-4.6 gcc-4.6-base gcc-4.7 gcc-4.7-base gcc-4.8-base gconf-service 
  gconf2 gconf2-common gdb ghostscript gir1.2-glib-2.0 gksu glib-networking glib-networking-common 
  glib-networking-services gnome-themes-standard-data gpicview gtk2-engines gvfs gvfs-backends gvfs-common 
  gvfs-daemons gvfs-fuse gvfs-libs hostapd hplip hplip-data idle idle3 init-system-helpers initscripts iproute 
  iptables iputils-ping isc-dhcp-client isc-dhcp-common jackd2 libalgorithm-diff-xs-perl libapt-inst1.5 
  libapt-pkg-dev libapt-pkg4.12 libasound2 libatasmart4 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data 
  libatlas3-base libblas3 libbluetooth3 libcairo2 libck-connector0 libcups2 libcupscgi1 libcupsfilters1 
  libcupsimage2 libcupsmime1 libcupsppdc1 libcurl3 libcurl3-gnutls libcwidget3 libdevmapper-event1.02.1 
  libdevmapper1.02.1 libept-dev libept1.4.12 libfftw3-3 libfile-fcntllock-perl libfltk1.3 libfm-gtk4 
  libfm-modules libfm4 libfontconfig1 libgail18 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common 
  libgfortran3 libgirepository-1.0-1 libgksu2-0 libgl1-mesa-glx libglade2-0 libglapi-mesa libglib2.0-0 
  libglib2.0-bin libglib2.0-dev libgnome-keyring-common libgnome-keyring0 libgomp1 libgs9 libgs9-common 
  libgstreamer-plugins-base1.0-0 libgstreamer0.10-0 libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin libgtk-3-common 
  libgtk2.0-0 libgtk2.0-bin libgudev-1.0-0 libharfbuzz-icu0 libhpmud0 libical-dev libimlib2 libjack-jackd2-0 
  libjasper1 libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libjson0 libldap-2.4-2 
  liblocale-gettext-perl liblvm2app2.2 libp11-kit0 libpam-modules libpam-modules-bin libpam0g libpango-1.0-0 
  libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpaper1 libpolkit-backend-1-0 
  libpolkit-gobject-1-0 libpulse0 libpython2.7 libqt4-dbus libqt4-network libqt4-svg libqt4-xml libqtcore4 
  libqtdbus4 libqtgui4 libqtwebkit4 librsvg2-2 librsvg2-common libruby1.9.1 libsane libsane-common 
  libsane-hpaio libsasl2-2 libscsynth1 libsdl-image1.2 libsdl-mixer1.2 libsecret-1-0 libsemanage-common 
  libsemanage1 libsmbclient libsnmp-base libssh2-1 libstdc++6 libstdc++6-4.6-dev libtagcoll2-dev 
  libtext-charwidth-perl libtext-iconv-perl libudev-dev libunique-1.0-0 libusb-1.0-0 libuuid-perl libv4l-0 
  libv4l2rds0 libv4lconvert0 libwbclient0 libwebkitgtk-1.0-0 libwebkitgtk-3.0-0 libwibble-dev libwnck22 
  libxapian-dev libxapian22 libxft2 libxslt1.1 lightdm linux-headers-rpi-rpfv linux-image-rpi-rpfv login 
  lxappearance lxde lxinput lxpanel lxpanel-data lxrandr lxsession lxtask lxterminal menu mount mountall 
  netsurf-common netsurf-gtk obconf openbox openssh-client openssh-server parted passwd pcmanfm perl 
  perl-base perl-modules plymouth policykit-1 poppler-utils printer-driver-all printer-driver-escpr 
  printer-driver-foo2zjs printer-driver-hpcups printer-driver-hpijs printer-driver-postscript-hp 
  printer-driver-splix procps python python-gi python-gobject-2 python-imaging python-minimal python-numpy 
  python-pexpect python-pygame python-reportlab python-tk python2.7 python2.7-minimal python3 python3-minimal 
  python3-numpy python3-tk python3.2 python3.2-minimal qdbus rsyslog ruby1.9.1 samba samba-common sane-utils 
  smbclient ssh sudo supercollider supercollider-common supercollider-server sysv-rc sysvinit sysvinit-utils 
  tcl8.5 tk8.5 ttf-dejavu-core udev udisks usbmuxd util-linux v4l-utils weston wget x11-utils xpdf 
  xserver-xorg xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-video-fbdev
The following packages will be upgraded:
  acl alsa-base aspell aspell-en at-spi2-core avahi-daemon base-files bash bash-completion bc binutils 
  bluetooth bluez-cups bluez-hcidump bsdmainutils bzip2 ca-certificates console-setup console-setup-linux 
  coreutils cpio cron cups-common dash dbus-x11 dc debconf debconf-i18n debconf-utils debian-reference-common 
  debian-reference-en debianutils desktop-base desktop-file-utils diffutils dphys-swapfile dpkg-dev e2fslibs 
  e2fsprogs ed esound-common fake-hwclock fbset file findutils firmware-linux-free fonts-droid 
  fonts-freefont-ttf foomatic-db-compressed-ppds foomatic-db-engine foomatic-filters fuse galculator 
  gdbserver geoip-database gettext-base git git-core git-man gnome-icon-theme gnupg gpgv grep groff-base 
  gsettings-desktop-schemas gstreamer0.10-alsa gzip hardlink hicolor-icon-theme hostname idle-python2.7 
  idle-python3.2 ifupdown info initramfs-tools install-info iso-codes java-common kbd keyboard-configuration 
  klibc-utils kmod krb5-locales leafpad less libacl1 libalgorithm-diff-perl libaspell15 libasprintf0c2 
  libasyncns0 libatspi2.0-0 libattr1 libaudio2 libaudiofile1 libavahi-client3 libavahi-common-data 
  libavahi-common3 libavahi-core7 libavahi-glib1 libblkid1 libbluray1 libboost-iostreams1.49.0 
  libboost-iostreams1.50.0 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc6 libc6-dev libcaca0 
  libcairo-gobject2 libcap-ng0 libcap2 libcdio-cdda1 libcdio-paranoia1 libcdio13 libclass-isa-perl 
  libcomerr2 libcroco3 libcwiid1 libdaemon0 libdatrie1 libdbus-1-3 libdbus-1-dev libdbus-glib-1-2
  libdirectfb-1.2-9 libdpkg-perl libdrm2 libecore1 libedit2 libeina1 libelfg0 libenchant1c2a liberror-perl 
  libesd0 libevent-2.0-5 libexif12 libexpat1 libffi5 libflac8 libfm-data libfm-extra4 libfm-gtk-data 
  libfontenc1 libfreetype6 libfreetype6-dev libfuse2 libgdbm3 libgeoclue0 libgeoip1 libgif4 libglib2.0-data 
  libgmp10 libgpg-error0 libgpm2 libgssapi-krb5-2 libgstreamer-plugins-base0.10-0 libgtk2.0-common 
  libgtop2-7 libgtop2-common libgusb2 libgutenprint2 libhunspell-1.3-0 libice6 libid3tag0 libidn11 
  libieee1284-3 libijs-0.35 libjbig0 libjpeg8 libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-3 
  libkrb5support0 liblapack3 liblcms1 liblcms2-2 liblightdm-gobject-1-0 libltdl7 libluajit-5.1-common 
  libmad0 libmagic1 libmng1 libmount1 libmpfr4 libmtdev1 libncurses5 libncursesw5 libnettle4 libnewt0.52 
  libnfnetlink0 libnfsidmap2 libnih-dbus1 libnih1 libnl-3-200 libnl-dev libnl-genl-3-200 libnl1 libnotify4 
  libnss-mdns libogg0 libopts25 liborc-0.4-0 libpam-runtime libpangox-1.0-0 libpaper-utils libpci3 
  libpciaccess0 libpcre3 libpcre3-dev libpcrecpp0 libpcsclite1 libpipeline1 libpng12-0 libpng12-dev 
  libpolkit-agent-1-0 libpopt0 libportaudio2 libportmidi0 libreadline-dev libreadline5 libreadline6 
  libreadline6-dev libsamplerate0 libsane-extras libsane-extras-common libsasl2-modules libsdl-ttf2.0-0 
  libsdl1.2debian libsecret-common libselinux1 libsensors4 libsepol1 libsgutils2-2 libsigc++-2.0-0c2a 
  libslang2 libslp1 libsm6 libsmpeg0 libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libss2 
  libssh-4 libssl-dev libssl-doc libssl1.0.0 libstartup-notification0 libswitch-perl libsysfs2 
  libsystemd-login0 libtalloc2 libtasn1-3 libtdb1 libthai-data libthai0 libtiff4 libtimedate-perl 
  libtinfo-dev libtinfo5 libtirpc1 libts-0.0-0 libusb-0.1-4 libuuid1 libvorbis0a libvorbisenc2 
  libvorbisfile3 libwebkitgtk-1.0-common libwebkitgtk-3.0-common libwnck-common libwrap0 libx11-6 
  libx11-data libx11-xcb1 libxau6 libxaw7 libxcb-glx0 libxcb-render0 libxcb-shape0 libxcb-shm0 
  libxcb-util0 libxcb-xfixes0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxfont1 
  libxi6 libxinerama1 libxkbcommon0 libxml2 libxmu6 libxmuu1 libxp6 libxpm4 libxrandr2 libxrender1 libxres1 
  libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 libyaml-0-2 lightdm-gtk-greeter linux-kbuild-3.12 
  linux-kbuild-3.18 linux-libc-dev lm-sensors locales logrotate lrzsz lsb-base lua5.1 luajit lxde-common 
  lxde-core lxde-icon-theme lxmenu-data make makedev man-db manpages manpages-dev mime-support minicom 
  module-assistant module-init-tools mscompress multiarch-support nano ncdu ncurses-base ncurses-bin 
  ncurses-term net-tools netbase netcat-traditional nfs-common ntp obexd-client openssl patch pciutils 
  pkg-config poppler-data printer-driver-c2050 printer-driver-c2esp printer-driver-cjet 
  printer-driver-gutenprint printer-driver-m2300w printer-driver-min12xxw printer-driver-pnm2ppa 
  printer-driver-ptouch printer-driver-pxljr printer-driver-sag-gdi psmisc python-dbus python-dbus-dev 
  python-renderpm python-reportlab-accel qjackctl readline-common rpcbind rsync sed sensible-utils 
  shared-mime-info squeak-plugins-scratch ssl-cert strace tar tasksel tasksel-data tcpd tdb-tools timidity 
  traceroute tsconf tzdata ucf unzip usbutils vim vim-common vim-runtime vim-tiny whiptail wpagui 
  wpasupplicant x11-common x11-xkb-utils x2x xarchiver xauth xdg-utils xfonts-encodings xfonts-utils 
  xinit xkb-data xserver-common xserver-xorg-input-all zenity zenity-common zlib1g zlib1g-dev
411 upgraded, 0 newly installed, 0 to remove and 295 not upgraded.
Need to get 147 MB of archives.
After this operation, 13.3 MB of additional disk space will be used.
Do you want to continue [Y/n]?y
(snip)
ln: failed to create hard link ‘/boot/initrd.img-3.18.0-trunk-rpi.dpkg-bak’ => ‘/boot/initrd.img-3.18.0-trunk-rpi’: Operation not permitted
update-initramfs: Generating /boot/initrd.img-3.18.0-trunk-rpi
Processing triggers for menu ...
Processing triggers for ca-certificates ...
Updating certificates in /etc/ssl/certs... 29 added, 26 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
.bashrcの差分(念のため)
--- .bashrc     2014-10-18 05:44:12.000000000 +0000
+++ .bashrc.dpkg-old    2014-01-07 21:10:36.890000030 +0000
@@ -3,10 +3,7 @@
 # for examples
 
 # If not running interactively, don't do anything
-case $- in
-    *i*) ;;
-      *) return;;
-esac
+[ -z "$PS1" ] && return
 
 # don't put duplicate lines or lines starting with space in the history.
 # See bash(1) for more options
@@ -31,7 +28,7 @@
 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
 
 # set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
     debian_chroot=$(cat /etc/debian_chroot)
 fi
 
@@ -43,21 +40,21 @@
 # uncomment for a colored prompt, if the terminal has the capability; turned
 # off by default to not distract the user: the focus in a terminal window
 # should be on the output of commands, not on the prompt
-#force_color_prompt=yes
+force_color_prompt=yes
 
 if [ -n "$force_color_prompt" ]; then
     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
-       # We have color support; assume it's compliant with Ecma-48
-       # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
-       # a case would tend to support setf rather than setaf.)
-       color_prompt=yes
+  # We have color support; assume it's compliant with Ecma-48
+  # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+  # a case would tend to support setf rather than setaf.)
+  color_prompt=yes
     else
-       color_prompt=
+  color_prompt=
     fi
 fi
 
 if [ "$color_prompt" = yes ]; then
-    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
 else
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 fi
@@ -79,14 +76,11 @@
     #alias dir='dir --color=auto'
     #alias vdir='vdir --color=auto'
 
-    #alias grep='grep --color=auto'
-    #alias fgrep='fgrep --color=auto'
-    #alias egrep='egrep --color=auto'
+    alias grep='grep --color=auto'
+    alias fgrep='fgrep --color=auto'
+    alias egrep='egrep --color=auto'
 fi
 
-# colored GCC warnings and errors
-#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-
 # some more ls aliases
 #alias ll='ls -l'
 #alias la='ls -A'
@@ -104,10 +98,6 @@
 # enable programmable completion features (you don't need to enable
 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
 # sources /etc/bash.bashrc).
-if ! shopt -oq posix; then
-  if [ -f /usr/share/bash-completion/bash_completion ]; then
-    . /usr/share/bash-completion/bash_completion
-  elif [ -f /etc/bash_completion ]; then
+if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
     . /etc/bash_completion
-  fi
 fi
更新(dist-upgrade)
pi@raspberrypi ~ $ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  foomatic-filters ghostscript-cups idle-python3.2 libaudit0 libcupsdriver1 libescpr1 libharfbuzz0a
  libmenu-cache1 libperl5.14 libsnmp15 libwayland0 lxpolkit lxsession-edit python3-rpi.gpio wolfram-engine
  xserver-xorg-video-fbturbo
The following NEW packages will be installed:
  adwaita-icon-theme alsamixergui attr cgmanager clipit colord-data cpp-4.9 cracklib-runtime cups-browsed
  cups-core-drivers cups-daemon cups-filters-core-drivers cups-server-common deluge deluge-common deluge-gtk
  dh-python dosfstools eject emacsen-common fonts-dejavu fonts-dejavu-core fonts-dejavu-extra g++-4.9
  gcc-4.9 gcc-4.9-base gdisk geoclue-2.0 giblib1 gnome-disk-utility gnome-icon-theme-symbolic gnome-mplayer
  gnome-system-tools gnome-user-guide gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x
  gucharmap idle-python3.4 init iproute2 javascript-common liba52-0.7.4 libaa1 libaio1 libalgorithm-c3-perl
  libarchive-extract-perl libarchive13 libasan1 libasn1-8-heimdal libasound2-data libass5 libatm1 libatomic1
  libaudit-common libaudit1 libauthen-sasl-perl libavc1394-0 libavcodec56 libavformat56 libavresample2
  libavutil54 libbind9-90 libblas-common libboost-atomic1.55.0 libboost-filesystem1.55.0
  libboost-iostreams1.55.0 libboost-program-options1.55.0 libboost-python1.55.0 libboost-regex1.55.0
  libboost-system1.55.0 libboost-thread1.55.0 libbs2b0 libc6-dbg libcanberra-gtk3-0 libcanberra-gtk3-module
  libcanberra0 libcap2-bin libcdparanoia0 libcgi-fast-perl libcgi-pm-perl libcgmanager0 libclass-c3-perl
  libclass-c3-xs-perl libcloog-isl4 libcolord2 libcolorhug2 libcpan-meta-perl libcrack2 libcryptsetup4
  libdata-optlist-perl libdata-section-perl libdb5.3 libdca0 libdconf1 libdebconfclient0 libdiscid0
  libdns-export100 libdns100 libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libdv4 libdvdnav4 libdvdread4
  libegl1-mesa libegl1-mesa-drivers libelf1 libenca0 libencode-locale-perl libepoxy0 libestr0 libevdev2
  libfaad2 libfakeroot libfcgi-perl libffi6 libfftw3-double3 libfftw3-single3 libfile-listing-perl
  libfltk1.1 libfluidsynth1 libfont-afm-perl libfontembed1 libfribidi0 libgbm1 libgcc-4.7-dev libgcc-4.9-dev
  libgcrypt20 libgd3 libgda-5.0-4 libgda-5.0-common libgl1-mesa-dri libgles2-mesa libglu1-mesa libgmlib1
  libgmtk1 libgmtk1-data libgnutls-deb0-28 libgnutls-openssl27 libgoa-1.0-0b libgoa-1.0-common libgphoto2-6
  libgphoto2-l10n libgphoto2-port10 libgpod-common libgpod4 libgraphite2-3 libgsm1 libgucharmap-2-90-7
  libharfbuzz0b libhcrypto4-heimdal libhdb9-heimdal libheimbase1-heimdal libhogweed2 libhtml-form-perl
  libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
  libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libhx509-5-heimdal
  libical1a libicu52 libiec61883-0 libimobiledevice4 libinput5 libio-html-perl libio-socket-ssl-perl
  libirs-export91 libisc-export95 libisc95 libisccc90 libisccfg-export90 libisccfg90 libisl10 libjim0.75
  libjpeg62-turbo libjs-jquery libjs-prettify libjson-c2 libjson-glib-1.0-0 libjson-glib-1.0-common
  libkrb5-26-heimdal liblcms2-utils libldb1 liblircclient0 libllvm3.5 liblog-message-perl
  liblog-message-simple-perl liblogging-stdlog0 liblognorm1 liblua5.2-0 liblwp-mediatypes-perl
  liblwp-protocol-https-perl liblwres90 liblzo2-2 libmailtools-perl libmbim-glib4 libmbim-proxy
  libmenu-cache-bin libmenu-cache3 libmikmod3 libmm-glib0 libmodule-build-perl libmodule-pluggable-perl
  libmodule-signature-perl libmotif-common libmozjs185-1.0 libmp3lame0 libmpc3 libmpdec2 libmpg123-0
  libmro-compat-perl libmtp-common libmtp-runtime libmtp9 libmusicbrainz3-6 libnautilus-extension1a
  libneon27-gnutls libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl
  libnl-route-3-200 libnspr4 libntdb1 libobrender29 libobt2 liboobs-1-5 libopenal-data libopenal1
  libopenjpeg5 libopenvg1-mesa libopus0 libpackage-constants-perl libpam-cap libpam-systemd
  libparams-util-perl libparted2 libperl5.20 libplist2 libpod-latex-perl libpod-readme-perl libpoppler46
  libpostproc52 libprocps3 libproxy1 libpsl0 libpulse-mainloop-glib0 libpwquality-common libpwquality1
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libpython3-stdlib libpython3.4-minimal
  libpython3.4-stdlib libqmi-glib1 libqpdf13 libqt4-xmlpatterns libquvi-scripts libquvi7 libraw1394-11
  libregexp-common-perl librest-0.7-0 libroken18-heimdal librtmp1 libruby2.1 libsasl2-modules-db
  libschroedinger-1.0-0 libshout3 libsmartcols1 libsnmp30 libsoftware-license-perl libspeex1
  libstdc++-4.9-dev libsub-exporter-perl libsub-install-perl libswscale3 libsystemd0 libtag1-vanilla
  libtag1c2a libtasn1-6 libtcl8.5 libtcl8.6 libterm-ui-perl libtevent0 libtext-soundex-perl
  libtext-template-perl libtheora0 libtie-ixhash-perl libtiff5 libtk8.5 libtk8.6 libtorrent-rasterbar7
  libtxc-dxtn-s2tc0 libubsan0 libudev1 libudisks2-0 liburi-perl libusbmuxd2 libuser1 libva1 libvdpau1
  libvisual-0.4-0 libvisual-0.4-plugins libvpx1 libwavpack1 libwayland-client0 libwayland-cursor0
  libwayland-egl1-mesa libwayland-server0 libwebp5 libwebpdemux1 libwebpmux1 libwind0-heimdal libwww-perl
  libwww-robotrules-perl libx264-142 libxcb-composite0 libxcb-dri2-0 libxcb-dri3-0 libxcb-present0
  libxcb-sync1 libxcb-xkb1 libxdo3 libxm4 libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl
  libxshmfence1 libxtables10 libxvidcore4 libyelp0 linux-compiler-gcc-4.9-arm linux-headers-4.4.0-1-common
  linux-headers-4.4.0-1-rpi linux-image-4.4.0-1-rpi linux-kbuild-4.4 lsb-release lxappearance-obconf
  modemmanager mplayer2 musescore-soundfont-gm notification-daemon ntfs-3g openssh-sftp-server
  printer-driver-brlaser printer-driver-dymo printer-driver-foo2zjs-common python-cairo
  python-characteristic python-chardet python-crypto python-dnspython python-glade2 python-gobject
  python-gtk2 python-ldb python-libtorrent python-notify python-ntdb python-openssl python-pam python-pil
  python-pkg-resources python-pyasn1 python-pyasn1-modules python-samba python-serial
  python-service-identity python-talloc python-tdb python-twisted-bin python-twisted-core python-twisted-web
  python-wicd python-xdg python-zope.interface python3.4 python3.4-minimal qpdf qtchooser qtcore4-l10n
  rename rfkill ruby ruby2.1 rubygems-integration samba-common-bin samba-dsdb-modules samba-libs
  samba-vfs-modules scrot startpar supercollider-ide supercollider-language supercollider-supernova
  system-tools-backends systemd systemd-shim systemd-sysv tcl tcl8.6 tk tk8.6 tk8.6-blt2.5 udisks2
  usb-modeswitch usb-modeswitch-data usermode va-driver-all vdpau-va-driver wamerican wicd wicd-daemon
  wicd-gtk xdg-user-dirs xdotool yelp yelp-xsl
The following packages will be upgraded:
  alsa-utils apt apt-utils aptitude aptitude-common base-passwd bind9-host blt bluez bsdutils
  build-essential cifs-utils colord consolekit cpp cpp-4.6 cpp-4.7 cups cups-bsd cups-client cups-filters
  cups-ppdc curl dbus dconf-gsettings-backend dconf-service dictionaries-common dillo dmsetup dpkg fakeroot
  fontconfig fontconfig-config g++ g++-4.6 gcc gcc-4.6 gcc-4.6-base gcc-4.7 gcc-4.7-base gcc-4.8-base
  gconf-service gconf2 gconf2-common gdb ghostscript gir1.2-glib-2.0 gksu glib-networking
  glib-networking-common glib-networking-services gnome-themes-standard-data gpicview gtk2-engines gvfs
  gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs hostapd hplip hplip-data idle idle3
  init-system-helpers initscripts iproute iptables iputils-ping isc-dhcp-client isc-dhcp-common jackd2
  libalgorithm-diff-xs-perl libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libasound2 libatasmart4
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatlas3-base libblas3 libbluetooth3 libcairo2
  libck-connector0 libcups2 libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libcurl3
  libcurl3-gnutls libcwidget3 libdevmapper-event1.02.1 libdevmapper1.02.1 libept-dev libept1.4.12 libfftw3-3
  libfile-fcntllock-perl libfltk1.3 libfm-gtk4 libfm-modules libfm4 libfontconfig1 libgail18 libgcc1
  libgconf-2-4 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgfortran3 libgirepository-1.0-1 libgksu2-0
  libgl1-mesa-glx libglade2-0 libglapi-mesa libglib2.0-0 libglib2.0-bin libglib2.0-dev
  libgnome-keyring-common libgnome-keyring0 libgomp1 libgs9 libgs9-common libgstreamer-plugins-base1.0-0
  libgstreamer0.10-0 libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin
  libgudev-1.0-0 libharfbuzz-icu0 libhpmud0 libical-dev libimlib2 libjack-jackd2-0 libjasper1
  libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libjson0 libldap-2.4-2 liblocale-gettext-perl
  liblvm2app2.2 libp11-kit0 libpam-modules libpam-modules-bin libpam0g libpango-1.0-0 libpango1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpaper1 libpolkit-backend-1-0
  libpolkit-gobject-1-0 libpulse0 libpython2.7 libqt4-dbus libqt4-network libqt4-svg libqt4-xml libqtcore4
  libqtdbus4 libqtgui4 libqtwebkit4 librsvg2-2 librsvg2-common libruby1.9.1 libsane libsane-common
  libsane-hpaio libsasl2-2 libscsynth1 libsdl-image1.2 libsdl-mixer1.2 libsecret-1-0 libsemanage-common
  libsemanage1 libsmbclient libsnmp-base libssh2-1 libstdc++6 libstdc++6-4.6-dev libtagcoll2-dev
  libtext-charwidth-perl libtext-iconv-perl libudev-dev libunique-1.0-0 libusb-1.0-0 libuuid-perl libv4l-0
  libv4l2rds0 libv4lconvert0 libwbclient0 libwebkitgtk-1.0-0 libwebkitgtk-3.0-0 libwibble-dev libwnck22
  libxapian-dev libxapian22 libxft2 libxslt1.1 lightdm linux-headers-rpi-rpfv linux-image-rpi-rpfv login
  lxappearance lxde lxinput lxpanel lxpanel-data lxrandr lxsession lxtask lxterminal menu mount mountall
  netsurf-common netsurf-gtk obconf openbox openssh-client openssh-server parted passwd pcmanfm perl
  perl-base perl-modules plymouth policykit-1 poppler-utils printer-driver-all printer-driver-escpr
  printer-driver-foo2zjs printer-driver-hpcups printer-driver-hpijs printer-driver-postscript-hp
  printer-driver-splix procps python python-gi python-gobject-2 python-imaging python-minimal python-numpy
  python-pexpect python-pygame python-reportlab python-tk python2.7 python2.7-minimal python3
  python3-minimal python3-numpy python3-tk python3.2 python3.2-minimal qdbus rsyslog ruby1.9.1 samba
  samba-common sane-utils smbclient ssh sudo supercollider supercollider-common supercollider-server sysv-rc
  sysvinit sysvinit-utils tcl8.5 tk8.5 ttf-dejavu-core udev udisks usbmuxd util-linux v4l-utils weston wget
  x11-utils xpdf xserver-xorg xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics
  xserver-xorg-video-fbdev
295 upgraded, 426 newly installed, 16 to remove and 0 not upgraded.
Need to get 355 MB of archives.
After this operation, 105 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(snip)
Operation not permitted
cp: error writing ‘/boot/initrd.img-4.4.0-1-rpi.dpkg-bak’: No space left on device
cp: failed to extend ‘/boot/initrd.img-4.4.0-1-rpi.dpkg-bak’: No space left on device
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for python-support (1.0.15) ...
Processing triggers for dictionaries-common (1.23.17) ...
Processing triggers for menu (2.1.47) ...
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
不要なパッケージを削除
pi@raspberrypi ~/backup/boot $ sudo aptitude search '~c'
c   foomatic-filters  - OpenPrinting printer support - filters
c   idle-python3.2    - IDE for Python (v3.2) using Tkinter
c   libaudit0         - Dynamic library for security auditing
c   libcupsdriver1    - Common UNIX Printing System(tm) - Driver library
c   libescpr1         - printer driver for Epson Inkjet - shared library
c   libfm-gtk-bin     - file management support (utilities)
c   libfm-gtk1        - file management support (GTK+ GUI library)
c   libfm1            - file management support (core library)
c   libgail-3-0       - GNOME Accessibility Implementation Library -- shared libr
c   libharfbuzz0a     - OpenType text shaping engine (shared library)
c   libmenu-cache1    - LXDE implementation of the freedesktop Menu specification
c   libsnmp15         - SNMP (Simple Network Management Protocol) library
c   libwayland0       - wayland compositor infrastructure - shared libraries
c   lxpolkit          - LXDE PolicyKit authentication agent
c   wolfram-engine    - Mathematica&#174; and the Wolfram Language
pi@raspberrypi ~/backup/boot $ sudo aptitude purge '~c'
The following packages will be REMOVED:
  foomatic-filters{p} idle-python3.2{p} libaudit0{p} libcupsdriver1{p} libescpr1{p} libfm-gtk-bin{p}  libfm-gtk1{p} libfm1{p} libgail-3-0{p} libharfbuzz0a{p} libmenu-cache1{p} libsnmp15{ libwayland0{p} lxpolkit{p} wolfram-engine{p}
The following partially installed packages will be configured:
  initramfs-tools
0 packages upgraded, 0 newly installed, 15 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?] y
(Reading database ... 130527 files and directories currently installed.)
(snip)
Processing triggers for menu (2.1.47) ...
Setting up initramfs-tools (0.120+deb8u2) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.120+deb8u2) ...
ln: failed to create hard link ‘/boot/initrd.img-4.4.0-1-rpi.dpkg-bak’ => ‘/boot/initrd.img-4.4.0-1-rpi’: Operation not permitted
update-initramfs: Generating /boot/initrd.img-4.4.0-1-rpi

wheezy(7.0)からjessie(8.0)へ無意味にバージョンアップ

手順を実施したので、無意味にメモしておく。raspberrypiってarmhfアーキなのか。知らなかった。

対象

注意

アップグレードを始める前に、バージョンを上げることを利用者に通知して下さい。(kernelが3.18→4.4になります。メジャーアップです。)
パッケージ自体が古く、バージョンアップ後削除されることがあるため、事前に必要(重要)なパッケージが削除されないか アップグレード および 第5章 jessie で知っておくべき問題点 で確認することを強く推奨します。(postgresqlとかpythonとか要注意)

コマンド

今後の自分のために使ったコマンドをメモ。(無保証の情報です、リリースノート(amd64,i386,armel,powerpc,sparc,kfreebsd-gnu,ia64,mips,s390) は必ず読みましょう)

既存のバージョンで最新にしておく
sudo aptitude update
sudo aptitude upgrade
sudo rpi-update

ここで、念のため、再起動することを推奨。

不要なkernelを確認し、削除する

3.12系は更新した際に、3.18系になるはず。

sudo dpkg -l | grep linux-
sudo apt-get remove --purge linux-headers-3.12-1-all linux-headers-3.12-1-all-armhf linux-headers-3.12-1-common linux-image-3.12-1-rpi linux-source-3.12
何も出力されないことを確認する
sudo dpkg --audit
sudo aptitude search "~ahold"
grep "proposed-updates" /etc/apt/sources.list
キレイキレイ
sudo apt-get clean
sudo apt-get autoremove
空き容量の確認

最低2G、推奨5Gぐらいあいていることを確認する。
また、/bootに30M程度あいていることを確認する。

df -h
wheezy →jessie に機械置換する、また、stable以外(testing等)がないことを確認する
cd /etc/apt/
sudo cp sources.list sources.list.wheezy
sudo vi sources.list
ソースリストの取得
sudo apt-get update
前段インストール
  • だいたい50分ぐらいかかる
  • サービスを勝手に再起動するという確認画面(青い画面)が出る
  • 設定ファイルの更新有無確認があった
    • /etc/skel/.bashrc
    • /etc/lightdm/lightdm-gtk-greeter.conf
    • /etc/xdg/openbox/LXDE/rc.xml
    • /etc/xdg/pcmanfm/LXDE/pcmanfm.conf
sudo apt-get upgrade
後段インストール
  • だいたい1時間ぐらいかかった
  • パッケージの削除が伴います
  • (Xあり、web server構成で)1GBytes近くのパッケージダウンロードがあるため、帯域によっては時間がかかります。
  • OpenSSHのrootパスワードログインを無効にする確認があった
    • 通常はYesで問題ないと思われる
  • 設定ファイルの更新有無確認があった
    • /etc/sysctl.conf
    • /etc/login.defs
sudo apt-get dist-upgrade
起動するkernelを再指定する
ls /boot
sudo vi /boot/config.txt

変更する。(変更前のものはコメントアウト等で残しておいてもかまわない)

kernel=vmlinuz-4.4-rpi
initramfs initrd.img-4.4-rpi followkernel
再起動前のキレイキレイ
# 削除したパッケージ探す
sudo aptitude search '~c'
# 削除したパッケージを完全削除する
sudo aptitude purge '~c'

以後のステップについては確認中であるため、特筆すべきポイントがあれば自分のために記載します。

user.configが崩壊

対象

  • ApplicationSettingsを使用している
  • 突然のException on System.Configuration

原因

アプリケーションの不正終了や、不正セクタのせいで、%LocalAppData%\CompanyName\Assembly_Url_sha256\user.configが崩壊する。

対策

Application.Run()前に、CheckConfiguration()をコールする。
formのコンストラクタで処理をさせてもよさげ。

.net - C# - User Settings broken - Stack Overflow (英語)

以下の宣言は忘れずに。参照設定へSystem.Configurationの追加を忘れずに。

using System.Configuration;
using System.IO;
using System.Threading;

コードは以下の通り。

        /// <summary>
        /// 設定を確認する
        /// </summary>
        /// <exception cref="UnauthorizedAccessException">呼び出し元に、必要なアクセス許可がありません。またはpath がディレクトリです。またはpath によって、読み取り専用のファイルが指定されました。</exception>
        /// <returns>true:設定ファイルが削除された/false:通常</returns>
        static public bool CheckConfiguration()
        {
            try
            {
                ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
                return false;
            }
            catch (ConfigurationErrorsException ex)
            {
                var filename = ex.Filename;
                if (string.IsNullOrEmpty(filename))
                    filename = (ex.InnerException as ConfigurationErrorsException)?.Filename;
                return DeleteWait(filename, 10);
            }
        }
        /// <summary>
        /// ファイルが削除するまで待機する
        /// </summary>
        /// <param name="filename">ファイル名</param>
        /// <param name="retry">リトライ回数</param>
        /// <exception cref="UnauthorizedAccessException">呼び出し元に、必要なアクセス許可がありません。またはpath がディレクトリです。またはpath によって、読み取り専用のファイルが指定されました。</exception>
        /// <returns>削除有無</returns>
        static bool DeleteWait(string filename, int retry)
        {
            if (string.IsNullOrEmpty(filename) || !File.Exists(filename))
                return false;
            for (var i = 0; i < retry; i++)
            {
                try
                {
                    if (File.Exists(filename))
                        File.Delete(filename);
                    using (var watcher = new FileSystemWatcher(Path.GetDirectoryName(filename), Path.GetFileName(filename)))
                    {
                        if (File.Exists(filename))
                            watcher.WaitForChanged(WatcherChangeTypes.Deleted);
                    }
                    return true;
                }
                catch (IOException) { }
                Thread.Sleep(1000);
            }
            return false;
        }

参考文献

linux でwifiを有効にするが、ACを有効にできない件について

対象

はじめに

以下のコマンドでロードできているのか確認する。

# ドライバを準備
 sudo aptitude install wireless-tools
# 再起動
 sudo reboot
# インターフェイスを確認する
 sudo iwconfig wlan0
#wlan0     IEEE 802.11abgn  ESSID:off/any  
#          Mode:Managed  Frequency:5.58 GHz  Access Point: Not-Associated   
#          Tx-Power=22 dBm   
#          Retry short limit:7   RTS thr:off   Fragment thr:off
#          Encryption key:off
#          Power Management:on

問題点

IEEE 802.11acを認識しない。
機能としては存在するはずだが、使用できない。
調査中。
→10/09 実は11acとして動いている模様。

 sudo iwconfig wlan0
#wlan0     IEEE 802.11abgn  ESSID:"AcAccessPoint"  
#          Mode:Managed  Frequency:5.26 GHz  Access Point: AB:CD:EF:12:34:56   
#          Bit Rate=520 Mb/s   Tx-Power=22 dBm   
#          Retry short limit:7   RTS thr:off   Fragment thr:off

フォーラムにて、ドライバはintel標準で、対応していないはずがないとコメントがあった。(ただしKernel 3.13以上じゃないとだめらしい)

改善手順

11nで接続されることが多いため、11nを無効にするべきだという記載が散見される。

/etc/modprobe.d/iwlwifi.conf へ以下の項目を書き込む。

options iwlwifi bt_coex_active=0 swcrypto=1 11n_disable=8

モバイル用途でない場合は電源管理機能を無効にすべきという記載も存在するため、
Wifiが有効になったら、電源管理機能を無効にするコマンドを投入する。
設定場所は /etc/network/interfaces か /etc/network/interfaces.d/wlan0。
GUIなどを使用している場合はもっと別の場所に設定がある可能性がある。

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# 次の行を記載しておく
  post-up iwconfig wlan0 power off

実際に、これらの手順を実施したところ、安定した。
なお、debianのパッケージとして提供されるドライバ以外を使った場合は不安定になったことだけを念のため報告しておく。
intel公式では最新版の提供があるが、debianパッケージでは提供がない

参考文献

参考情報

# よくあるUSBなら、プライベート設定があるのだが...ない
 sudo iwpriv wlan0
#wlan0     no private ioctls.

型番としては正しく認識できているみたいなのだが。
ソースコードを追うしかないのかな。

[    8.989027] Bluetooth: hci0: read Intel version: 3707100180012d0d00
[    9.055643] bluetooth hci0: firmware: direct-loading firmware intel/ibt-hw-37.7.10-fw-1.80.1.2d.d.bseq
[    9.055652] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.1.2d.d.bseq
[    9.099972] Bluetooth: hci0: Intel Bluetooth firmware patch completed and activated
[    9.118379] Intel(R) Wireless WiFi driver for Linux, in-tree:
[    9.118380] Copyright(c) 2003- 2014 Intel Corporation
[    9.118499] iwlwifi 0000:03:00.0: irq 141 for MSI/MSI-X
[    9.118747] iwlwifi 0000:03:00.0: Unsupported splx structure
[    9.118759] AVX2 version of gcm_enc/dec engaged.
[    9.119690] alg: No test for __gcm-aes-aesni (__driver-gcm-aes-aesni)
[    9.232638] iwlwifi 0000:03:00.0: firmware: direct-loading firmware iwlwifi-7260-9.ucode
[    9.232728] iwlwifi 0000:03:00.0: loaded firmware version 23.214.9.0 op_mode iwlmvm
[    9.486968] iwlwifi 0000:03:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144
[    9.487011] iwlwifi 0000:03:00.0: L1 Disabled - LTR Enabled
[    9.487222] iwlwifi 0000:03:00.0: L1 Disabled - LTR Enabled

C++とC#

対象

  • 衝動的にC++(native)を動かしたい人
  • dryな関係で居たい人
  • 再配布パッケージをインストールしたくない人

結論

以下のような構成をとることが多い。

構成
  • C#プロジェクト
    • ラッパープロジェクトを参照する
  • C# C++ラッパープロジェクト
    • 出力先に注意すること(C++のDLLがないと実行時エラーとなる)
  • C++プロジェクト

※Cインターフェイスを記述することで、名前が固定され、ラッパーからの呼び出しが比較的安全で、わかりやすくなる
気が向いたらサンプルプロジェクトをGistにでも記載するのと、文字列(配列)の扱いについていくつか記載する。

説明

C++プロジェクトについて

.NET 互換CLIライブラリをC++側で書くのが一番の近道。
しかし、CLIライブラリは/MD(動的リンク:マルチスレッド)のみ、/MT(静的リンク:マルチスレッド)には対応していない。[要出典]
動的リンクとしたとき、再配布パッケージは必須となってしまう。[要出典]
再配布パッケージを使用しないようにするためには、/MDを指定しなくてはならない。

Visual Studio 2015 (v140)からは再配布パッケージに使用されるvcruntime.dllの依存関係が多くなってしまったこと(マージモジュールになったから?)により、再配布をするにはパッケージが必要になってしまったように見受けられる。
以前はmsvcr120.dll単体+αで事足りていた。(Windows 7をターゲットとする場合)

Visual Studio Platform Toolset DLL .NET
2015 v140 vcruntime.dll 4.5.2/4.6
2013 v120 msvcr120.dll 4.5.1
2012 v110 msvcr110.dll 4.5
コールバックをC++側に渡すときの注意点

以下のようなコードがあったとする。

var cls = CPlusPlusMethod_Factory();
CPlusPlusMethod(cls, new Action(()=>DoSomething()));

Actionがメソッドを抜ける前に実行され、参照されなくなるなら、問題はないが、
たいていはコールバックとして関数を登録しているケースが多い。
マネージドコードからアンマネージドコードへコールバックを渡すだけでは、
参照が増えず、即座にGCされてしまい、不正アクセスの例外が発生する。
そのため、以下のようにC++側のコードが生きている間は、コールバックを参照として保持すべき。

var avoidgc = new List<Delegate>();
var cls = CPlusPlusMethod_Factory();
var action = new Action(()=>DoSomething());
avoidgc.Add(action);
CPlusPlusMethod(cls, action);

※上記記述はrubyの何かの記事のパクリです。出典を探し出せなくて困っているので、後日見つけたらリンクします