WIFIHELL - 科技改变生活

 找回密码
 注册WIFIHELL

QQ登录

只需一步,快速开始

开启左侧

[通用] 【转载】Debian Wheezy on LinkStation LS421DE

[复制链接]
222ba 发表于 2015-12-10 23:01:10 | 显示全部楼层 |阅读模式

注册WIFIHELL,浏览更多技术贴!

您需要 登录 才可以下载或查看,没有账号?注册WIFIHELL

x

Disclaimer:
THE FOLLOWING PROCEDURE WILL CAUSE ALL OF YOUR DATA TO BE LOST. YOU HAVE BEEN WARNED!

Installing Debian on LinkStation LS421DE to replace the Buffalo stock firmware aimed to create a full customized operating system without unnecessary software as in stock firmware.

The configuration for the following scenario described as below:

  • Using LinkStation LS421DE with armhf (arm hard float) architecture.
  • Not using raid, but adding raid partition for data partition is fully supported.
  • Currently, no vanilla kernel available. So, we are using Buffalo kernel at the moment. Vanilla kernel can be cross compiled.

The main process of Debian installation summarized as follow:

  • Creating rootfs by debootstrapping Debian on running LS421DE system.
  • Using a Linux box (Ubuntu) to prepare suitable image for LinkStation.
  • Modifying partition and installing Debian.
  • Enable lsmonitor script and customize Debian system.
Creating rootfs on running LS421DE system

You must have already a root access to the LinkStation box, if not, follow the the procedure on https://tohenk.wordpress.com/2014/11/11/opening-stock-firmware-of-linkstation-ls421de/.

Install debootstrap:

$ cd ~$ wget http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.64~bpo70+1_all.deb$ dpkg -i --force-all debootstrap_1.0.64~bpo70+1_all.deb

Prepare the tools by issuing commands:

$ mkdir ~/lsmod$ cd ~/lsmod$ wget https://github.com/tohenk/linkstation-mod/archive/master.zip$ unzip master.zip$ cd linkstation-mod-master

Edit scripts/debootstrap-rootfs.cfg and adjust as you need, choose closest mirror from your location. Extra packages can be specified using PACKAGES variable.

$ cat scripts/debootstrap-rootfs.cfgARCH=armhfVERSION=wheezyMIRROR=http://kartolo.sby.datautama.net.id/debianPACKAGES=$ vi scripts/debootstrap-rootfs.cfg

Run debootstrap:

$ ./scripts/debootstrap-rootfs.sh --clean

You can ommit –clean option if you don’t want to debootstrap-ing again. After debootstrap process, the rootfs archive can be found on rootfs folder:
rootfs_wheezy_armhf_yymmdd.tar.gz => hddrootfs
initrd_wheezy_armhf_yymmdd.tar.gz => initrd

Preparing Debian image for LinkStation

On Linux (Ubuntu) box, prepare the tools:

$ mkdir ~/lsmod$ cd ~/lsmod$ wget https://github.com/tohenk/linkstation-mod/archive/master.zip$ unzip master.zip$ cd linkstation-mod-master

Transfer rootfs from LinkStation (replace lsbox with your real LinkStation hostname or IP address):

