-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathqemu_install.sh
145 lines (115 loc) · 5.31 KB
/
qemu_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
COL_GREEN="\e[1;32m"
COL_NORMAL="\e[m"
echo "${COL_GREEN}Technexion customized minimal rootfs staring...${COL_NORMAL}"
echo "${COL_GREEN}creating ubuntu sudoer account...${COL_NORMAL}"
cd /
echo technexion > /etc/hostname
echo -e "127.0.1.1\ttechnexion" >> /etc/hosts
echo -e "nameserver\t8.8.8.8" >> /etc/hosts
(echo "root"; echo "root";) | passwd
(echo "ubuntu"; echo "ubuntu"; echo;) | adduser ubuntu
usermod -aG sudo ubuntu
echo "${COL_GREEN}apt-get server upgrading...${COL_NORMAL}"
# apt-get source adding
cat <<END > /etc/apt/sources.list
deb http://ports.ubuntu.com/ubuntu-ports/ focal main
deb http://ports.ubuntu.com/ubuntu-ports/ focal universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main
END
# apt-get source update and installation
yes "Y" | sudo apt-get update
yes "Y" | sudo apt-get upgrade
yes "Y" | sudo apt --fix-broken install
yes "Y" | apt install openssh-server iw wpasupplicant hostapd util-linux procps iproute2 haveged dnsmasq iptables net-tools ppp ntp ntpdate bridge-utils can-utils v4l-utils usbutils
yes "Y" | apt install bash-completion ifupdown resolvconf alsa-utils gpiod cloud-utils libpolkit-agent-1-0 libpolkit-gobject-1-0 policykit-1 udhcpc rng-tools
#install docker-ce
yes "Y" | apt install gnupg apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu focal stable"
yes "Y" | sudo apt-get update
apt-cache policy docker-ce
yes "Y" | apt install docker-ce
# network configuration
cat <<END > /etc/network/interfaces
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
END
# audio setting
cat <<END > /root/.asoundrc
pcm.!default {
type plug
slave {
pcm "hw:0,0"
}
}
ctl.!default {
type hw
card 0
}
END
# weston
yes "Y" | apt install libinput10 libpixman-1-0 libxkbcommon0 libpng16-16 libfontconfig1 libxcb-shm0 libxcb-render0 libxrender1 libthai0 libharfbuzz0b libcolord2
# chromium
yes "Y" | apt install libnss3 libwebpdemux2 libxslt1.1
# QT5
yes "Y" | apt install libdouble-conversion3
#docker part
groupadd docker
usermod -aG docker ubuntu
# weston desktop support
yes "Y" | apt install libinput10 libpixman-1-0 libxkbcommon0 libpng16-16 libfontconfig1 libxcb-shm0 libxcb-render0 libxrender1 libthai0 libharfbuzz0b libcolord2 libpangocairo-1.0-0
# gstreamer-1.0 dependency
yes "Y" | apt install libdc1394-22 libmodplug1 libsoup2.4-1 librsvg2-2 libopenmpt0 libmpcdec6 libzbar0 libbs2b0 libvpx6 libv4l-0 libavfilter7 libvo-aacenc0 libgdk-pixbuf2.0-0
yes "Y" | apt install libde265-0 libmms0 libmjpegutils-2.1-0 libvo-amrwbenc0 libwildmidi2 libmpeg2encpp-2.1-0 libvisual-0.4-0 libsrt1 libtag1-dev libcaca0 libavfilter7
yes "Y" | apt install libcodec2-0.9 libxdamage1 libshout3 libchromaprint1 libusrsctp1 libjack0 libsbc1 libmplex2-2.1-0 libavc1394-0 libsoundtouch1 libfluidsynth2 libshout3 libdca0
yes "Y" | apt install libofa0 libsrtp2-1 libdv4 libkate1 libwebrtc-audio-processing1 libaa1 libnice10 libcurl4-gnutls-dev libdvdnav4 libiec61883-0 libgraphene-1.0-0 libspandsp2 libfaad2
yes "Y" | apt install libcurl4 libatk1.0-0 libatk-bridge2.0-0 libtbb2
# dpkg install latest network-manager and modem-manager for 5gnr module
# mmcli
dpkg -i /opt/deb/5gnr/mm/libmbim-glib4_1.24.4-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/libmbim-proxy_1.24.4-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/libmm-glib0_1.14.2-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/libqmi-glib5_1.26.4-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/libqmi-proxy_1.26.4-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/modemmanager_1.14.2-0.1_arm64.deb
dpkg -i /opt/deb/5gnr/mm/libqmi-utils_1.26.4-0.1_arm64.deb
# nmcli
dpkg -i /opt/deb/5gnr/nm/libbluetooth3_5.55-0ubuntu1_arm64.deb
dpkg -i /opt/deb/5gnr/nm/libndp0_1.7-0ubuntu1_arm64.deb
dpkg -i /opt/deb/5gnr/nm/libselinux1_3.1-2_arm64.deb
dpkg -i /opt/deb/5gnr/nm/libjansson4_2.13.1-1ubuntu1_arm64.deb
dpkg -i /opt/deb/5gnr/nm/libnm0_1.26.2-1ubuntu1_arm64.deb
dpkg -i /opt/deb/5gnr/nm/libteamdctl0_1.31-1_arm64.deb
dpkg -i /opt/deb/5gnr/nm/network-manager_1.26.2-1ubuntu1_arm64.deb
# tn nfc
dpkg -i /opt/deb/nfc/tn-nfc_1.0.0-0.1_arm64.deb
sudo systemctl daemon-reload
sudo systemctl disable getty@tty1.service
sudo systemctl enable rc-local.service
sudo systemctl disable serial-qcabtfw
sudo systemctl disable bluetooth
# disable initail failed relate services
sudo systemctl disable hostapd.service
sudo systemctl disable dnsmasq.service
# let network-manager handle all network interfaces
touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
sed -i 's/managed=false/managed=true/' /etc/NetworkManager/NetworkManager.conf
# disable type password everytime using ubuntu user
sed -i 's/sudo\tALL=(ALL:ALL) ALL/sudo\tALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
# zram swap size
echo "${COL_GREEN}Add swap partition...Default size is one-fourth of total memory${COL_NORMAL}"
yes "Y" | apt install zram-config
sed -i 's/totalmem\ \/\ 2/totalmem\ \/\ 4/' /usr/bin/init-zram-swapping
mkdir -p /lib/modules/
echo -e "source /etc/profile.d/weston.sh" >> /root/.bashrc
# clear the patches
rm -rf var/cache/apt/archives/*
sync