├── .github └── workflows │ └── default.yml ├── README.md ├── config-aarch64-default ├── config-default ├── config-gnome ├── config-kde ├── config-ultralite ├── config-xfce ├── contrib └── arch-chroot ├── custom ├── patches │ └── archiso_pxe_http.hook │ │ ├── 1.patch │ │ └── patch.sh ├── rootoverlay │ └── etc │ │ └── initcpio │ │ ├── hooks │ │ └── archiso_pxe_dns │ │ └── install │ │ └── archiso_pxe_dns └── rootoverlays │ ├── kde │ └── etc │ │ └── polkit-1 │ │ └── rules.d │ │ └── 49-nopasswd_global.rules │ ├── ultralite-zram │ └── etc │ │ └── initcpio │ │ ├── hooks │ │ └── archiso_zram │ │ └── install │ │ └── archiso_zram │ └── xfce │ └── etc │ └── polkit-1 │ └── rules.d │ └── 49-nopasswd_global.rules └── makelivecd.sh /.github/workflows/default.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: livecd_builder 4 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request 6 | # events but only for the master branch 7 | on: 8 | push: 9 | branches: [ master ] 10 | schedule: 11 | - cron: '0 3 2,16 * *' 12 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 14 | jobs: 15 | # This workflow contains a single job called "build" 16 | build: 17 | name: Build livecd 18 | # The type of runner that the job will run on 19 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }} 20 | runs-on: ubuntu-22.04 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | LIVECD_PROFILE: 25 | - ultralite 26 | - default 27 | - xfce 28 | - kde 29 | - gnome 30 | 31 | # Steps represent a sequence of tasks that will be executed as part of the job 32 | steps: 33 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 34 | - uses: actions/checkout@v4 35 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, format('[skip {0}]', matrix.LIVECD_PROFILE)) }} 36 | with: 37 | ref: master 38 | 39 | # install deps 40 | - name: Install deps 41 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, format('[skip {0}]', matrix.LIVECD_PROFILE)) }} 42 | shell: bash 43 | run: | 44 | sudo apt update -qq 45 | sudo apt install -y tree rsync openssh-client qemu-user-static 46 | 47 | # Runs a single command using the runners shell 48 | - name: Run makelivecd script 49 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, format('[skip {0}]', matrix.LIVECD_PROFILE)) }} 50 | shell: bash 51 | env: 52 | LIVECD_PROFILE: ${{ matrix.LIVECD_PROFILE }} 53 | run: sudo LIVECD_PROFILE="$LIVECD_PROFILE" bash makelivecd.sh 54 | 55 | # Runs a set of commands using the runners shell 56 | # upload files 57 | - name: Upload files 58 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, format('[skip {0}]', matrix.LIVECD_PROFILE)) }} 59 | env: 60 | LIVECD_PROFILE: ${{ matrix.LIVECD_PROFILE }} 61 | RSYNC_HOST: ${{ secrets.HOST }} 62 | RSYNC_PATH: ${{ secrets.PATH }} 63 | KNOWN_HOST: ${{ secrets.KNOWN_HOST }} 64 | SSHPRIVKEY: ${{ secrets.KEY }} 65 | shell: bash 66 | run: | 67 | cd root.x86_64/livecd/releng 68 | sudo chown -R $UID upload 69 | sudo chown $UID . 70 | tree -a upload || true 71 | echo "Setting up KNOWN_HOST..." 72 | echo "$KNOWN_HOST" > ~/kh 73 | echo "Setting up PRIV_KEY ..." 74 | trap "shred -v ~/key ~/kh" ERR EXIT 75 | echo "$SSHPRIVKEY" |base64 -d > ~/key 76 | chmod 0600 ~/key 77 | echo "ASSERTING ..." 78 | [ -n "$RSYNC_HOST" ] || (echo RSYNC_HOST is not set; exit 1) 79 | [ -n "$RSYNC_PATH" ] || (echo RSYNC_PATH is not set; exit 1) 80 | [ -n "$KNOWN_HOST" ] || (echo KNOWN_HOST is not set; exit 1) 81 | [ -n "$SSHPRIVKEY" ] || (echo SSHPRIVKEY is not set; exit 1) 82 | echo "Starting Upload ..." 83 | rsync --delete -rlvPh -e "ssh -l ${RSYNC_HOST%@*} -i ~/key -o StrictHostKeyChecking=ask -o UserKnownHostsFile=~/kh" upload/ "${RSYNC_HOST#*@}:${RSYNC_PATH}/${LIVECD_PROFILE}" 84 | 85 | keepalive: 86 | name: do keepalive 87 | # The type of runner that the job will run on 88 | needs: [build] 89 | if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }} 90 | runs-on: ubuntu-22.04 91 | # Steps represent a sequence of tasks that will be executed as part of the job 92 | steps: 93 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 94 | - uses: actions/checkout@v4 95 | with: 96 | ref: master 97 | - name: keepalive 98 | env: 99 | SSHPRIVKEY: ${{ secrets.KEY }} 100 | shell: bash 101 | run: | 102 | echo "Starting KeepAlive ..." 103 | trap "shred -v ~/key" ERR EXIT 104 | echo "$SSHPRIVKEY" |base64 -d > ~/key 105 | pushd . 106 | mkdir -p ~/.ssh 107 | echo "IdentityFile $(realpath ~/key)" > ~/.ssh/config 108 | ssh -o StrictHostKeyChecking=no git@github.com -T || true 109 | git config user.email "bot@github.com" 110 | git config user.name "bot" 111 | git reset --soft HEAD 112 | git commit --allow-empty -m "[skip ci] keepalive at $(date -u +"%Y-%m-%dT%H:%M:%SZ")" 113 | while ! git push origin master; do sleep 10; done 114 | git show --name-only |grep -Fq '[skip ci] keepalive at' 115 | git reset --soft HEAD~1 116 | while ! git push --force origin master; do sleep 10; done 117 | popd 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Custom Archlinux Livecd 2 | [iso.meson.cc](https://iso.meson.cc) 3 | 4 | ## variant: ultra lite 5 | Suitable for VMs, does not contain any firmware. Small in size. 6 | 7 | ## variant: default 8 | Same packages as the offical archiso, with netboot double copytoram fix and reflector disabled at boot. 9 | 10 | ## variant: xfce 11 | With XFCE, NetworkManager, Gparted, Firefox built-in. 12 | 13 | ## variant: aarch64-default 14 | Arch Linux ARM version. 15 | -------------------------------------------------------------------------------- /config-aarch64-default: -------------------------------------------------------------------------------- 1 | ISO_ARCH=aarch64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep ! TODO: update aarch64 mkarchiso 10 | # sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # add archiso_pxe_dns to mkinitcpio.conf 12 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf 13 | # add ntfs-3g to mkinitcpio.conf 14 | sed -i 's/\(BINARIES=(\)/\1mount.ntfs /g' airootfs/etc/mkinitcpio.conf 15 | 16 | # no customize_airootfs.sh? no problem 17 | mkdir -p airootfs/etc/pacman.d/hooks 18 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 19 | # remove from airootfs! 20 | [Trigger] 21 | Operation = Install 22 | Type = Package 23 | Target = base 24 | 25 | [Action] 26 | Description = Running customize-airootfs... 27 | When = PostTransaction 28 | Exec = /bin/sh -c "systemctl disable sshd reflector && \ 29 | passwd -d root" 30 | EOF 31 | 32 | # alter packages 33 | cat << EOF >> packages.x86_64 34 | EOF 35 | cat << EOF > packages.x86_64.remove 36 | EOF 37 | 38 | } 39 | -------------------------------------------------------------------------------- /config-default: -------------------------------------------------------------------------------- 1 | ISO_ARCH=x86_64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep 10 | sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # sdboot: no beep 12 | sed -i 's/beep on/beep off/g' efiboot/loader/loader.conf 13 | # add archiso_pxe_dns to mkinitcpio.conf 14 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 15 | # add ntfs-3g to mkinitcpio.conf 16 | echo >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 17 | echo 'BINARIES+=(mount.ntfs)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 18 | 19 | # no customize_airootfs.sh? no problem 20 | mkdir -p airootfs/etc/pacman.d/hooks 21 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 22 | # remove from airootfs! 23 | [Trigger] 24 | Operation = Install 25 | Type = Package 26 | Target = base 27 | 28 | [Action] 29 | Description = Running customize-airootfs... 30 | When = PostTransaction 31 | Exec = /bin/sh -c "systemctl disable sshd reflector && \ 32 | passwd -d root" 33 | EOF 34 | 35 | # pkglist check 36 | compatver=v83 37 | compatlink="https://gitlab.archlinux.org/archlinux/archiso/-/blob/${compatver}/configs/releng/packages.x86_64" 38 | compatraw="https://gitlab.archlinux.org/archlinux/archiso/-/raw/${compatver}/configs/releng/packages.x86_64" 39 | curl -L -o packages.x86_64.compat "$compatraw" 40 | diff packages.x86_64 packages.x86_64.compat 41 | rm packages.x86_64.compat 42 | 43 | # alter packages 44 | cat << EOF >> packages.x86_64 45 | EOF 46 | cat << EOF > packages.x86_64.remove 47 | broadcom-wl 48 | EOF 49 | 50 | } 51 | -------------------------------------------------------------------------------- /config-gnome: -------------------------------------------------------------------------------- 1 | ISO_ARCH=x86_64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep 10 | sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # sdboot: no beep 12 | sed -i 's/beep on/beep off/g' efiboot/loader/loader.conf 13 | # add archiso_pxe_dns to mkinitcpio.conf 14 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 15 | # add ntfs-3g to mkinitcpio.conf 16 | echo >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 17 | echo 'BINARIES+=(mount.ntfs)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 18 | # add rndis_host to mkinitcpio.conf 19 | echo 'MODULES+=(rndis_host)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 20 | # add kernel cmdline 21 | sed -i 's/archisosearchuuid.*$/& sysrq_always_enabled=1 nvidia_drm.modeset=1 nvidia_drm.fbdev=1 systemd.debug_shell/' efiboot/loader/entries/*.conf grub/grub.cfg syslinux/*.cfg 22 | 23 | 24 | # no customize_airootfs.sh? no problem 25 | mkdir -p airootfs/etc/pacman.d/hooks 26 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 27 | # remove from airootfs! 28 | [Trigger] 29 | Operation = Install 30 | Type = Package 31 | Target = networkmanager 32 | 33 | [Action] 34 | Description = Running customize-airootfs... 35 | When = PostTransaction 36 | Exec = /bin/sh -c "true && \ 37 | systemctl disable sshd iwd reflector systemd-networkd systemd-resolved && \ 38 | systemctl mask systemd-networkd systemd-resolved && \ 39 | systemctl enable NetworkManager gdm bluetooth && \ 40 | systemctl set-default graphical.target && \ 41 | sed -i 's/^\(PermitRootLogin\) yes$/\1 prohibit-password/' /etc/ssh/sshd_config.d/10-archiso.conf && \ 42 | useradd -m -G wheel -g users -s /usr/bin/zsh archiso && \ 43 | echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ 44 | echo -e 'archiso\narchiso' | passwd archiso && \ 45 | passwd -d root && \ 46 | rm -fv /etc/resolv.conf && \ 47 | touch /etc/resolv.conf && \ 48 | true" 49 | EOF 50 | 51 | # gdm autologin 52 | mkdir -p airootfs/etc/gdm 53 | cat << EOF > airootfs/etc/gdm/custom.conf 54 | [daemon] 55 | TimedLoginEnable=true 56 | TimedLogin=archiso 57 | TimedLoginDelay=1 58 | EOF 59 | 60 | # pkglist check 61 | compatver=v83 62 | compatlink="https://gitlab.archlinux.org/archlinux/archiso/-/blob/${compatver}/configs/releng/packages.x86_64" 63 | compatraw="https://gitlab.archlinux.org/archlinux/archiso/-/raw/${compatver}/configs/releng/packages.x86_64" 64 | curl -L -o packages.x86_64.compat "$compatraw" 65 | diff packages.x86_64 packages.x86_64.compat 66 | rm packages.x86_64.compat 67 | 68 | # alter packages 69 | cat << EOF >> packages.x86_64 70 | nano 71 | bash-completion 72 | nvidia-open 73 | mesa 74 | virtualbox-guest-utils 75 | gnome-tweaks 76 | gnome-terminal 77 | pipewire 78 | pipewire-alsa 79 | pipewire-pulse 80 | wireplumber 81 | sof-firmware 82 | bluez 83 | networkmanager 84 | nm-connection-editor 85 | firefox 86 | gparted 87 | vlc 88 | EOF 89 | cat << EOF >> packages.x86_64 90 | baobab 91 | evince 92 | gdm 93 | gnome-terminal 94 | gnome-backgrounds 95 | gnome-calculator 96 | gnome-calendar 97 | gnome-characters 98 | gnome-clocks 99 | gnome-color-manager 100 | gnome-connections 101 | gnome-contacts 102 | gnome-control-center 103 | gnome-disk-utility 104 | gnome-font-viewer 105 | gnome-keyring 106 | gnome-logs 107 | gnome-maps 108 | gnome-menus 109 | gnome-music 110 | gnome-remote-desktop 111 | gnome-session 112 | gnome-settings-daemon 113 | gnome-shell 114 | gnome-shell-extensions 115 | gnome-software 116 | gnome-system-monitor 117 | gnome-text-editor 118 | gnome-tour 119 | gnome-user-docs 120 | gnome-user-share 121 | gnome-weather 122 | grilo-plugins 123 | gvfs 124 | gvfs-afc 125 | gvfs-dnssd 126 | gvfs-goa 127 | gvfs-google 128 | gvfs-gphoto2 129 | gvfs-mtp 130 | gvfs-nfs 131 | gvfs-onedrive 132 | gvfs-smb 133 | gvfs-wsdd 134 | loupe 135 | malcontent 136 | nautilus 137 | orca 138 | rygel 139 | simple-scan 140 | snapshot 141 | sushi 142 | tecla 143 | totem 144 | xdg-desktop-portal-gnome 145 | xdg-user-dirs-gtk 146 | yelp 147 | EOF 148 | cat << EOF > packages.x86_64.remove 149 | virtualbox-guest-utils-nox 150 | broadcom-wl 151 | EOF 152 | 153 | } 154 | -------------------------------------------------------------------------------- /config-kde: -------------------------------------------------------------------------------- 1 | ISO_ARCH=x86_64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep 10 | sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # sdboot: no beep 12 | sed -i 's/beep on/beep off/g' efiboot/loader/loader.conf 13 | # add archiso_pxe_dns to mkinitcpio.conf 14 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 15 | # add ntfs-3g to mkinitcpio.conf 16 | echo >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 17 | echo 'BINARIES+=(mount.ntfs)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 18 | # add rndis_host to mkinitcpio.conf 19 | echo 'MODULES+=(rndis_host)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 20 | # add kernel cmdline 21 | sed -i 's/archisosearchuuid.*$/& sysrq_always_enabled=1 nvidia_drm.modeset=1 nvidia_drm.fbdev=1 systemd.debug_shell/' efiboot/loader/entries/*.conf grub/grub.cfg syslinux/*.cfg 22 | 23 | 24 | # no customize_airootfs.sh? no problem 25 | mkdir -p airootfs/etc/pacman.d/hooks 26 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 27 | # remove from airootfs! 28 | [Trigger] 29 | Operation = Install 30 | Type = Package 31 | Target = networkmanager 32 | 33 | [Action] 34 | Description = Running customize-airootfs... 35 | When = PostTransaction 36 | Exec = /bin/sh -c "true && \ 37 | systemctl disable sshd iwd reflector systemd-networkd systemd-resolved && \ 38 | systemctl mask systemd-networkd systemd-resolved && \ 39 | systemctl enable NetworkManager sddm bluetooth && \ 40 | systemctl set-default graphical.target && \ 41 | sed -i 's/^\(PermitRootLogin\) yes$/\1 prohibit-password/' /etc/ssh/sshd_config.d/10-archiso.conf && \ 42 | useradd -m -G wheel -g users -s /usr/bin/zsh archiso && \ 43 | echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ 44 | echo -e 'archiso\narchiso' | passwd archiso && \ 45 | passwd -d root && \ 46 | rm -fv /etc/resolv.conf && \ 47 | touch /etc/resolv.conf && \ 48 | true" 49 | EOF 50 | 51 | # sddm autologin 52 | mkdir -p airootfs/etc/sddm.conf.d 53 | cat << EOF > airootfs/etc/sddm.conf.d/autologin.conf 54 | [Autologin] 55 | User=archiso 56 | Session=plasma 57 | EOF 58 | 59 | # pkglist check 60 | compatver=v83 61 | compatlink="https://gitlab.archlinux.org/archlinux/archiso/-/blob/${compatver}/configs/releng/packages.x86_64" 62 | compatraw="https://gitlab.archlinux.org/archlinux/archiso/-/raw/${compatver}/configs/releng/packages.x86_64" 63 | curl -L -o packages.x86_64.compat "$compatraw" 64 | diff packages.x86_64 packages.x86_64.compat 65 | rm packages.x86_64.compat 66 | 67 | # alter packages 68 | cat << EOF >> packages.x86_64 69 | nano 70 | bash-completion 71 | nvidia-open 72 | mesa 73 | virtualbox-guest-utils 74 | sddm 75 | plasma-desktop 76 | plasma-nm 77 | plasma-pa 78 | kscreen 79 | konsole 80 | dolphin 81 | bluedevil 82 | pipewire 83 | pipewire-alsa 84 | pipewire-pulse 85 | wireplumber 86 | sof-firmware 87 | bluez 88 | networkmanager 89 | nm-connection-editor 90 | firefox 91 | gparted 92 | EOF 93 | cat << EOF > packages.x86_64.remove 94 | virtualbox-guest-utils-nox 95 | broadcom-wl 96 | EOF 97 | 98 | } 99 | -------------------------------------------------------------------------------- /config-ultralite: -------------------------------------------------------------------------------- 1 | ISO_ARCH=x86_64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep 10 | sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # sdboot: no beep 12 | sed -i 's/beep on/beep off/g' efiboot/loader/loader.conf 13 | # drop speech from sdboot, just forget about grub and syslinux, writing sed is hard 14 | rm -f efiboot/loader/entries/archiso-x86_64-speech-linux.conf 15 | # drop kms from mkinitcpio.conf 16 | sed -i 's/kms //g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 17 | # add archiso_pxe_dns to mkinitcpio.conf 18 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 19 | # add ntfs-3g to mkinitcpio.conf 20 | echo >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 21 | echo 'BINARIES+=(mount.ntfs)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 22 | 23 | # no customize_airootfs.sh? no problem 24 | mkdir -p airootfs/etc/pacman.d/hooks 25 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 26 | # remove from airootfs! 27 | [Trigger] 28 | Operation = Install 29 | Type = Package 30 | Target = bash-completion 31 | 32 | [Action] 33 | Description = Running customize-airootfs... 34 | When = PostTransaction 35 | Exec = /bin/sh -c "chsh -s /bin/bash root && \ 36 | cp -rT /etc/skel /root/ && \ 37 | echo /root/.automated_script.sh >> /root/.bashrc && \ 38 | systemctl disable sshd && \ 39 | echo c2VkIC1lICcvTU9EVUxFU19ERUNPTVBSRVNTL2lpZiB0cnVlOyB0aGVuJyAtZSAnL01PRFVMRVNfREVDT01QUkVTUy9kJyAtZSAnL0dlbmVyYXRpbmcgbW9kdWxlIGRlcGVuZGVuY2llcy9pZmluZCAiJEJVSUxEUk9PVFwvJF9kX2ttb2R1bGVkaXIiIC10eXBlIGYgLW5hbWUgIioua28iIC1wcmludDAgfHhhcmdzIC0wIC1QIiQobnByb2MpIiAtSXt9IHh6IC0teDg2IC0tbHptYTIge30nIC1pLmJhayAvdXNyL2xpYi9pbml0Y3Bpby9mdW5jdGlvbnMK |base64 -d |/bin/sh && \ 40 | { diff -u /usr/lib/initcpio/functions{.bak,} || true; } && \ 41 | mkinitcpio -P && \ 42 | passwd -d root && \ 43 | find /etc/systemd/system -xtype l -delete -print" 44 | EOF 45 | 46 | # pkglist check 47 | compatver=v83 48 | compatlink="https://gitlab.archlinux.org/archlinux/archiso/-/blob/${compatver}/configs/releng/packages.x86_64" 49 | compatraw="https://gitlab.archlinux.org/archlinux/archiso/-/raw/${compatver}/configs/releng/packages.x86_64" 50 | curl -L -o packages.x86_64.compat "$compatraw" 51 | diff packages.x86_64 packages.x86_64.compat 52 | rm packages.x86_64.compat 53 | 54 | # alter packages 55 | cat << EOF >> packages.x86_64 56 | nano 57 | bash-completion 58 | EOF 59 | cat << EOF > packages.x86_64.remove 60 | b43-fwcutter 61 | bind 62 | broadcom-wl 63 | clonezilla 64 | crda 65 | darkhttpd 66 | ddrescue 67 | dhclient 68 | edk2-shell 69 | efibootmgr 70 | fsarchiver 71 | grml-zsh-config 72 | hdparm 73 | ipw2100-fw 74 | ipw2200-fw 75 | iwd 76 | kitty-terminfo 77 | lftp 78 | linux-firmware 79 | lynx 80 | man-db 81 | man-pages 82 | mc 83 | memtest86+ 84 | ndisc6 85 | nmap 86 | nvme-cli 87 | openconnect 88 | openvpn 89 | partclone 90 | parted 91 | partimage 92 | pptpclient 93 | reflector 94 | rsync 95 | rxvt-unicode-terminfo 96 | sdparm 97 | sg3_utils 98 | smartmontools 99 | systemd-resolvconf 100 | tcpdump 101 | terminus-font 102 | testdisk 103 | usb_modeswitch 104 | usbutils 105 | vim 106 | vpnc 107 | wireless-regdb 108 | wireless_tools 109 | wpa_supplicant 110 | xl2tpd 111 | zsh 112 | amd-ucode 113 | intel-ucode 114 | alsa-utils 115 | brltty 116 | espeakup 117 | fatresize 118 | gpart 119 | livecd-sounds 120 | squashfs-tools 121 | tmux 122 | udftools 123 | cloud-init 124 | usbmuxd 125 | sof-firmware 126 | modemmanager 127 | archinstall 128 | libusb-compat 129 | pcsclite 130 | libfido2 131 | tpm2-tss 132 | qemu-guest-agent 133 | virtualbox-guest-utils-nox 134 | iw 135 | screen 136 | pv 137 | grub 138 | refind 139 | linux-firmware-marvell 140 | dmidecode 141 | hyperv 142 | open-iscsi 143 | open-vm-tools 144 | ipw2100-fw 145 | ipw2200-fw 146 | memtest86+-efi 147 | foot-terminfo 148 | openpgp-card-tools 149 | sequoia-sq 150 | tpm2-tools 151 | bolt 152 | ldns 153 | reiserfsprogs 154 | gnu-netcat 155 | EOF 156 | 157 | } 158 | -------------------------------------------------------------------------------- /config-xfce: -------------------------------------------------------------------------------- 1 | ISO_ARCH=x86_64 2 | 3 | pre_build() { 4 | 5 | # add custom/rootoverlay to airootfs 6 | cp -rvT /custom/rootoverlay airootfs 7 | [ -d "/custom/rootoverlays/$LIVECD_PROFILE" ] && cp -rvT "/custom/rootoverlays/$LIVECD_PROFILE" airootfs 8 | 9 | # grub: no beep 10 | sed -i '/^# GRUB init tune for accessibility$/,/^$/s/^play/# play/g' grub/grub.cfg 11 | # sdboot: no beep 12 | sed -i 's/beep on/beep off/g' efiboot/loader/loader.conf 13 | # add archiso_pxe_dns to mkinitcpio.conf 14 | sed -i 's/archiso_pxe_common/archiso_pxe_dns archiso_pxe_common/g' airootfs/etc/mkinitcpio.conf.d/archiso.conf 15 | # add ntfs-3g to mkinitcpio.conf 16 | echo >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 17 | echo 'BINARIES+=(mount.ntfs)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 18 | # add rndis_host to mkinitcpio.conf 19 | echo 'MODULES+=(rndis_host)' >> airootfs/etc/mkinitcpio.conf.d/archiso.conf 20 | 21 | # no customize_airootfs.sh? no problem 22 | mkdir -p airootfs/etc/pacman.d/hooks 23 | cat << EOF > airootfs/etc/pacman.d/hooks/zzzz98-customize-airootfs.hook 24 | # remove from airootfs! 25 | [Trigger] 26 | Operation = Install 27 | Type = Package 28 | Target = networkmanager 29 | 30 | [Action] 31 | Description = Running customize-airootfs... 32 | When = PostTransaction 33 | Exec = /bin/sh -c "true && \ 34 | systemctl disable sshd iwd reflector systemd-networkd systemd-resolved && \ 35 | systemctl mask systemd-networkd systemd-resolved && \ 36 | systemctl enable NetworkManager lightdm && \ 37 | systemctl set-default graphical.target && \ 38 | sed -i 's/^\(PermitRootLogin\) yes$/\1 prohibit-password/' /etc/ssh/sshd_config.d/10-archiso.conf && \ 39 | groupadd -r autologin && \ 40 | useradd -m -G autologin,wheel -g users -s /usr/bin/zsh archiso && \ 41 | echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ 42 | echo -e 'archiso\narchiso' | passwd archiso && \ 43 | passwd -d root && \ 44 | rm -fv /etc/lightdm/lightdm.conf.pacnew && \ 45 | rm -fv /etc/resolv.conf && \ 46 | touch /etc/resolv.conf && \ 47 | true" 48 | EOF 49 | 50 | # lightdm.conf 51 | mkdir -p airootfs/etc/lightdm 52 | cat << EOF > airootfs/etc/lightdm/lightdm.conf 53 | [LightDM] 54 | run-directory=/run/lightdm 55 | [Seat:*] 56 | session-wrapper=/etc/lightdm/Xsession 57 | autologin-user=archiso 58 | autologin-user-timeout=1 59 | autologin-session=xfce 60 | EOF 61 | 62 | # pkglist check 63 | compatver=v83 64 | compatlink="https://gitlab.archlinux.org/archlinux/archiso/-/blob/${compatver}/configs/releng/packages.x86_64" 65 | compatraw="https://gitlab.archlinux.org/archlinux/archiso/-/raw/${compatver}/configs/releng/packages.x86_64" 66 | curl -L -o packages.x86_64.compat "$compatraw" 67 | diff packages.x86_64 packages.x86_64.compat 68 | rm packages.x86_64.compat 69 | 70 | # alter packages 71 | cat << EOF >> packages.x86_64 72 | nano 73 | bash-completion 74 | xorg-server 75 | nvidia 76 | mesa 77 | virtualbox-guest-utils 78 | xfce4 79 | lightdm 80 | lightdm-gtk-greeter 81 | networkmanager 82 | network-manager-applet 83 | nm-connection-editor 84 | firefox 85 | gparted 86 | EOF 87 | cat << EOF > packages.x86_64.remove 88 | virtualbox-guest-utils-nox 89 | broadcom-wl 90 | EOF 91 | 92 | } 93 | -------------------------------------------------------------------------------- /contrib/arch-chroot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s extglob 4 | 5 | # generated from util-linux source: libmount/src/utils.c 6 | declare -A pseudofs_types=([anon_inodefs]=1 7 | [autofs]=1 8 | [bdev]=1 9 | [bpf]=1 10 | [binfmt_misc]=1 11 | [cgroup]=1 12 | [cgroup2]=1 13 | [configfs]=1 14 | [cpuset]=1 15 | [debugfs]=1 16 | [devfs]=1 17 | [devpts]=1 18 | [devtmpfs]=1 19 | [dlmfs]=1 20 | [efivarfs]=1 21 | [fuse.gvfs-fuse-daemon]=1 22 | [fusectl]=1 23 | [hugetlbfs]=1 24 | [mqueue]=1 25 | [nfsd]=1 26 | [none]=1 27 | [pipefs]=1 28 | [proc]=1 29 | [pstore]=1 30 | [ramfs]=1 31 | [rootfs]=1 32 | [rpc_pipefs]=1 33 | [securityfs]=1 34 | [sockfs]=1 35 | [spufs]=1 36 | [sysfs]=1 37 | [tmpfs]=1) 38 | 39 | # generated from: pkgfile -vbr '/fsck\..+' | awk -F. '{ print $NF }' | sort 40 | declare -A fsck_types=([cramfs]=1 41 | [exfat]=1 42 | [ext2]=1 43 | [ext3]=1 44 | [ext4]=1 45 | [ext4dev]=1 46 | [jfs]=1 47 | [minix]=1 48 | [msdos]=1 49 | [reiserfs]=1 50 | [vfat]=1 51 | [xfs]=1) 52 | 53 | out() { printf "$1 $2\n" "${@:3}"; } 54 | error() { out "==> ERROR:" "$@"; } >&2 55 | warning() { out "==> WARNING:" "$@"; } >&2 56 | msg() { out "==>" "$@"; } 57 | msg2() { out " ->" "$@";} 58 | die() { error "$@"; exit 1; } 59 | 60 | ignore_error() { 61 | "$@" 2>/dev/null 62 | return 0 63 | } 64 | 65 | in_array() { 66 | local i 67 | for i in "${@:2}"; do 68 | [[ $1 = "$i" ]] && return 0 69 | done 70 | return 1 71 | } 72 | 73 | chroot_add_mount() { 74 | mount "$@" && CHROOT_ACTIVE_MOUNTS=("$2" "${CHROOT_ACTIVE_MOUNTS[@]}") 75 | } 76 | 77 | chroot_maybe_add_mount() { 78 | local cond=$1; shift 79 | if eval "$cond"; then 80 | chroot_add_mount "$@" 81 | fi 82 | } 83 | 84 | chroot_setup() { 85 | CHROOT_ACTIVE_MOUNTS=() 86 | [[ $(trap -p EXIT) ]] && die '(BUG): attempting to overwrite existing EXIT trap' 87 | trap 'chroot_teardown' EXIT 88 | 89 | chroot_add_mount proc "$1/proc" -t proc -o nosuid,noexec,nodev && 90 | chroot_add_mount sys "$1/sys" -t sysfs -o nosuid,noexec,nodev,ro && 91 | ignore_error chroot_maybe_add_mount "[[ -d '$1/sys/firmware/efi/efivars' ]]" \ 92 | efivarfs "$1/sys/firmware/efi/efivars" -t efivarfs -o nosuid,noexec,nodev && 93 | chroot_add_mount udev "$1/dev" -t devtmpfs -o mode=0755,nosuid && 94 | chroot_add_mount devpts "$1/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec && 95 | chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev && 96 | chroot_add_mount /run "$1/run" --bind && 97 | chroot_add_mount tmp "$1/tmp" -t tmpfs -o mode=1777,strictatime,nodev,nosuid 98 | } 99 | 100 | chroot_teardown() { 101 | if (( ${#CHROOT_ACTIVE_MOUNTS[@]} )); then 102 | umount "${CHROOT_ACTIVE_MOUNTS[@]}" 103 | fi 104 | unset CHROOT_ACTIVE_MOUNTS 105 | } 106 | 107 | try_cast() ( 108 | _=$(( $1#$2 )) 109 | ) 2>/dev/null 110 | 111 | valid_number_of_base() { 112 | local base=$1 len=${#2} i= 113 | 114 | for (( i = 0; i < len; i++ )); do 115 | try_cast "$base" "${2:i:1}" || return 1 116 | done 117 | 118 | return 0 119 | } 120 | 121 | mangle() { 122 | local i= chr= out= 123 | local {a..f}= {A..F}= 124 | 125 | for (( i = 0; i < ${#1}; i++ )); do 126 | chr=${1:i:1} 127 | case $chr in 128 | [[:space:]\\]) 129 | printf -v chr '%03o' "'$chr" 130 | out+=\\ 131 | ;; 132 | esac 133 | out+=$chr 134 | done 135 | 136 | printf '%s' "$out" 137 | } 138 | 139 | unmangle() { 140 | local i= chr= out= len=$(( ${#1} - 4 )) 141 | local {a..f}= {A..F}= 142 | 143 | for (( i = 0; i < len; i++ )); do 144 | chr=${1:i:1} 145 | case $chr in 146 | \\) 147 | if valid_number_of_base 8 "${1:i+1:3}" || 148 | valid_number_of_base 16 "${1:i+1:3}"; then 149 | printf -v chr '%b' "${1:i:4}" 150 | (( i += 3 )) 151 | fi 152 | ;; 153 | esac 154 | out+=$chr 155 | done 156 | 157 | printf '%s' "$out${1:i}" 158 | } 159 | 160 | optstring_match_option() { 161 | local candidate pat patterns 162 | 163 | IFS=, read -ra patterns <<<"$1" 164 | for pat in "${patterns[@]}"; do 165 | if [[ $pat = *=* ]]; then 166 | # "key=val" will only ever match "key=val" 167 | candidate=$2 168 | else 169 | # "key" will match "key", but also "key=anyval" 170 | candidate=${2%%=*} 171 | fi 172 | 173 | [[ $pat = "$candidate" ]] && return 0 174 | done 175 | 176 | return 1 177 | } 178 | 179 | optstring_remove_option() { 180 | local o options_ remove=$2 IFS=, 181 | 182 | read -ra options_ <<<"${!1}" 183 | 184 | for o in "${!options_[@]}"; do 185 | optstring_match_option "$remove" "${options_[o]}" && unset 'options_[o]' 186 | done 187 | 188 | declare -g "$1=${options_[*]}" 189 | } 190 | 191 | optstring_normalize() { 192 | local o options_ norm IFS=, 193 | 194 | read -ra options_ <<<"${!1}" 195 | 196 | # remove empty fields 197 | for o in "${options_[@]}"; do 198 | [[ $o ]] && norm+=("$o") 199 | done 200 | 201 | # avoid empty strings, reset to "defaults" 202 | declare -g "$1=${norm[*]:-defaults}" 203 | } 204 | 205 | optstring_append_option() { 206 | if ! optstring_has_option "$1" "$2"; then 207 | declare -g "$1=${!1},$2" 208 | fi 209 | 210 | optstring_normalize "$1" 211 | } 212 | 213 | optstring_prepend_option() { 214 | local options_=$1 215 | 216 | if ! optstring_has_option "$1" "$2"; then 217 | declare -g "$1=$2,${!1}" 218 | fi 219 | 220 | optstring_normalize "$1" 221 | } 222 | 223 | optstring_get_option() { 224 | local opts o 225 | 226 | IFS=, read -ra opts <<<"${!1}" 227 | for o in "${opts[@]}"; do 228 | if optstring_match_option "$2" "$o"; then 229 | declare -g "$o" 230 | return 0 231 | fi 232 | done 233 | 234 | return 1 235 | } 236 | 237 | optstring_has_option() { 238 | local "${2%%=*}" 239 | 240 | optstring_get_option "$1" "$2" 241 | } 242 | 243 | dm_name_for_devnode() { 244 | read dm_name <"/sys/class/block/${1#/dev/}/dm/name" 245 | if [[ $dm_name ]]; then 246 | printf '/dev/mapper/%s' "$dm_name" 247 | else 248 | # don't leave the caller hanging, just print the original name 249 | # along with the failure. 250 | print '%s' "$1" 251 | error 'Failed to resolve device mapper name for: %s' "$1" 252 | fi 253 | } 254 | 255 | fstype_is_pseudofs() { 256 | (( pseudofs_types["$1"] )) 257 | } 258 | 259 | fstype_has_fsck() { 260 | (( fsck_types["$1"] )) 261 | } 262 | 263 | 264 | usage() { 265 | cat <[:group] Specify non-root user and optional group to use 270 | 271 | If 'command' is unspecified, ${0##*/} will launch /bin/bash. 272 | 273 | Note that when using arch-chroot, the target chroot directory *should* be a 274 | mountpoint. This ensures that tools such as pacman(8) or findmnt(8) have an 275 | accurate hierarchy of the mounted filesystems within the chroot. 276 | 277 | If your chroot target is not a mountpoint, you can bind mount the directory on 278 | itself to make it a mountpoint, i.e. 'mount --bind /your/chroot /your/chroot'. 279 | 280 | EOF 281 | } 282 | 283 | chroot_add_resolv_conf() { 284 | local chrootdir=$1 resolv_conf=$1/etc/resolv.conf 285 | 286 | [[ -e /etc/resolv.conf ]] || return 0 287 | 288 | # Handle resolv.conf as a symlink to somewhere else. 289 | if [[ -L $chrootdir/etc/resolv.conf ]]; then 290 | # readlink(1) should always give us *something* since we know at this point 291 | # it's a symlink. For simplicity, ignore the case of nested symlinks. 292 | resolv_conf=$(readlink "$chrootdir/etc/resolv.conf") 293 | if [[ $resolv_conf = /* ]]; then 294 | resolv_conf=$chrootdir$resolv_conf 295 | else 296 | resolv_conf=$chrootdir/etc/$resolv_conf 297 | fi 298 | 299 | # ensure file exists to bind mount over 300 | if [[ ! -f $resolv_conf ]]; then 301 | install -Dm644 /dev/null "$resolv_conf" || return 1 302 | fi 303 | elif [[ ! -e $chrootdir/etc/resolv.conf ]]; then 304 | # The chroot might not have a resolv.conf. 305 | return 0 306 | fi 307 | 308 | chroot_add_mount /etc/resolv.conf "$resolv_conf" --bind 309 | } 310 | 311 | while getopts ':hu:' flag; do 312 | case $flag in 313 | h) 314 | usage 315 | exit 0 316 | ;; 317 | u) 318 | userspec=$OPTARG 319 | ;; 320 | :) 321 | die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG" 322 | ;; 323 | ?) 324 | die '%s: invalid option -- '\''%s'\' "${0##*/}" "$OPTARG" 325 | ;; 326 | esac 327 | done 328 | shift $(( OPTIND - 1 )) 329 | 330 | (( EUID == 0 )) || die 'This script must be run with root privileges' 331 | (( $# )) || die 'No chroot directory specified' 332 | chrootdir=$1 333 | shift 334 | 335 | [[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$chrootdir" 336 | 337 | if ! mountpoint -q "$chrootdir"; then 338 | warning "$chrootdir is not a mountpoint. This may have undesirable side effects." 339 | fi 340 | 341 | chroot_setup "$chrootdir" || die "failed to setup chroot %s" "$chrootdir" 342 | chroot_add_resolv_conf "$chrootdir" || die "failed to setup resolv.conf" 343 | 344 | chroot_args=() 345 | [[ $userspec ]] && chroot_args+=(--userspec "$userspec") 346 | 347 | SHELL=/bin/bash unshare --fork --pid chroot "${chroot_args[@]}" -- "$chrootdir" "$@" 348 | -------------------------------------------------------------------------------- /custom/patches/archiso_pxe_http.hook/1.patch: -------------------------------------------------------------------------------- 1 | --- archiso_pxe_http.1 2021-06-25 17:23:08.814964877 +0800 2 | +++ archiso_pxe_http 2021-06-25 19:06:27.860266549 +0800 3 | @@ -9,7 +9,6 @@ 4 | 5 | # booting with http is always copy-to-ram, so set here to make sure 6 | # addresses are flushed and interface is set down 7 | - export copytoram="y" 8 | 9 | archiso_http_srv=$(eval echo "${archiso_http_srv}") 10 | [ -z "${archiso_http_spc}" ] && archiso_http_spc="75%" 11 | -------------------------------------------------------------------------------- /custom/patches/archiso_pxe_http.hook/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | # https://gitlab.archlinux.org/archlinux/archiso/-/raw/9c44aeedd182e70194d2b90ca919dcad7ced42b1/archiso/initcpio/hooks/archiso_pxe_http 5 | pacman -S --asdeps --noconfirm --needed mkinitcpio-archiso 6 | cp /usr/lib/initcpio/hooks/archiso_pxe_http $(dirname "$0")/archiso_pxe_http 7 | patch -p0 $(dirname "$0")/archiso_pxe_http < $(dirname "$0")/1.patch 8 | 9 | cp -v $(dirname "$0")/archiso_pxe_http $(dirname "$0")/../../rootoverlay/etc/initcpio/hooks/archiso_pxe_http 10 | cat $(dirname "$0")/../../rootoverlay/etc/initcpio/hooks/archiso_pxe_http 11 | -------------------------------------------------------------------------------- /custom/rootoverlay/etc/initcpio/hooks/archiso_pxe_dns: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | run_hook () { 4 | if [ -n "${archiso_dns}" ]; then 5 | echo "# added by archiso_pxe_dns hook" > /etc/resolv.conf 6 | echo "nameserver ${archiso_dns}" >> /etc/resolv.conf 7 | fi 8 | } 9 | -------------------------------------------------------------------------------- /custom/rootoverlay/etc/initcpio/install/archiso_pxe_dns: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | build() { 4 | add_runscript 5 | } 6 | 7 | help() { 8 | cat < /dev/null 8 | echo 1 > /sys/block/zram0/reset 9 | echo zstd > /sys/block/zram0/comp_algorithm 10 | echo 1G > /sys/block/zram0/disksize 11 | chmod 0660 /dev/zram0 12 | mkswap /dev/zram0 13 | echo 0 > /sys/module/zswap/parameters/enabled 14 | swapon /dev/zram0 15 | } 16 | -------------------------------------------------------------------------------- /custom/rootoverlays/ultralite-zram/etc/initcpio/install/archiso_zram: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | build() { 4 | add_module zram 5 | add_binary mkswap 6 | add_binary swapon 7 | add_runscript 8 | } 9 | 10 | help() { 11 | cat < sha256sum 19 | echo "$bootstrap_tarball" |python3 -c 'print(input().split("-")[2])' > version 20 | curl -o "$bootstrap_tarball" "${MIRROR}/${ISO_DIR}/${bootstrap_tarball}" 21 | sha256sum -c sha256sum 22 | tar --zstd -xf "$bootstrap_tarball" 23 | } 24 | configure_archbootstrap_aarch64() { 25 | ISO_DIR="os" 26 | MD5SUM="${MIRROR}/${ISO_DIR}/ArchLinuxARM-aarch64-latest.tar.gz.md5" 27 | curl -o md5sum "$MD5SUM" 28 | md5=$(cat md5sum |grep -F '.tar.gz') 29 | bootstrap_tarball=$(awk '{print $2;}' <<< "$md5") 30 | echo "$md5" > md5sum 31 | date '+%Y-%m-01' > version 32 | curl -o "$bootstrap_tarball" "${MIRROR}/${ISO_DIR}/${bootstrap_tarball}" 33 | md5sum -c md5sum 34 | mkdir root.x86_64 35 | ln -s root.x86_64 root.aarch64 36 | tar xzf "$bootstrap_tarball" -C root.x86_64 37 | cp /usr/bin/qemu-aarch64-static root.x86_64/usr/bin/ 38 | cp contrib/arch-chroot root.x86_64/usr/bin/ 39 | chmod +x root.x86_64/usr/bin/arch-chroot 40 | } 41 | 42 | arch-chroot() { 43 | cp -av $0 ./root.x86_64/$0 44 | cp -av "config-${LIVECD_PROFILE}" ./root.x86_64/"config-${LIVECD_PROFILE}" 45 | cp -av version ./root.x86_64/version 46 | cp -av custom ./root.x86_64/custom 47 | mount --bind root.x86_64 root.x86_64 48 | ./root.x86_64/bin/arch-chroot ./root.x86_64 bash "/${0}" 49 | umount root.x86_64 || true 50 | } 51 | 52 | makelivecd() { 53 | cd / 54 | source "/config-${LIVECD_PROFILE}" 55 | [[ "$ISO_ARCH" == "x86_64" ]] && { 56 | echo 'Server = '"$MIRROR"'/$repo/os/$arch' > /etc/pacman.d/mirrorlist 57 | echo 'Server = https://archive.archlinux.org/.all' >> /etc/pacman.d/mirrorlist 58 | pacman-key --init 59 | pacman-key --populate archlinux 60 | pacman --noconfirm --needed -Sy archlinux-keyring 61 | pacman --noconfirm --needed -Syu base base-devel python archiso 62 | } 63 | [[ "$ISO_ARCH" == "aarch64" ]] && { 64 | echo 'Server = '"$MIRROR"'/$arch/$repo' > /etc/pacman.d/mirrorlist 65 | pacman-key --init 66 | pacman-key --populate archlinuxarm 67 | pacman --noconfirm --needed -Sy archlinuxarm-keyring 68 | rm -fv /usr/bin/arch-chroot 69 | pacman --noconfirm --needed -Syu base base-devel python \ 70 | dosfstools mtools squashfs-tools arch-install-scripts libisoburn 71 | 72 | curl -Lo aarch64.tar.gz "https://github.com/archlinux-jerry/archiso-aarch64/archive/aarch64.tar.gz" 73 | tar -xvf aarch64.tar.gz 74 | rm -rf /usr/share/archiso/ 75 | cp -rv archiso-aarch64-aarch64 /usr/share/archiso 76 | cp /usr/share/archiso/archiso/mkarchiso /usr/bin/mkarchiso 77 | chmod +x /usr/bin/mkarchiso 78 | pushd /usr/share/archiso/configs/releng 79 | mv packages.aarch64 packages.x86_64 80 | ln -s packages.x86_64 packages.aarch64 81 | popd 82 | } 83 | 84 | # make sure patches apply 85 | /custom/patches/archiso_pxe_http.hook/patch.sh 86 | 87 | mkdir -p livecd 88 | cd livecd 89 | cp -r /usr/share/archiso/configs/releng releng 90 | cp -r /usr/share/archiso/configs/releng releng.1 91 | cd releng 92 | 93 | pre_build 94 | 95 | cat packages.x86_64 |sort |uniq > packages.x86_64.dedup 96 | cat packages.x86_64.dedup packages.x86_64.remove packages.x86_64.remove |sort |uniq -u > packages.x86_64.final 97 | mv -f packages.x86_64.final packages.x86_64 98 | rm packages.x86_64.remove packages.x86_64.dedup 99 | # print diff 100 | { 101 | pushd .. 102 | diff -r releng.1 releng || true 103 | popd 104 | } 105 | mkarchiso -v . 106 | } 107 | finalize() { 108 | mkdir upload 109 | pushd out 110 | ls -alh || true 111 | realver=$(ls -1 *.iso |python3 -c 'print(input().split("-")[1])') 112 | popd 113 | ver=$(cat /version) 114 | mkdir "upload/${realver}" 115 | pushd upload 116 | ln -s "$realver" "$ver" 117 | ln -s "$realver" "latest" 118 | popd 119 | # move iso 120 | mv out/*.iso "upload/${realver}/" 121 | pushd "upload/${realver}" 122 | md5sum *.iso > md5sums.txt 123 | sha1sum *.iso > sha1sums.txt 124 | sha256sum *.iso > sha256sums.txt 125 | b2sum *.iso > b2sums.txt 126 | cat md5sums.txt sha1sums.txt sha256sums.txt b2sums.txt 127 | ln -s *.iso archlinux-${ISO_ARCH}.iso 128 | popd 129 | # copy netboot content 130 | cp -av work/iso/arch "upload/${realver}/" 131 | [[ "$ISO_ARCH" == "aarch64" ]] && mcopy -snv -i "work/efiboot.img" "::/arch/boot" "upload/${realver}/arch/" 132 | # makelink /archlinux/iso -> ../ 133 | mkdir upload/archlinux 134 | # generic archlinux mirror structure 135 | pushd upload/archlinux 136 | ln -s .. iso 137 | popd 138 | # mirror.pkgbuild.com structure 139 | pushd upload 140 | ln -s . iso 141 | popd 142 | } 143 | 144 | if [ -e '/makelivecd.sh' ]; then 145 | makelivecd 146 | finalize 147 | else 148 | configure_archbootstrap_${ISO_ARCH} 149 | arch-chroot 150 | fi 151 | exit 0 152 | --------------------------------------------------------------------------------