This repository was archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy paththird-stage.sh
69 lines (51 loc) · 1.81 KB
/
third-stage.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
#!/bin/bash
#### Prepare environment path
export PS1="(chroot)${PS1}"
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
export DEBIAN_FRONTEND=noninteractive
#### Configure networking and timezone
echo '127.0.0.1 localhost' > /etc/hosts
echo '127.0.1.1 oem' >> /etc/hosts
echo 'oem' > /etc/hostname
echo 'Etc/UTC' > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
#### Install packages
apt update
apt dist-upgrade -yq
apt install flash-kernel linux-firmware sudo u-boot-tools wireless-tools -y
apt install xserver-xorg{,-input-{evdev,synaptics},-video-fbdev} -y
apt install xubuntu-default-settings light{dm{,-gtk-greeter{,-settings}},-locker} -y
apt install xfce4-{appfinder,indicator-plugin,notifyd,panel,power-manager,screenshooter,terminal,whiskermenu-plugin} -y
apt install catfish lxtask midori mousepad ristretto thunar -y
apt install evince file-roller gnome-{calculator,system-tools} gucharmap -y
apt install {language-selector,network-manager}-gnome software-properties-gtk -y
apt install oem-config-gtk ubiquity-frontend-gtk -y
#### Create filesystem table
cat <<'EOF' > /etc/fstab
/dev/mmcblk0p1 / ext4 rw,noatime,commit=30,barrier=1,data=ordered 0 0
/swapfile none swap sw 0 0
EOF
#### Fix flash-kernel utility
cat <<'EOF' > /usr/share/flash-kernel/db/all.db
Machine: Toshiba AC100 / Dynabook AZ
Method: generic
U-Boot-Kernel-Address: 0x1000000
U-Boot-Initrd-Address: 0x0
Boot-Kernel-Path: /boot/uImage
Boot-Initrd-Path: /boot/uInitrd
Bootloader-sets-root: no
EOF
#### Installing kernel
dpkg -i /tmp/linux-image-ac100_3.16*.deb
#### Configure swap
echo 'vm.swappiness = 15' >> /etc/sysctl.conf
#### Add user
adduser --disabled-password --gecos "" oem
echo 'oem:oem' | chpasswd
gpasswd -a oem sudo
#### Housekeeping
oem-config-prepare
apt-get autoremove --purge -y
apt-get autoclean
apt-get clean
exit