太りぎみ。

こまめが歩いている姿が最近下腹だけ垂れてきているので、もしかして腹水?なのでは?と不安になり動物病院に連れて行ってみた。どうやら太り気味とのこと。前回来たときは文字通り猫可愛がりだったらしいのだが、今回は「貫禄でましたねぇ。」と。こまめ!やばいお前もか。というわけでワシ、ヨメ、こまめと一家みんな太り気味と。ヤバいなぁ。

ああ、確かに後ろ姿が太り気味だ。

../../../_images/3971795790_111ebf96fc_o.png

最近こまめの遊び相手をあまりしてやってなかったので、久々に往復ダッシュ&ジャンプを30分やらせた。相手をしていたワシの方が先にダウンしたよ…。

git stash便利ですな。

最新のコミットの後に作業して、ワーキングツリーに変更がある状態だと、git pushできないので、オフラインで作業していて、自宅に帰ってpushだけしようとすると、

$ git push origin master
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   hoge
#
no changes added to commit (use "git add" and/or "git commit -a")
E: There is diff in this directory, commit them first.

とプッシュ出来ないので、コミットできるところまで作業進める、という非効率なことをやっていたが、コミットできるところまで作業進まずに、また通勤電車の中でコミットするという状況が多い。そうすると次にオンラインになるまで作業を止めておくというのはますます非効率。

んで、iwamatsuさんに以前git stashが便利だということを聞いていたので試してみることにした。

$ git stash
Saved working directory and index state WIP on master: 6bd6da7 Latest commit.
HEAD is now at 6bd6da7 Latest commit.
(To restore them type "git stash apply")
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

とワーキングツリーにあった変更途中の内容が退避される 1 。んで再度プッシュ。戻すのはgit stash pop。

$ git stash pop
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   hoge
#
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (3990af523043df9f39a236cdb6ec8eb3024c4654)
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   hoge
#
no changes added to commit (use "git add" and/or "git commit -a")

と元の状態に戻せた。便利ですな。本来の使い方とは違うのかもしれんが。

1

コミットログメッセージは適当。

suspendもhibernateも使えるみたい。

先ほどの変更 でサスペンドも一応ちゃんと機能したのだが、こんなメッセージが出ていたのが気になる。他でも普段出てたっけ?そういやLet’s noteだとsuspendよりもhibernateを使ってたんだっけか。

[ 5636.161927] PM: resume devices took 5.968 seconds
[ 5636.161929] ------------[ cut here ]------------
[ 5636.161935] WARNING: at kernel/power/suspend_test.c:52 suspend_devices_and_enter+0x197/0x1c8()
[ 5636.161937] Hardware name: MacBook5,2
[ 5636.161938] Component: resume devices
[ 5636.161940] Modules linked in: usb_storage nvidia(P) binfmt_misc uvcvideo videodev v4l1_compat \
v4l2_compat_ioctl32 sco bridge stp llc bnep rfcomm l2cap bluetooth rfkill kvm_intel kvm \
nf_conntrack_ipv4 nf_defrag_ipv4 xt_state xt_tcpudp ipt_LOG iptable_filter ip_tables x_tables \
nf_conntrack_ftp nf_conntrack ipv6 cpufreq_stats cpufreq_conservative cpufreq_powersave \
cpufreq_userspace acpi_cpufreq loop snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_pcm_oss \
snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq \
snd_timer snd_seq_device snd isight_firmware joydev appletouch soundcore i2c_nforce2 snd_page_alloc \
shpchp pci_hotplug evdev pcspkr button ac processor battery ext3 jbd mbcache dm_mod sg sd_mod sr_mod \
cdrom ata_generic ahci libata scsi_mod ohci_hcd ohci1394 ieee1394 ssb ide_pci_generic ide_core \
forcedeth ehci_hcd thermal fan thermal_sys [last unloaded: scsi_wait_scan]
[ 5636.161996] Pid: 5599, comm: s2ram Tainted: P           2.6.31.3 #1
[ 5636.161997] Call Trace:
[ 5636.162002]  [<ffffffff8106c35e>] ? suspend_devices_and_enter+0x197/0x1c8
[ 5636.162005]  [<ffffffff8106c35e>] ? suspend_devices_and_enter+0x197/0x1c8
[ 5636.162009]  [<ffffffff81042b22>] ? warn_slowpath_common+0x77/0xa3
[ 5636.162012]  [<ffffffff81042baa>] ? warn_slowpath_fmt+0x51/0x59
[ 5636.162017]  [<ffffffff8120e166>] ? pm_dev_dbg+0xa1/0xc6
[ 5636.162021]  [<ffffffff812ecf42>] ? mutex_lock+0xd/0x31
[ 5636.162024]  [<ffffffff8120ea8b>] ? dpm_resume_end+0x42f/0x43e
[ 5636.162027]  [<ffffffff8106c555>] ? suspend_test_finish+0x46/0x75
[ 5636.162030]  [<ffffffff8106c35e>] ? suspend_devices_and_enter+0x197/0x1c8
[ 5636.162033]  [<ffffffff8106c488>] ? enter_state+0xf9/0x13a
[ 5636.162036]  [<ffffffff8106bbe8>] ? state_store+0xb4/0xd5
[ 5636.162041]  [<ffffffff81126927>] ? sysfs_write_file+0xd0/0x107
[ 5636.162045]  [<ffffffff8102573e>] ? default_spin_lock_flags+0x5/0xb
[ 5636.162049]  [<ffffffff810d72e0>] ? vfs_write+0xad/0x169
[ 5636.162052]  [<ffffffff810d7458>] ? sys_write+0x45/0x6e
[ 5636.162056]  [<ffffffff8100ba82>] ? system_call_fastpath+0x16/0x1b
[ 5636.162058] ---[ end trace 2a3b09550686ca82 ]---
[ 5636.162346] PM: Finishing wakeup.
[ 5636.162347] Restarting tasks ... done.
[ 5637.026887] CPU0 attaching NULL sched-domain.
[ 5637.026980] CPU0 attaching NULL sched-domain.

