mirror of
https://github.com/vale981/archiso-bcachefs
synced 2025-03-05 09:31:39 -05:00
init
This commit is contained in:
commit
7dc4d7e629
3 changed files with 125 additions and 0 deletions
8
docker-setup.sh
Normal file
8
docker-setup.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
--rm --privileged=true \
|
||||
--name archiso \
|
||||
--mount type=bind,source="$(pwd)",target=/archiso \
|
||||
archlinux:latest bash < ./in_docker.sh
|
28
in_docker.sh
Normal file
28
in_docker.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
# install the basics
|
||||
pacman --noconfirm -Syu
|
||||
pacman --noconfirm -S archiso sudo git base-devel bash
|
||||
|
||||
# add a user for makepkg
|
||||
useradd -m archiso
|
||||
|
||||
# make him sudoer
|
||||
cat >> /etc/sudoers <<EOF
|
||||
archiso ALL=(ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
|
||||
# fix sudo: setrlimit(RLIMIT_CORE): Operation not permitted
|
||||
echo "Set disable_coredump false" > /etc/sudo.conf
|
||||
|
||||
# more dependencies
|
||||
cd /tmp
|
||||
su archiso
|
||||
git clone https://aur.archlinux.org/libscrypt.git
|
||||
cd libscrypt
|
||||
makepkg -si --noconfirm
|
||||
|
||||
# make the bacon
|
||||
cd /archiso
|
||||
bash make_iso.sh
|
89
make_iso.sh
Normal file
89
make_iso.sh
Normal file
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
cd $DIR
|
||||
|
||||
ARCH=x86_64
|
||||
REPO_DIR=$DIR/repo/$ARCH
|
||||
REPO=$REPO_DIR/repo.db.tar.gz
|
||||
PACKAGE_DIR=$DIR/packages
|
||||
WORKDIR=$DIR/archlive/
|
||||
|
||||
echo "Init Workdir"
|
||||
echo "============"
|
||||
|
||||
echo "Removing $WORKDIR"
|
||||
sudo rm -rf $WORKDIR
|
||||
cp -r /usr/share/archiso/configs/releng/ $WORKDIR
|
||||
|
||||
# echo "Setting up mkinitcpio.conf"
|
||||
# sed -i 's/\(HOOKS=(.*\))/\1 bcachefs)/' $WORKDIR/mkinitcpio.conf
|
||||
# cat >> $WORKDIR/mkinitcpio.conf <<EOF
|
||||
# MODULES=(bcachefs)
|
||||
# BINARIES=(bcachefs)
|
||||
# EOF
|
||||
|
||||
echo "Patching build.sh"
|
||||
sed -i 's/vmlinuz-linux/vmlinuz-linux-bcachefs-git/' archlive/build.sh
|
||||
|
||||
echo "Adding Packages"
|
||||
cat >> $WORKDIR/packages.x86_64 <<EOF
|
||||
libscrypt-git
|
||||
bcachefs-tools-git
|
||||
linux-bcachefs-git
|
||||
linux-bcachefs-git-headers
|
||||
linux-bcachefs-git-docs
|
||||
EOF
|
||||
|
||||
echo "Setting up pacman.conf"
|
||||
cat >> $WORKDIR/pacman.conf <<EOF
|
||||
[repo]
|
||||
SigLevel = Optional TrustAll
|
||||
Server = file:///$REPO_DIR/
|
||||
EOF
|
||||
|
||||
echo "Init Repo"
|
||||
echo "========="
|
||||
|
||||
mkdir -p $REPO_DIR
|
||||
mkdir -p $PACKAGE_DIR
|
||||
repo-add $REPO
|
||||
|
||||
printf "\nBuilding AUR Packages\n"
|
||||
echo "====================="
|
||||
|
||||
# git clone linux-bcachefs-git
|
||||
# git clone https://aur.archlinux.org/bcachefs-tools-git.git
|
||||
# git clone https://aur.archlinux.org/linux-bcachefs-git.git
|
||||
|
||||
function add_aur {
|
||||
CURRDIR=$(pwd)
|
||||
URL=$1
|
||||
NAME=$(echo $URL | sed -r 's/^.*\.org\/(.*).git$/\1/')
|
||||
|
||||
cd $PACKAGE_DIR
|
||||
|
||||
if [ ! -d "$NAME" ]; then
|
||||
git clone $URL
|
||||
cd $NAME
|
||||
makepkg -s
|
||||
else
|
||||
cd $NAME
|
||||
fi
|
||||
|
||||
|
||||
repo-add $REPO *.pkg.tar.xz
|
||||
cp *.pkg.tar.xz $REPO_DIR
|
||||
|
||||
# restore
|
||||
cd $CURRDIR
|
||||
}
|
||||
|
||||
add_aur https://aur.archlinux.org/libscrypt-git.git
|
||||
add_aur https://aur.archlinux.org/bcachefs-tools-git.git
|
||||
add_aur https://aur.archlinux.org/linux-bcachefs-git.git
|
||||
|
||||
printf "\nBuilding the ISO\n"
|
||||
echo "====================="
|
||||
|
||||
cd $WORKDIR
|
||||
sudo ./build.sh -v
|
Loading…
Add table
Reference in a new issue