Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to newer livekit + Debian #29

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed ISO/sbc-data/sbc/boot/initrfs.img
Binary file not shown.
Binary file removed ISO/sbc-data/sbc/sbc-public.sb
Binary file not shown.
37 changes: 24 additions & 13 deletions SbcOS/build_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ check_exit_code() {
fi
}

function extract_deb {
extract_deb() {
echo " | extact $1 to $2"
DATAFILE=$(ar -t "$1" | grep data)
ar -x "$1" $DATAFILE && tar -C $2 -xaf $DATAFILE && rm $DATAFILE
}

function depcheck() {
depcheck() {
DEPVARIANT="$1"
echo " | scan required packages for bin and lib files for variant $DEPVARIANT"
for i in $(cat $CFGDIR/$DEPVARIANT/install.req); do
Expand Down Expand Up @@ -115,22 +115,20 @@ function depcheck() {
rm $TMPDIR/main.install.tmp $TMPDIR/main.deps.tmp $TMPDIR/additional.deps*
}

function mkdir_if_missing() {
mkdir_if_missing() {
if [ ! -d "$1" ]; then
echo " | create directory \"$1\""
mkdir -p "$1"
check_exit_code
fi
}

function init_pool() {

init_pool() {
rm -rf $RFSDIR/rootfs
mkdir_if_missing $RFSDIR/rootfs
}

function init_rootfs() {

rm -rf $BASEDIR
mkdir_if_missing $IMGDIR
mkdir_if_missing $TMPDIR
Expand All @@ -142,7 +140,7 @@ function init_rootfs() {
}


function clean_multistrap() {
clean_multistrap() {
echo "use parameter [-debian] for update builder"
echo "-= build sbc-repository repository" | tee $LOGDIR/${SCRIPTNAME}_$BUILDDATE.echo

Expand All @@ -157,9 +155,8 @@ function clean_multistrap() {
}


function prebuild() {

cp /etc/apt/trusted.gpg "${BOOTSTRAPDIR}/etc/apt"
prebuild() {
cp -R /etc/apt/trusted.gpg.d "${BOOTSTRAPDIR}/etc/apt"
check_exit_code

cp $CFGDIR/multistrap-bootstrap-debian.conf $CFGDIR/multistrap-bootstrap-current.conf
Expand All @@ -186,14 +183,13 @@ function prebuild() {
reprepro --basedir $DEBDIR --confdir $CFGDIR includedeb sbc-repository $PACKAGES/telegraf/*.deb
check_exit_code

#echo " | import libuv packages into sbc-repository repository"
#echo " | import liagent packages into sbc-repository repository"
#reprepro --basedir $DEBDIR --confdir $CFGDIR includedeb sbc-repository $PACKAGES/liagent/packages/*.deb
#check_exit_code
echo " ! done."
}

function buildrootfs() {

buildrootfs() {
rm -rf $RFSDIR/rootfs
mkdir_if_missing $RFSDIR/rootfs
rm $LOGDIR/install.lib.* $LOGDIR/install.deb.*
Expand Down Expand Up @@ -494,6 +490,21 @@ function buildrootfs() {
install -m 755 $CFGDIR/iproute2/* $RFSDIR/rootfs/etc/iproute2/
check_exit_code

echo " | install approved shells list to new base rootfs"
install -m 644 $CFGDIR/shells $RFSDIR/rootfs/etc/shells
check_exit_code

if [ -e $RFSDIR/rootfs/usr/sbin/iptables-legacy ]; then
echo " | making legacy iptables primary"
pushd $RFSDIR/rootfs//usr/sbin > /dev/null 2>&1
rm -f *-nft*
ln -s iptables-legacy iptables
ln -s iptables-legacy-restore iptables-restore
ln -s ip6tables-legacy ip6tables
ln -s ip6tables-legacy-restore ip6tables-restore
popd > /dev/null 2>&1
fi

echo " | create ramdisk to install packages for squashfs"
mountpoint -q "$RFSDIR/squashfs" && umount "$RFSDIR/squashfs" -l
mount -o size=1024M -t tmpfs none "$RFSDIR/squashfs"
Expand Down
Loading