From 69d42d08aae3477ed9bf553e332ee5b3a1a20af3 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sat, 13 Feb 2010 16:31:20 -0600 Subject: [PATCH] Clean up build tree: sources in src, output in tree --- Makefile | 37 +++++++++---------- script/gencard | 6 +-- script/gentree | 1 + push => script/push | 2 +- {overlay => src/overlay}/boot/boot.config | 0 {overlay => src/overlay}/boot/loader.conf | 0 {overlay => src/overlay}/etc/bashrc | 0 {overlay => src/overlay}/etc/fstab | 0 {overlay => src/overlay}/etc/inputrc | 0 {overlay => src/overlay}/etc/rc.conf | 0 {overlay => src/overlay}/etc/rc.d/saveconfig | 0 {overlay => src/overlay}/sbin/saveconfig | 0 .../patch}/boot_device.hints-ata-probe.patch | 0 .../etc_profile-sensible-defaults.patch | 0 .../etc_rc.d_zfs-tmpfs-mountpoint.patch | 0 .../etc_rc.initdiskless-mount-anything.patch | 0 .../etc_rc.initdiskless-no-rescue.patch | 0 .../patch}/etc_ttys-serialconsole.patch | 0 ..._etc_gkrellmd.conf-sensible-defaults.patch | 0 .../usr_local_etc_sudoers-allow-wheel.patch | 0 20 files changed, 23 insertions(+), 23 deletions(-) rename push => script/push (84%) rename {overlay => src/overlay}/boot/boot.config (100%) rename {overlay => src/overlay}/boot/loader.conf (100%) rename {overlay => src/overlay}/etc/bashrc (100%) rename {overlay => src/overlay}/etc/fstab (100%) rename {overlay => src/overlay}/etc/inputrc (100%) rename {overlay => src/overlay}/etc/rc.conf (100%) rename {overlay => src/overlay}/etc/rc.d/saveconfig (100%) rename {overlay => src/overlay}/sbin/saveconfig (100%) rename {patch => src/patch}/boot_device.hints-ata-probe.patch (100%) rename {patch => src/patch}/etc_profile-sensible-defaults.patch (100%) rename {patch => src/patch}/etc_rc.d_zfs-tmpfs-mountpoint.patch (100%) rename {patch => src/patch}/etc_rc.initdiskless-mount-anything.patch (100%) rename {patch => src/patch}/etc_rc.initdiskless-no-rescue.patch (100%) rename {patch => src/patch}/etc_ttys-serialconsole.patch (100%) rename {patch => src/patch}/usr_local_etc_gkrellmd.conf-sensible-defaults.patch (100%) rename {patch => src/patch}/usr_local_etc_sudoers-allow-wheel.patch (100%) diff --git a/Makefile b/Makefile index de7b64c..161cda2 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ # -V volume label # Settables +srctree ?= src worktree ?= tree boot_pad ?= 1280 image_sect ?= 1000944 @@ -33,50 +34,48 @@ curruser != id -u checkroot = @if [ $(curruser) -gt 0 ]; then printf "\033[1;31mI need root\033[0m\n"; exit 1; fi checkdeps = @if [ ! -x "$(mkisofs)" -o ! -x "$(mkuzip)" ]; then printf "\033[1;31mCheck depends! mkisofs: $(mkisofs) mkuzip: $(mkuzip)\033[0m\n"; exit 1; fi -all: card.img +all: $(worktree)/card.img -image: card.img +image: $(worktree)/card.img -firmware: card.img +firmware: $(worktree)/card.img checkroot: $(checkroot) -burn: card.img +burn: $(worktree)/card.img $(checkroot) script/burn $(.ALLSRC) $(dev) -card.img: boot.img root.img +$(worktree)/card.img: $(worktree)/boot.img $(worktree)/root.img $(checkroot) - ${gencard} -c $(worktree)/conf - @printf " \033[1;32m*\033[0m Complete" + ${gencard} -b $(worktree)/boot.img -r $(worktree)/root.img -c $(worktree)/conf -o $(worktree)/card.img + @printf " \033[1;32m*\033[0m Complete\n" -boot.img: $(worktree)/boot +$(worktree)/boot.img: $(worktree)/boot $(checkroot) - ${genufs} -p $(boot_pad) $(worktree)/boot + ${genufs} -p $(boot_pad) -l boot -o $(worktree)/boot.img $(worktree)/boot -root.img: root.iso +$(worktree)/root.img: $(worktree)/root.iso $(checkroot) $(checkdeps) ${genuzip} $(.ALLSRC) $(.TARGET) -root.iso: $(worktree)/root +$(worktree)/root.iso: $(worktree)/root $(checkroot) $(checkdeps) ${geniso} -n root $(.ALLSRC) $(.TARGET) -$(worktree): root - $(checkroot) - $(gentree) -t $(worktree) -r $(.ALLSRC) +$(worktree): $(worktree)/root -$(worktree)/boot: root +$(worktree)/boot: $(srctree)/root $(checkroot) - $(gentree) -t $(worktree) -r $(.ALLSRC) + $(gentree) -b $(srctree) -t $(worktree) -r $(.ALLSRC) -$(worktree)/root: root +$(worktree)/root: $(srctree)/root $(checkroot) - $(gentree) -t $(worktree) -r $(.ALLSRC) + $(gentree) -b $(srctree) -t $(worktree) -r $(.ALLSRC) clean: $(checkroot) - rm -Rf card.img boot.img root.img root.iso $(worktree) + rm -Rf $(worktree) diff --git a/script/gencard b/script/gencard index ea485e5..dba2ef8 100755 --- a/script/gencard +++ b/script/gencard @@ -36,9 +36,9 @@ compute_label(){ omfg_ofst=0 omfg_size=16 boot_ofst="$(( ${omfg_ofst} + ${omfg_size} ))" - boot_size="$(img_sects boot.img)" + boot_size="$(img_sects "${boot_file}")" root_ofst="$(( ${boot_ofst} + ${boot_size} ))" - root_size="$(img_sects root.img)" + root_size="$(img_sects "${root_file}")" conf_ofst="$(( ${root_ofst} + ${root_size} ))" conf_size="$(( ${card_size} - ( ${omfg_size} + ${boot_size} + ${root_size} ) ))" last_ofst="$(( ${conf_ofst} + ${conf_size} ))" @@ -81,7 +81,7 @@ rm -f "${card_img}" dd if=/dev/zero of="${card_img}" bs=512 count=0 seek="${card_size}" 2>/dev/null md=$(mdconfig -a -t vnode -f "${card_img}") mnt="$(mktemp -d /tmp/conf.XXXXXXXX)" -trap "umount '${mnt}'; rmdir '${mnt}'; mdconfig -d -u '${md}'" exit hup int term kill +trap "umount '${mnt}'; rm -Rf '${mnt}'; mdconfig -d -u '${md}'" exit hup int term kill compute_label "${card_size}" "${boot_img}" "${root_img}" | bsdlabel -R -B "${md}" /dev/stdin log Applied label: diff --git a/script/gentree b/script/gentree index 1ab7f14..6681a4e 100755 --- a/script/gentree +++ b/script/gentree @@ -49,6 +49,7 @@ shift $(( $OPTIND - 1 )) sequence="${*:-${targets}}" base="${base:-/usr/home/cyberleo/world}" +base="$(realpath "${base}")" stage="${stage:-${base}/tree}" pkgs="${pkgs:-${base}/pkg}" patch="${patch:-${base}/patch}" diff --git a/push b/script/push similarity index 84% rename from push rename to script/push index 04c3191..53a2241 100755 --- a/push +++ b/script/push @@ -1,5 +1,5 @@ #!/bin/sh -cd "$(dirname "${0}")" +cd "$(dirname "$(dirname "${0}")")" rsync --archive --delete --exclude=".git" --exclude="conf" --exclude="pkg" --exclude="root" --exclude="tree" --hard-links --progress --sparse --stats --verbose ./ cyberleo@ss4200:world/ diff --git a/overlay/boot/boot.config b/src/overlay/boot/boot.config similarity index 100% rename from overlay/boot/boot.config rename to src/overlay/boot/boot.config diff --git a/overlay/boot/loader.conf b/src/overlay/boot/loader.conf similarity index 100% rename from overlay/boot/loader.conf rename to src/overlay/boot/loader.conf diff --git a/overlay/etc/bashrc b/src/overlay/etc/bashrc similarity index 100% rename from overlay/etc/bashrc rename to src/overlay/etc/bashrc diff --git a/overlay/etc/fstab b/src/overlay/etc/fstab similarity index 100% rename from overlay/etc/fstab rename to src/overlay/etc/fstab diff --git a/overlay/etc/inputrc b/src/overlay/etc/inputrc similarity index 100% rename from overlay/etc/inputrc rename to src/overlay/etc/inputrc diff --git a/overlay/etc/rc.conf b/src/overlay/etc/rc.conf similarity index 100% rename from overlay/etc/rc.conf rename to src/overlay/etc/rc.conf diff --git a/overlay/etc/rc.d/saveconfig b/src/overlay/etc/rc.d/saveconfig similarity index 100% rename from overlay/etc/rc.d/saveconfig rename to src/overlay/etc/rc.d/saveconfig diff --git a/overlay/sbin/saveconfig b/src/overlay/sbin/saveconfig similarity index 100% rename from overlay/sbin/saveconfig rename to src/overlay/sbin/saveconfig diff --git a/patch/boot_device.hints-ata-probe.patch b/src/patch/boot_device.hints-ata-probe.patch similarity index 100% rename from patch/boot_device.hints-ata-probe.patch rename to src/patch/boot_device.hints-ata-probe.patch diff --git a/patch/etc_profile-sensible-defaults.patch b/src/patch/etc_profile-sensible-defaults.patch similarity index 100% rename from patch/etc_profile-sensible-defaults.patch rename to src/patch/etc_profile-sensible-defaults.patch diff --git a/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch b/src/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch similarity index 100% rename from patch/etc_rc.d_zfs-tmpfs-mountpoint.patch rename to src/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch diff --git a/patch/etc_rc.initdiskless-mount-anything.patch b/src/patch/etc_rc.initdiskless-mount-anything.patch similarity index 100% rename from patch/etc_rc.initdiskless-mount-anything.patch rename to src/patch/etc_rc.initdiskless-mount-anything.patch diff --git a/patch/etc_rc.initdiskless-no-rescue.patch b/src/patch/etc_rc.initdiskless-no-rescue.patch similarity index 100% rename from patch/etc_rc.initdiskless-no-rescue.patch rename to src/patch/etc_rc.initdiskless-no-rescue.patch diff --git a/patch/etc_ttys-serialconsole.patch b/src/patch/etc_ttys-serialconsole.patch similarity index 100% rename from patch/etc_ttys-serialconsole.patch rename to src/patch/etc_ttys-serialconsole.patch diff --git a/patch/usr_local_etc_gkrellmd.conf-sensible-defaults.patch b/src/patch/usr_local_etc_gkrellmd.conf-sensible-defaults.patch similarity index 100% rename from patch/usr_local_etc_gkrellmd.conf-sensible-defaults.patch rename to src/patch/usr_local_etc_gkrellmd.conf-sensible-defaults.patch diff --git a/patch/usr_local_etc_sudoers-allow-wheel.patch b/src/patch/usr_local_etc_sudoers-allow-wheel.patch similarity index 100% rename from patch/usr_local_etc_sudoers-allow-wheel.patch rename to src/patch/usr_local_etc_sudoers-allow-wheel.patch -- 2.42.0