Compare commits

..

7 Commits

Author SHA1 Message Date
59709f139e whoops. THIS should get a working overlayfs, fingers crossed 2015-02-04 19:56:39 -05:00
f549d24977 fixing some buildtime issues.. 2015-02-01 01:48:51 -05:00
904d644990 overlayfs implementation 2015-01-30 20:38:42 -05:00
745cda0357 force 32 sector size for EFI 2015-01-20 04:46:19 -05:00
3a5914faca tweak to bashrc 2015-01-18 00:06:51 -05:00
0162513827 completed apacman integration and linux 3.18.2 2015-01-17 17:37:57 -05:00
599a2fcbe2 updating apacman, stabilizations 2015-01-16 03:36:40 -05:00
16 changed files with 83 additions and 178 deletions

Binary file not shown.

View File

@@ -1,7 +1,7 @@
# Server list generated by rankmirrors on 2015-01-10 # Server list generated by rankmirrors on 2015-02-01
Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch Server = http://mirrors.acm.wpi.edu/archlinux/$repo/os/$arch
Server = http://mirror.yellowfiber.net/archlinux/$repo/os/$arch Server = http://mirror.yellowfiber.net/archlinux/$repo/os/$arch
Server = http://mirror.es.its.nyu.edu/archlinux/$repo/os/$arch Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch
Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch
Server = http://mirror.umd.edu/archlinux/$repo/os/$arch Server = http://mirror.umd.edu/archlinux/$repo/os/$arch
Server = http://mirror.jmu.edu/pub/archlinux/$repo/os/$arch
Server = http://mirror.cs.pitt.edu/archlinux/$repo/os/$arch

View File

@@ -89,6 +89,6 @@ Include = /etc/pacman.d/mirrorlist
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
#Server = file:///home/custompkgs #Server = file:///home/custompkgs
[archlinuxfr] #[archlinuxfr]
SigLevel = Never #SigLevel = Never
Server = http://repo.archlinux.fr/$arch #Server = http://repo.archlinux.fr/$arch

View File

@@ -98,6 +98,6 @@ Include = /etc/pacman.d/mirrorlist
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
#Server = file:///home/custompkgs #Server = file:///home/custompkgs
[archlinuxfr] #[archlinuxfr]
SigLevel = Never #SigLevel = Never
Server = http://repo.archlinux.fr/$arch #Server = http://repo.archlinux.fr/$arch

View File

