Tag Archives: ubuntu

ARM64 Centos8 PXE Boot Install

This document will introduce how to setup a centos PXE boot environment on ubuntu 18.04 for install centos8 to your ARM64 machine.

In this document, it uses CentOS 8 version is 8.1.1911, it might also work on later version if you change file name accordingly . 

all command in this document we assume you already run with root permission. 

Read more »

Install Kubernetes on ARM64 Ubuntu 18.04 (with QEMU)

Install Kubernetes on Ubuntu 18.04 is very easy now, but only for x86 platform. If on ARM64 environment, it might have some other problem.
Some old article mentioned a lot of information but software version is too old for deploy a new version software.

After a lot of time to have research, here is instruction for how to install Kubernetes on ARM64 Ubuntu 18.04

Read more »

Ubuntu 18.04 Change Mac Address on QEMU via Netplan

This is a quick note about how to modify mac address for qemu image with ubuntu 18.04 cloud image.

but I have not found a working way only change mac address in system

Read more »

Ubuntu 18.04 ARM64 DPDK in VM (QEMU)

DPDK is a very popular infrastructure in high speed packet process domain, some applications will used the same architecture to process packet, like EPC.

For Ubuntu 18.04, it used dpdk 17.11, it not good for some other application like dpdk pktgen, but enough for testpmd and l3fwd test. here is some personal note for setup whole environment.

DPDK in QEMU archeticture
Read more »

ARM64 Kdump cannot allocate crashkernel

In ARM64 server and installed memory around 128G, ubuntu default /etc/default/grub.d/kdump-tools.cfg default configuration might cause kdump allocate memory failed. error message as below

[ 0.000000] cannot allocate crashkernel (size:0x80000000)
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.18.0-25-generic root=UUID=ee8be10d-d649-425d-a807-640751836186 ro console=tty0 crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M

Read more »

Change Ubuntu Cloud Image Size

Ubuntu Cloud Image Size 似乎各個版本的特性不太一樣, 而且似乎也要用不同的方式修改 Image size

Read more »

Change Ubuntu Cloud Image Password

Ubuntu cloud image is very good for deploy a simple qemu image system.
But the image has it owns password and initial script.

Read more »

Ubuntu Create Netboot Image

剛好工作上有需要用到在 Ubuntu 做一個新的 netboot image, 這樣就不用等 Canonical release 新版的 netboot image.

我用的是 Ubuntu 17.04, 如果要在別的版本上執行, 會有一點差異
Read more »

MIPS/ARM64 Debian/Ubuntu debootstrap

這個時間點, debian mips 的 debootstrap 只有 jessie 是好的, sid 或是 stretch 都有問題.

$ debootstrap --verbose --foreign --arch mips jessie ./   http://ftp.tw.debian.org/debian

mips64 只有 mips64le , 沒有 mips64 .

其他的還是看這篇文章就好, 也快八年了.
[ARM][Linux] 建立 ARM 平台的 Debian System

懶得再開一篇, 改一改就好了.
如果是裝 ARM64 Ubuntu 呢? mirror 改到 ports.ubuntu.com 去就可以了, 也有 tw.ports.ubuntu.com 但是我記得是指向國外, 記得 arch 和版本號都要改
Ubuntu 16.04 LTS

$ debootstrap --verbose --foreign --arch arm64 xenial ./ubuntu http://tw.ports.ubuntu.com/ubuntu-ports

Ubuntu 18.04 LTS

$ debootstrap --verbose --foreign --arch arm64 bionic./ubuntu http://tw.ports.ubuntu.com/ubuntu-ports

我愛用 NFS 開機, 這是 u-boot NFS 的 example command

setenv bootargs 'console=ttyAMA0,115200n8 earlycon=pl011,0x87e028000000 debug maxcpus=24 rootwait rw ip=dhcp::eth2:off root=/dev/nfs rw nfsroot=,v3 coherent_pool=16M'
setenv start 'setenv ethact vnic2 ; dhcp ;  setenv serverip ;  tftpboot $kernel_addr Image ; booti $kernel_addr - $fdtcontroladdr'
run start

