commit 14b8a73b569f58ad89d38f315416c774f80c405d
parent cc3d545845287938cac43be658fea8573bf6a762
Author: parazyd <parazyd@dyne.org>
Date: Mon, 10 Oct 2016 19:54:19 +0200
add TEEVERBOSE to tee calls
Diffstat:
5 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/zlibs/bootstrap b/zlibs/bootstrap
@@ -48,20 +48,24 @@ bootstrap_complete_base() {
## write all system configuration
notice "writing system configuration"
- conf_print_debconf | sudo tee $strapdir/debconf.set
- conf_print_fstab | sudo tee $strapdir/etc/fstab
- conf_print_hostname | sudo tee $strapdir/etc/hostname
- conf_print_hosts | sudo tee $strapdir/etc/hosts
- conf_print_networkifaces | sudo tee $strapdir/etc/network/interfaces
- conf_print_resolvconf | sudo tee $strapdir/etc/resolv.conf
- conf_print_sourceslist | sudo tee $strapdir/etc/apt/sources.list
+ conf_print_debconf | sudo tee $strapdir/debconf.set ${TEEVERBOSE}
+ conf_print_fstab | sudo tee $strapdir/etc/fstab ${TEEVERBOSE}
+ conf_print_hostname | sudo tee $strapdir/etc/hostname ${TEEVERBOSE}
+ conf_print_hosts | sudo tee $strapdir/etc/hosts ${TEEVERBOSE}
+ conf_print_networkifaces | sudo tee $strapdir/etc/network/interfaces ${TEEVERBOSE}
+ conf_print_resolvconf | sudo tee $strapdir/etc/resolv.conf ${TEEVERBOSE}
+ conf_print_sourceslist | sudo tee $strapdir/etc/apt/sources.list ${TEEVERBOSE}
## below typically used in arm-sdk
- [[ -n $inittab ]] && { print $inittab | sudo tee -a $strapdir/etc/inittab }
- for i in $custmodules; do print $i | sudo tee -a $strapdir/etc/modules; done
+ [[ -n $inittab ]] && {
+ print $inittab | sudo tee -a $strapdir/etc/inittab ${TEEVERBOSE}
+ }
+ for i in $custmodules; do
+ print $i | sudo tee -a $strapdir/etc/modules ${TEEVERBOSE}
+ done
## write third-stage for chroot
- bootstrap_config_thirdstage | sudo tee $strapdir/thirdstage
- bootstrap_config_cleanup | sudo tee $strapdir/cleanup
+ bootstrap_config_thirdstage | sudo tee $strapdir/thirdstage ${TEEVERBOSE}
+ bootstrap_config_cleanup | sudo tee $strapdir/cleanup ${TEEVERBOSE}
sudo chmod +x $strapdir/thirdstage
sudo chmod +x $strapdir/cleanup
@@ -75,9 +79,10 @@ bootstrap_complete_base() {
devprocsys mount $strapdir || zerr
sudo chroot $strapdir /thirdstage || zerr
- sudo chroot $strapdir /cleanup || zerr
+ sudo chroot $strapdir /cleanup || zerr
- sleep 1 && devprocsys umount $strapdir || zerr
+ sleep 1
+ devprocsys umount $strapdir || zerr
bootstrap_tar_pack || zerr
}
diff --git a/zlibs/helpers b/zlibs/helpers
@@ -44,16 +44,16 @@ devprocsys() {
ckreq || return 1
if [[ $watdo = mount ]]; then
- sudo mount -o bind /sys $werdo/sys && act "mounted sys" && \
- sudo mount -t proc proc $werdo/proc && act "mounted proc" && \
- sudo mount -o bind /dev $werdo/dev && act "mounted dev" && \
- sudo mount -o bind /dev/pts $werdo/dev/pts && act "mounted dev/pts" && \
+ sudo mount -o bind /sys $werdo/sys && act "mounted sys" && \
+ sudo mount -t proc proc $werdo/proc && act "mounted proc" && \
+ sudo mount -o bind /dev $werdo/dev && act "mounted dev" && \
+ sudo mount -o bind /dev/pts $werdo/dev/pts && act "mounted devpts" && \
return 0
elif [[ $watdo = umount ]]; then
- sudo umount $werdo/dev/pts && act "umounted dev/pts" && sleep 1 && \
- sudo umount $werdo/dev && act "umounted dev" && sleep 1 && \
- sudo umount $werdo/proc && act "umounted proc" && sleep 1 && \
- sudo umount $werdo/sys && act "umounted sys" && sleep 1 && \
+ sudo umount $werdo/dev/pts && act "umounted devpts" && sleep 1 && \
+ sudo umount $werdo/dev && act "umounted dev" && sleep 1 && \
+ sudo umount $werdo/proc && act "umounted proc" && sleep 1 && \
+ sudo umount $werdo/sys && act "umounted sys" && sleep 1 && \
return 0
fi
return 1
diff --git a/zlibs/imaging b/zlibs/imaging
@@ -67,9 +67,10 @@ image_partition_raw_gpt() {
parted $workdir/${image_name}.img --script -- mklabel gpt
cgpt create -z ${image_name}.img
cgpt create ${image_name}.img
- cgpt add -i 1 -t kernel -b 8192 -s 32768 -l kernel -S 1 -T 5 -P 10 ${image_name}.img
- cgpt add -i 2 -t data -b 40960 -s $(expr $(cgpt show ${image_name}.img \
- | awk '/Sec GPT table/ {print \$1}') - 40960) -l Root ${image_name}.img
+ cgpt add -i 1 -t kernel -b ${gpt_boot[1]} -s ${gpt_boot[2]} \
+ -l kernel -S 1 -T 5 -P 10 ${image_name}.img
+ cgpt add -i 2 -t data -b ${gpt_root[1]} -s $(expr $(cgpt show ${image_name}.img \
+ | awk '/Sec GPT table/ {print \$1}') - ${gpt_root[1]}) -l Root ${image_name}.img
findloopmapp
@@ -94,11 +95,10 @@ image_pack_dist() {
sleep 2
- # TODO: decide how to check gpt
- # [[ $gpt = 0 ]] || {
- # sudo cgpt repair $loopdevice
- # sleep 2
- # }
+ [[ $parted_type = gpt ]] && {
+ sudo cgpt repair $loopdevice
+ sleep 1
+ }
sudo kpartx -dv $loopdevice || { die "kpartx failed to remove $loopdevice"; zerr }
sudo losetup -d $loopdevice || { die "losetup failed to remove $loopdevice"; zerr }
diff --git a/zlibs/kernel b/zlibs/kernel
@@ -22,7 +22,7 @@
build_kernel_amd64() {
fn build_kernel_amd64
req=(strapdir arch)
- freq=($strapdir/.done)
+ #freq=($strapdir/.done)
ckreq || return 1
local kernel_base="linux-image"
@@ -41,7 +41,7 @@ build_kernel_amd64() {
build_kernel_i386() {
fn build_kernel_i386
req=(strapdir arch)
- freq=($strapdir/.done)
+ #freq=($strapdir/.done)
ckreq || return 1
local kernel_base="linux-image"
diff --git a/zlibs/sysconf b/zlibs/sysconf
@@ -121,8 +121,8 @@ deb ${mirror} ${release}-updates ${section}
deb ${mirror} ${release}-security ${section}
## source repositories
-# deb-src ${mirror} ${release} ${section}
-# deb-src ${mirror} ${release}-updates ${section}
-# deb-src ${mirror} ${release}-security ${section}
+#deb-src ${mirror} ${release} ${section}
+#deb-src ${mirror} ${release}-updates ${section}
+#deb-src ${mirror} ${release}-security ${section}
EOF
}