zrenx

2019年11月4日

LS-WXL Debian rebuild

Filed under: Linux — zrenx @ 8:41 下午

After 4 years of hard working, both hard drives in my LS-WXL have bad sectors. A replacement of hard drives is necessary, as the price of both SSD and large HDD are very good at the moment, I decided to install the system on a HIKVISION C160 256G SSD, while using a HGST 3TB HHD as storage.

Here’s how I overcome the issues and finally did it.

Prepare
As described in: https://github.com/rogers0/OpenLinkstation
Download files from https://d-i.debian.org/daily-images/armel/daily/kirkwood/network-console/buffalo/
However, this url might show “Not Found” as the daily build might fail, you have to check another day, say https://d-i.debian.org/daily-images/armel/20191028-01:09/kirkwood/network-console/buffalo/ls-wxl/
Files are downloaded and put in the first partition of the SSD.

SSD partition is done as:


/boot 200MB ext3
/ 255GB ext4
/swap 800MB

Install
Power up the machine and login with ssh:


ssh installer@192.168.1.100

Follow the instructions and reach the point when partition guide is done, there I met the first issue: OOM.
Solution is to turn on SWAP. SSH with another terminal window and select “installer shell”, then


mkswap /dev/sda3
swapon /dev/sda3

Login again and redo the process, the installation is completed without further issues.

Post install
After installation, a few packages are installed to meet my need, however there’s a lot error messages showing up:

Failed to reload daemon: Refusing to reload, not enough space available on /run/
systemd. Currently, 11.0M are free, but a safety buffer of 16.0M is enforced.

To resolve this, I need to increase the run partition size, edit the initramfs.conf:

vim /etc/initramfs-tools/initramfs.conf

Find the line says: “RUNSIZE=10%” and change it to “RUNSIZE=15%”
Regenerate the initramfs

dpkg-reconfigure linux-image-4.19.0-6-marvell

—- UPDATE —-
Fan control
Set signal 0/85/170/255 to pwm1

cat 85 > /sys/devices/platform/gpio_fan/hwmon/hwmon0/pwm1

Check RPM of the fan

cat 85 > /sys/devices/platform/gpio_fan/hwmon/hwmon0/fan1_input

For automatic fan control, install afancontrol and edit /etc/afancontrol/afancontrol.conf accordinglly.
https://afancontrol.readthedocs.io/en/latest/

2015年05月14日

LS-WXL Debian Upgrade

Filed under: Linux — 标签:, , , , — zrenx @ 11:03 下午

I installed a Debian system on my Buffalo LS-WXL two years ago.

Recently, I want to play with some Nodejs, the LS-WXL will be my server, but the Linux kernel on it was too old (2.6.32). So I decided to upgrade it first. Obviously, compile a new kernel was my first thought. However, when I compiled the first one, there was a few patches, which I don’t think I can find new ones for the new kernel version.

I searched and searched, came across this thread, it says:

Support for the LS-XHL and LS-CHLv2 was added in the official Debian packets.
Just install linux-image-kirkwood and flash-kernel from wheezy-backports and reboot.

Similar devices, this method might works on LS-WXL as well. I tried and failed on “Unsupported platform”.

Early, I found this github repo: https://github.com/rogers0/OpenLinkstation
It supposed to be able to convert stock Linux system into a Debian system. There are bash scripts I can use as a instruction.

The magic begins:

  • Edit /etc/flash-kernel/db
Machine: Buffalo LS-WXL
Kernel-Flavors: kirkwood
Machine-Id: 527
DTB-Id: kirkwood-lswxl.dtb
DTB-Append: yes
U-Boot-Kernel-Address: 0x00008000
U-Boot-Initrd-Address: 0x0
Boot-Kernel-Path: /boot/uImage.buffalo
Boot-Initrd-Path: /boot/initrd.buffalo
Boot-DTB-Path: /boot/dtb
Required-Packages: u-boot-tools
Bootloader-Sets-Incorrect-Root: yes

I edited a little to match what’s on my machine. Boot-DTB-Path is where a dtb file will be generated

  • Copy kirkwood-lswxl.dtb and kirkwood-lswxl.dts from 1_debootstrap/dtb/ to /etc/flash-kernel/dtb/
  • Run: update-initramfs -uk all
  • Reboot and Good luck!

2014年06月18日

Android Studio Text Disappeared

Filed under: Android,Java,Linux — 标签:, , — zrenx @ 10:04 下午

I’m an Archlinux user, when I trying to setup Android Studio I noticed that text in the Android Studio window disappeared.
The fix is to modify the vmoptions, set the “-Dawt.useSystemAAFontSettings=lcd” to “-Dawt.useSystemAAFontSettings=on”.

2012年09月13日

LS-WXL Debian改造过程