@@ -1,89 +0,0 @@
#!/bin/sh
# change some versions around
sed -i -e 's/^\(pkgbase=linux[[:space:]]*\)/#\1/g' ${1}
sed -i -e 's/^#\(pkgbase=linux-\)custom.*$/\1BDisk/g' ${1}
sed -i -e '/^_kernelname/a KERNVER=$(echo ${pkgver} | sed -e "s/\\\([0-9]\\\.[0-9]*\\\).*$/\\\1/")' ${1}
sed -i -e "s/^\(makedepends=.*\))$/\1 'rsync' 'git')/g" ${1}
##cp linux.preset linux-BDisk.preset
##sed -i -e 's#^[[:space:]]*install\ -D\ -m644\ "${srcdir}/linux.preset".*$#install -D -m644 "${srcdir}/linux-BDisk.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"#g' ${1}
##sed -i -e "s/\ 'fallback'//g" \
##-e '/^fallback/d' \
##-e '/^$/d' \
##-e '/^[[:space:]]*$/d' \
##-e 's#^\(default_image="/boot/initramfs-linux\).*#\1-BDisk"/g' linux-BDisk.preset
##-e 's/^\(ALL_kver="/boot/vmlinuz-linux\)\(.*\)/\1-BDisk\2/g' linux-BDisk.preset
# add source for aufs3
## 12.07.2014 - remove the "git checkout <SPECIFIC COMMIT HASH>" once a bug is fixed. currently fails with:
## LD fs/aufs/built-in.o
## CC [M] fs/aufs/module.o
##In file included from fs/aufs/module.c:24:0:
##fs/aufs/inode.h:307:12: error: function declaration isn't a prototype
##[-Werror=strict-prototypes]
## AuStubInt0(au_cpup_xattr, h_dst, h_src, ignore_flags)
## ^
##fs/aufs/aufs.h:28:21: note: in definition of macro 'AuStub'
## static inline type name(__VA_ARGS__) { body; }
## ^
##fs/aufs/inode.h:307:1: note: in expansion of macro 'AuStubInt0'
## AuStubInt0(au_cpup_xattr, h_dst, h_src, ignore_flags)
## ^
##cc1: some warnings being treated as errors
##scripts/Makefile.build:257: recipe for target 'fs/aufs/module.o' failed
##make[2]: *** [fs/aufs/module.o] Error 1
##scripts/Makefile.build:404: recipe for target 'fs/aufs' failed
##make[1]: *** [fs/aufs] Error 2
##Makefile:929: recipe for target 'fs' failed
##make: *** [fs] Error 2
sed -i -e '/^prepare()\ {/a\
\ git clone git:\/\/aufs.git.sourceforge.net\/gitroot\/aufs\/aufs3-standalone.git aufs3 > \/dev\/null 2>&1\
\ cd aufs3\
\ git checkout aufs${KERNVER} > \/dev\/null 2>&1\
\ git checkout c75f6dddc1c58950c76cc1581e4b4c7ac8365bff > \/dev\/null 2>&1\
\ cd ..\/' ${1}
#sed -i -e 's/^\(_kernelname=\).*$/\1"-BDisk"/' ${1}
sed -i -e '/^[[:space:]]*patch.*pkgver}"$/i rsync -a ../aufs3/Documentation/. Documentation/. ; rsync -a ../aufs3/fs/. fs/. ; cp -a ../aufs3/include/uapi/linux/aufs_type.h include/uapi/linux/. \
\ for i in $(ls -1 ../aufs3/*.patch) ; do patch -p1 -i ../aufs3/${i} ; done' ${1}
# and we need to be sure to build aufs3-util
#sed -i -e '/^[[:space:]]*install\ -D\ -m644\ vmlinux.*$/a\
#\ git clone git:\/\/git.code.sf.net\/p\/aufs\/aufs-util > \/dev\/null 2>&1\
#\ cd aufs-util\
#\ UTILVER=$(git branch -a | grep -v master | sort -nr | grep -v rcN | head -n1 | cut -f3 -d"\/")\
#\ git checkout ${UTILVER} > \/dev\/null 2>&1\
#\ make' ${1}
# and configure the kernel. this gets messy.
#-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=m/g" \\\
sed -i -e '/^[[:space:]]*make\ prepare.*$/i yes "" | make olddefconfig >/dev/null' ${1}
sed -i -e '/^[[:space:]]*make\ prepare.*$/a sed -i \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BRANCH_MAX_127\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_SBILIST\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HNOTIFY\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HFSNOTIFY\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_EXPORT\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_INO_T_64\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FHSM\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_RDU\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BDEV_LOOP\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_511\\\).*$/\\\1=n/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_1023\\\).*$/\\\1=n/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_32767\\\).*$/\\\1=n/g" ${srcdir}/../config{,.x86_64}' ${1}
# yes, we have to do this twice. with a hammer.
sed -i -e '/^[[:space:]]*make\ prepare.*$/a sed -i \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=m/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BRANCH_MAX_127\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_SBILIST\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HNOTIFY\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HFSNOTIFY\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_EXPORT\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_INO_T_64\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FHSM\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_RDU\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BDEV_LOOP\\\).*$/\\\1=y/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_511\\\).*$/\\\1=n/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_1023\\\).*$/\\\1=n/g" \\\
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_32767\\\).*$/\\\1=n/g" .config' ${1}
sed -i -e 's/^\([[:space:]]*yes\ ""\ |\ \)make\ config/\1make olddefconfig/' ${1}
# and we have to edit the linux.install as well.
sed -i -e 's/^\(KERNEL_NAME=\).*$/\1-BDisk/g' linux.install*

