diff options
Diffstat (limited to 'packages/slugos-init')
-rw-r--r-- | packages/slugos-init/files/boot/disk | 1 | ||||
-rw-r--r-- | packages/slugos-init/files/boot/kexec | 2 | ||||
-rw-r--r-- | packages/slugos-init/files/sysconf | 2 | ||||
-rw-r--r-- | packages/slugos-init/files/turnup | 10 | ||||
-rw-r--r-- | packages/slugos-init/slugos-init_5.0.bb | 148 |
5 files changed, 156 insertions, 7 deletions
diff --git a/packages/slugos-init/files/boot/disk b/packages/slugos-init/files/boot/disk index a991bc50ac..d47be54c37 100644 --- a/packages/slugos-init/files/boot/disk +++ b/packages/slugos-init/files/boot/disk @@ -37,6 +37,7 @@ then # the UUID mount fails a standard device mount # is attempted. if test -n "$UUID" && + mount "$@" UUID="$UUID" /mnt || mount "$@" -U "$UUID" /mnt || mount "$@" "$device" /mnt then diff --git a/packages/slugos-init/files/boot/kexec b/packages/slugos-init/files/boot/kexec index 8973d20bfe..dd757fd771 100644 --- a/packages/slugos-init/files/boot/kexec +++ b/packages/slugos-init/files/boot/kexec @@ -126,7 +126,7 @@ if [ -n "$1" -a -n "$2" ] ; then sleep "$sleep" if [ -n "$UUID" ] ; then echo "mounting partition UUID \"$UUID\"..." - if mount -o ro -U "$UUID" /mnt ; then + if mount -o ro UUID="$UUID" /mnt ; then need_umount=1 kexec_image="/mnt/$kpath" fi diff --git a/packages/slugos-init/files/sysconf b/packages/slugos-init/files/sysconf index 57a69b7643..3059a466da 100644 --- a/packages/slugos-init/files/sysconf +++ b/packages/slugos-init/files/sysconf @@ -238,7 +238,7 @@ sysconf_save_conffiles(){ } # ( cd "$ffsdir" - find etc/*.conf $(sed 's!^/!!' usr/lib/ipkg/info/*.conffiles) ! -type d -newer etc/.configured -print | + find etc/*.conf $(sed 's!^/!!' usr/lib/opkg/info/*.conffiles) ! -type d -newer etc/.configured -print | sed 's/^/diff /' exec sed 's/#.*$//;/^[ ]*$/d' etc/default/conffiles ) | sed 's!^/*!!' | diff --git a/packages/slugos-init/files/turnup b/packages/slugos-init/files/turnup index c6220077a5..4aa1fba3ed 100644 --- a/packages/slugos-init/files/turnup +++ b/packages/slugos-init/files/turnup @@ -49,7 +49,7 @@ l root root 1777 /var/tmp /var/volatile/tmp d root root 0755 /var/lock/subsys none d root root 0755 /var/lib/dropbear none d root root 0755 /var/lib/misc none -d root root 0755 /var/lib/ipkg none +d root root 0755 /var/lib/opkg none f root root 0664 /var/log/wtmp none f root root 0664 /var/log/lastlog none f root root 0664 /var/run/utmp none" @@ -68,7 +68,7 @@ d root root 1777 /var/tmp none d root root 0755 /var/lock/subsys none d root root 0755 /var/lib/dropbear none d root root 0755 /var/lib/misc none -d root root 0755 /var/lib/ipkg none +d root root 0755 /var/lib/opkg none f root root 0664 /var/log/wtmp none f root root 0664 /var/log/lastlog none f root root 0664 /var/run/utmp none" @@ -578,7 +578,7 @@ disk() { fso="$(fsoptions "$@")" if if test -n "$uuid" then - mount "$@" -U "$uuid" "$new" + mount "$@" UUID="$uuid" "$new" || mount "$@" -U "$uuid" "$new" else mount "$@" "$device" "$new" fi @@ -591,7 +591,7 @@ disk() { if test -n "$fst" && if test -n "$uuid" then - mount -t "$fst" -o "$fso" -U "$uuid" "$new" + mount -t "$fst" -o "$fso" UUID="$uuid" "$new" || mount -t "$fst" -o "$fso" -U "$uuid" "$new" else mount -t "$fst" -o "$fso" "$device" "$new" fi @@ -633,7 +633,7 @@ disk() { then echo " options used: -t $fst -o $fso [error in this script]" >&2 test -n "$uuid" && - echo " uuid: $uuid (passed with -U)" >&2 + echo " uuid: $uuid (passed with UUID= or -U)" >&2 fi fi diff --git a/packages/slugos-init/slugos-init_5.0.bb b/packages/slugos-init/slugos-init_5.0.bb new file mode 100644 index 0000000000..9c50cd61f6 --- /dev/null +++ b/packages/slugos-init/slugos-init_5.0.bb @@ -0,0 +1,148 @@ +DESCRIPTION = "SlugOS initial network config via sysconf" +SECTION = "base" +PRIORITY = "required" +LICENSE = "GPL" +DEPENDS = "base-files devio" +RDEPENDS = "busybox devio" +PR = "r0" + +SRC_URI = "file://boot/flash \ + file://boot/disk \ + file://boot/nfs \ + file://boot/ram \ + file://boot/kexec \ + file://boot/network \ + file://boot/udhcpc.script \ + file://initscripts/fixfstab \ + file://initscripts/syslog.buffer \ + file://initscripts/syslog.file \ + file://initscripts/syslog.network \ + file://initscripts/zleds \ + file://initscripts/leds_startup \ + file://initscripts/rmrecovery \ + file://initscripts/sysconfsetup \ + file://initscripts/umountinitrd.sh \ + file://initscripts/loadmodules.sh \ + file://functions \ + file://modulefunctions \ + file://conffiles \ + file://sysconf \ + file://leds \ + file://turnup \ + " + +SBINPROGS = "" +USRSBINPROGS = "" +CPROGS = "${USRSBINPROGS} ${SBINPROGS}" +SCRIPTS = "turnup leds sysconf" +BOOTSCRIPTS = "flash disk nfs ram kexec network udhcpc.script" +INITSCRIPTS = "syslog.buffer syslog.file syslog.network zleds\ + leds_startup rmrecovery sysconfsetup umountinitrd.sh\ + fixfstab loadmodules.sh" + +# This just makes things easier... +S="${WORKDIR}" + +do_compile() { + set -ex + for p in ${CPROGS} + do + ${CC} ${CFLAGS} -o $p $p.c + done + set +ex +} + +do_install() { + set -ex + + # Directories + install -d ${D}${sysconfdir} \ + ${D}${sysconfdir}/default \ + ${D}${sysconfdir}/init.d \ + ${D}${sysconfdir}/modutils \ + ${D}${sysconfdir}/udev \ + ${D}${sbindir} \ + ${D}${base_sbindir} \ + ${D}/initrd \ + ${D}/boot + + # linuxrc + rm -f ${D}/linuxrc + ln -s boot/flash ${D}/linuxrc + + # C programs + for p in ${USRSBINPROGS} + do + install -m 0755 $p ${D}${sbindir}/$p + done + for p in ${SBINPROGS} + do + install -m 0755 $p ${D}${base_sbindir}/$p + done + + # Shell scripts + for p in ${SCRIPTS} + do + install -m 0755 $p ${D}${base_sbindir}/$p + done + + # + # Init scripts + install -m 0644 functions ${D}${sysconfdir}/default + install -m 0644 modulefunctions ${D}${sysconfdir}/default + for s in ${INITSCRIPTS} + do + install -m 0755 initscripts/$s ${D}${sysconfdir}/init.d/ + done + + # + # Boot scripts + for p in ${BOOTSCRIPTS} + do + install -m 0755 boot/$p ${D}/boot + done + + # Configuration files + install -m 0644 conffiles ${D}${sysconfdir}/default + + set +ex +} + +# If the package is installed on an NSLU2 $D will be empty, in that +# case it is normal to run 'start' and 'stop', but because the conf +# files installed don't actually start or stop anything this is +# unnecessary, so the package postfoo handling is simplified here. +#NB: do not use '08' (etc) for the first argument after start/stop, +# the value is interpreted as an octal number if there is a leading +# zero. +pkg_postinst_slugos-init() { + opt= + test -n "$D" && opt="-r $D" + update-rc.d $opt hwclock.sh start 8 S . start 45 0 6 . + update-rc.d $opt umountinitrd.sh start 9 S . + update-rc.d $opt fixfstab start 10 S . + update-rc.d $opt syslog.buffer start 11 S . start 49 0 6 . + update-rc.d $opt sysconfsetup start 12 S . + update-rc.d $opt loadmodules.sh start 21 S . + update-rc.d $opt syslog.file start 39 S . start 47 0 6 . + update-rc.d $opt syslog.network start 44 S . start 39 0 6 . + update-rc.d $opt zleds start 99 S 1 2 3 4 5 . start 89 0 6 . stop 5 0 1 2 3 4 5 6 . + update-rc.d $opt rmrecovery start 99 1 2 3 4 5 . + # bug fix for startup + update-rc.d $opt leds_startup start 1 1 2 3 4 5 . +} + +pkg_postrm_slugos-init() { + opt= + test -n "$D" && opt="-r $D" + for s in ${INITSCRIPTS} + do + update-rc.d $opt "$s" remove + done +} + +FILES_${PN} = "/" + +# It is bad to overwrite /linuxrc as it puts the system back to +# a flash boot (and the flash has potentially not been upgraded!) +CONFFILES_${PN} = "/linuxrc ${sysconfdir}/default/conffiles" |