Filed under: Linux — 标签:, , , , , — zrenx @ 11:11 下午

缘由

自从老婆搬过来,并且把我07年的笔记本霸占以后,台式机充当下载机已经一年多了。看着最近的电费单总是一阵阵的不爽,就想着弄个全职下载机。想要自己的VPS也不是一天两天了,AWS的micro instance免费体验也到期了,弄个机器也要能装linux才行。

半个月前买了个Buffalo LS-WXL,原因有很多

  • 便宜  —— 不到600,看中Synology的也有段时间了,可惜就是贵了点
  • 不带硬盘 —— WD My Book Live, 不错,可惜找不到不带硬盘的,刚买的2T硬盘不想浪费了
  • 可以改Debian —— Linux党的最爱,折腾不是问题
  • 有两个硬盘位 —— 不想格式化2T硬盘,里面积攒的电影要挪出来也没地方暂放了。还有两个多余的笔记本硬盘。

要折腾必先获取root权限,有了root就可以通过optware玩些初级的东西了。

获取Root权限

完整方法

参考:http://buffalo.nas-central.org/wiki/Category:LS-WXL#Gain_Root_Access
买过来直接就是1.60的固件了,直接跳到 #Firmware_1.41_and_later 开始就行。

偷懒方法

下载别人提供的已经破解好的固件,http://forum.buffalo.nas-central.org/viewtopic.php?f=68&t=23603

有了root权限也不是就能为所欲为了,Buffalo在固件里面直接定死了 —— 要么RAID0,要么RAID1。要让我多余的硬盘发挥余热还是得靠Debian。

改造成Debian

制作rootfs

参考:Debian Squeeze on ‘V’ and ‘X’ Series (LS-WXL and others)

装Debian系统

  • 一开始参照前面的教程复制文件到/boot,启动后只能是闪蓝灯的无限循环; 用LSupdaterg刷,同样结果。
  • 后来找到了这个帖子,有外国网友已经制作好了一个完整的刷机包,第一次就刷成了,很兴奋,可是为什么就不能装软件?(一定是我打开方式不对,XD)  这个方法后来辗转又回来试过,不过不知道为什么就不行了。
  • 又找到个国内网友的帖子,他的方法只要直接解压rootfs就行了。可惜他的包放在115,而115关了大众分享。

想了想,hddrootfs.buffalo.buffalo本来就是系统根文件夹的压缩包,国内网友的帖子很靠谱。找出前面的自己做的 hddrootfs.buffalo.updated 准备就这么干了。

拔出硬盘,装到移动硬盘盒里,插上电脑,重建gpt分区表,手动分区。
sdd1 1G  /boot ext3
sdd2 5G  /         ext3
sdd3 1G  swap
sdd4 剩下的100多G xfs /mnt/disk1

找出前面收集到的2.7M的 uImage.buffalo、 1.5K的空白 initrd.buffalo,放入sdd1。把hddrootfs.buffalo.updated放入sdd2,解压,针对当前分区修改 /etc/fstab。

把硬盘重新插入LS-WXL,召唤神龙 启动。过一会儿后,ssh能连入就是成功了。

继续参考前面制作rootfs的文章下文,安装blstools(修复LED灯状态,控制风扇速度),打开开机日志,安装xfs文件系统工具,设置时区,开启debian安全更新源。

Debian系统总算是可以用了,关机插上第二块硬盘,再开机,发现不能mount ext4分区。Buffalo官方uImage.buffalo内核不支持ext4文件系统。

编译内核

参考:Building the Debian kernel

编译之前修改.config,在File systems下加入

CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y

内核编译安装完成,重启后就能加载ext4分区了。

直接使用http://pastebin.com/9yWQBnhW的脚本会有一堆如下的错误信息:

cat: /sys/class/gpio/gpio42/value: No such file or directory

原因是以上脚本有误,导致无法创建GPIO signals。脚本中的字符串比较要用“=”而不是“==”,
默认的dash不支持“==”。

gpio_config()
{
        if [ $1 = "enable" ]; then
                [ -d /sys/class/gpio/gpio$2 ] || echo $2 > /sys/class/gpio/export
                if [ $3 = "output" ]; then
                        echo out > /sys/class/gpio/gpio$2/direction
                else
                        echo in > /sys/class/gpio/gpio$2/direction
                fi
        else
                echo $2 > /sys/class/gpio/unexport
        fi
}

2010年08月23日

Linux Chrome Flash 音乐破音

Filed under: Linux — 标签:, , — zrenx @ 4:17 下午

最近发现新的Chrome听 xiami.com 的音乐会有破音,豆瓣电台也一样。
这对遇喜欢写代码时塞着耳塞的我来说,相当难受。
想到Chrome是直接包含了Flash插件的,一看它的安装目录里面有个 libgcflashplayer.so 文件,跟正常的官方的Flash插件的不同。
于是就直接换用Adobe官方的 libflashplayer.so