View File

@@ -3,7 +3,7 @@
# run. Advanced users may wish to specify all system modules # run. Advanced users may wish to specify all system modules
# in this array. For instance: # in this array. For instance:
# MODULES="piix ide_disk reiserfs" # MODULES="piix ide_disk reiserfs"
MODULES="aufs ata_generic ata_piix loop nls_cp437 ext4 raid456 vfat netconsole" MODULES="overlay ata_generic ata_piix loop nls_cp437 ext4 raid456 vfat netconsole"
# BINARIES # BINARIES
# This setting includes any additional binaries a given user may # This setting includes any additional binaries a given user may

View File

@@ -0,0 +1,15 @@
# mkinitcpio preset file for the 'linux' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
#PRESETS=('default' 'fallback')
PRESETS=('default')
#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""
#fallback_config="/etc/mkinitcpio.conf"
#fallback_image="/boot/initramfs-linux-fallback.img"
#fallback_options="-S autodetect"

View File

@@ -4,24 +4,5 @@ set -e
apacman --noconfirm --noedit -S --needed customizepkg-scripting apacman --noconfirm --noedit -S --needed customizepkg-scripting
echo -n "Compiling kernel sources..."
set +e
## Uncomment below and remove manual ABS/makepkg when https://github.com/oshazard/apacman/issues/2 is fulfulled
#apacman --noconfirm --noedit -S --needed linux
export ABSROOT=/tmp
abs core/linux
cd /tmp/core/linux
customizepkg --modify
chown -R nobody:nobody /tmp/core/linux
sudo -u nobody makepkg
set -e
for i in $(ls -1 linux-*.pkg.tar.xz | sort);
do
pacman --noconfirm -U ${i}
done
echo "Done." echo "Done."

View File