hibernateも大丈夫そうだ。

acpi=offにしていた場合は、ハイバネートするところまでは良かったが、リジューム時にacpi=offが効かないようで、acpi=offをつけないときと同じでブラックアウトしてしまっていた。が、こっちもちゃんと機能するようになった。良かった。

acpi=off から maxcpus=1 に変更。

ACPIを有効にするとブラックアウトしてしまい起動しなかったMacBook 5,2だが、 このバグの件一歩前進したよう で、grubのオプションを

  • acpi=off

  • nosmp

  • maxcpus=1

のいずれかにすれば起動出来るようになったらしい 1 。以前、HackCafeでmaxcpus=1を設定してもダメだったので、これはかなり期待大。ということで/etc/default/grubを早速変更してみた。

$ cd /etc/default
$ sudo git diff
diff --git a/default/grub b/default/grub
index 1ab62e9..ce041b5 100644
--- a/default/grub
+++ b/default/grub
@@ -4,8 +4,7 @@ GRUB_DEFAULT=0
 GRUB_TIMEOUT=5
 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
 GRUB_CMDLINE_LINUX_DEFAULT="quiet"
-#GRUB_CMDLINE_LINUX="acpi=off quiet"
-GRUB_CMDLINE_LINUX="acpi=off"
+GRUB_CMDLINE_LINUX="maxcpus=1"

 # Uncomment to disable graphical terminal (grub-pc only)
 #GRUB_TERMINAL=console

で、/boot/grub.d/grub.cfgを更新。

$ sudo update-grub2

再起動してみたら、無事起動。そして予想通り、ACPIがちゃんと機能するようになった!

$ cat /proc/acpi/ac_adapter/ADP1/state
state:                   on-line
$ cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         50200 mWh
last full capacity:      51440 mWh
battery technology:      rechargeable
design voltage:          10950 mV
design capacity warning: 250 mWh
design capacity low:     100 mWh
capacity granularity 1:  10 mWh
capacity granularity 2:  10 mWh
model number:            ASMB016
serial number:
battery type:            LION016
OEM info:                SMPN016

そして、shutdown してもちゃんと電源が切れる!これでshutdown後に電源ボタンを押して電源を切らなければあかん状況や、バッテリー駆動していて残り時間が分からんとかいう状況から開放される。

ところで、maxcpus=1にしてcoreを1個しか使えないんじゃcore 2 duoの意味が無いんじゃね?というツッコミもあるかもしれない。ここはそれ、acpi=offにしていた段階から既にCPUは1個しか認識されていないから、現時点では良いのだ。ノートPCでACPIの機能が使えないことの方がよっぽど辛い。

何はともあれ良かった良かった。 2

Footnotes

1

BTSのスレッドのタイトルが変更されていたので気づいた。

2

まぁ、自分は利用するだけで何もしてないけどな。

リマインダに納得がいかん。

日経BPパスポートでパスワードを忘れたのでリマインダ要求を出したら、パスワードをメールで送ってきた。いつの時代のシステムだよ。あと、パスワードの保存も平文もしくはせいぜい可逆可能な方法で暗号化して保存している、ということだよな。他にもこういうサイトは多そうな気がする。