$ mkdir rootfs$ scp root@lsbox:/root/lsmod/linkstation-mod-master/rootfs/* rootfs/

Prepare LinkStation stock firmware and place it in firmware folder:

$ mkdir firmware$ cp path-to-buffalo-firmware/ls400-133en.zip firmware/$ unzip firmware/ls400-133en.zip

Customize scripts/debootstrap-combine.cfg (adjust HOSTNAME, NETWORK_PROTO, etc), then create hddrootfs and initrd:

$ cat scripts/debootstrap-combine.cfgHOSTNAME=LS421DE88BNETWORK_INTERFACE=eth1NETWORK_PROTO=staticNETWORK_IP=172.16.1.4NETWORK_NETMASK=255.255.255.0NETWORK_GATEWAY=172.16.1.1NETWORK_DNS=172.16.1.1NETWORK_DOMAIN=ntlab.net#INITRD_TEMP_ROOT="0x811"#INITRD_ROOT="0x901"INITRD_ROOT="0x802"$ vi scripts/debootstrap-combine.cfg$ sudo ./scripts/debootstrap-combine.sh rootfs/rootfs_wheezy_armhf_141112.tar.gz rootfs/initrd_wheezy_armhf_141112.tar.gz firmware/ls400-133en

Unpack Buffalo kernel image:

$ sudo ./scripts/unpack-image.sh firmware/ls400-133en/uImage.img out/

Debian image for LinkStation now ready in the folder out with files hddrootfs.buffalo.updated, initrd.buffalo, anduImage.buffalo.

Modifying partition and installing Debian

Now, detach the hard disk from LinkStation and attach it to Linux box. Ensure the disk is detected and acquire the correct device node:

$ ls /dev/sd*

I’m assumed the disk detected as /dev/sda. Next install mdadm if it’s not already installed:

$ sudo apt-get install --no-install-recommends mdadm

Assemble raid partition:

$ sudo mdadm --assemble --scan

Stop all raid partition:

$ sudo mdadm --stop /dev/md0$ sudo mdadm --stop /dev/md1$ sudo mdadm --stop /dev/md2$ sudo mdadm --stop /dev/md101

Remove all raid partition:

$ sudo mdadm --remove /dev/md0$ sudo mdadm --remove /dev/md1$ sudo mdadm --remove /dev/md2$ sudo mdadm --remove /dev/md101

Zero super block:

$ sudo mdadm --zero-superblock /dev/sda1$ sudo mdadm --zero-superblock /dev/sda2$ sudo mdadm --zero-superblock /dev/sda5$ sudo mdadm --zero-superblock /dev/sda6

Create filesystems:

$ sudo mkfs.ext3 /dev/sda1$ sudo mkfs.ext4 /dev/sda2$ sudo mkswap /dev/sda5$ sudo mkfs.ext4 /dev/sda6

Install Debian:

$ mkdir /tmp/sda1$ sudo mount /dev/sda1 /tmp/sda1$ sudo cp out/initrd.buffalo /tmp/sda1$ sudo cp out/uImage.buffalo /tmp/sda1$ mkdir /tmp/sda2$ sudo mount /dev/sda2 /tmp/sda2$ sudo ./scripts/unpack-rootfs.sh out/hddrootfs.updated.buffalo /tmp/sda2

Attach back the disk to LinkStation, try pinging to test if installation was successfull. You then can SSH-ing as usual.

Enable lsmonitor script and customize Debian system

Now, the final step to customize Debian system by enabling lsmonitor init script:

$ cd ~$ wget https://github.com/tohenk/linkstation-mod/raw/master/lsmonitor/lsmonitor.tar.gz$ cd / && tar -xvf ~/lsmonitor.tar.gz

Install dependencies:

$ apt-get install smartmontools hdparm

Enable init script:

$ update-rc.d lsmonitor defaults

Start lsmonitor service:

$ service lsmonitor start

Now, Debian system is complete. Next you can customize your Debian as you need.


原文:

游客,如果您要查看本帖隐藏内容请回复


WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
qsjdh 发表于 2015-12-19 10:20:18 | 显示全部楼层
英文,看不懂。有哪位可以翻译一下了、
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
chenkaifu 发表于 2015-12-27 17:44:23 | 显示全部楼层
【转载】Debian Wheezy on LinkStation LS421DE
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
redstone325 发表于 2016-1-5 17:21:23 | 显示全部楼层
chenkaifu 发表于 2015-12-27 17:44
【转载】Debian Wheezy on LinkStation LS421DE

LS420D 可以嘛
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
gyjys 发表于 2016-1-8 09:01:21 | 显示全部楼层
这个方法管用,我的LS420已经安装成功了

我装的是SID版本的DEBIAN,最大的优点是DEBIAN里面的GCC可以正常工作了,而且源软件包都是最新的

(原来IPKG源中的GCC有问题,不能编译)

另外,我看到LS4系列的机器都是采用MARVELL 370的CPU,跟SYNOLOG 213J的CPU型号一样
是不是意味着可以安装群晖系统呢?
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
gyjys 发表于 2016-1-8 09:06:41 | 显示全部楼层
其实这个方法理论上可以安装在任何DEBIAN支持的平台上,现在DEBIAN支持的CPU有X86/64、ARM、MIPS、POWERPC、PPC64、S390

但有个前提是,原操作系统的kernel版本不能太老。因为它是采用挂载的方法来实现DEBIAN的功能,所以原系统的内核仍然会被继续使用,所以新的DEBIAN一般需要2.6以上的KERNEL才能工作。

WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
leoxhj 发表于 2016-1-9 22:48:11 | 显示全部楼层
新手进来学习
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
topsir 发表于 2016-1-22 14:40:53 | 显示全部楼层
新手进来学习
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
dgm333 发表于 2016-2-1 17:52:12 | 显示全部楼层
看看如何,谢谢分享
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
qsjdh 发表于 2016-2-15 14:48:16 | 显示全部楼层
英文,看不懂。有哪位可以翻译一下了、
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
intomon 发表于 2016-2-29 13:32:41 | 显示全部楼层
装这个有啥好处?
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
13585936205 发表于 2016-3-15 23:26:49 | 显示全部楼层
看看看啊看、
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
tnt3000 发表于 2016-7-22 09:48:46 | 显示全部楼层
英文,看不懂。有哪位可以翻译一下了
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
jankol 发表于 2016-9-28 21:11:12 | 显示全部楼层
先试试,好像不错
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
gunzheng 发表于 2017-4-22 21:09:44 | 显示全部楼层
可惜不懂英文
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
关闭

站点推荐上一条 /1 下一条

万丰乐活

GMT+8, 2024-3-28 19:22

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表