如果是在 target board 上執行, 可以 chroot 到 ubuntu 內, 如果是用 NFS 開機, 可以跳到 run second-stage

cd /ubuntu
mount --bind /proc proc
mount --bind /dev dev
mount --bind /sys sys
cd etc
cp /etc/resolv.conf . 
cd / 
chroot ubuntu bash

執行, 解壓相關的 package (run second-stage)

/debootstrap/debootstrap --second-stage

Ubuntu 16.04 編輯 /etc/apt/source.list 加上

deb http://tw.ports.ubuntu.com/ubuntu-ports xenial main restricted
deb http://tw.ports.ubuntu.com/ubuntu-ports xenial-updates main restricted
deb-src http://tw.ports.ubuntu.com/ubuntu-ports xenial main restricted universe multiverse
deb-src http://tw.ports.ubuntu.com/ubuntu-ports xenial-updates main restricted universe multiverse
deb http://tw.ports.ubuntu.com/ubuntu-ports xenial universe
deb http://tw.ports.ubuntu.com/ubuntu-ports xenial-updates universe
deb http://tw.ports.ubuntu.com/ubuntu-ports xenial multiverse
deb http://tw.ports.ubuntu.com/ubuntu-ports xenial-updates multiverse

如果是 18.04

deb http://tw.ports.ubuntu.com/ubuntu-ports bionic main restricted
deb http://tw.ports.ubuntu.com/ubuntu-ports bionic-updates main restricted
deb-src http://tw.ports.ubuntu.com/ubuntu-ports bionic main restricted universe
deb-src http://tw.ports.ubuntu.com/ubuntu-ports bionic-updates main restricted u
niverse multiverse
deb http://tw.ports.ubuntu.com/ubuntu-ports bionic universe
deb http://tw.ports.ubuntu.com/ubuntu-ports bionic-updates universe
deb http://tw.ports.ubuntu.com/ubuntu-ports bionic multiverse
deb http://tw.ports.ubuntu.com/ubuntu-ports bionic-updates multiverse


$ apt update
$ apt -y upgrade

安裝必要的程式 (註:註 net-tools 過時了, 可以我還是習慣舊指令)

$ apt install -y vim openssh-server tmux btrfs-tools net-tools sudo wget resolvconf-admin

Add User

$ adduser [username]

順便改 root 的密碼

$ passwd root

加上無密碼 請參考這個連結

註: 18.04 可能要先設定密碼之後重開機一次才能, 更新系統環境變數, 安裝套件以便之後的設定

註2: 18.04 如果時間差太多會 update 失敗, 要先調整時間到今天
先裝 nfs-common 增加 nfs access 的速度

$ apt install -y nfs-common

備用, 17.04 後似乎都會用 resolvconf 當 DNS service, 但是不知道為什麼不會取用 DHCP 得到的 DNS

$ systemctl disable systemd-resolved.service
$ service systemd-resolved stop
$ echo "nameserver" > /etc/resolv.conf


編輯 /etc/hostname
取一個合適的名字, 預設是用執行 debootstrap 的主機名稱

編輯 /etc/network/interface

如果有 cache server, 加到 /etc/apt/apt.conf

最後要產生 utf-8 的 locale 檔案

$ sudo locale-gen en_US.UTF-8

Ubuntu Sudo Nopasswd

目前用到比較好 sudo nopasswd 的方法
Ubuntu 16.04 適用

改寫一下, 這是講 ubuntu clouding image , 不過一般 Desktop 應該也適用

At the end of /etc/sudoers there is what I thought was just a comment:
#includedir /etc/sudoers.d

You should edit this file using visudo. The following command will let you edit the correct file with visudo.

$ sudo visudo -f /etc/sudoers.d/90-cloudimg-ubuntu 

And add a line like:

[username] ALL=(ALL) NOPASSWD:ALL 

At the end.