├── motd ├── aur-packages ├── download.sh ├── file.list └── SHA256SUMS ├── Riot.desktop ├── syncarch ├── xinitrc ├── LICENSE ├── chroot-install.sh ├── README.rst └── install.sh /motd: -------------------------------------------------------------------------------- 1 | 2 | Welcome to glorious arch! 3 | The password of arch is arch. 4 | -------------------------------------------------------------------------------- /aur-packages/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | wget -c -i file.list && sha256sum -c SHA256SUMS && echo ok 3 | -------------------------------------------------------------------------------- /aur-packages/file.list: -------------------------------------------------------------------------------- 1 | https://wehack.space/vimacs/aur/coreboot-utils-git-4.9.r865.g49aaff799f2-1-x86_64.pkg.tar.xz 2 | https://wehack.space/vimacs/aur/trousers-0.3.14-3-x86_64.pkg.tar.xz 3 | https://wehack.space/vimacs/aur/opencryptoki-3.7.0-2-x86_64.pkg.tar.xz 4 | https://wehack.space/vimacs/aur/tpm-tools-1.3.9.1-2-x86_64.pkg.tar.xz 5 | -------------------------------------------------------------------------------- /Riot.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Version=1.0 4 | Name=Riot 5 | GenericName=Riot Web 6 | Exec=/usr/lib/firefox/firefox /usr/share/webapps/riot/index.html 7 | Icon=firefox 8 | Terminal=false 9 | Type=Application 10 | StartupNotify=true 11 | StartupWMClass=Firefox 12 | Categories=Network;WebBrowser; 13 | Keywords=web;browser;internet; 14 | -------------------------------------------------------------------------------- /aur-packages/SHA256SUMS: -------------------------------------------------------------------------------- 1 | 1eabdbec60c8197126e013bc24adbcd58f160e362bd3e793033d228d12b0d2e4 coreboot-utils-git-4.9.r865.g49aaff799f2-1-x86_64.pkg.tar.xz 2 | 8258f77074868a5681ba7043e8f734d4a5d7a43e2dd7979b8393d125f5e1b02a trousers-0.3.14-3-x86_64.pkg.tar.xz 3 | 080e24f3f94499f64c9063e4b4552681fe2cff4483dc77fd678f752394a60156 opencryptoki-3.7.0-2-x86_64.pkg.tar.xz 4 | 417c99050e64a319aa44369ab4607e1dfaa2a6d5ceea81416376f5c19169cec1 tpm-tools-1.3.9.1-2-x86_64.pkg.tar.xz 5 | -------------------------------------------------------------------------------- /syncarch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # refer to: https://wiki.archlinux.org/index.php/Rsync#Full_system_backup 3 | 4 | ROOTPATH=/mnt 5 | 6 | rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/var/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / "$ROOTPATH" 7 | 8 | # reinstall linux 9 | arch-chroot "$ROOTPATH" pacman -S --noconfirm linux 10 | 11 | genfstab -U "$ROOTPATH" | tee "$ROOTPATH/etc/fstab" 12 | 13 | SYSTEMD="$ROOTPATH/etc/systemd/system" 14 | rm -rf "$SYSTEMD/getty@tty1.service.d" 15 | rm "$SYSTEMD"/*.{service,mount} "$SYSTEMD"/multi-user.target.wants/*.service 16 | -------------------------------------------------------------------------------- /xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | userresources=$HOME/.Xresources 4 | usermodmap=$HOME/.Xmodmap 5 | sysresources=/etc/X11/xinit/.Xresources 6 | sysmodmap=/etc/X11/xinit/.Xmodmap 7 | 8 | # merge in defaults and keymaps 9 | 10 | if [ -f $sysresources ]; then 11 | xrdb -merge $sysresources 12 | fi 13 | 14 | if [ -f $sysmodmap ]; then 15 | xmodmap $sysmodmap 16 | fi 17 | 18 | if [ -f "$userresources" ]; then 19 | xrdb -merge "$userresources" 20 | fi 21 | 22 | if [ -f "$usermodmap" ]; then 23 | xmodmap "$usermodmap" 24 | fi 25 | 26 | # start some nice programs 27 | 28 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 29 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 30 | [ -x "$f" ] && . "$f" 31 | done 32 | unset f 33 | fi 34 | 35 | for desession in mate-session startxfce4 startlxde startlxqt startdde budgie-desktop 36 | do 37 | which $desession && exec $desession 38 | done 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Iru Cai (vimacs) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /chroot-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | MIRROR=${MIRROR:='http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch'} 5 | DESKTOP_LXQT=(lxqt) 6 | DESKTOP_DDE=(deepin deepin-extra) 7 | 8 | GUIPKGS=(qemu ovmf \ 9 | ttf-droid ttf-dejavu \ 10 | xorg-server xorg-xrandr xorg-xrdb xorg-xev xorg-setxkbmap xorg-setxkbmap xorg-drivers xorg-xinit 11 | gparted firefox pidgin pidgin-otr pidgin-xmpp-receipts element-desktop 12 | leafpad 13 | network-manager-applet) 14 | 15 | case "${DESKTOP}" in 16 | no) 17 | DESKTOP=() 18 | ;; 19 | mate) 20 | DESKTOP=(mate mate-terminal) 21 | ;; 22 | xfce*) 23 | DESKTOP=(xfce4) 24 | ;; 25 | lxde-gtk3) 26 | DESKTOP=(lxde-common lxlauncher-gtk3 lxpanel-gtk3 lxsession-gtk3 lxterminal openbox pcmanfm-gtk3) 27 | ;; 28 | lxqt) 29 | DESKTOP=("${DESKTOP_LXQT[@]}") 30 | ;; 31 | dde) 32 | DESKTOP=("${DESKTOP_DDE[@]}") 33 | ;; 34 | budgie) 35 | DESKTOP=(budgie-desktop gnome-terminal) 36 | ;; 37 | *) 38 | DESKTOP=() 39 | ;; 40 | esac 41 | 42 | if [[ "${#DESKTOP[@]}" -ne 0 ]]; then 43 | DESKTOP+=("${GUIPKGS[@]}") 44 | fi 45 | 46 | pacman-key --init 47 | pacman-key --populate archlinux 48 | 49 | cp /etc/pacman.conf /etc/pacman.conf.bak 50 | sed -i 's/CheckSpace/#CheckSpace/g' /etc/pacman.conf 51 | 52 | cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak 53 | echo "Server = ${MIRROR}" > /etc/pacman.d/mirrorlist 54 | 55 | # (re)install linux because the Linux image is not present 56 | pacman --noconfirm -Sy linux 57 | pacman --noconfirm -Syu --needed \ 58 | base-devel \ 59 | git \ 60 | archiso \ 61 | wireguard-tools \ 62 | flashrom debootstrap htop \ 63 | acpid iasl dmidecode procinfo-ng efibootmgr \ 64 | picocom \ 65 | bash-completion zsh-completions \ 66 | networkmanager \ 67 | chntpw radare2 \ 68 | fwupd \ 69 | wimlib \ 70 | "${DESKTOP[@]}" 71 | 72 | if /bin/ls /aur/*.pkg.tar.*; then 73 | pacman --noconfirm -U --needed /aur/*.pkg.tar.* 74 | fi 75 | 76 | # wireguard modules has been built, remove dkms and linux-headers 77 | #pacman --noconfirm -Rdd dkms 78 | #pacman --noconfirm -Rcsn linux-headers 79 | 80 | mkinitcpio -p linux 81 | 82 | mv /etc/pacman.conf.bak /etc/pacman.conf 83 | mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist 84 | 85 | if ! grep '^arch:' /etc/passwd; then 86 | useradd -m -G wheel,uucp arch 87 | echo arch:arch | chpasswd 88 | sed -i 's/^# %wheel/%wheel/g' /etc/sudoers 89 | sed -i 's/root/arch/g' /etc/systemd/system/getty@tty1.service.d/autologin.conf 90 | fi 91 | 92 | gpgconf --homedir /etc/pacman.d/gnupg/ --kill gpg-agent || echo 'Failed to kill gpg-agent' 93 | rm -f /etc/udev/rules.d/81-dhcpcd.rules 94 | 95 | systemctl enable NetworkManager 96 | systemctl enable acpid 97 | 98 | # save the kernel package 99 | cp "/var/cache/pacman/pkg/linux-$(pacman -Q linux|cut -d ' ' -f2)-x86_64.pkg.tar.zst" /opt/ 100 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Oh my Glorious Arch 2 | =================== 3 | 4 | `Arch is the best! `_ 5 | 6 | I need a good Live CD, but I still cannot find a perfect one for me. 7 | 8 | - `SystemRescueCd `_ is awesome, but it's Gentoo-based and not so easy to extend it. Now it's based on Arch, and it becomes bigger and lacks some tools I need. 9 | - Debian-based distributions are easy to make, but I don't like the style of deb/rpm packages. Well, `Grml `__ is awesome for admins. 10 | - Arch is glorious, but its Live CD is a bit simple. 11 | 12 | So now I'll make another Arch Live CD of my own. I'll make a new airootfs.sfs from any other GNU/Linux distribution, and package it in an iso file. My `liveusb-builder `_ also supports it. 13 | 14 | The name `glorious` comes from `r/linuxmasterrace `_. 15 | 16 | Usage 17 | ----- 18 | 19 | Dependencies: 20 | 21 | - systemd (for systemd-nspawn) 22 | - squashfs-tools 23 | - xorriso 24 | 25 | To prevent you from screwing up your machine, you'd better use this script in a VM. 26 | 27 | You need root to run the install script, because chroot is needed. The command is very simple:: 28 | 29 | sudo ./install.sh [--mirror=] [--desktop=] [--comp=] 30 | 31 | To add more packages, you can put your Arch packages to ``aur-packages/``. 32 | 33 | The format of is the string after ``Server =`` in /etc/pacman.d/mirrorlist. 34 | 35 | can be ``mate``, ``xfce``, ``dde``, ``lxde-gtk3`` and ``lxqt``. 36 | 37 | Default mirror and desktop is TUNA mirror and MATE desktop. 38 | 39 | Example:: 40 | 41 | sudo ./install.sh archlinux-2017.05.01-x86_64.iso --mirror 'http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch' --desktop=lxqt 42 | 43 | Packages 44 | -------- 45 | 46 | I now have these tools in my Live CD: 47 | 48 | - flashrom: to flash coreboot to my machine 49 | - coreboot-utils: cbmem, inteltool, intelmetool, ectool, etc. 50 | - acpid and iasl: for handling ACPI things 51 | - htop: the glorious task manager 52 | - debootstrap: to install a Debian-based system easily 53 | - picocom: to access the serial console 54 | - WireGuard VPN 55 | 56 | For the Live CDs with a desktop environment, I have: 57 | 58 | - a good desktop environment: MATE, Xfce, LXDE-GTK3, LXQt or DDE 59 | - QEMU: to install other OS with an ISO image, including Windows (using my disk as virtual disk). This is the most glorious feature of this Live CD. `And Grml adopted my idea. `__ 60 | - gparted: the glorious partition manager 61 | - Firefox to access the Internet 62 | - Riot web 63 | - Pidgin with OTR plugin 64 | 65 | 66 | Download 67 | -------- 68 | 69 | I built a gloriousarch Xfce4 iso and uploaded it to `sourceforge `_. It's signed by a PGP key whose primary key fingerprint is 7079B481F04B5D8B65A0ECDEEA2DB82FE04A9403. 70 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # check if the needed tools exist 5 | mksquashfs -version | grep 'mksquashfs version' 6 | xorriso -version 2>/dev/null | grep 'xorriso version' 7 | 8 | ROOTDIR="$(dirname $(realpath "$0"))" 9 | WORKDIR=/tmp/work 10 | ISO="$(realpath "$1")" 11 | MIRROR= 12 | DESKTOP=nox 13 | COMP=xz 14 | 15 | shift 16 | while [ -n "$1" ]; do 17 | case "$1" in 18 | --mirror) 19 | shift 20 | MIRROR="$1" 21 | shift 22 | ;; 23 | --mirror=*) 24 | MIRROR="${1/--mirror=}" 25 | shift 26 | ;; 27 | --desktop) 28 | shift 29 | DESKTOP="$1" 30 | shift 31 | ;; 32 | --desktop=*) 33 | DESKTOP="${1/--desktop=}" 34 | shift 35 | ;; 36 | --comp) 37 | shift 38 | COMP="$1" 39 | shift 40 | ;; 41 | --comp=*) 42 | COMP="${1/--comp=}" 43 | shift 44 | ;; 45 | *) 46 | ;; 47 | esac 48 | done 49 | 50 | mkdir -p "${WORKDIR}/mnt" 51 | 52 | if test -d /var/cache/pacman/pkg 53 | then 54 | PKGDIR=/var/cache/pacman/pkg 55 | else 56 | mkdir -p "${WORKDIR}/pkg" 57 | PKGDIR=pkg 58 | fi 59 | 60 | cd "${WORKDIR}" 61 | mount "$ISO" mnt 62 | 63 | # copy all iso files to target/ 64 | mkdir -p target/arch/x86_64 65 | cp -a mnt/{EFI,syslinux,loader} target/ 66 | cp -a mnt/arch/boot target/arch/ 67 | 68 | unsquashfs mnt/arch/x86_64/airootfs.sfs 69 | 70 | #mount -t proc none squashfs-root/proc 71 | #mount --bind /dev squashfs-root/dev 72 | #mount -t sysfs none squashfs-root/sys 73 | mount --bind "${PKGDIR}" squashfs-root/var/cache/pacman/pkg 74 | 75 | mkdir -p squashfs-root/aur 76 | mount --bind -o ro "${ROOTDIR}/aur-packages" squashfs-root/aur 77 | 78 | #cp -L /etc/resolv.conf squashfs-root/etc/resolv.conf 79 | cp "${ROOTDIR}/chroot-install.sh" squashfs-root/ 80 | #install -D "${ROOTDIR}/archiso.preset" squashfs-root/etc/mkinitcpio.d/ 81 | cd squashfs-root 82 | systemd-nspawn /usr/bin/env MIRROR="${MIRROR}" DESKTOP="${DESKTOP}" \ 83 | /bin/bash /chroot-install.sh 84 | cd "${WORKDIR}" 85 | 86 | rm squashfs-root/chroot-install.sh 87 | install "${ROOTDIR}/syncarch" squashfs-root/usr/local/bin/syncarch 88 | install "${ROOTDIR}/xinitrc" squashfs-root/home/arch/.xinitrc 89 | chroot squashfs-root chown -R arch:arch \ 90 | /home/arch/.xinitrc 91 | cat "${ROOTDIR}/motd" >> squashfs-root/etc/motd 92 | mv squashfs-root/boot/vmlinuz-linux target/arch/boot/x86_64/ 93 | mv squashfs-root/boot/initramfs-linux.img target/arch/boot/x86_64/ 94 | #mv squashfs-root/boot/*-ucode.img target/arch/boot/ 95 | rm -f squashfs-root/boot/initramfs* 96 | 97 | umount squashfs-root/aur 98 | umount squashfs-root/var/cache/pacman/pkg 99 | rmdir squashfs-root/aur 100 | mv squashfs-root/opt/*.pkg.tar* squashfs-root/var/cache/pacman/pkg/ 101 | #umount squashfs-root/sys 102 | #umount squashfs-root/dev 103 | #umount squashfs-root/proc 104 | 105 | mksquashfs squashfs-root target/arch/x86_64/airootfs.sfs -comp $COMP 106 | umount mnt 107 | 108 | _label_line=$(grep -m 1 -o 'archisolabel=ARCH_[0-9]*' target/syslinux/archiso_sys-linux.cfg) 109 | iso_label=${_label_line/archisolabel=} 110 | 111 | xorriso -as mkisofs \ 112 | -iso-level 3 \ 113 | -full-iso9660-filenames \ 114 | -volid "${iso_label}" \ 115 | -eltorito-boot syslinux/isolinux.bin \ 116 | -eltorito-catalog syslinux/boot.cat \ 117 | -no-emul-boot -boot-load-size 4 -boot-info-table \ 118 | -isohybrid-mbr target/syslinux/isohdpfx.bin \ 119 | -output "gloriousarch-${DESKTOP}.iso" \ 120 | target/ 121 | 122 | echo "gloriousarch.iso is at ${WORKDIR}/gloriousarch-${DESKTOP}.iso" 123 | printf 'clean up...' 124 | rm -rf squashfs-root target 125 | echo 'done' 126 | --------------------------------------------------------------------------------