**** BEGIN LOGGING AT Fri Jun 16 02:59:56 2006 Jun 16 15:47:55 hello eFfeM Jun 16 15:48:38 hi kitno455 Jun 16 15:50:08 i keep hitting you with questions- i sent the email complaining about gcc4.1.1 thumb support Jun 16 15:50:40 ah, ok, didn't know it was you, np. Jun 16 15:50:40 i also spent some time looking into ifdown being broken with dhcp Jun 16 15:50:51 actually i am just looking into that Jun 16 15:51:46 if i run ifdown -v eth0: Jun 16 15:52:00 run-parts /etc/network/if-down.d Jun 16 15:52:00 kill -USR2 `cat /var/run/udhcpc.eth0.pid 2>/dev/null` 2>/dev/null Jun 16 15:52:00 kill -TERM `cat /var/run/udhcpc.eth0.pid 2>/dev/null` 2>/dev/null Jun 16 15:52:00 run-parts /etc/network/if-post-down.d Jun 16 15:52:07 plus a blank line Jun 16 15:52:21 and udhcpd is gone Jun 16 15:52:29 but eth0 still up Jun 16 15:52:37 if i run ifdown again: Jun 16 15:52:50 run-parts /etc/network/if-down.d Jun 16 15:52:50 kill -USR2 `cat /var/run/udhcpc.eth0.pid 2>/dev/null` 2>/dev/null Jun 16 15:52:50 kill -TERM `cat /var/run/udhcpc.eth0.pid 2>/dev/null` 2>/dev/null Jun 16 15:52:50 ifconfig eth0 down Jun 16 15:52:50 run-parts /etc/network/if-post-down.d Jun 16 15:53:00 it works Jun 16 15:53:11 but note that it runs two extra commands Jun 16 15:53:25 well, one extra Jun 16 15:54:26 so i am now trying to find ifupdown Jun 16 15:54:35 why do you need two kills ? Jun 16 15:54:48 if you really want to stop a process use kill -9 Jun 16 15:56:06 not my code Jun 16 15:56:14 that is what ifdown does Jun 16 15:56:22 look at the two different signals' Jun 16 15:56:38 i bet udhcpc does something majic with USR2 Jun 16 15:57:01 and kill -9 is stupid Jun 16 15:57:08 :) Jun 16 15:58:35 yeah usr2 is a usr signal ... Jun 16 15:59:25 ifupdown is in the slugos meta packages list, Jun 16 15:59:37 but it does not seem to have been built on my system Jun 16 16:00:18 hmm, ifdown is a link to busybox Jun 16 16:00:32 i really hate messing with busybox :) Jun 16 16:03:04 hmmm... where do i have to add the udev rules so that a swap-partition on a usb drive gets mounted, too? Jun 16 16:04:15 hld- /etc/udev/rules.d/local.rules Jun 16 16:05:13 you will have to hardcode the KERNEL, or figure out how to identify the partition type Jun 16 16:05:26 the KERNEL name i meant Jun 16 16:05:35 erm, never messed around with udev before... Jun 16 16:05:41 ahh Jun 16 16:05:44 udev is cool Jun 16 16:05:48 hld: you don't, just add them in fstab Jun 16 16:06:18 effem: but that doesn't work when the device is hotplugged i think?! Jun 16 16:06:20 if the disk is plugged in Jun 16 16:06:26 hld- correct Jun 16 16:06:56 udev rules have two parts kinds of directives- Jun 16 16:06:58 so, could you help me a bit with that udev config stuff? :) Jun 16 16:07:15 1 part that is used to match the device Jun 16 16:07:24 2nd part is used to do something Jun 16 16:07:45 you can match the device on all kinds of weird things Jun 16 16:07:46 hld, not if the disk is plugged in it works, but not if you hotplug it. Jun 16 16:08:08 but those 'things' vary from one type of device to the next Jun 16 16:08:15 3.10 automounts hotplugged devices, don't know why you want to hotswap a swap partition ... Jun 16 16:08:31 because i run from a usb flash Jun 16 16:08:46 but dont you leave the usb hd plugged in? Jun 16 16:08:51 this is cool because i have some little things that doesn't need the swap Jun 16 16:09:03 you dont want to swap to flash Jun 16 16:09:10 at least not for long Jun 16 16:09:15 and when i plugin the usb hdd i need server-daemons and than i need swap :) Jun 16 16:09:28 dual purpose slug? Jun 16 16:09:33 so i want the swap added when i plugin the usb hdd Jun 16 16:09:37 yup Jun 16 16:09:46 buy a second one, they are cheap :) Jun 16 16:10:00 nono ... Jun 16 16:10:42 ok, read this Jun 16 16:10:44 http://www.reactivated.net/writing_udev_rules.html Jun 16 16:10:51 it gives the basic overview Jun 16 16:14:09 then fire up udevmonitor --env and plug in the device Jun 16 16:14:46 scroll thru all that stuff to find ways to identify your device, serial number, partition number, etc Jun 16 16:15:30 okay Jun 16 16:16:44 then write a udev rule that identifies the device and then does something like ACTION=="add", RUN="/sbin/swapon %k" Jun 16 16:17:11 example, if you know the drive is always going to come up first: Jun 16 16:18:06 okay, sdb1 gets mounted... Jun 16 16:18:23 KERNEL=="sda1", ACTION=="add", RUN+="/sbin/swapon /dev/%k" Jun 16 16:18:36 yes- the rules in local.rules did the mounting Jun 16 16:18:43 yup Jun 16 16:18:49 but your swap partition likely did not mount :) Jun 16 16:19:06 so make your own rules file Jun 16 16:19:08 but i don't see something like serial number... but i know that the swap is sdb2 :) Jun 16 16:19:28 ok, its cheap, but it will work :) Jun 16 16:19:39 your rules file must end in rules Jun 16 16:19:51 .rules i mean Jun 16 16:20:05 should i create a new one? Jun 16 16:20:10 yes Jun 16 16:20:23 call it zrules.rules Jun 16 16:20:43 it will run last, so you can un-do something the default rules did Jun 16 16:20:53 if you want to Jun 16 16:21:04 put a single line in there: Jun 16 16:21:04 ahh... makes sense ^^ Jun 16 16:21:50 KERNEL=="sdb2", ACTION=="add", RUN+="/sbin/swapon /dev/%k" Jun 16 16:21:58 i think thats right- Jun 16 16:22:12 %k might contain '/dev/' already? Jun 16 16:22:51 then- you have to tell running udevd process you changed the rules :) Jun 16 16:22:58 how? ;) Jun 16 16:23:33 udevcontrol reload_rules Jun 16 16:23:57 then fireup udev monitor again Jun 16 16:24:02 and plug/unplug Jun 16 16:24:09 or viceversa Jun 16 16:24:10 i unmount first :)= Jun 16 16:24:29 sync, and pull the plug for me :) Jun 16 16:25:16 UEVENT[1150478971.846571] add@/block/sdb/sdb2 Jun 16 16:25:16 ACTION=add Jun 16 16:25:16 DEVPATH=/block/sdb/sdb2 Jun 16 16:25:16 SUBSYSTEM=block Jun 16 16:25:16 SEQNUM=253 Jun 16 16:25:16 MINOR=18 Jun 16 16:25:18 MAJOR=8 Jun 16 16:25:20 PHYSDEVPATH=/devices/pci0000:00/0000:00:01.2/usb1/1-2/1-2:1.0/host3/target3:0:0/3:0:0:0 Jun 16 16:25:22 PHYSDEVBUS=scsi Jun 16 16:25:24 PHYSDEVDRIVER=sd Jun 16 16:25:34 the only thing with sdb2... Jun 16 16:25:46 cat /proc/swaps Jun 16 16:26:00 Filename Type Size Used Priority Jun 16 16:26:00 /dev/sdb2 partition 208836 0 -1 Jun 16 16:26:07 tada Jun 16 16:26:17 :) Jun 16 16:26:18 thanks Jun 16 16:26:25 now, dont pull the plug :) Jun 16 16:26:37 hehe, that's the next thing *g* Jun 16 16:26:39 you could add a swapoff rule Jun 16 16:26:50 you read my mind? :) Jun 16 16:26:58 but if the kernel is already swapped to it, you will have issues Jun 16 16:27:40 hmmm... but there shouldn't be any important data on it since the big data partition is off Jun 16 16:27:43 i wish udev could see you reaching for the plug, and run some 'pre-remove' rules :) Jun 16 16:27:54 heh Jun 16 16:28:13 if your kernel is swapping, and you lose your swap partition, the box will lock Jun 16 16:28:14 hmmm... udev unmounts the normal partitions, right? Jun 16 16:28:29 the rules in local.rules do, look at them Jun 16 16:28:49 but they are already gone, really Jun 16 16:28:57 i mean, you pulled the plug Jun 16 16:29:12 all udev does is cleanup the system's list of mount Jun 16 16:29:23 ...mounted partitions Jun 16 16:29:25 SUBSYSTEM=="block", ACTION=="remove", RUN+="/etc/udev/scrips/mount.sh" Jun 16 16:29:33 yeap Jun 16 16:29:56 mount.sh looks at lots of env vars to figure out what to do Jun 16 16:30:03 it's pretty slick Jun 16 16:30:47 hmmm, i think i'll try it... if the box freezes, then i don't have another option ;/ Jun 16 16:31:25 i really would like to see a maxtor 'onetouch' drive have the button 'umount/swapoff' everything Jun 16 16:31:34 then you can unplug Jun 16 16:32:13 heh Jun 16 16:33:57 eFfeM, from the busybox src: Jun 16 16:34:19 SIGUSR2 forces udhcpc to release the current lease and go inactive Jun 16 16:34:30 ah ok Jun 16 16:34:49 KERNEL=="sdb2", ACTION=="remove", RUN+="/sbin/swapoff /dev/%k" Jun 16 16:34:55 doesn't do the trick... Jun 16 16:34:57 ;( Jun 16 16:36:22 try running swapoff -v /dev/sdb2 at the prompt Jun 16 16:36:37 with the drive unplugged Jun 16 16:36:45 one moment ^^ Jun 16 16:38:22 root@NSLU2:~# swapoff -v /dev/sdb2 Jun 16 16:38:22 swapoff on /dev/sdb2 Jun 16 16:38:22 swapoff: /dev/sdb2: No such file or directory Jun 16 16:39:14 haha Jun 16 16:39:17 its gone Jun 16 16:39:24 cat /proc/swaps Jun 16 16:39:40 root@NSLU2:~# cat /proc/swaps Jun 16 16:39:40 Filename Type Size Used Priority Jun 16 16:39:40 /dev/sdb2\040(deleted) partition 208836 0 -1 Jun 16 16:39:54 hmm- you need to make another rules file Jun 16 16:40:03 that will be before local.rules Jun 16 16:40:27 it's in alphabetical order? Jun 16 16:40:30 yeap Jun 16 16:40:34 so arules.rules would do the trick Jun 16 16:40:37 sure Jun 16 16:40:41 or 0rules Jun 16 16:40:47 okay... what to insert? :) Jun 16 16:40:57 same line you tried Jun 16 16:41:46 okay, did it Jun 16 16:42:58 cool, now dont :) Jun 16 16:43:16 ? Jun 16 16:43:21 dont unplug :) Jun 16 16:43:41 actually, the kernel will likely stay running Jun 16 16:43:59 but no new processes will init Jun 16 16:44:23 making it impossible to shutdown :) Jun 16 16:45:06 eFfeM, here is what i see re: dhcp/ifdown Jun 16 16:45:22 busybox does: Jun 16 16:45:32 result = execute("kill -USR2... Jun 16 16:45:44 result += execute("kill -TERM... Jun 16 16:45:49 then: Jun 16 16:46:03 return (result || static_down(ifd, exec)); Jun 16 16:46:16 so it appears that result is > 0 Jun 16 16:46:31 when udhcpc is still running Jun 16 16:46:45 the very top of the file says: Jun 16 16:46:59 TODO: standardise execute() return codes to return 0 for success and 1 for failure Jun 16 16:48:21 run this under gdb or instrument it to print result ... Jun 16 16:48:33 still looking at your arm problem, almost there Jun 16 16:48:38 thanks Jun 16 16:49:16 i tried reading the gcc maillist and the patches, but i am over my head with arm :) Jun 16 16:57:45 building gdb now Jun 16 17:00:09 kitno455: I think I have fixed the arm problem, I'm now testing my work Jun 16 17:02:28 will take a while, first I'll try with openslug, then I'll build ucslguc Jun 16 17:02:32 ucslugc Jun 16 17:04:15 does the same compiler binary make arm and thumb code? Jun 16 17:04:30 or are there two different copies of compiler on disk? Jun 16 17:08:20 i think the same compiler can generate both using a compiler opiton, but i am not sure Jun 16 17:09:36 option Jun 16 17:17:24 ok, dhcp on the slug is weird Jun 16 17:18:10 when it gets a new lease, it briefly brings up the interface with the old ip, then downs it, and brings it up with the new ip. Jun 16 17:18:29 i may switch to isc's dhcp client Jun 16 17:21:46 what about dhclient Jun 16 17:21:55 not sure if busybox is that good Jun 16 17:22:25 dhclient == isc Jun 16 17:22:39 i think i found the issue Jun 16 17:23:19 busybox ifdown calls ifconfig eth0 down Jun 16 17:23:36 which does not seem to work if udhcpc is still running? Jun 16 17:24:03 but busybox ifdown does not wait for udhcpc to exit after it signals Jun 16 17:24:17 so just dropping a sleep() in there seems to help Jun 16 17:25:10 trying to figure out how long... Jun 16 17:36:12 ah ok Jun 16 17:37:28 kitno455: gcc builds, I'm now trying to build uclogc Jun 16 17:37:42 have to go in a short while, but will try to check in my change later tonight Jun 16 17:37:57 assuming the ucslugc now succeeds Jun 16 17:43:12 thanks Jun 16 17:43:51 looks like we need to add a sleep(1) after the calls to kill udhcpc in busyboxes ifupdown.c Jun 16 17:44:06 how can i make that happen? Jun 16 17:46:16 add the call in the code, then make a patch and add it to the bb file Jun 16 17:47:23 the existing code, which may have already been patched? Jun 16 17:47:37 i guess if i put my patch at end of patches in bb that will work? Jun 16 17:48:19 lets try :) Jun 16 17:50:39 yeah, be sure to terminate properly (last one ends with a " others with a \ 0 Jun 16 17:50:42 yeah, be sure to terminate properly (last one ends with a " others with a \ ) Jun 16 17:50:44 later Jun 16 17:52:00 adios Jun 16 19:50:31 eFfeM-away, assuming your logger is listening... Jun 16 19:51:18 just a sleep does not fix the ifdown/dhcp issue Jun 16 19:52:01 but i did find why the interface keeps its ip, a slugos specific mod to the udhcpc scripts Jun 16 19:52:39 if i revert part of that patch, ifdown at least releases the ip. Jun 16 19:55:22 i will detail in email, now back to my original issue :) **** ENDING LOGGING AT Sat Jun 17 02:59:57 2006