第一步:

sudo cp /usr/lib/flashplugin-nonfree/libflashplayer.so /opt/google/chrome/

PS:请先确认你已经安装了flashplugin-nonfree

第二步:
在Chrome中打开 about:plugins -> 点开右上角的 Details.
看到 Shockwave Flash 下有两个文件,禁用其中的 libgcflashplayer.so ,Done!

PS:libgcflashplayer.so 和 libflashplayer.so 两个文件的大小完全一样,md5sum 不同,不知道是出了什么差错。

2010年07月16日

Debian上真机开发OPhone应用

Filed under: Android,Linux — zrenx @ 1:42 上午

前面一篇文章介绍过Nexus One在Debian系统上无法被ADB识别的解决办法,这两天在弄移动的OMS平台,发现需要使用同样的办法解决同样的问题。Debian 调试 Nexus One 的设置

OPhone1.5 插上 USB会有5个选项,选中”adb”就可以了。
OPhone2.0 插上 USB只有4个,选”同步“。

lsusb 找到手机对应的制造商和设备的ID,在/etc/udev/rules.d/51-android.rules上照样写一行就好了。

2010年05月10日

Debian 调试 Nexus One 的设置

Filed under: Android,Linux — 标签:, , , — zrenx @ 4:06 下午

问题:无法在Nexus One上调试,adb无法识别设备。

richard@r:~$ adb devices
List of devices attached
????????????	no permissions

原因:USB 设备ID无法被系统识别。(参考)
解决方法:
创建或修改文件(参考)

sudo vim /etc/udev/rules.d/51-android.rules

添加一行

SUBSYSTEMS=="usb", SYSFS{idVendor}=="18d1", SYSFS{idProduct}=="4e12",
MODE="0666", OWNER="YOUR_USERNAME"

改权限

chmod a+r /etc/udev/rules.d/51-android.rules

重新载入USB设备

sudo service udev reload

看效果

richard@r:~$ adb devices
List of devices attached
HT9CXP811756	device

2010年02月25日

Debian fcitx 设置

Filed under: Linux — zrenx @ 6:29 下午

最近Debian 下 fcitx 更新到3.6.3.
这个版本的fcitx相关文件位置从 ~/.fcitx/ 移到了 ~/.config/fcitx/。
然后我就发现我原来的fcitx配置不能用了,在把config移动到~/.config/fcitx/config 后还是不行。
怀疑启动设置方式有问题,找来了正统的设置方法:
新建文件 /etc/X11/Xsession.d/95xinput,添加如下内容:

export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=”fcitx”
export QT_IM_MODULE=”fcitx”
fcitx

重启X后发现还是没启动。
terminal 下执行 fcitx 提示说配置文件有错。
于是从 /usr/share/fcitx/data/config 把文件cp 过来,适当修改后, fcitx能启动了,但是输入状态条是灰色的.
修改 /usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules
找到 “xim” “X Input Method” “gtk20” “/usr/share/locale” “en:ko:ja:th:zh”
后面的语言列表里面加上”en”就可以了,因为我的系统Locale是en_US.UTF-8

另外一个Fcitx 的设置方法,似乎更加”正统”。

im-switch -z all_ALL -s fcitx

Eclipse崩溃一则

Filed under: Linux — zrenx @ 1:41 下午

Eclipse 在proposals弹出框按下回车后崩溃。

控制台下出错信息如下:

richard@r:~/bin/eclipse$ ./eclipse
The program ‘Eclipse’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘RenderBadPicture (invalid Picture parameter)’.
(Details: serial 61307 error_code 169 request_code 150 minor_code 7)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the –sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

系统是 Debian sid
看信息是图形方面的问题,想到早上刚更新过,打开history 一看唯一可能导致这问题的就只有 libcairo2 从1.8.8-2 升级到了 1.8.10-1。
重新安装了 apt archives 下 libcairo2_1.8.8-2_i386.deb 后问题解决。

给debian提交了bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571192

更新:此bug已fix, 更新libcairo2到1.8.10-2即可。

2009年12月22日

Debian下Java程序不能访问网络

Filed under: Java,Linux — zrenx @ 6:32 下午

现象: 1. mvn *** 命令不能下载到任何文件 (任何Java程序都不能正常访问网络)
2. eclipse 不能安装插件,或者升级
3. svn 更新, 提示错误: “Network is unreachable”
原因: 简单来说, Debian对IPv6的默认设置使 Java 虚拟机网络不能正常工作.
解决: 修改文件 /etc/sysctl.d/bindv6only.conf
“net.ipv6.bindv6only = 1” -> “net.ipv6.bindv6only = 0”
参考: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560142

Powered by WordPress