diff options
| author | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2026-05-24 15:40:32 +0000 |
|---|---|---|
| committer | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2026-05-24 15:40:32 +0000 |
| commit | dea2a1fa20fc8e843cd85e5920a67b9054d00b2e (patch) | |
| tree | f331ff92dc5fd26f5803b483a24a0a21fd9bb97a /utils | |
| parent | ef5bfeb93345a5a681d88e99775622bf28defd8d (diff) | |
| download | alicelinux-dea2a1fa20fc8e843cd85e5920a67b9054d00b2e.tar.gz alicelinux-dea2a1fa20fc8e843cd85e5920a67b9054d00b2e.zip | |
Woodpecker CI ef5bfeb93345a5a681d88e99775622bf28defd8d [SKIP CI]
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/buildsite.sh | 396 | ||||
| -rw-r--r-- | utils/mkiso.d/include/etc/issue | 21 | ||||
| -rw-r--r-- | utils/mkiso.d/include/etc/skel/.profile | 9 | ||||
| -rw-r--r-- | utils/mkiso.d/init | 96 | ||||
| -rw-r--r-- | utils/mkiso.d/live_script.sh | 26 | ||||
| -rwxr-xr-x | utils/mkiso.sh | 194 | ||||
| -rwxr-xr-x | utils/mkrootfs.sh | 39 | ||||
| -rwxr-xr-x | utils/qemu.sh | 23 |
8 files changed, 0 insertions, 804 deletions
diff --git a/utils/buildsite.sh b/utils/buildsite.sh deleted file mode 100755 index e00d3088..00000000 --- a/utils/buildsite.sh +++ /dev/null @@ -1,396 +0,0 @@ -#!/bin/sh -e -# -# Build the Alice Linux static website into public/. -# Run from the project root. -# -# Dependencies: cmark, curl - -cd "$(dirname "$0")/.." - -for dep in cmark curl; do - command -v "$dep" >/dev/null 2>&1 || { - printf 'Error: "%s" is required but not found in PATH.\n' "$dep" >&2 - exit 1 - } -done - -rm -rf public -mkdir -p public - -html_escape() { - # takes a single string argument, prints escaped to stdout - printf '%s' "$1" | sed 's/\&/\&/g;s/</\</g;s/>/\>/g;s/"/\"/g' -} - -port_version() { - grep '^version=' "$1/abuild" | cut -d = -f2- || true -} - -port_release() { - grep '^release=' "$1/abuild" | cut -d = -f2- || true -} - -port_depends() { - [ -f "$1/depends" ] || return 0 - grep -Ev '^(#|$)' "$1/depends" | tr '\n' ' ' | sed 's/[[:space:]]*$//' || true -} - -generate_ports_page() { - { - sed "s/@TITLE@/ports/g" files/header - echo "<p>Package ports generated from <code>repos/core</code>, <code>repos/extra</code>, and <code>repos/community</code>.</p>" - echo "<div class=\"ports-toolbar\">" - echo "<button type=\"button\" class=\"active\" data-repo=\"all\">all</button>" - echo "<button type=\"button\" data-repo=\"core\">core</button>" - echo "<button type=\"button\" data-repo=\"extra\">extra</button>" - echo "<button type=\"button\" data-repo=\"community\">community</button>" - echo "<input id=\"ports-search\" type=\"search\" placeholder=\"filter ports\" autocomplete=\"off\">" - echo "</div>" - echo "<div class=\"ports-count\"><span id=\"ports-visible\">0</span> / <span id=\"ports-total\">0</span> ports</div>" - echo "<table id=\"ports-table\">" - echo "<thead><tr><th>repo</th><th>name</th><th>version</th><th>dependencies</th></tr></thead>" - echo "<tbody>" - - for repo in core extra community; do - for port in repos/$repo/*; do - [ -f "$port/abuild" ] || continue - name=${port##*/} - version=$(port_version "$port") - release=$(port_release "$port") - depends=$(port_depends "$port") - [ "$release" ] && version=$version-$release - - e_repo=$(html_escape "$repo") - e_name=$(html_escape "$name") - e_version=$(html_escape "$version") - e_depends=$(html_escape "$depends") - - printf '<tr data-repo="%s"><td>%s</td><td><a href="https://codeberg.org/emmett1/alicelinux/src/branch/main/repos/%s/%s">%s</a></td><td>%s</td><td>%s</td></tr>\n' \ - "$e_repo" \ - "$e_repo" \ - "$e_repo" \ - "$e_name" \ - "$e_name" \ - "$e_version" \ - "$e_depends" - done - done - - echo "</tbody>" - echo "</table>" - cat << 'EOF' -<script> -(function () { - var table = document.getElementById('ports-table'); - var rows = Array.prototype.slice.call(table.querySelectorAll('tbody tr')); - var search = document.getElementById('ports-search'); - var visible = document.getElementById('ports-visible'); - var total = document.getElementById('ports-total'); - var buttons = Array.prototype.slice.call(document.querySelectorAll('.ports-toolbar button')); - var repo = 'all'; - - total.textContent = rows.length; - - function filterPorts() { - var query = search.value.trim().toLowerCase(); - var count = 0; - - rows.forEach(function (row) { - var repoMatch = repo === 'all' || row.dataset.repo === repo; - var textMatch = !query || row.textContent.toLowerCase().indexOf(query) !== -1; - var show = repoMatch && textMatch; - row.style.display = show ? '' : 'none'; - if (show) count++; - }); - - visible.textContent = count; - } - - buttons.forEach(function (button) { - button.addEventListener('click', function () { - repo = button.dataset.repo; - buttons.forEach(function (b) { b.classList.remove('active'); }); - button.classList.add('active'); - filterPorts(); - }); - }); - - search.addEventListener('input', filterPorts); - filterPorts(); -}()); -</script> -EOF - cat files/footer - } > public/ports.html -} - -# copy static .html files (from repo root, readme, etc.) into public/ -find . -type f -name "*.html" ! -path './public/*' | sed 's|^\./||' | while IFS= read -r i; do - dir=${i%/*} - file=${i##*/} - title=${dir##*/} - [ "$dir" = "$file" ] && { - title=home; dir= - } - mkdir -p "public/$dir" - printf 'copy html for %s...\n' "$i" - { - sed "s/@TITLE@/$title/g" files/header - cat "$i" - cat files/footer - } > "public/$dir/$file" -done - -generate_ports_page - -generate_commits_page() { - { - sed "s/@TITLE@/commits/g" files/header - cat << 'EOF' -<p>Recent commits from <a href="https://codeberg.org/emmett1/alicelinux">codeberg.org/emmett1/alicelinux</a>.</p> -<ul id="commits"></ul> -<div id="commits-loading">loading…</div> -<div id="commits-error"></div> -<script> -(function () { - var list = document.getElementById('commits'); - var loading = document.getElementById('commits-loading'); - var errEl = document.getElementById('commits-error'); - var page = 1; - var loadingMore = false; - var hasMore = true; - var PER_PAGE = 30; - - function fmtHash(hash) { - return hash.substring(0, 7); - } - - function fmtDate(iso) { - var d = new Date(iso); - var y = d.getFullYear(); - var m = String(d.getMonth() + 1).padStart(2, '0'); - var day = String(d.getDate()).padStart(2, '0'); - var h = String(d.getHours()).padStart(2, '0'); - var min = String(d.getMinutes()).padStart(2, '0'); - return y + '-' + m + '-' + day + ' ' + h + ':' + min; - } - - function esc(s) { - var d = document.createElement('div'); - d.textContent = s; - return d.innerHTML; - } - - function loadCommits() { - if (!hasMore || loadingMore) return; - loadingMore = true; - loading.style.display = 'block'; - - var url = 'https://codeberg.org/api/v1/repos/emmett1/alicelinux/commits?limit=' + PER_PAGE + '&page=' + page; - - fetch(url) - .then(function (r) { - if (!r.ok) throw new Error('HTTP ' + r.status); - var link = r.headers.get('X-HasMore'); - if (link === 'false' || link === null) hasMore = false; - return r.json(); - }) - .then(function (data) { - if (!data.length || data.length < PER_PAGE) hasMore = false; - - data.forEach(function (c) { - var li = document.createElement('li'); - var hash = c.sha || ''; - var msg = c.commit.message.split('\n')[0] || ''; - var author = c.commit.author.name || 'unknown'; - var date = c.commit.author.date || ''; - var url = c.html_url || '#'; - - li.innerHTML = - '<span class="commit-hash"><a href="' + esc(url) + '">' + esc(fmtHash(hash)) + '</a></span>' + - '<span class="commit-msg"><a href="' + esc(url) + '">' + esc(msg) + '</a></span>' + - '<span class="commit-meta">' + esc(author) + '<br>' + esc(fmtDate(date)) + '</span>'; - list.appendChild(li); - }); - - page++; - loadingMore = false; - loading.style.display = 'none'; - }) - .catch(function (err) { - loadingMore = false; - loading.style.display = 'none'; - hasMore = false; - errEl.textContent = 'Failed to load commits: ' + err.message; - errEl.style.display = 'block'; - }); - } - - window.addEventListener('scroll', function () { - if (loadingMore || !hasMore) return; - var scrollBottom = window.scrollY + window.innerHeight; - var threshold = document.body.scrollHeight - 600; - if (scrollBottom >= threshold) loadCommits(); - }); - - loadCommits(); -}()); -</script> -EOF - cat files/footer - } > public/commits.html -} - -generate_commits_page - -generate_download_page() { - { - sed "s/@TITLE@/download/g" files/header - - listing=$(curl -sL --max-time 10 https://dl.alicelinux.org/ 2>/dev/null || true) - - cat << 'EOF' -<div id="dl-status" class="dl-empty">loading…</div> -<table class="dl-table" id="dl-table"><tbody> -EOF - - if [ -n "$listing" ]; then - echo "$listing" | sed -n '/<tbody>/,/<\/tbody>/p' | while IFS= read -r row; do - case $row in - *'<tr>'*) - href=$(printf '%s' "$row" | sed 's/.*<a href="\([^"]*\)">.*/\1/') - name=$(printf '%s' "$row" | sed 's/.*<a href="[^"]*">\([^<]*\)<.*/\1/') - size=$(printf '%s' "$row" | sed 's/.*<td class="s"[^>]*>\([^<]*\)<.*/\1/') - date=$(printf '%s' "$row" | sed 's/.*<td class="m">\([^<]*\)<.*/\1/') - type=$(printf '%s' "$row" | sed 's/.*<td class="t">\([^<]*\)<.*/\1/') - [ "$name" = "../" ] && continue - url="https://dl.alicelinux.org/$href" - e_url=$(html_escape "$url") - e_name=$(html_escape "$name") - e_size=$(html_escape "$size") - e_date=$(html_escape "$date") - if [ "$type" = "Directory" ]; then - printf '<tr><td><a href="%s">%s/</a></td><td>%s</td><td>%s</td></tr>\n' \ - "$e_url" "$e_name" "$e_size" "$e_date" - else - printf '<tr><td><a href="%s">%s</a></td><td>%s</td><td>%s</td></tr>\n' \ - "$e_url" "$e_name" "$e_size" "$e_date" - fi - ;; - esac - done - fi - - cat << 'EOF' -</tbody></table> -<script> -(function () { - var table = document.getElementById('dl-table'); - var tbody = table.querySelector('tbody'); - var status = document.getElementById('dl-status'); - - function esc(s) { - var d = document.createElement('div'); - d.textContent = s; - return d.innerHTML; - } - - function rowHTML(href, name, size, date, isDir) { - var url = 'https://dl.alicelinux.org/' + href; - var label = esc(name) + (isDir ? '/' : ''); - return '<tr><td><a href="' + esc(url) + '">' + label + '</a></td><td>' + esc(size) + '</td><td>' + esc(date) + '</td></tr>'; - } - - fetch('https://dl.alicelinux.org/') - .then(function (r) { - if (!r.ok) throw new Error('HTTP ' + r.status); - return r.text(); - }) - .then(function (html) { - var parser = new DOMParser(); - var doc = parser.parseFromString(html, 'text/html'); - var rows = doc.querySelectorAll('table tbody tr'); - var frag = document.createDocumentFragment(); - - rows.forEach(function (row) { - var cells = row.querySelectorAll('td'); - if (!cells.length) return; - var link = cells[0].querySelector('a'); - if (!link) return; - var href = link.getAttribute('href'); - var name = link.textContent; - if (name === '../') return; - var size = cells[2] ? cells[2].textContent.trim() : ''; - var date = cells[1] ? cells[1].textContent.trim() : ''; - var isDir = cells[3] && cells[3].textContent.trim() === 'Directory'; - var tr = document.createElement('tr'); - tr.innerHTML = rowHTML(href, name, size, date, isDir); - frag.appendChild(tr); - }); - - if (frag.childNodes.length) { - tbody.innerHTML = ''; - tbody.appendChild(frag); - } - status.textContent = ''; - status.style.display = 'none'; - }) - .catch(function () { - var rows = tbody.querySelectorAll('tr'); - if (rows.length) { - status.textContent = ''; - status.style.display = 'none'; - } else { - status.innerHTML = 'Unable to load. Visit <a href="https://dl.alicelinux.org">dl.alicelinux.org</a> directly.'; - } - }); -}()); -</script> -EOF - cat files/footer - } > public/download.html -} - -generate_download_page - -# build docs index -cat docs/readme.md > docs/index.md -for f in docs/*.md; do - case $f in */readme.md|*/index.md) continue;; esac - title=$(head -n1 "$f") - file=${f##*/} - echo "- [$title](./${file%.md}.html)" >> docs/index.md -done - -# convert markdown to html -find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= read -r i; do - dir=${i%/*} - file=${i##*/} - title=${dir##*/} - [ "$dir" = "$file" ] && { - title=home; dir= - } - mkdir -p "public/$dir" - printf 'generating html for %s...\n' "$i" - { - sed "s/@TITLE@/$title/g" files/header - cmark "$i" - cat files/footer - } > "public/${i%.md}.html" -done - -# move readme.html to index.html -find public -type f -name "readme.html" | while IFS= read -r i; do - mv -n "$i" "${i%/*}/index.html" -done - -rm -f docs/index.md - -if [ -d files ]; then - cp -ra files public/ -fi - -echo alicelinux.org > public/.domains -echo alicelinux.emmett1.my >> public/.domains - -exit 0 diff --git a/utils/mkiso.d/include/etc/issue b/utils/mkiso.d/include/etc/issue deleted file mode 100644 index e8f879f5..00000000 --- a/utils/mkiso.d/include/etc/issue +++ /dev/null @@ -1,21 +0,0 @@ -Alice Linux \r (\l) - -Project page : https://codeberg.org/emmett1/alicelinux - -user login : live -user password: live - -root login : root -root password: root - -run 'sway' after login to start gui - -Some default sway keybindsym reminder: - - Super + Enter : foot terminal - Super + d : menu launcher - Super + Shift + q : quit program - Super + Shift + e : exit sway - -run 'doas poweroff' to poweroff live system - diff --git a/utils/mkiso.d/include/etc/skel/.profile b/utils/mkiso.d/include/etc/skel/.profile deleted file mode 100644 index e425b03b..00000000 --- a/utils/mkiso.d/include/etc/skel/.profile +++ /dev/null @@ -1,9 +0,0 @@ -# ~/.profile - -export ENV=~/.ashrc - -if [ -z "$XDG_RUNTIME_DIR" ]; then - XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir" - mkdir -pm 0700 "$XDG_RUNTIME_DIR" - export XDG_RUNTIME_DIR -fi diff --git a/utils/mkiso.d/init b/utils/mkiso.d/init deleted file mode 100644 index 05356e39..00000000 --- a/utils/mkiso.d/init +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/busybox sh - -NEWROOT=/.newroot -INITRAMFS=/run/initramfs -MEDIA=$INITRAMFS/media -LOWER=$INITRAMFS/lower -UPPER=$INITRAMFS/upper -WORK=$INITRAMFS/work -SFSIMAGE=$MEDIA/boot/rootfs.sfs - -/bin/busybox --install -s /bin - -clear - -mkdir -p /proc /sys /run /dev -mount -t proc proc /proc -mount -t sysfs sysfs /sys -mount -t tmpfs run /run -mount -t devtmpfs dev /dev - -mkdir -p $LOWER $MEDIA $UPPER $WORK $NEWROOT - -exec >/dev/console </dev/console 2>&1 - -PRINTK="`cat /proc/sys/kernel/printk`" -echo "0" > /proc/sys/kernel/printk - -# mdev -mkdir -p /etc -echo '$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"' > /etc/mdev.conf -mdev -df & pid_mdev=$! - -# load kernel modules, twice -find /sys -name 'modalias' -type f -exec cat '{}' + | sort -u | xargs modprobe -b -a >/dev/null 2>&1 -find /sys -name 'modalias' -type f -exec cat '{}' + | sort -u | xargs modprobe -b -a >/dev/null 2>&1 - -# load kernel modules required for live iso -for m in loop cdrom isofs overlay squashfs usb-storage loop fuse exfat; do - modprobe $m >/dev/null 2>&1 -done - -echo "Please wait..." - -# figure out media -if [ -f /proc/sys/dev/cdrom/info ]; then - CDROM=$(grep name /proc/sys/dev/cdrom/info | awk -F : '{print $2}' | awk '{print $1}') -fi - -while [ "$wait" != 10 ]; do - BLOCK=$(grep -E '[vsh]d' /proc/partitions | awk '{print $4}') - for i in $CDROM $BLOCK; do - mount -v -r /dev/$i $MEDIA >/dev/null 2>&1 || continue - [ -f $MEDIA/boot/livemedia ] || { umount $MEDIA; continue; } - MEDIAFOUND=1 - break 2 - done - wait=$(( wait + 1 )) - sleep 1 -done - -if [ ! "$MEDIAFOUND" ]; then - echo "Media not found even after 10 seconds" - sh - echo "Cannot go further" - sleep 99999 - exit 1 -fi - -# mount stuffs -loopdevice=$(losetup -f) -losetup -f $SFSIMAGE -mount -r $loopdevice $LOWER -mount -t overlay overlay -o lowerdir=$LOWER,upperdir=$UPPER,workdir=$WORK $NEWROOT -if [ -f $MEDIA/boot/rootfs.gz ]; then - tar -xzaf $MEDIA/boot/rootfs.gz -C $NEWROOT -fi - -kill $pid_mdev - -mount --move /sys $NEWROOT/sys -mount --move /proc $NEWROOT/proc -mount --move /dev $NEWROOT/dev -mount --move /run $NEWROOT/run - -# execute live script if exist -if [ -f $NEWROOT/$MEDIA/boot/live_script.sh ]; then - chroot $NEWROOT sh $MEDIA/boot/live_script.sh -fi - -# switch to newroot -clear -exec /bin/switch_root $NEWROOT /sbin/init - -echo "This is the end of initramfs" -echo "Nothing further, here's the shell" -/bin/busybox sh diff --git a/utils/mkiso.d/live_script.sh b/utils/mkiso.d/live_script.sh deleted file mode 100644 index bb470dc1..00000000 --- a/utils/mkiso.d/live_script.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -LIVEUSER=live -PASSWORD=live -LIVEHOSTNAME=alicelive - -adduser -D $LIVEUSER -for g in users wheel audio video input; do - addgroup $LIVEUSER $g -done - -passwd -d $LIVEUSER >/dev/null 2>&1 -passwd -d root >/dev/null 2>&1 - -echo "root:root" | chpasswd -c SHA512 -echo "$LIVEUSER:$PASSWORD" | chpasswd -c SHA512 - -for sv in tty1 tty2 tty3 seatd; do - [ -d /etc/sv/$sv ] && ln -s /etc/sv/$sv /var/service -done - -echo $LIVEHOSTNAME > /etc/hostname - -if [ -f /etc/doas.conf ]; then - echo "permit nopass $LIVEUSER" >> /etc/doas.conf -fi diff --git a/utils/mkiso.sh b/utils/mkiso.sh deleted file mode 100755 index c6fc083d..00000000 --- a/utils/mkiso.sh +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/sh -e - -msg() { echo "-> $@"; } -cleanup() { rm -rf $WORKDIR; } - -prepare_rootfs() { - [ -d $ROOTFS ] && return - basepkg="baselayout autils binutils bison busybox - bzip2 ca-certificates curl file flex gcc - git gmp initscripts linux-headers m4 make - mpc mpfr musl openssl patch spm xz zlib" - requiredpkg="linux grub syslinux efibootmgr" - extrapkg="pfetch sway swaybg swayidle swaylock wmenu mpv - foot firefox fff ranger dejavu-fonts-ttf wpa_supplicant dhcpcd - imv lm-sensors opendoas zstd rsync squashfs-tools" - mkdir -p $ROOTFS/var/lib/spm/db - APKG_NOPROMPT=1 APKG_ROOT=$ROOTFS apkg -I $basepkg $requiredpkg $extrapkg -} - -squashfs_rootfs() { - [ -f $ISODIR/boot/rootfs.sfs ] && return - mkdir -p $ISODIR/boot - - msg "squashing rootfs..." - mksquashfs \ - $ROOTFS \ - $ISODIR/boot/rootfs.sfs \ - -b 1048576 \ - -comp xz \ - -wildcards \ - -e tmp/* -e root/* -e sys/* -e dev/* -e proc/* -e run/* -} - -add_kmod() { - [ -f $INITRAMFSDIR/$KERNEL_MODULES_DIR/$1 ] && continue - mkdir -p $INITRAMFSDIR/$KERNEL_MODULES_DIR/${1%/*} - cp $ROOTFS/$KERNEL_MODULES_DIR/$1 $INITRAMFSDIR/$KERNEL_MODULES_DIR/${1%/*} - for d in $(grep $1: $ROOTFS/$KERNEL_MODULES_DIR/modules.dep | tr ' ' '\n' | tail -n+2); do - add_kmod $d - done -} - -make_initramfs() { - [ -f $ISODIR/boot/initrd ] && return - mkdir -p $INITRAMFSDIR/bin - cp $MKISOD/init $INITRAMFSDIR - chmod +x $INITRAMFSDIR/init - cp /bin/busybox $INITRAMFSDIR/bin - - KERNEL_VER=$(file $ROOTFS/boot/vmlinuz-linux | awk '{print $9}') - KERNEL_MODULES_DIR=lib/modules/$KERNEL_VER - - msg "copying kernel modules..." - ( cd $ROOTFS/$KERNEL_MODULES_DIR - for rk in $required_kmods; do - [ -d kernel/$rk ] || continue - for f in $(find kernel/$rk -type f); do - add_kmod $f - done - done - ) - - for i in order builtin builtin.modinfo; do - cp $ROOTFS/$KERNEL_MODULES_DIR/modules.$i $INITRAMFSDIR/lib/modules/$KERNEL_VER/ - done - depmod -b $INITRAMFSDIR $KERNEL_VER - - msg "generating live initrd..." - ( cd $INITRAMFSDIR ; find . | cpio -o -H newc | gzip -9 ) > $ISODIR/boot/initrd -} - -prepare_grub() { - [ -f $ISODIR/boot/efiboot.img ] && return - msg "preparing grub boot files..." - mkdir -p $ISODIR/boot/grub/x86_64-efi $ISODIR/boot/grub/fonts - echo "set prefix=/boot/grub" > $ISODIR/boot/grub-early.cfg - cp -a $ROOTFS/usr/lib/grub/x86_64-efi/*.mod $ISODIR/boot/grub/x86_64-efi - cp -a $ROOTFS/usr/lib/grub/x86_64-efi/*.lst $ISODIR/boot/grub/x86_64-efi - cp $ROOTFS/usr/share/grub/unicode.pf2 $ISODIR/boot/grub/fonts/unicode.pf2 - - # UEFI - rm -f $ISODIR/boot/efiboot.img - mkdir -p $ISODIR/efi/boot - grub-mkimage -c $ISODIR/boot/grub-early.cfg -o $ISODIR/efi/boot/bootx64.efi -O x86_64-efi -p "" iso9660 normal search search_fs_file - modprobe loop - dd if=/dev/zero of=$ISODIR/boot/efiboot.img count=4096 - mkdosfs -n LIVE-UEFI $ISODIR/boot/efiboot.img - mkdir -p $ISODIR/boot/efiboot - mount -o loop $ISODIR/boot/efiboot.img $ISODIR/boot/efiboot - mkdir -p $ISODIR/boot/efiboot/EFI/boot - cp $ISODIR/efi/boot/bootx64.efi $ISODIR/boot/efiboot/EFI/boot - umount $ISODIR/boot/efiboot - rm -fr $ISODIR/boot/efiboot -} - -prepare_syslinux() { - [ -f $ISODIR/isolinux/isolinux.bin ] && return - msg "preparing syslinux boot files..." - mkdir -p $ISODIR/isolinux - cp $ROOTFS/usr/share/syslinux/ldlinux.c32 $ISODIR/isolinux - cp $ROOTFS/usr/share/syslinux/isolinux.bin $ISODIR/isolinux -} - -make_iso() { - cp $ROOTFS/boot/vmlinuz-linux $ISODIR/boot/vmlinuz - [ -f $MKISOD/live_script.sh ] && cp $MKISOD/live_script.sh $ISODIR/boot - touch $ISODIR/boot/livemedia - - if [ -d $MKISOD/include ]; then - echo "include rootfs files..." - ( - cd $MKISOD/include - chown -R 0:0 * - tar -czf $ISODIR/boot/rootfs.gz * - ) - fi - - cat << EOF > $ISODIR/isolinux/isolinux.cfg -#UI /isolinux/menu.c32 -DEFAULT silent -TIMEOUT 0 - -LABEL silent -LINUX /boot/vmlinuz -APPEND initrd=/boot/initrd -EOF - - cat << EOF > $ISODIR/boot/grub/grub.cfg -set default=0 -set timeout=3 -set timeout_style=hidden - -menuentry 'Alice Linux' { - linux /boot/vmlinuz - initrd /boot/initrd -} -EOF - - msg "generating iso..." - rm -f $OUTPUT - xorriso -as mkisofs \ - -isohybrid-mbr $ROOTFS/usr/share/syslinux/isohdpfx.bin \ - -c isolinux/boot.cat \ - -b isolinux/isolinux.bin \ - -no-emul-boot \ - -boot-load-size 4 \ - -boot-info-table \ - -eltorito-alt-boot \ - -e boot/efiboot.img \ - -no-emul-boot \ - -isohybrid-gpt-basdat \ - -volid ALICE \ - -o $OUTPUT $ISODIR - - sha256sum $OUTPUT > $ISOSUM -} - -WORKDIR=/tmp/alice-iso -ROOTFS=$WORKDIR/rootfs -ISODIR=$WORKDIR/liveiso -INITRAMFSDIR=$WORKDIR/initramfs -MKISOD=$PWD/mkiso.d -OUTPUT=$PWD/alicelinux-$(date +%Y%m%d).iso -ISOSUM=$OUTPUT.sha256sum - -required_kmods="crypto - fs lib - drivers/block - drivers/md - drivers/ata - drivers/firewire - drivers/input/keyboard - drivers/input/mouse - drivers/scsi - drivers/message - drivers/pcmcia - drivers/virtio - drivers/usb/host - drivers/usb/storage - drivers/hid - drivers/cdrom" - -cleanup -prepare_rootfs -squashfs_rootfs -make_initramfs -prepare_grub -prepare_syslinux -make_iso -cleanup - -msg "making iso done" - -exit 0 diff --git a/utils/mkrootfs.sh b/utils/mkrootfs.sh deleted file mode 100755 index ccd4cbb6..00000000 --- a/utils/mkrootfs.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -e - -[ "$(id -u)" = 0 ] || { - echo "making rootfs required root access" - false -} - -HERE=$(pwd) -OUTNAME=alicelinux-rootfs-$(date +%Y%m%d) -TARBALL=$HERE/$OUTNAME.tar.xz -PKGLIST=$TARBALL.pkglist -SHASUM=$TARBALL.sha256sum -ROOTFS=/tmp/alicerootfs -basepkg="baselayout autils binutils bison busybox - bzip2 ca-certificates curl file flex gcc - git gmp initscripts linux-headers m4 make - mpc mpfr musl openssl patch spm xz zlib" - -rm -rf $ROOTFS -mkdir -p $ROOTFS/var/lib/spm/db -APKG_ROOT=$ROOTFS apkg -i $basepkg -apkg-chroot $ROOTFS revdep -v - -rm -f $TARBALL - -echo "compressing rootfs..." -(cd $ROOTFS; tar -cJpf $TARBALL *) - -for i in $ROOTFS/var/lib/spm/db/*; do - n=${i##*/} - v=$(head -n1 $i); v=${v%-*} - echo "$n $v" >> $PKGLIST -done - -sha256sum ${TARBALL##*/} > $SHASUM - -rm -rf $ROOTFS - -echo "alice rootfs created." diff --git a/utils/qemu.sh b/utils/qemu.sh deleted file mode 100755 index 11b82a6d..00000000 --- a/utils/qemu.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -PORTSDIR="$(dirname $(dirname $(realpath $0)))" -SCRIPTDIR="$(dirname $(realpath $0))" - -[ -f /tmp/qemu-vm.img ] || { - qemu-img create -f qcow2 /tmp/qemu-vm.img 50G -} - -qemu-system-x86_64 -enable-kvm \ - -cpu host \ - -drive file=/tmp/qemu-vm.img,if=virtio \ - -device virtio-rng-pci \ - -m 2G \ - -smp 4 \ - -monitor stdio \ - -name "QEMU" \ - -boot d \ - -cdrom $@ - -rm -f /tmp/qemu-vm.img - -exit 0 |