Commit e3fb3d51 authored by ZappeL's avatar ZappeL
Browse files

fixed syscall issues

parent 33b2b378
#!/bin/bash
resources=$(dirname `readlink -f $0`)/../resources/chroot
### HEAD ###
if [[ ${EUID} != 0 ]] ; then
......@@ -13,13 +14,16 @@ ex_dscr="Setup extension."
ex_help="No Help available"
chroot_rc=$1/etc/bash/bashrc.d/chroot.sh
## TODO: fix appending only if not already applied!
# base64 -w0 "${resources}/append_make.conf"
### MAIN ###
if [[ -f ${chroot_rc} ]]; then
echo -e "
make_conf_data=\"Q0ZMQUdTPSItbWFyY2g9YXJtdjgtYStjcmMgLW10dW5lPWNvcnRleC1hNTMgLWZ0cmVlLXZlY3Rvcml6ZSAtTzIgLXBpcGUgLWZvbWl0LWZyYW1lLXBvaW50ZXIiDQpDWFhGTEFHUz0iJHtDRkxBR1N9Ig0KQ0hPU1Q9ImFhcmNoNjQtdW5rbm93bi1saW51eC1nbnUiDQoNCk1BS0VPUFRTPSItajUiDQoNCkxJTkdVQVM9ImRlIiANCkwxME49IiR7TDEwTn0gJHtMSU5HVUFTfSINCkFDQ0VQVF9MSUNFTlNFPSIqIg0KQUNDRVBUX0tFWVdPUkRTPSJ+YXJtNjQiDQoNClVTRT0iLXNlY2NvbXAgLVgiDQoNClBPUlRESVI9Ii91c3IvcG9ydGFnZSINCkRJU1RESVI9Ii91c3IvcG9ydGFnZS9kaXN0ZmlsZXMiDQpQS0dESVI9Ii91c3IvcG9ydGFnZS9wYWNrYWdlcyINCg0KRU1FUkdFX0RFRkFVTFRfT1BUUz0iLS1sb2FkLWF2ZXJhZ2U9MTUgLS1hdXRvdW5tYXNrPW4gLS1xdWlldC1idWlsZD15IC0tY29tcGxldGUtZ3JhcGgiDQo=\"
ex_initial_setup() {
make_conf_data=\"Ck1BS0VPUFRTPSItajUiCgojIHRoaXMgaXMgbmVlZGVkIGZvciBjb21waWxpbmcgaW4gY2hyb290CkZFQVRVUkVTPSItcGlkLXNhbmRib3giCgpMSU5HVUFTPSJkZSIKTDEwTj0iJHtMMTBOfSAke0xJTkdVQVN9IgpBQ0NFUFRfTElDRU5TRT0iKiIKQUNDRVBUX0tFWVdPUkRTPSJ+YXJtNjQiCgpVU0U9Ii1zZWNjb21wIC1YIgoKUE9SVERJUj0iL3Vzci9wb3J0YWdlIgpESVNURElSPSIvdXNyL3BvcnRhZ2UvZGlzdGZpbGVzIgpQS0dESVI9Ii91c3IvcG9ydGFnZS9wYWNrYWdlcyIKCkVNRVJHRV9ERUZBVUxUX09QVFM9Ii0tbG9hZC1hdmVyYWdlPTE1IC0tYXV0b3VubWFzaz1uIC0tcXVpZXQtYnVpbGQ9eSAtLWNvbXBsZXRlLWdyYXBoIgo=\"
echo -e \"fixing make.conf...\"
echo \${make_conf_data} | base64 -d > /etc/portage/make.conf
echo \${make_conf_data} | base64 -d >> /etc/portage/make.conf
echo -e \"creating portage dirs...\"
mkdir -p /etc/portage/package.{use,mask,keywords,unmask}
echo \"sys-apps/util-linux build -udev\" > /etc/portage/package.use/util-linux
......@@ -29,6 +33,9 @@ ex_initial_setup() {
cp -a /var/tmp/portage/app-misc/pax-utils-*/image/* /
(emerge -1O pax-utils &>/dev/null)
fi
echo -e \"setting profile...\"
eselect profile set default/linux/arm64/17.0/systemd
echo -e \"initial setup done.\"
}\n" >> ${chroot_rc}
fi
......
......@@ -17,11 +17,13 @@ chroot_rc=$1/etc/bash/bashrc.d/chroot.sh
if [[ -f ${chroot_rc} ]]; then
echo -e "
ex_kernel_build() {
echo currently unsupported\!
exit 0
cd /usr/src/linux
make -s menuconfig
make -j\`nproc\` && make modules_install
cp arch/arm64/boot/Image /boot/kernel8.img
cp arch/arm64/boot/dts/broadcom/*.dtb /boot/
cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
cp arch/arm64/boot/dts/overlays/* /boot/overlays
}\n" >> ${chroot_rc}
fi
......
MAKEOPTS="-j5"
# this is needed for compiling in chroot
FEATURES="-pid-sandbox"
LINGUAS="de"
L10N="${L10N} ${LINGUAS}"
ACCEPT_LICENSE="*"
ACCEPT_KEYWORDS="~arm64"
USE="-seccomp -X"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
EMERGE_DEFAULT_OPTS="--load-average=15 --autounmask=n --quiet-build=y --complete-graph"
......@@ -29,9 +29,9 @@ make.conf:
general package use (/etc/portage/package/use/qemu):
app-emulation/qemu static-user
>=dev-libs/glib-2.52.3 static-libs
>=sys-apps/attr-2.4.47-r2 static-libs
>=dev-libs/libpcre-8.41 static-libs"
dev-libs/glib static-libs
sys-apps/attr static-libs
dev-libs/libpcre static-libs"
echo -e "\nPlease reinstall app-emulation/qemu with static-user flag and then rerun this script."
......@@ -85,6 +85,7 @@ echo -e "registering aarch64..."
echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64:' > /proc/sys/fs/binfmt_misc/register 2> /dev/null
echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:' > /proc/sys/fs/binfmt_misc/register 2> /dev/null
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/qemu-wrapper:' > /proc/sys/fs/binfmt_misc/register 2> /dev/null
echo -e "mounting needed dependencies..."
mount --rbind /dev ${build_root}/dev
mount --make-rslave ${build_root}/dev
......@@ -110,6 +111,7 @@ echo -e "chrooting..."
echo -e "cleaning things up..."
rm ${build_root}/etc/bash/bashrc.d/chroot.sh
rm ${build_root}/qemu-wrapper
echo > ${build_root}/etc/resolv.conf
## unmounting
(umount -fl ${build_root}/* &>/dev/null)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment