5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android上にdebianをインストールするdebian-kitの流れを追ってみた

5
Last updated at Posted at 2013-07-08

Android上でubuntuやdebianが動作します。
(nexus7にAndroidを消してubuntuを入れるというのにこだわらなくて済みそう。)
ubuntuだとXで問題があるらしいので、実質debian専用かな。

インストーラ(debian-kit-1-5.shar)を改修しようと思ったけど時間が足りなかった・・・。
取り急ぎわかったところをスクリプトで伝えます。

debian-kit-1-5.sharをダウンロードし、実行
# !/system/bin/sh
SHAR_FILE="debian-kit-1-5.shar"
if [ ! -e "$SHAR_FILE" ];then
    echo "[ERR1] '$SHAR_FILE' no such file. quit."
    exit 1
fi

chmod +x $SHAR_FILE && ./$SHAR_FILE
  • /data/local/deb/autorun がインストーラから呼ばれ、mk-debianを呼ぶ。
  • /data/local/deb/mk-debian から debootstrapが呼ばれる。
  • インストールが終わったら、 deb コマンドでdebian環境が開始される。
インストール後の必須初期設定
# !/bin/sh

if [ ! -e "/etc/debian_version" ]; then
    echo "[ERR1] cannot execute. check file '/etc/debian_version' not found. quit."
    exit 1
fi

if [ "$USER" != "root" ]; then
    echo "[ERR2] execute user must root. quit."
    exit 1
fi

apt-get update
apt-get -y install andromize sudo netcat ssh locales

# rootしかいないので一般ユーザ(例:debian)作成
adduser debian
usermod -G inet,sudo,debian debian
passwd debian

# timezone
echo "Asia/Tokyo" > /etc/timezone
echo "TZ='Asia/Tokyo'; export TZ" >> /home/debian/.profile 

# 一般ユーザでも読み取れるように700から修正
chmod 755 /etc/resolv.conf

# locale変更
sed -i -e 's/# \(ja_JP.UTF-8\)/\1/' /etc/locale.gen
locale-gen

echo "[INFO] done."

寝よう。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?