From c6c77d7175abc5268aba8ca2ad1324128a9bdcee Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 6 Mar 2011 11:13:28 +0100 Subject: [PATCH] xbps-casper: simplify and remove unused stuff. --HG-- branch : gnome3 --- srcpkgs/xbps-casper/files/scripts/casper | 113 +++--------------- .../files/scripts/casper-functions | 12 -- srcpkgs/xbps-casper/template | 4 +- 3 files changed, 16 insertions(+), 113 deletions(-) delete mode 100644 srcpkgs/xbps-casper/files/scripts/casper-functions diff --git a/srcpkgs/xbps-casper/files/scripts/casper b/srcpkgs/xbps-casper/files/scripts/casper index d534ad6391f..2ad65c8953d 100644 --- a/srcpkgs/xbps-casper/files/scripts/casper +++ b/srcpkgs/xbps-casper/files/scripts/casper @@ -40,12 +40,6 @@ parse_cmdline() { export PERSISTENT="" ;; union=*) export UNIONFS="${x#union=}";; - ip*) - STATICIP=${x#ip=} - if [ "${STATICIP}" = "" ]; then - STATICIP="frommedia" - fi - export STATICIP ;; ignore_uuid) IGNORE_UUID="Yes" ;; live-media-path=*) @@ -186,74 +180,6 @@ copy_live_to() { return 0 } -do_netmount() { - rc=1 - - modprobe "${MP_QUIET}" af_packet # For DHCP - - /sbin/udevadm trigger --action=add - /sbin/udevadm settle - - ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config - - if [ "${NFSROOT}" = "auto" ]; then - NFSROOT=${ROOTSERVER}:${ROOTPATH} - fi - - [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}" - - if [ "${NETBOOT}" != "nfs" ] && do_cifsmount ; then - rc=0 - elif do_nfsmount ; then - NETBOOT="nfs" - export NETBOOT - rc=0 - fi - - [ "$quiet" != "y" ] && log_end_msg - return ${rc} -} - -do_nfsmount() { - rc=1 - modprobe "${MP_QUIET}" nfs - if [ -z "${NFSOPTS}" ]; then - NFSOPTS="" - fi - - [ "$quiet" != "y" ] && \ - log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}" - # FIXME: This while loop is an ugly HACK round an nfs bug - i=0 - while [ "$i" -lt 60 ]; do - nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" \ - "${mountpoint}" && rc=0 && break - sleep 1 - i="$(($i + 1))" - done - return ${rc} -} - -do_cifsmount() { - rc=1 - if [ -x "/sbin/mount.cifs" ]; then - if [ -z "${NFSOPTS}" ]; then - CIFSOPTS="-ouser=root,password=" - else - CIFSOPTS="${NFSOPTS}" - fi - - [ "$quiet" != "y" ] && \ - log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}" - modprobe "${MP_QUIET}" cifs - - if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" ; then - rc=0 - fi - fi - return ${rc} -} - do_snap_copy () { fromdev="${1}" @@ -577,28 +503,18 @@ mountroot() { wait_for_udev 10 maybe_break casper-premount - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-premount" + log_begin_msg "Running /scripts/casper-premount" run_scripts /scripts/casper-premount - [ "$quiet" != "y" ] && log_end_msg + log_end_msg - if [ ! -z "${NETBOOT}" ]; then - if do_netmount ; then - livefs_root="${mountpoint}" - else - panic "Unable to find a live file system on the network" - fi - else - # Scan local devices for the image - i=0 - while [ "$i" -lt 60 ]; do - livefs_root=$(find_livefs $i) - if [ "${livefs_root}" ]; then - break - fi - sleep 1 - i="$(($i + 1))" - done - fi + # Scan local devices for the image + i=0 + while [ "$i" -lt 60 ]; do + livefs_root=$(find_livefs $i) + [ -n "${livefs_root}" ] && break + sleep 1 + i="$(($i + 1))" + done if [ -z "${livefs_root}" ]; then panic "Unable to find a medium containing a live file system" @@ -610,16 +526,15 @@ mountroot() { live_dest="${TODISK}" fi if [ "${live_dest}" ]; then - [ "$quiet" != "y" ] && \ - log_begin_msg "Copying live_media to ${live_dest}" + log_begin_msg "Copying live_media to ${live_dest}" copy_live_to "${livefs_root}" "${live_dest}" - [ "$quiet" != "y" ] && log_end_msg + log_end_msg fi mount_images_in_directory "${livefs_root}" "${rootmnt}" maybe_break casper-bottom - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-bottom" + log_begin_msg "Running /scripts/casper-bottom" run_scripts /scripts/casper-bottom - [ "$quiet" != "y" ] && log_end_msg + log_end_msg } diff --git a/srcpkgs/xbps-casper/files/scripts/casper-functions b/srcpkgs/xbps-casper/files/scripts/casper-functions deleted file mode 100644 index 3dc9c3bc202..00000000000 --- a/srcpkgs/xbps-casper/files/scripts/casper-functions +++ /dev/null @@ -1,12 +0,0 @@ - -. /scripts/functions - -# Print a message and wait for enter -log_wait_msg() -{ - if [ -x /sbin/usplash_write ]; then - /sbin/usplash_write "INPUTENTER $@" - read nunya < /dev/.initramfs/usplash_outfifo - fi - _log_msg "Waiting: $@ ..." -} diff --git a/srcpkgs/xbps-casper/template b/srcpkgs/xbps-casper/template index bb30f86a814..634d63820a2 100644 --- a/srcpkgs/xbps-casper/template +++ b/srcpkgs/xbps-casper/template @@ -1,6 +1,6 @@ # Template file for 'xbps-casper' pkgname=xbps-casper -_localver=0.9 # XBPS package version +_localver=0.10 # XBPS package version _distver=1.236 # This should match the upstream (Ubuntu) version version=${_localver}.${_distver} build_style=custom-install @@ -35,7 +35,7 @@ do_install() install -m 755 ${FILESDIR}/hooks/* ${initramfsdir}/hooks install -m 755 ${FILESDIR}/scripts/casper-bottom/* \ ${initramfsdir}/scripts/casper-bottom - install -m 644 ${FILESDIR}/scripts/{casper,casper-{functions,helpers}} \ + install -m 644 ${FILESDIR}/scripts/{casper,casper-helpers}} \ ${initramfsdir}/scripts install -m 644 ${FILESDIR}/conf.d/* ${initramfsdir}/conf.d }