@@ -11,19 +11,13 @@ _mnt_fs() {
ro_dev=$(losetup --find --show --read-only "${img}") ro_dev=$(losetup --find --show --read-only "${img}")
echo ${ro_dev} >> /run/archiso/used_block_devices echo ${ro_dev} >> /run/archiso/used_block_devices
ro_dev_size=$(blockdev --getsz ${ro_dev}) ro_dev_size=$(blockdev --getsz ${ro_dev})
if [[ "${cowfile_size}" == "100" ]]; then
rw_dev_size=${ro_dev_size}
else
# size calculation done in this way to avoid integer overflow when ro_dev_size is > 10.2G
rw_dev_size=$((ro_dev_size/100*cowfile_size))
fi
if [[ "${cow_persistent}" == "P" ]]; then if [[ "${cow_persistent}" == "P" ]]; then
if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then
msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent." msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent."
else else
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent." msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent."
dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${rw_dev_size} &> /dev/null truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
else else
if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then
@@ -31,13 +25,13 @@ _mnt_fs() {
rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent." msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent."
dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${rw_dev_size} &> /dev/null truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
fi fi
rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
echo ${rw_dev} >> /run/archiso/used_block_devices echo ${rw_dev} >> /run/archiso/used_block_devices
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8"
_mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w"
echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices
@@ -108,9 +102,7 @@ run_hook() {
[[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch"
[[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}"
if [[ -z "${cowfile_size}" ]]; then if [[ -z "${cowfile_size}" ]]; then
cowfile_size="100" cowfile_size="256M"
else
cowfile_size=${cowfile_size/%}
fi fi
if [[ -n "${cow_label}" ]]; then if [[ -n "${cow_label}" ]]; then
@@ -176,7 +168,7 @@ archiso_mount_handler() {
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs" "/run/archiso/sfs/airootfs" _mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs" "/run/archiso/sfs/airootfs"
#_mnt_fs "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/" #_mnt_fs "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/"
mount --bind "run/archiso/sfs/airootfs" "/new_root" mount --bind "/run/archiso/sfs/airootfs" "/new_root"
if [[ "${copytoram}" == "y" ]]; then if [[ "${copytoram}" == "y" ]]; then
umount /run/archiso/bootmnt umount /run/archiso/bootmnt

View File

@@ -1,15 +1,13 @@
# vim: set ft=sh: # vim: set ft=sh:
run_cleanuphook () { run_cleanuphook () {
msg ":: Mounting aufs on / with tmpfs=rw, ${root}=ro ..." msg ":: Mounting OverlayFS on / with tmpfs=rw, ${root}=ro ..."
modprobe aufs modprobe overlay
echo "Now attempting aufs mount..." echo "Now attempting overlay mount..."
mkdir /new_root.hw mkdir -p /new_root.hw /overlay /overlay-rw
mount --move /new_root /new_root.hw mount --move /new_root /new_root.hw
mkdir /dev/shm mount -t overlay overlay -olowerdir=/new_root.hw,upperdir=/overlay,workdir=/overlay-rw,noatime /new_root
mount -t tmpfs none /dev/shm
mount -t aufs none /new_root -o dirs=/dev/shm=rw:/new_root.hw=ro -o noatime
pkill -9 dropbear #kill SSH (in preparation for the live system starting ssh on port 22 pkill -9 dropbear #kill SSH (in preparation for the live system starting ssh on port 22
} }

View File

@@ -4,7 +4,7 @@ build()
{ {
add_module 'squashfs' add_module 'squashfs'
add_module 'loop' add_module 'loop'
add_module 'aufs' add_module 'overlay'
add_binary "sed" add_binary "sed"
add_binary "pkill" add_binary "pkill"
@@ -16,6 +16,6 @@ build()
help() help()
{ {
cat <<HELPEOF cat <<HELPEOF
Mount a squashed flat-file directory with AUFS3 on / Mount a squashed flat-file directory with OverlayFS on /
HELPEOF HELPEOF
} }

View File

@@ -62,7 +62,8 @@ EOF
FTSIZE=$(du -sc ${TEMPDIR}/{boot,EFI,loader} | tail -n1 | awk '{print $1}') FTSIZE=$(du -sc ${TEMPDIR}/{boot,EFI,loader} | tail -n1 | awk '{print $1}')
FATSIZE=$((${FTSIZE} + 64)) # let's give a little wiggle room FATSIZE=$((${FTSIZE} + 64)) # let's give a little wiggle room
${RACECAR_CHK}truncate -s "${FATSIZE}"K ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img ${RACECAR_CHK}truncate -s "${FATSIZE}"K ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img
${RACECAR_CHK}mkfs.vfat -n ${DISTNAME}_EFI ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${RACECAR_CHK}mkfs.vfat -F 32 -n ${DISTNAME}_EFI ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img >> "${LOGFILE}.${FUNCNAME}" 2>&1
#${RACECAR_CHK}mkfs.vfat -F32 -s2 -n ${DISTNAME}_EFI ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img >> "${LOGFILE}.${FUNCNAME}" 2>&1
mkdir -p ${SRCDIR}/efiboot mkdir -p ${SRCDIR}/efiboot
mount ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img ${SRCDIR}/efiboot mount ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img ${SRCDIR}/efiboot
mkdir -p ${SRCDIR}/efiboot/EFI/${DISTNAME} mkdir -p ${SRCDIR}/efiboot/EFI/${DISTNAME}

View File

@@ -37,20 +37,13 @@ function mentos {
local MIRROR=$(egrep '^Server' ${i}/etc/pacman.d/mirrorlist | head -n1 | sed -e 's/^Server\ =\ //g ; s#$repo.*#core/os/x86_64/#g') local MIRROR=$(egrep '^Server' ${i}/etc/pacman.d/mirrorlist | head -n1 | sed -e 's/^Server\ =\ //g ; s#$repo.*#core/os/x86_64/#g')
local NEWKERN=$(curl -s "${MIRROR}" | grep linux | awk '{print $3}' | cut -f2 -d\" | egrep '^linux-[0-9].*pkg.tar.xz$' | cut -f2 -d"-") local NEWKERN=$(curl -s "${MIRROR}" | grep linux | awk '{print $3}' | cut -f2 -d\" | egrep '^linux-[0-9].*pkg.tar.xz$' | cut -f2 -d"-")
if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer ${BASEDIR}/root.x86_64/boot/vmlinuz-linux-${PNAME}) ]] || [[ "${INSTKERN}" != "${NEWKERN}" ]];
then
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit -Syyua --devel" >> "${LOGFILE}.${FUNCNAME}" 2>&1
else
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit -Syyua --devel --ignore linux,linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit -S --needed --ignore linux,linux-${PNAME} ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed --ignore linux ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
#${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit -S --needed ${PKGLIST}" ${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer root.x86_64/boot/vmlinuz-linux-${PNAME}) ]]; #${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}"
then cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${PNAME}
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}mkinitcpio -p linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
fi
echo "Done." echo "Done."
done done
@@ -60,7 +53,7 @@ function mentos {
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
${CHROOTCMD} ${CHROOTDIR32}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${CHROOTDIR32}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
@@ -69,10 +62,10 @@ function mentos {
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
${CHROOTCMD} ${CHROOTDIR64}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${CHROOTDIR64}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
#${CHROOTCMD} ${CHROOTDIR64}/ bash -c "apacman --noconfirm --noedit -S --needed ${PKGLIST}" #${CHROOTCMD} ${CHROOTDIR64}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}"
echo "Syncing overlay..." echo "Syncing overlay..."
rsync -a ${BASEDIR}/overlay/64/. ${CHROOTDIR64}/. rsync -a ${BASEDIR}/overlay/64/. ${CHROOTDIR64}/.
echo "Done." echo "Done."

View File

@@ -74,7 +74,8 @@ function mkchroot {
cd "${BASEDIR}" cd "${BASEDIR}"
## Set some vars. ## Set some vars.
MIRROR='http://mirrors.kernel.org/archlinux' #MIRROR='http://mirrors.kernel.org/archlinux'
MIRROR='http://mirror.us.leaseweb.net/archlinux'
RLSDIR="${MIRROR}/iso/latest" RLSDIR="${MIRROR}/iso/latest"
CURRLS64=$(curl -s ${RLSDIR}/sha1sums.txt | grep bootstrap | awk '{print $2}' | grep 'x86_64') CURRLS64=$(curl -s ${RLSDIR}/sha1sums.txt | grep bootstrap | awk '{print $2}' | grep 'x86_64')
@@ -167,7 +168,7 @@ EOF
# if that doesn't work, # if that doesn't work,
${CHROOTCMD} ${i}/ pacman -Syy >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ pacman -Syy >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed base syslinux wget rsync unzip jshon sed sudo abs xmlto bc >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed base syslinux wget rsync unzip jshon sed sudo abs xmlto bc docbook-xsl git >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo "Done." echo "Done."
echo -n "...Upgrading any outdated packages..." echo -n "...Upgrading any outdated packages..."
@@ -182,11 +183,12 @@ EOF
## https://projects.archlinux.org/pacman.git/tree/NEWS#n54 ## https://projects.archlinux.org/pacman.git/tree/NEWS#n54
## https://bugs.archlinux.org/task/43302 ## https://bugs.archlinux.org/task/43302
#${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1
mkdir ${i}/var/tmp/pkg mkdir -p ${i}/var/tmp/pkg
cp ${BASEDIR}/extra/bootstrap/apacman* ${i}/var/tmp/pkg/apacman.tar.xz cp ${BASEDIR}/extra/bootstrap/apacman* ${i}/var/tmp/pkg/apacman.tar.xz
#${CHROOTCMD} ${i} "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i} "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz" >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i} bash -c "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i} bash -c "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz && mkdir /var/tmp/apacman && chmod 0750 /var/tmp/apacman && chown root:aurbuild /var/tmp/apacman " >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i} bash -c "apacman -S --noconfirm --noedit apacman-deps expac" >> "${LOGFILE}.${FUNCNAME}" 2>&1 for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
${CHROOTCMD} ${i} bash -c "apacman -S --noconfirm --noedit --skipinteg -S apacman-deps expac" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#rm -rf ${i}/var/tmp/pkg #rm -rf ${i}/var/tmp/pkg
#${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
@@ -211,19 +213,21 @@ EOF
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.both | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.both | tr '\n' ' ')
for i in ${CHROOTDIR32} ${CHROOTDIR64}; for i in ${CHROOTDIR32} ${CHROOTDIR64};
do do
echo "Running post-build tasks (building kernel, etc.) in ${i}..." echo "Running post-build tasks in ${i}..."
${CHROOTCMD} ${i}/ "/root/post-build.sh" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ "/root/post-build.sh" >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
#set +e set +e
#${CHROOTCMD} ${i}/ /usr/bin/bash -c "apacman --noconfirm --noedit -S --needed linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#set -e cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${PNAME}
#for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
set -e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
# Uncomment if you wish to use the mkpasswd binary from within the chroot... # Uncomment if you wish to use the mkpasswd binary from within the chroot...
#${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit -S --needed debian-whois-mkpasswd" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed debian-whois-mkpasswd" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done #for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo -n "Regular packages..." echo -n "Regular packages..."
set +e set +e
${CHROOTCMD} ${i}/ bash -c "yes '' | apacman --noconfirm --noedit -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ bash -c "yes '' | apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
# User creation # User creation
set -e set -e
@@ -260,7 +264,11 @@ EOF
for i in ${CHROOTDIR32} ${CHROOTDIR64}; for i in ${CHROOTDIR32} ${CHROOTDIR64};
do do
${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 set +e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
set -e
done done
# 32-bit # 32-bit
@@ -268,7 +276,7 @@ EOF
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
${CHROOTCMD} ${CHROOTDIR32}/ /usr/bin/bash -c "apacman --noconfirm --noedit -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${CHROOTDIR32}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
set +e set +e
for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
@@ -280,7 +288,7 @@ EOF
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
${CHROOTCMD} ${CHROOTDIR64}/ /usr/bin/bash -c "apacman --noconfirm --noedit -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${CHROOTDIR64}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
set +e set +e
for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done

View File

@@ -43,15 +43,21 @@ PS1='[\u@\h \W]\$ '
export HISTTIMEFORMAT="%F %T " export HISTTIMEFORMAT="%F %T "
export PATH="${PATH}:/sbin:/bin:/usr/sbin" export PATH="${PATH}:/sbin:/bin:/usr/sbin"
DEFROUTEIF=$(ip route show | egrep '^default' | awk '{print $5}')
echo echo
echo "===================================" echo "==================================="
date date
if [ -n "${DEFROUTEIF}" ];
then
echo echo
echo "eth0 is:" echo -n "${DEFROUTEIF} is: "
ifconfig eth0 | egrep 'inet|ether' | grep -v "inet6" | awk '{print $2}' ifconfig "${DEFROUTEIF}" | egrep 'inet|ether' | grep -v "inet6" | awk '{print $2}'
fi
echo echo
echo "tun0 is:" echo -n "tun0 is:"
ifconfig tun0 | grep inet | grep -v "inet6" | awk '{print $2}' ifconfig tun0 | grep inet | grep -v "inet6" | awk '{print $2}'
echo
echo "http://bdisk.square-r00t.net/" echo "http://bdisk.square-r00t.net/"
echo "===================================" echo "==================================="
echo echo